Compare commits

..

No commits in common. '0ef73039205061e24a1529f6e15dd4d26be0c407' and '91df70301e610c1437babcb62c1c6cf2f9be3990' have entirely different histories.

@ -1,8 +1,6 @@
# 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">
@ -10,15 +8,7 @@ An advanced Hugo theme.
<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
@ -86,18 +76,18 @@ please share it by [posting a link](https://github.com/willfaught/paige/discussi
## Setup
1. Install [Hugo](https://gohugo.io/installation/) and [Dart Sass](https://github.com/sass/dart-sass):
1. [Install Hugo](https://gohugo.io/installation/) (the extended version, and at least v0.141.0).
For Homebrew on Mac:
```sh
$ brew install hugo sass/sass/sass
$ brew install hugo
```
For Chocolatey on Windows:
```sh
$ choco install hugo-extended sass
$ choco install hugo-extended
```
For Snap on Linux:
@ -106,22 +96,34 @@ please share it by [posting a link](https://github.com/willfaught/paige/discussi
$ sudo snap install hugo
```
Hugo must be the extended version, and at least version v0.141.0.
2. [Install Dart Sass](https://github.com/sass/dart-sass/releases).
2. Create a site:
For Homebrew on Mac:
```sh
$ brew install sass/sass/sass
```
For Chocolatey on Windows:
```sh
$ choco install sass
```
3. Create a site:
```sh
$ hugo new site yoursite
```
3. Create a post:
4. Create a post:
```sh
$ cd yoursite
$ hugo new yourpost.md
```
4. Configure your module:
5. Configure your module:
```sh
$ cd yoursite
@ -133,7 +135,7 @@ please share it by [posting a link](https://github.com/willfaught/paige/discussi
EOF
```
5. Configure the Paige module:
6. Configure the Paige module:
```sh
$ cd yoursite
@ -144,21 +146,21 @@ please share it by [posting a link](https://github.com/willfaught/paige/discussi
EOF
```
6. Build and run the site for development:
7. Build and run the site for development:
```sh
$ cd yoursite
$ hugo server --buildDrafts
```
7. Build the site for production:
8. Build the site for production:
```sh
$ cd yoursite
$ hugo --environment production --minify
```
8. Update the Paige module:
9. Update the Paige module:
```sh
$ cd yoursite
@ -170,9 +172,7 @@ 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,8 +1072,7 @@ try the following in `yoursite/hugo.toml`:
```toml
[params.paige]
style = """
#paige-page-content,
#paige-page-pages > * { margin-left: auto; margin-right: auto; max-width: 40rem; }
#paige-page-content > * { margin-left: auto; margin-right: auto; max-width: 40rem; }
"""
```
@ -1088,8 +1087,7 @@ try the following in `yoursite/hugo.toml`:
```toml
[params.paige]
style = """
#paige-page-content,
#paige-page-pages > * { margin-left: auto; margin-right: auto; max-width: 40rem; }
#paige-page-content > * { 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,

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

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

@ -1,7 +0,0 @@
{{ $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 | htmlUnescape | transform.XMLEscape }}
{{ $title := $subpage.Title | markdownify | plainify }}
{{ $link := cond $external (htmlEscape $subpage.Params.link) $subpage.Permalink }}

@ -39,13 +39,7 @@
{{ 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 }}
{{ with $page.Param "paige.style" }}

@ -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.Title | markdownify | and ($page.Param "paige.pages.disable_title" | not) }}
{{ $title := $page.LinkTitle | 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 }}
<h2 class="fw-bold" id="paige-page-title" {{ if $microdata }} itemprop="headline name" {{ end }}>{{ if $link }}<a href="{{ $link }}">{{ . }}</a>{{ else }}{{ . }}{{ end }}</h2>
<h1 class="fw-bold" id="paige-page-title" {{ if $microdata }} itemprop="headline name" {{ end }}>{{ if $link }}<a href="{{ $link }}">{{ . }}</a>{{ else }}{{ . }}{{ end }}</h1>
{{ end }}
{{ with $description }}

@ -50,7 +50,7 @@
{{ partial "paige/page-header.html" $page }}
{{ with $content }}
<main id="paige-page-content" {{ if $microdata }} itemprop="articleBody" {{ end }}>
<main class="mw-100" 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-5 fw-bold {{ if not (or $breadcrumbs $description $menu) }} paige-row-tall {{ end }} text-center" id="paige-site-title">
<div class="display-1 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" $map "includePaths" $paths "outputStyle" $style "silenceDeprecations" (slice "color-functions" "global-builtin" "import" "mixed-decls") "transpiler" "dartsass") }}
{{ $resource = $resource | toCSS (dict "enableSourceMap" $enablesourcemap "includePaths" $paths "outputStyle" $outputstyle "silenceDeprecations" (slice "color-functions" "global-builtin" "import" "mixed-decls") "transpiler" "dartsass") }}
{{ end }}
{{ $resource = $resource | minify | fingerprint }}

Loading…
Cancel
Save