Compare commits

..

10 Commits

Author SHA1 Message Date
0ef7303920 Add math.html partial if math parameter is true 2025-07-02 16:10:55 -04:00
201a496d2e Changes to HTML tags and styling choices 2025-07-01 15:23:32 -04:00
Will Faught
8219b9fe0c Add narrow look to list page subpages 2025-04-02 19:12:39 -07:00
Will Faught
b9a2bfe1b7 Simplify install step 2025-03-30 18:39:14 -07:00
Will Faught
97bf7e0e52 Word wrap 2025-03-30 18:30:29 -07:00
Will Faught
7e3617c5cc Use page title in single kind, not link title 2025-03-30 18:07:32 -07:00
Will Faught
6745a04bf4 Shorten var names 2025-03-28 22:17:37 -07:00
Will Faught
c6b7a1422e Add text var 2025-03-28 21:58:20 -07:00
Will Faught
0744138bb0 Remove heading links in Atom, RSS 2025-03-28 21:56:39 -07:00
Will Faught
4cf6298806 Escape titles for XML for RSS 2025-03-28 18:58:02 -07:00
10 changed files with 62 additions and 39 deletions

View File

@@ -1,6 +1,8 @@
# Paige # 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> <picture>
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/willfaught/paige/raw/master/images/screenshot-dark.jpg"> <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"> <img alt="Screenshot" src="https://github.com/willfaught/paige/raw/master/images/screenshot.jpg">
</picture> </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 ## Features
@@ -76,18 +86,18 @@ please share it by [posting a link](https://github.com/willfaught/paige/discussi
## Setup ## 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: For Homebrew on Mac:
```sh ```sh
$ brew install hugo $ brew install hugo sass/sass/sass
``` ```
For Chocolatey on Windows: For Chocolatey on Windows:
```sh ```sh
$ choco install hugo-extended $ choco install hugo-extended sass
``` ```
For Snap on Linux: 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 $ 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: 2. Create a site:
```sh
$ brew install sass/sass/sass
```
For Chocolatey on Windows:
```sh
$ choco install sass
```
3. Create a site:
```sh ```sh
$ hugo new site yoursite $ hugo new site yoursite
``` ```
4. Create a post: 3. Create a post:
```sh ```sh
$ cd yoursite $ cd yoursite
$ hugo new yourpost.md $ hugo new yourpost.md
``` ```
5. Configure your module: 4. Configure your module:
```sh ```sh
$ cd yoursite $ cd yoursite
@@ -135,7 +133,7 @@ please share it by [posting a link](https://github.com/willfaught/paige/discussi
EOF EOF
``` ```
6. Configure the Paige module: 5. Configure the Paige module:
```sh ```sh
$ cd yoursite $ cd yoursite
@@ -146,21 +144,21 @@ please share it by [posting a link](https://github.com/willfaught/paige/discussi
EOF EOF
``` ```
7. Build and run the site for development: 6. Build and run the site for development:
```sh ```sh
$ cd yoursite $ cd yoursite
$ hugo server --buildDrafts $ hugo server --buildDrafts
``` ```
8. Build the site for production: 7. Build the site for production:
```sh ```sh
$ cd yoursite $ cd yoursite
$ hugo --environment production --minify $ hugo --environment production --minify
``` ```
9. Update the Paige module: 8. Update the Paige module:
```sh ```sh
$ cd yoursite $ cd yoursite
@@ -172,7 +170,9 @@ The current major version is 0.
From time to time, breaking changes are made. From time to time, breaking changes are made.
When you update Paige, you must test your site. 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 ## Kickoff
@@ -1072,7 +1072,8 @@ try the following in `yoursite/hugo.toml`:
```toml ```toml
[params.paige] [params.paige]
style = """ 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 ```toml
[params.paige] [params.paige]
style = """ 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 > img,
#paige-page-content > .paige-shortcode-image, #paige-page-content > .paige-shortcode-image,
#paige-page-content > .paige-shortcode-vimeo, #paige-page-content > .paige-shortcode-vimeo,

View File

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

View File

@@ -5,6 +5,7 @@
{{ $new := $context.Level }} {{ $new := $context.Level }}
{{ $old := $context.Level }} {{ $old := $context.Level }}
{{ $page := $context.Page }} {{ $page := $context.Page }}
{{ $text := $context.Text }}
{{ $attrs := merge $context.Attributes $defaults }} {{ $attrs := merge $context.Attributes $defaults }}
@@ -47,7 +48,7 @@
{{ end }} {{ end }}
{{ if not $found }} {{ if not $found }}
{{ $class = $class | append (print "h" $new) }} {{ $class = $class | append (print "h" $old) }}
{{ end }} {{ end }}
{{ $class = delimit (sort $class) " " }} {{ $class = delimit (sort $class) " " }}
@@ -56,5 +57,5 @@
{{ end }} {{ end }}
<h{{ $old }} {{ range $k, $v := $attrs }} {{ printf `%s="%s"` $k $v | safeHTMLAttr }} {{ 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 }}> </h{{ $old }}>

View File

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

View File

@@ -97,7 +97,7 @@
{{ $external := and $subpage.Params.link (not ($subpage.Param "paige.feeds.disable_link")) | not | not }} {{ $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) }} {{ $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 }} {{ $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 }} {{ $link := cond $external (htmlEscape $subpage.Params.link) $subpage.Permalink }}

View File

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

View File

@@ -14,7 +14,7 @@
{{ $series := $page.GetTerms "series" | and ($page.Param "paige.pages.disable_series" | not) }} {{ $series := $page.GetTerms "series" | and ($page.Param "paige.pages.disable_series" | not) }}
{{ $tags := $page.GetTerms "tags" }} {{ $tags := $page.GetTerms "tags" }}
{{ $time := $page.ReadingTime | and ($page.Param "paige.pages.disable_reading_time" | not) }} {{ $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) }} {{ $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) }} {{ $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 }} {{ partial "paige/func-include.html" (dict "name" "page-header-first%s.html" "page" $page) | safeHTML }}
{{ with $title }} {{ 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 }} {{ end }}
{{ with $description }} {{ with $description }}

View File

@@ -50,7 +50,7 @@
{{ partial "paige/page-header.html" $page }} {{ partial "paige/page-header.html" $page }}
{{ with $content }} {{ 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 }} {{ partial "paige/func-include.html" (dict "name" "page-body-first%s.html" "page" $page) | safeHTML }}
{{ . | safeHTML }} {{ . | safeHTML }}
{{ partial "paige/func-include.html" (dict "name" "page-body-last%s.html" "page" $page) | safeHTML }} {{ partial "paige/func-include.html" (dict "name" "page-body-last%s.html" "page" $page) | safeHTML }}

View File

@@ -38,7 +38,7 @@
{{ partial "paige/func-include.html" (dict "name" "site-header-first%s.html" "page" $page) | safeHTML }} {{ partial "paige/func-include.html" (dict "name" "site-header-first%s.html" "page" $page) | safeHTML }}
{{ with $title }} {{ 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> <a class="text-body text-decoration-none" href="{{ relLangURL `` }}">{{ . }}</a>
</div> </div>
{{ end }} {{ end }}

View File

@@ -1,15 +1,15 @@
{{ $params := . }} {{ $params := . }}
{{ $context := $params.context }} {{ $context := $params.context }}
{{ $enablesourcemap := not hugo.IsProduction }}
{{ $href := $params.href }} {{ $href := $params.href }}
{{ $integrity := $params.integrity }} {{ $integrity := $params.integrity }}
{{ $map := not hugo.IsProduction }}
{{ $origin := $params.crossorigin | default "anonymous" }} {{ $origin := $params.crossorigin | default "anonymous" }}
{{ $outputstyle := cond hugo.IsProduction "compressed" "" }}
{{ $page := $params.page }} {{ $page := $params.page }}
{{ $paths := $params.includepaths }} {{ $paths := $params.includepaths }}
{{ $policy := $params.referrerpolicy | default "no-referrer" }} {{ $policy := $params.referrerpolicy | default "no-referrer" }}
{{ $sass := $params.sass }} {{ $sass := $params.sass }}
{{ $style := cond hugo.IsProduction "compressed" "" }}
{{ $template := $params.template }} {{ $template := $params.template }}
{{ $resource := partial "paige/func-resource.html" (dict "page" $page "url" $href) }} {{ $resource := partial "paige/func-resource.html" (dict "page" $page "url" $href) }}
@@ -33,7 +33,7 @@
{{ if $sass }} {{ if $sass }}
{{/* TODO: Remove the silenceDeprecations option when Bootstrap is updated beyond v5.3.3. */}} {{/* 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 }} {{ end }}
{{ $resource = $resource | minify | fingerprint }} {{ $resource = $resource | minify | fingerprint }}