Compare commits

...

10 Commits

@ -1,6 +1,8 @@
# Paige
Powerful, pliable pixel perfection. An advanced Hugo theme. [Try it out.](https://willfaught.com/paige)
Powerful, pliable pixel perfection.
An advanced Hugo theme.
[Try it out.](https://willfaught.com/paige)
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/willfaught/paige/raw/master/images/screenshot-dark.jpg">
@ -8,7 +10,15 @@ Powerful, pliable pixel perfection. An advanced Hugo theme. [Try it out.](https:
<img alt="Screenshot" src="https://github.com/willfaught/paige/raw/master/images/screenshot.jpg">
</picture>
Paige is designed to put your content front and center, avoiding the typical clutter. The look is seamless and smooth, scalable and readable, portable and efficient. The layout is minimal and responsive, using verticality and white space to delineate and highlight each part of the page. The implementation is flexible and extensible. Its a versatile canvas that serves most needs.
Paige is designed to put your content front and center,
avoiding the typical clutter.
The look is seamless and smooth,
scalable and readable,
portable and efficient.
The layout is minimal and responsive,
using verticality and white space to delineate and highlight each part of the page.
The implementation is flexible and extensible.
Its a versatile canvas that serves most needs.
## Features
@ -76,18 +86,18 @@ please share it by [posting a link](https://github.com/willfaught/paige/discussi
## Setup
1. [Install Hugo](https://gohugo.io/installation/) (the extended version, and at least v0.141.0).
1. Install [Hugo](https://gohugo.io/installation/) and [Dart Sass](https://github.com/sass/dart-sass):
For Homebrew on Mac:
```sh
$ brew install hugo
$ brew install hugo sass/sass/sass
```
For Chocolatey on Windows:
```sh
$ choco install hugo-extended
$ choco install hugo-extended sass
```
For Snap on Linux:
@ -96,34 +106,22 @@ please share it by [posting a link](https://github.com/willfaught/paige/discussi
$ sudo snap install hugo
```
2. [Install Dart Sass](https://github.com/sass/dart-sass/releases).
Hugo must be the extended version, and at least version v0.141.0.
For Homebrew on Mac:
```sh
$ brew install sass/sass/sass
```
For Chocolatey on Windows:
```sh
$ choco install sass
```
3. Create a site:
2. Create a site:
```sh
$ hugo new site yoursite
```
4. Create a post:
3. Create a post:
```sh
$ cd yoursite
$ hugo new yourpost.md
```
5. Configure your module:
4. Configure your module:
```sh
$ cd yoursite
@ -135,7 +133,7 @@ please share it by [posting a link](https://github.com/willfaught/paige/discussi
EOF
```
6. Configure the Paige module:
5. Configure the Paige module:
```sh
$ cd yoursite
@ -146,21 +144,21 @@ please share it by [posting a link](https://github.com/willfaught/paige/discussi
EOF
```
7. Build and run the site for development:
6. Build and run the site for development:
```sh
$ cd yoursite
$ hugo server --buildDrafts
```
8. Build the site for production:
7. Build the site for production:
```sh
$ cd yoursite
$ hugo --environment production --minify
```
9. Update the Paige module:
8. Update the Paige module:
```sh
$ cd yoursite
@ -172,7 +170,9 @@ The current major version is 0.
From time to time, breaking changes are made.
When you update Paige, you must test your site.
See Hugo's [installation](https://gohugo.io/installation/), [getting started](https://gohugo.io/getting-started/), and [module](https://gohugo.io/hugo-modules/) guides for more information.
See Hugo's [installation](https://gohugo.io/installation/),
[getting started](https://gohugo.io/getting-started/),
and [module](https://gohugo.io/hugo-modules/) guides for more information.
## Kickoff
@ -1072,7 +1072,8 @@ try the following in `yoursite/hugo.toml`:
```toml
[params.paige]
style = """
#paige-page-content > * { margin-left: auto; margin-right: auto; max-width: 40rem; }
#paige-page-content,
#paige-page-pages > * { margin-left: auto; margin-right: auto; max-width: 40rem; }
"""
```
@ -1087,7 +1088,8 @@ try the following in `yoursite/hugo.toml`:
```toml
[params.paige]
style = """
#paige-page-content > * { margin-left: auto; margin-right: auto; max-width: 40rem; }
#paige-page-content,
#paige-page-pages > * { margin-left: auto; margin-right: auto; max-width: 40rem; }
#paige-page-content > img,
#paige-page-content > .paige-shortcode-image,
#paige-page-content > .paige-shortcode-vimeo,

@ -0,0 +1,7 @@
{{ $context := . }}
{{ $anchor := $context.Anchor }}
{{ $level := $context.Level }}
{{ $text := $context.Text }}
<h{{ $level }} {{ with $anchor }} id="{{ . }}" {{ end }}>{{ $text }}</h{{ $level }}>

@ -5,6 +5,7 @@
{{ $new := $context.Level }}
{{ $old := $context.Level }}
{{ $page := $context.Page }}
{{ $text := $context.Text }}
{{ $attrs := merge $context.Attributes $defaults }}
@ -47,7 +48,7 @@
{{ end }}
{{ if not $found }}
{{ $class = $class | append (print "h" $new) }}
{{ $class = $class | append (print "h" $old) }}
{{ end }}
{{ $class = delimit (sort $class) " " }}
@ -56,5 +57,5 @@
{{ end }}
<h{{ $old }} {{ range $k, $v := $attrs }} {{ printf `%s="%s"` $k $v | safeHTMLAttr }} {{ end }}>
<a href="#{{ $context.Anchor }}" style="color: rgba(var(--bs-body-color-rgb), var(--bs-text-opacity)); text-decoration: none">{{ $context.Text }}</a>
<a href="#{{ $context.Anchor }}" style="color: rgba(var(--bs-body-color-rgb), var(--bs-text-opacity)); text-decoration: none">{{ $text }}</a>
</h{{ $old }}>

@ -0,0 +1,7 @@
{{ $context := . }}
{{ $anchor := $context.Anchor }}
{{ $level := $context.Level }}
{{ $text := $context.Text }}
<h{{ $level }} {{ with $anchor }} id="{{ . }}" {{ end }}>{{ $text }}</h{{ $level }}>

@ -97,7 +97,7 @@
{{ $external := and $subpage.Params.link (not ($subpage.Param "paige.feeds.disable_link")) | not | not }}
{{ $id := printf "tag:%s,%s:%s" (urls.Parse site.BaseURL).Host ($subpage.PublishDate.Format "2006-01-02") (cond ($subpage.Params.id | not) $subpage.RelPermalink $subpage.Params.id) }}
{{ $published := $subpage.PublishDate.Format $date }}
{{ $title := $subpage.Title | markdownify | plainify }}
{{ $title := $subpage.Title | markdownify | plainify | htmlUnescape | transform.XMLEscape }}
{{ $link := cond $external (htmlEscape $subpage.Params.link) $subpage.Permalink }}

@ -39,6 +39,12 @@
{{ with $title }}
<title>{{ . }}</title>
{{ end }}
{{ with .Params.customJS }}
<script type="module" src="{{ . | relURL }}"></script>
{{ end }}
{{ if .Param "math" }}
{{ partialCached "math.html" . }}
{{ end }}
{{ partial "paige/links.html" $page }}

@ -14,7 +14,7 @@
{{ $series := $page.GetTerms "series" | and ($page.Param "paige.pages.disable_series" | not) }}
{{ $tags := $page.GetTerms "tags" }}
{{ $time := $page.ReadingTime | and ($page.Param "paige.pages.disable_reading_time" | not) }}
{{ $title := $page.LinkTitle | markdownify | and ($page.Param "paige.pages.disable_title" | not) }}
{{ $title := $page.Title | markdownify | and ($page.Param "paige.pages.disable_title" | not) }}
{{ $toc := and $page.Content (ne $page.TableOfContents `<nav id="TableOfContents"></nav>`) | and ($page.Param "paige.pages.disable_toc" | not) }}
{{ $words := $page.WordCount | and ($page.Param "paige.pages.disable_word_count" | not) }}
@ -25,7 +25,7 @@
{{ partial "paige/func-include.html" (dict "name" "page-header-first%s.html" "page" $page) | safeHTML }}
{{ with $title }}
<h1 class="fw-bold" id="paige-page-title" {{ if $microdata }} itemprop="headline name" {{ end }}>{{ if $link }}<a href="{{ $link }}">{{ . }}</a>{{ else }}{{ . }}{{ end }}</h1>
<h2 class="fw-bold" id="paige-page-title" {{ if $microdata }} itemprop="headline name" {{ end }}>{{ if $link }}<a href="{{ $link }}">{{ . }}</a>{{ else }}{{ . }}{{ end }}</h2>
{{ end }}
{{ with $description }}

@ -50,7 +50,7 @@
{{ partial "paige/page-header.html" $page }}
{{ with $content }}
<main class="mw-100" id="paige-page-content" {{ if $microdata }} itemprop="articleBody" {{ end }}>
<main id="paige-page-content" {{ if $microdata }} itemprop="articleBody" {{ end }}>
{{ partial "paige/func-include.html" (dict "name" "page-body-first%s.html" "page" $page) | safeHTML }}
{{ . | safeHTML }}
{{ partial "paige/func-include.html" (dict "name" "page-body-last%s.html" "page" $page) | safeHTML }}

@ -38,7 +38,7 @@
{{ partial "paige/func-include.html" (dict "name" "site-header-first%s.html" "page" $page) | safeHTML }}
{{ with $title }}
<div class="display-1 fw-bold {{ if not (or $breadcrumbs $description $menu) }} paige-row-tall {{ end }} text-center" id="paige-site-title">
<div class="display-5 fw-bold {{ if not (or $breadcrumbs $description $menu) }} paige-row-tall {{ end }} text-center" id="paige-site-title">
<a class="text-body text-decoration-none" href="{{ relLangURL `` }}">{{ . }}</a>
</div>
{{ end }}

@ -1,15 +1,15 @@
{{ $params := . }}
{{ $context := $params.context }}
{{ $enablesourcemap := not hugo.IsProduction }}
{{ $href := $params.href }}
{{ $integrity := $params.integrity }}
{{ $map := not hugo.IsProduction }}
{{ $origin := $params.crossorigin | default "anonymous" }}
{{ $outputstyle := cond hugo.IsProduction "compressed" "" }}
{{ $page := $params.page }}
{{ $paths := $params.includepaths }}
{{ $policy := $params.referrerpolicy | default "no-referrer" }}
{{ $sass := $params.sass }}
{{ $style := cond hugo.IsProduction "compressed" "" }}
{{ $template := $params.template }}
{{ $resource := partial "paige/func-resource.html" (dict "page" $page "url" $href) }}
@ -33,7 +33,7 @@
{{ if $sass }}
{{/* TODO: Remove the silenceDeprecations option when Bootstrap is updated beyond v5.3.3. */}}
{{ $resource = $resource | toCSS (dict "enableSourceMap" $enablesourcemap "includePaths" $paths "outputStyle" $outputstyle "silenceDeprecations" (slice "color-functions" "global-builtin" "import" "mixed-decls") "transpiler" "dartsass") }}
{{ $resource = $resource | toCSS (dict "enableSourceMap" $map "includePaths" $paths "outputStyle" $style "silenceDeprecations" (slice "color-functions" "global-builtin" "import" "mixed-decls") "transpiler" "dartsass") }}
{{ end }}
{{ $resource = $resource | minify | fingerprint }}

Loading…
Cancel
Save