Use config to hide values

master
Will Faught 12 months ago
parent b17519532a
commit ada7e4c8c1

@ -178,6 +178,7 @@ color = "#0d6efd" # Bootstrap primary color and theme color for Safari and Windo
color_scheme = "auto" # Must be "auto", "dark", or "light"
credit = '<a class="link-secondary text-decoration-none" href="https://github.com/willfaught/paige">Paige Theme</a>'
date_format = ":date_long" # Hugo date format
description = "" # Site description. Appears above the menu, below the site title, if set.
external_link_new_tab = false # Open external links in new tabs
file_edit_url = "" # Example: "https://github.com/account/project/edit/master/content/%s"
file_history_url = "" # Example: "https://github.com/account/project/commits/master/content/%s"
@ -185,8 +186,7 @@ keyword_style = "text" # Must be "text" or "pills"
license = "" # Example: "CC BY 4.0 License", "CC BY-NC 4.0 License", "MIT License"
math = false # Enable math typesetting
menu_style = "links" # Must be "links", "pills", "tabs", or "underline"
site_title = "" # Appears above the menu, above the site description, if set
site_description = "" # Appears above the menu, below the site title, if set
title = "" # Site title. Appears above the menu, above the site description, if set.
style = "" # CSS included at the end of the stylesheet, before style-last.css
[paige.alert]
@ -292,6 +292,43 @@ logo = "" # Example: "/logo.webp"
managing_editor = "" # Example: "example@example.com (John Doe)"
web_master = "" # Example: "example@example.com (John Doe)"
[params.paige.list_page]
hide_authors = false
hide_collections = false
hide_date = false
hide_description = false
hide_keywords = false
hide_pages = false
hide_reading_time = false
hide_sections = false
hide_series = false
hide_summary = false
hide_title = false
[params.paige.page]
hide_alert = false
hide_authors = false
hide_date = false
hide_description = false
hide_edit = false
hide_history = false
hide_keywords = false
hide_next = false
hide_prev = false
hide_reading_time = false
hide_series = false
hide_title = false
hide_toc = false
[params.paige.site]
hide_breadcrumbs = false
hide_copyright = false
hide_credit = false
hide_description = false
hide_license = false
hide_menu = false
hide_title = false
[paige.search]
hide_page = false
```
@ -907,14 +944,16 @@ Body: None.
| ---------------------------------------------------------| -------------------------------------|
| `yoursite/layouts/partials/paige/body-first.html` | The beginning of the body tag |
| `yoursite/layouts/partials/paige/body-last.html` | The end of the body tag |
| `yoursite/layouts/partials/paige/footer-first.html` | The beginning of the footer tag |
| `yoursite/layouts/partials/paige/footer-last.html` | The end of the footer tag |
| `yoursite/layouts/partials/paige/head-first.html` | The beginning of the head tag |
| `yoursite/layouts/partials/paige/head-last.html` | The end of the head tag |
| `yoursite/layouts/partials/paige/main-first.html` | The beginning of the main tag |
| `yoursite/layouts/partials/paige/main-last.html` | The end of the main tag |
| `yoursite/layouts/partials/paige/page-footer-first.html` | The beginning of the page footer tag |
| `yoursite/layouts/partials/paige/page-footer-last.html` | The end of the page footer tag |
| `yoursite/layouts/partials/paige/page-header-first.html` | The beginning of the page header tag |
| `yoursite/layouts/partials/paige/page-header-last.html` | The end of the page header tag |
| `yoursite/layouts/partials/paige/site-first.html` | The beginning of the main tag |
| `yoursite/layouts/partials/paige/site-last.html` | The end of the main tag |
| `yoursite/layouts/partials/paige/site-footer-first.html` | The beginning of the site footer tag |
| `yoursite/layouts/partials/paige/site-footer-last.html` | The end of the site footer tag |
| `yoursite/layouts/partials/paige/site-header-first.html` | The beginning of the site header tag |
| `yoursite/layouts/partials/paige/site-header-last.html` | The end of the site header tag |
| `yoursite/layouts/partials/paige/style-first.css` | The beginning of the style tag |
@ -986,81 +1025,79 @@ Page identifiers:
<dl>
<dt><code>#paige-alert</code></dt>
<dd>The page alert.</dd>
<dt><code>#paige-article</code></dt>
<dd>The article.</dd>
<dt><code>#paige-authors</code></dt>
<dd>The authors.</dd>
<dd>The page authors.</dd>
<dt><code>#paige-breadcrumbs</code></dt>
<dd>The breadcrumbs.</dd>
<dd>The site breadcrumbs.</dd>
<dt><code>#paige-collections</code></dt>
<dd>The collections.</dd>
<dd>The site collection pages.</dd>
<dt><code>#paige-collections-header</code></dt>
<dd>The collections header.</dd>
<dd>The site collection pages header.</dd>
<dt><code>#paige-comments</code></dt>
<dd>The comments.</dd>
<dd>The page comments.</dd>
<dt><code>#paige-content</code></dt>
<dd>The content.</dd>
<dd>The page content.</dd>
<dt><code>#paige-copyright</code></dt>
<dd>The copyright.</dd>
<dd>The site copyright.</dd>
<dt><code>#paige-credit</code></dt>
<dd>The credit.</dd>
<dd>The site credit.</dd>
<dt><code>#paige-date</code></dt>
<dd>The date.</dd>
<dt><code>#paige-description</code></dt>
<dd>The description.</dd>
<dd>The page date.</dd>
<dt><code>#paige-edit</code></dt>
<dd>The page edit link.</dd>
<dt><code>#paige-file</code></dt>
<dd>The file links.</dd>
<dt><code>#paige-file-edit</code></dt>
<dd>The file edit link.</dd>
<dt><code>#paige-file-history</code></dt>
<dd>The file history link.</dd>
<dd>The page edit and history links.</dd>
<dt><code>#paige-history</code></dt>
<dd>The page history link.</dd>
<dt><code>#paige-keywords</code></dt>
<dd>The keywords.</dd>
<dd>The page keywords.</dd>
<dt><code>#paige-license</code></dt>
<dd>The license.</dd>
<dt><code>#paige-main</code></dt>
<dd>The main.</dd>
<dd>The site license.</dd>
<dt><code>#paige-menu</code></dt>
<dd>The menu.</dd>
<dd>The site menu.</dd>
<dt><code>#paige-metadata</code></dt>
<dd>The metadata.</dd>
<dd>The page metadata.</dd>
<dt><code>#paige-next</code></dt>
<dd>The next page link.</dd>
<dt><code>#paige-page-description</code></dt>
<dd>The page description.</dd>
<dt><code>#paige-page-footer</code></dt>
<dd>The page footer that contains the page edit, history, next, and previous links.</dd>
<dt><code>#paige-page-header</code></dt>
<dd>The page header that contains the page title, description, metadata, and table of contents.</dd>
<dt><code>#paige-page-title</code></dt>
<dd>The page title.</dd>
<dt><code>#paige-pages</code></dt>
<dd>The pages.</dd>
<dd>The page sub-pages.</dd>
<dt><code>#paige-pages-header</code></dt>
<dd>The pages header.</dd>
<dd>The page sub-pages header.</dd>
<dt><code>#paige-pagination</code></dt>
<dd>The sub-page pagination links.</dd>
<dd>The pagination of sub-pages.</dd>
<dt><code>#paige-prev</code></dt>
<dd>The previous page link.</dd>
<dt><code>#paige-prev-next</code></dt>
<dd>The container of the previous and next page links.</dd>
<dt><code>#paige-reading-time</code></dt>
<dd>The reading time.</dd>
<dt><code>#paige-root</code></dt>
<dd>The outermost element in the body.</dd>
<dd>The page reading time.</dd>
<dt><code>#paige-sections</code></dt>
<dd>The sections.</dd>
<dd>The page section sub-pages.</dd>
<dt><code>#paige-sections-header</code></dt>
<dd>The sections header.</dd>
<dd>The page section sub-pages header.</dd>
<dt><code>#paige-series</code></dt>
<dd>The series.</dd>
<dd>The page series.</dd>
<dt><code>#paige-siblings</code></dt>
<dd>The page next and previous links.</dd>
<dt><code>#paige-site-description</code></dt>
<dd>The site description.</dd>
<dt><code>#paige-site-footer</code></dt>
<dd>The container of the site copyright, license, and credit.</dd>
<dd>The site footer that contains the site copyright, license, and credit.</dd>
<dt><code>#paige-site-header</code></dt>
<dd>The site header that contains the site title, description, menu, and breadcrumbs.</dd>
<dt><code>#paige-site-title</code></dt>
<dd>The site title.</dd>
<dt><code>#paige-title</code></dt>
<dd>The title.</dd>
<dt><code>#paige-toc</code></dt>
<dd>The table of contents.</dd>
</dl>
Page and sub-page classes:
Sub-page field classes:
<dl>
<dt><code>.paige-authors</code></dt>
@ -1069,8 +1106,6 @@ Page and sub-page classes:
<dd>The date.</dd>
<dt><code>.paige-description</code></dt>
<dd>The description.</dd>
<dt><code>.paige-keyword</code></dt>
<dd>A keyword.</dd>
<dt><code>.paige-keywords</code></dt>
<dd>The keywords.</dd>
<dt><code>.paige-metadata</code></dt>
@ -1102,7 +1137,7 @@ Page kind classes:
<dd>The container element of pages with kind "term".</dd>
</dl>
Status classes:
Page status classes:
<dl>
<dt><code>.paige-draft</code></dt>
@ -1146,24 +1181,26 @@ Shortcode classes:
By default, everything is shown.
If you want a more minimal look,
try the following in `yoursite/layouts/partials/paige/style-first.css`:
```css
#paige-authors,
#paige-collections,
#paige-keywords,
#paige-prev-next,
#paige-reading-time,
#paige-series,
#paige-toc,
.paige-authors,
.paige-date,
.paige-keywords,
.paige-reading-time,
.paige-series,
.paige-summary {
display: none;
}
try the following in `yoursite/hugo.toml`:
```toml
[params.paige.list_page]
hide_authors = true
hide_date = true
hide_keywords = true
hide_reading_time = true
hide_series = true
hide_summary = true
[params.paige.page]
hide_authors = true
hide_date = true
hide_keywords = true
hide_next = true
hide_prev = true
hide_reading_time = true
hide_series = true
hide_toc = true
```
### Narrow look

@ -1,19 +1,14 @@
+++
title = "Paige"
[paige]
style = """
#paige-collections,
#paige-metadata,
#paige-sections,
#paige-pages {
display: none;
}
"""
[paige.search]
hide_page = true
[paige.list_page]
hide_collections = true
hide_pages = true
hide_sections = true
[paige.page]
hide_title = true
+++
<p>{{% paige/image alt="Landscape" breakpoints=true class="object-fit-cover rounded-4 shadow-lg" fetchpriority="high" height="20rem" loading="eager" process="webp" src="https://images.unsplash.com/photo-1490604001847-b712b0c2f967?w=1296" width="100%" %}}</p>
{{< paige/image alt="Landscape" breakpoints=true class="mt-3 object-fit-cover rounded-4 shadow-lg" fetchpriority="high" height="20rem" loading="eager" process="webp" src="https://images.unsplash.com/photo-1490604001847-b712b0c2f967?w=1296" width="100%" >}}
<h1 class="display-5 fw-bold mb-2 text-center">An advanced Hugo theme</h1>
@ -29,6 +24,6 @@ hide_page = true
<a href="https://github.com/willfaught/paige">Get started!</a>
</p>
<div class="column-gap-3 d-flex display-6 justify-content-center mb-3">
<div class="column-gap-3 d-flex display-6 justify-content-center">
{{< paige/icon class="bi bi-github" title="GitHub" url="https://github.com/willfaught/paige" >}}
</div>

@ -7,23 +7,29 @@ tags = ["sections"]
title = "Customizations"
[paige]
credit = "Paige Theme"
style = """
#paige-authors,
#paige-date,
#paige-file,
#paige-keywords,
#paige-reading-time,
#paige-series,
#paige-toc,
.paige-authors,
.paige-date,
.paige-keywords,
.paige-reading-time,
.paige-series,
.paige-summary {
display: block;
}
"""
file_edit_url = "https://github.com/willfaught/paige/edit/master/exampleSite/content/%s"
file_history_url = "https://github.com/willfaught/paige/commits/master/exampleSite/content/%s"
license = "MIT License"
[paige.list_page]
hide_authors = false
hide_date = false
hide_keywords = false
hide_reading_time = false
hide_series = false
hide_summary = false
[paige.page]
hide_authors = false
hide_date = false
hide_keywords = false
hide_next = false
hide_prev = false
hide_reading_time = false
hide_series = false
hide_toc = false
[paige.site]
hide_breadcrumbs = false
hide_credit = false
hide_license = false
+++
This site hides some section page data by default. This page shows it all.
@ -34,25 +40,30 @@ This site hides some section page data by default. This page shows it all.
This page has the following parameters:
```yaml
paige:
credit: "Paige Theme"
file_link:
disable: false
style: |
#paige-authors,
#paige-date,
#paige-file,
#paige-keywords,
#paige-reading-time,
#paige-series,
#paige-toc,
.paige-authors,
.paige-date,
.paige-keywords,
.paige-reading-time,
.paige-series,
.paige-summary {
display: block;
}
```toml
[paige]
credit = "Paige Theme"
file_edit_url = "https://github.com/willfaught/paige/edit/master/exampleSite/content/%s"
file_history_url = "https://github.com/willfaught/paige/commits/master/exampleSite/content/%s"
license = "MIT License"
[paige.list_page]
hide_authors = false
hide_date = false
hide_keywords = false
hide_reading_time = false
hide_series = false
hide_summary = false
[paige.page]
hide_authors = false
hide_date = false
hide_keywords = false
hide_next = false
hide_prev = false
hide_reading_time = false
hide_series = false
hide_toc = false
[paige.site]
hide_breadcrumbs = false
hide_credit = false
hide_license = false
```

@ -8,25 +8,29 @@ tags = ["show", "singles"]
title = "Show Data"
[paige]
credit = "Paige Theme"
style = """
#paige-authors,
#paige-breadcrumbs,
#paige-date,
#paige-file,
#paige-keywords,
#paige-prev-next,
#paige-reading-time,
#paige-series,
#paige-toc,
.paige-authors,
.paige-date,
.paige-keywords,
.paige-reading-time,
.paige-series,
.paige-summary {
display: block;
}
"""
file_edit_url = "https://github.com/willfaught/paige/edit/master/exampleSite/content/%s"
file_history_url = "https://github.com/willfaught/paige/commits/master/exampleSite/content/%s"
license = "MIT License"
[paige.list_page]
hide_authors = false
hide_date = false
hide_keywords = false
hide_reading_time = false
hide_series = false
hide_summary = false
[paige.page]
hide_authors = false
hide_date = false
hide_keywords = false
hide_next = false
hide_prev = false
hide_reading_time = false
hide_series = false
hide_toc = false
[paige.site]
hide_breadcrumbs = false
hide_credit = false
hide_license = false
+++
This page shows some data that the rest of the site hides.
@ -37,27 +41,30 @@ This page shows some data that the rest of the site hides.
This page has the following parameters:
```yaml
paige:
credit: "Paige Theme"
file_link:
disable: false
style: |
#paige-authors,
#paige-breadcrumbs,
#paige-date,
#paige-file,
#paige-keywords,
#paige-prev-next,
#paige-reading-time,
#paige-series,
#paige-toc,
.paige-authors,
.paige-date,
.paige-keywords,
.paige-reading-time,
.paige-series,
.paige-summary {
display: block;
}
```toml
[paige]
credit = "Paige Theme"
file_edit_url = "https://github.com/willfaught/paige/edit/master/exampleSite/content/%s"
file_history_url = "https://github.com/willfaught/paige/commits/master/exampleSite/content/%s"
license = "MIT License"
[paige.list_page]
hide_authors = false
hide_date = false
hide_keywords = false
hide_reading_time = false
hide_series = false
hide_summary = false
[paige.page]
hide_authors = false
hide_date = false
hide_keywords = false
hide_next = false
hide_prev = false
hide_reading_time = false
hide_series = false
hide_toc = false
[paige.site]
hide_breadcrumbs = false
hide_credit = false
hide_license = false
```

@ -8,40 +8,52 @@ tags = ["singles", "style"]
title = "Style Data"
[paige]
credit = "Paige Theme"
file_edit_url = "https://github.com/willfaught/paige/edit/master/exampleSite/content/%s"
file_history_url = "https://github.com/willfaught/paige/commits/master/exampleSite/content/%s"
license = "MIT License"
style = """
#paige-authors,
#paige-breadcrumbs,
#paige-content,
#paige-copyright,
#paige-credit,
#paige-date,
#paige-description,
#paige-file,
#paige-keywords,
#paige-prev-next,
#paige-license,
#paige-menu,
#paige-page-title,
#paige-page-description,
#paige-reading-time,
#paige-series,
#paige-toc,
.paige-authors,
.paige-date,
.paige-keywords,
.paige-reading-time,
.paige-series,
.paige-summary {
display: block;
#paige-siblings,
#paige-site-title,
#paige-site-description,
#paige-toc {
font-style: italic;
}
#paige-authors { font-style: italic; }
#paige-content { font-style: italic; }
#paige-date { font-style: italic; }
#paige-description { font-style: italic; }
#paige-file { font-style: italic; }
#paige-keywords { font-style: italic; }
#paige-reading-time { font-style: italic; }
#paige-series { font-style: italic; }
#paige-title { font-style: italic; }
#paige-toc { font-style: italic; }
#paige-copyright { font-style: italic; }
.paige-authors { font-style: italic; }
.paige-date { font-style: italic; }
.paige-keyword { font-style: italic; }
.paige-series { font-style: italic; }
.paige-summary { font-style: italic; }
"""
[paige.list_page]
hide_authors = false
hide_date = false
hide_keywords = false
hide_reading_time = false
hide_series = false
hide_summary = false
[paige.page]
hide_authors = false
hide_date = false
hide_keywords = false
hide_next = false
hide_prev = false
hide_reading_time = false
hide_series = false
hide_toc = false
[paige.site]
hide_breadcrumbs = false
hide_credit = false
hide_license = false
+++
This page styles some data differently than the rest of the site.
@ -52,42 +64,53 @@ This page styles some data differently than the rest of the site.
This page has the following parameters:
```yaml
paige:
credit: "Paige Theme"
file_link:
disable: false
style: |
```toml
[paige]
credit = "Paige Theme"
file_edit_url = "https://github.com/willfaught/paige/edit/master/exampleSite/content/%s"
file_history_url = "https://github.com/willfaught/paige/commits/master/exampleSite/content/%s"
license = "MIT License"
style = """
#paige-authors,
#paige-breadcrumbs,
#paige-content,
#paige-copyright,
#paige-credit,
#paige-date,
#paige-description,
#paige-file,
#paige-keywords,
#paige-prev-next,
#paige-license,
#paige-menu,
#paige-page-title,
#paige-page-description,
#paige-reading-time,
#paige-series,
#paige-toc,
.paige-authors,
.paige-date,
.paige-keywords,
.paige-reading-time,
.paige-series,
.paige-summary {
display: block;
#paige-siblings,
#paige-site-title,
#paige-site-description,
#paige-toc {
font-style: italic;
}
#paige-authors { font-style: italic; }
#paige-content { font-style: italic; }
#paige-date { font-style: italic; }
#paige-description { font-style: italic; }
#paige-file { font-style: italic; }
#paige-keywords { font-style: italic; }
#paige-reading-time { font-style: italic; }
#paige-series { font-style: italic; }
#paige-title { font-style: italic; }
#paige-toc { font-style: italic; }
#paige-copyright { font-style: italic; }
.paige-authors { font-style: italic; }
.paige-date { font-style: italic; }
.paige-keyword { font-style: italic; }
.paige-series { font-style: italic; }
.paige-summary { font-style: italic; }
"""
[paige.list_page]
hide_authors = false
hide_date = false
hide_keywords = false
hide_reading_time = false
hide_series = false
hide_summary = false
[paige.page]
hide_authors = false
hide_date = false
hide_keywords = false
hide_next = false
hide_prev = false
hide_reading_time = false
hide_series = false
hide_toc = false
[paige.site]
hide_breadcrumbs = false
hide_credit = false
hide_license = false
```

@ -1,15 +1,20 @@
baseurl = "https://example.com"
copyright = "© Will Faught"
enablerobotstxt = true
languagecode = "en-us"
paginate = 50
timezone = "America/Los_Angeles"
titlecasestyle = "Go"
[languages.en]
title = "Paige"
languagecode = "en-us"
languagedirection = "ltr"
languagename = "English"
weight = 10
[languages.en.params.paige]
copyright = "© Will Faught"
description = "Powerful, pliable pixel perfection"
title = "Paige"
[[languages.en.menu.main]]
identifier = "home"
name = "Home"
@ -90,12 +95,28 @@ section = ["html"]
taxonomy = ["html"]
term = ["html"]
[params.paige]
credit = ""
file_edit_url = "https://github.com/willfaught/paige/edit/master/exampleSite/content/%s"
file_history_url = "https://github.com/willfaught/paige/commits/master/exampleSite/content/%s"
site_description = "Powerful, pliable pixel perfection"
site_title = "Paige"
[params.paige.list_page]
hide_authors = true
hide_date = true
hide_keywords = true
hide_reading_time = true
hide_series = true
hide_summary = true
[params.paige.page]
hide_authors = true
hide_date = true
hide_keywords = true
hide_next = true
hide_prev = true
hide_reading_time = true
hide_series = true
hide_toc = true
[params.paige.site]
hide_breadcrumbs = true
hide_credit = true
hide_license = true
[[params.paige.feed.atom.authors]]
email = "example@example.com"

@ -1,17 +0,0 @@
#paige-authors,
#paige-breadcrumbs,
#paige-date,
#paige-file,
#paige-keywords,
#paige-prev-next,
#paige-reading-time,
#paige-series,
#paige-toc,
.paige-authors,
.paige-date,
.paige-keywords,
.paige-reading-time,
.paige-series,
.paige-summary {
display: none;
}

@ -8,22 +8,20 @@
{{ partial "paige/body-first.html" $page }}
{{ end }}
<div class="container flex-fill" id="paige-root">
<div class="container">
<div class="row">
<div class="col">
<main class="mt-3" id="paige-main">
{{ if templates.Exists "partials/paige/main-first.html" }}
{{ partial "paige/main-first.html" $page }}
<div class="col mt-3" id="paige-site">
{{ if templates.Exists "partials/paige/site-first.html" }}
{{ partial "paige/site-first.html" $page }}
{{ end }}
{{ partial "paige/site-header.html" $page }}
{{ block "main" $page }}{{ end }}
{{ partial "paige/site-footer.html" $page }}
{{ if templates.Exists "partials/paige/main-last.html" }}
{{ partial "paige/main-last.html" $page }}
{{ if templates.Exists "partials/paige/site-last.html" }}
{{ partial "paige/site-last.html" $page }}
{{ end }}
</main>
</div>
</div>
</div>

@ -1,21 +1,21 @@
{{ $page := . }}
{{ $authors := partial "paige/authors.html" $page }}
{{ $authors := partial "paige/authors.html" $page | and ($page.Parent.Param "paige.list_page.hide_authors" | not) }}
{{ $categories := $page.GetTerms "categories" }}
{{ $date := $page.PublishDate }}
{{ $dateformat := $page.Param "paige.date_format" | default ":date_long" }}
{{ $description := $page.Description | markdownify | plainify | htmlUnescape }}
{{ $date := $page.PublishDate | and ($page.Parent.Param "paige.list_page.hide_date" | not) }}
{{ $dateformat := $page.Parent.Param "paige.date_format" | default ":date_long" }}
{{ $description := $page.Description | markdownify | plainify | htmlUnescape | and ($page.Parent.Param "paige.list_page.hide_description" | not) }}
{{ $draft := $page.Draft }}
{{ $expired := and $page.ExpiryDate (lt $page.ExpiryDate now) }}
{{ $flags := slice }}
{{ $future := and $page.PublishDate (gt $page.PublishDate now) }}
{{ $modified := and $page.PublishDate $page.Lastmod (lt $page.PublishDate $page.Lastmod) }}
{{ $readingtime := $page.ReadingTime }}
{{ $series := $page.GetTerms "series" }}
{{ $summary := $page.Summary | markdownify | plainify | htmlUnescape }}
{{ $readingtime := $page.ReadingTime | and ($page.Parent.Param "paige.list_page.hide_reading_time" | not) }}
{{ $series := $page.GetTerms "series" | and ($page.Parent.Param "paige.list_page.hide_series" | not) }}
{{ $summary := $page.Summary | markdownify | plainify | htmlUnescape | and ($page.Parent.Param "paige.list_page.hide_summary" | not) }}
{{ $tags := $page.GetTerms "tags" }}
{{ $textkeywords := eq ($page.Param "paige.keyword_style" | default "text") "text" }}
{{ $title := $page.Title | markdownify | plainify | htmlUnescape }}
{{ $textkeywords := eq ($page.Parent.Param "paige.keyword_style" | default "text") "text" }}
{{ $title := $page.Title | markdownify | plainify | htmlUnescape | and ($page.Parent.Param "paige.list_page.hide_title" | not) }}
{{ $titlelink := $page.RelPermalink }}
{{ if $draft }}
@ -38,25 +38,25 @@
{{ $flags = $flags | append "paige-published" }}
{{ end }}
{{ $flags = delimit ($flags | uniq) " " }}
{{ $class := delimit (slice "mb-3" "paige-page" "w-100" | append $flags | uniq | sort) " " }}
{{ $class := delimit (slice "paige-page" "w-100" | append $flags | uniq | sort) " " }}
{{ $keywords := sort (append $categories $tags) "Title" | and ($page.Parent.Param "paige.list_page.hide_keywords" | not) }}
<div class="{{ $class }}">
{{ with $title }}
<p class="mb-0 paige-title text-center"><a href="{{ $titlelink }}">{{ . }}</a></p>
<p class="paige-row-narrow paige-title text-center"><a href="{{ $titlelink }}">{{ . }}</a></p>
{{ end }}
{{ with $description }}
<p class="mb-0 paige-description text-center">{{ . }}</p>
<p class="paige-description paige-row-narrow text-center">{{ . }}</p>
{{ end }}
{{ with $summary }}
<p class="fst-italic mb-0 paige-summary text-center">{{ . }}</p>
<p class="fst-italic paige-row-narrow paige-summary text-center">{{ . }}</p>
{{ end }}
{{ if or $categories $tags }}
<p class="mb-0 paige-keywords text-center text-secondary">
{{ range $i, $term := sort (append $categories $tags) "LinkTitle" -}}
{{ with $keywords }}
<p class="paige-keywords paige-row-narrow text-center text-secondary">
{{ range $i, $term := . -}}
{{- if $textkeywords -}}
{{- if gt $i 0 }} · {{ end -}}
@ -71,7 +71,7 @@
{{ end }}
{{ with $series }}
<p class="mb-0 paige-series text-center text-secondary">
<p class="paige-row-narrow paige-series text-center text-secondary">
{{ range $i, $series := . -}}
{{- if gt $i 0 }} · {{ end -}}
@ -81,7 +81,7 @@
{{ end }}
{{ with $authors }}
<p class="mb-0 paige-authors text-center text-secondary">
<p class="paige-authors text-center paige-row-narrow text-secondary">
{{ range $i, $author := . -}}
{{- if gt $i 0 }} · {{ end -}}
@ -91,12 +91,12 @@
{{ end }}
{{ with $date }}
<p class="mb-0 paige-date text-center text-secondary">
<p class="paige-date text-center paige-row-narrow text-secondary">
<time datetime="{{ .Format `2006-01-02` }}">{{ time.Format $dateformat . }}</time>
</p>
{{ end }}
{{ with $readingtime }}
<p class="mb-0 paige-reading-time text-center text-secondary">{{ . }} {{ i18n "paige_minutes" . }}</p>
<p class="paige-reading-time paige-row-narrow text-center text-secondary">{{ . }} {{ i18n "paige_minutes" . }}</p>
{{ end }}
</div>

@ -40,8 +40,8 @@
{{ end }}
{{ $collections := slice }}
{{ $pages := $page.RegularPages }}
{{ $sections := $page.Sections }}
{{ $pages := $page.RegularPages | and ($page.Param "paige.list_page.hide_pages" | not) }}
{{ $sections := $page.Sections | and ($page.Param "paige.list_page.hide_sections" | not) }}
{{ if $page.IsHome }}
{{ range $name, $taxonomy := site.Taxonomies }}
@ -51,6 +51,8 @@
{{ end }}
{{ end }}
{{ $collections = $collections | and ($page.Param "paige.list_page.hide_collections" | not) }}
{{ if and (not $pages) (in (slice "taxonomy" "term") $page.Kind) }}
{{ $pages = $page.Pages }}
{{ end }}

@ -1,59 +1,52 @@
{{ $page := . }}
{{ $fileediturl := $page.Param "paige.file_edit_url" }}
{{ $filehistoryurl := $page.Param "paige.file_history_url" }}
{{ $file := false }}
{{ $fileediturl := $page.Param "paige.file_edit_url" | and ($page.Param "paige.page.hide_edit" | not) }}
{{ $filehistoryurl := $page.Param "paige.file_history_url" | and ($page.Param "paige.page.hide_history" | not) }}
{{ $first := templates.Exists "partials/paige/page-footer-first.html" }}
{{ $last := templates.Exists "partials/paige/page-footer-last.html" }}
{{ $next := $page.NextInSection }}
{{ $prev := $page.PrevInSection }}
{{ $next := $page.NextInSection | and ($page.Param "paige.page.hide_next" | not) }}
{{ $prev := $page.PrevInSection | and ($page.Param "paige.page.hide_prev" | not) }}
{{ if $page.File }}
{{ if $fileediturl }}
{{ $file = true }}
{{ $fileediturl = printf $fileediturl $page.File.Path }}
{{ end }}
{{ if $filehistoryurl }}
{{ $file = true }}
{{ $filehistoryurl = printf $filehistoryurl $page.File.Path }}
{{ end }}
{{ end }}
{{ if or $file $first $last $next $prev }}
<footer class="mt-3 mw-100 text-center text-secondary" id="paige-page-footer">
{{ if or $fileediturl $filehistoryurl $first $last $next $prev }}
<footer class="mw-100" id="paige-page-footer">
{{ if $first }}
{{ partial "paige/page-footer-first.html" . }}
{{ end }}
{{ if $file }}
<div class="mb-3" id="paige-file">
{{ if or $fileediturl $filehistoryurl }}
<div id="paige-file">
{{ if $fileediturl }}
<p class="mb-0" id="paige-file-edit">
<div class="paige-row-narrow text-center text-secondary" id="paige-edit">
<a class="link-secondary" href="{{ $fileediturl | safeURL }}">{{ i18n "paige_edit_this_page" }}</a>
</p>
</div>
{{ end }}
{{ if $filehistoryurl }}
<p class="mb-0" id="paige-file-history">
<div class="paige-row-narrow text-center text-secondary" id="paige-history">
<a class="link-secondary" href="{{ $filehistoryurl | safeURL }}">{{ i18n "paige_edit_history" }}</a>
</p>
</div>
{{ end }}
</div>
{{ end }}
{{ if or $next $prev }}
<div id="paige-prev-next">
<div id="paige-siblings">
{{ with $prev }}
<p class="mb-0" id="paige-next">
<a class="link-secondary" href="{{ .Permalink }}">{{ .Title }}</a> &rsaquo;
</p>
<div class="paige-row-narrow text-center text-secondary" id="paige-next"><a class="link-secondary" href="{{ .Permalink }}">{{ .Title }}</a> &rsaquo;</div>
{{ end }}
{{ with $next }}
<p class="mb-0" id="paige-prev">
&lsaquo; <a class="link-secondary" href="{{ .Permalink }}">{{ .Title }}</a>
</p>
<div class="paige-row-narrow text-center text-secondary" id="paige-prev">&lsaquo; <a class="link-secondary" href="{{ .Permalink }}">{{ .Title }}</a></div>
{{ end }}
</div>
{{ end }}

@ -1,41 +1,42 @@
{{ $page := . }}
{{ $alert := $page.Param "paige.alert" }}
{{ $authors := partial "paige/authors.html" $page }}
{{ $alert := $page.Param "paige.alert" | and ($page.Param "paige.page.hide_alert" | not) }}
{{ $authors := partial "paige/authors.html" $page | and ($page.Param "paige.page.hide_authors" | not) }}
{{ $categories := $page.GetTerms "categories" }}
{{ $date := and $page.IsPage $page.PublishDate }}
{{ $date := and $page.IsPage $page.PublishDate | and ($page.Param "paige.page.hide_date" | not) }}
{{ $dateformat := $page.Param "paige.date_format" | default ":date_long" }}
{{ $description := $page.Description | markdownify }}
{{ $description := $page.Description | markdownify | and ($page.Param "paige.page.hide_description" | not) }}
{{ $first := templates.Exists "partials/paige/page-header-first.html" }}
{{ $last := templates.Exists "partials/paige/page-header-last.html" }}
{{ $link := $page.Params.link }}
{{ $readingtime := $page.ReadingTime }}
{{ $series := $page.GetTerms "series" }}
{{ $table := and $page.Content (ne $page.TableOfContents `<nav id="TableOfContents"></nav>`) }}
{{ $readingtime := $page.ReadingTime | and ($page.Param "paige.page.hide_reading_time" | not) }}
{{ $series := $page.GetTerms "series" | and ($page.Param "paige.page.hide_series" | not) }}
{{ $tags := $page.GetTerms "tags" }}
{{ $textkeywords := eq ($page.Param "paige.keyword_style" | default "text") "text" }}
{{ $title := $page.Title | markdownify }}
{{ $title := $page.Title | markdownify | and ($page.Param "paige.page.hide_title" | not) }}
{{ $toc := and $page.Content (ne $page.TableOfContents `<nav id="TableOfContents"></nav>`) | and ($page.Param "paige.page.hide_toc" | not) }}
{{ $keywords := sort (append $categories $tags) "Title" }}
{{ $keywords := sort (append $categories $tags) "Title" | and ($page.Param "paige.page.hide_keywords" | not) }}
{{ if or $authors $date $description $first $keywords $last $readingtime $series $table $title }}
<header class="align-items-center d-flex flex-column mw-100" id="paige-page-header">
{{ if or $authors $date $description $first $keywords $last $readingtime $series $title $toc }}
<header class="mw-100" id="paige-page-header">
<div class="align-items-center d-flex flex-column">
{{ if $first }}
{{ partial "paige/page-header-first.html" . }}
{{ end }}
{{ with $title }}
<h1 class="fw-bold text-center" id="paige-title">{{ if $link }}<a href="{{ $link }}">{{ . }}</a>{{ else }}{{ . }}{{ end }}</h1>
<h1 class="fw-bold" id="paige-page-title">{{ if $link }}<a href="{{ $link }}">{{ . }}</a>{{ else }}{{ . }}{{ end }}</h1>
{{ end }}
{{ with $description }}
<p class="lead text-center" id="paige-description">{{ . }}</p>
<p class="lead paige-row-wide" id="paige-page-description">{{ . }}</p>
{{ end }}
{{ if or $authors $date $keywords $readingtime $series }}
<div class="my-3">
<div id="paige-metadata">
{{ with $keywords }}
<p class="{{ if $textkeywords }} mb-0 {{ end }} text-center {{ if $textkeywords }} text-secondary {{ end }}" id="paige-keywords">
<p class="{{ if $textkeywords }} paige-row-narrow {{ end }} text-center {{ if $textkeywords }} text-secondary {{ end }}" id="paige-keywords">
{{ range $i, $term := . -}}
{{- if $textkeywords -}}
{{- if gt $i 0 }} · {{ end -}}
@ -44,14 +45,14 @@
{{- else -}}
{{- if gt $i 0 }} {{ end -}}
<a class="badge paige-keyword text-bg-secondary text-decoration-none" href="{{ .RelPermalink | safeURL }}">{{ .Title }}</a>
<a class="badge text-bg-secondary text-decoration-none" href="{{ .RelPermalink | safeURL }}">{{ .Title }}</a>
{{- end -}}
{{- end }}
</p>
{{ end }}
{{ with $series }}
<p class="mb-0 text-center text-secondary" id="paige-series">
<p class="paige-row-narrow text-center text-secondary" id="paige-series">
{{ range $i, $series := . -}}
{{- if gt $i 0 }} · {{ end -}}
@ -61,7 +62,7 @@
{{ end }}
{{ with $authors }}
<p class="mb-0 text-center text-secondary" id="paige-authors">
<p class="paige-row-narrow text-center text-secondary" id="paige-authors">
{{ range $i, $author := . -}}
{{- if gt $i 0 }} · {{ end -}}
@ -71,24 +72,24 @@
{{ end }}
{{ with $date }}
<p class="mb-0 text-center text-secondary" id="paige-date">
<p class="paige-row-narrow text-center text-secondary" id="paige-date">
<time datetime="{{ .Format `2006-01-02` }}">{{ time.Format $dateformat . }}</time>
</p>
{{ end }}
{{ with $readingtime }}
<p class="mb-0 text-center text-secondary" id="paige-reading-time">{{ . }} {{ i18n "paige_minutes" . }}</p>
<p class="paige-row-narrow text-center text-secondary" id="paige-reading-time">{{ . }} {{ i18n "paige_minutes" . }}</p>
{{ end }}
</div>
{{ end }}
{{ with $alert }}
<div class="alert alert-{{ .type }} my-3" id="paige-alert" role="alert">{{ .message | markdownify }}</div>
<div class="alert alert-{{ .type }} paige-row-wide" id="paige-alert" role="alert">{{ .message | markdownify }}</div>
{{ end }}
{{ if $table }}
<div class="my-3" id="paige-toc">
<div class="border mb-3 pe-3 ps-3 pt-3 rounded">
{{ if $toc }}
<div class="paige-row-wide" id="paige-toc">
<div class="border pe-3 ps-3 pt-3 rounded">
{{ $page.TableOfContents }}
</div>
</div>
@ -97,5 +98,6 @@
{{ if $last }}
{{ partial "paige/page-header-last.html" . }}
{{ end }}
</div>
</header>
{{ end }}

@ -1,6 +1,6 @@
{{ $page := . }}
{{ $class := slice "align-items-center" "d-flex" "flex-column" "my-3" }}
{{ $class := slice }}
{{ $content := $page.Content | replaceRE `(<h[1-6] id="([^"]+)".+)(</h[1-6]+>)` (printf `${1}<a aria-label="%s" class="paige-header-link" href="#${2}"></a>${3}` (i18n "paige_aria_section_link")) }}
{{ $draft := $page.Draft }}
{{ $expired := and $page.ExpiryDate (lt $page.ExpiryDate now) }}
@ -43,12 +43,14 @@
{{ $class = delimit ($class | uniq | sort) " " }}
<article class="{{ $class }}" id="paige-article">
<article class="{{ $class }}" id="paige-page">
<div class="align-items-center d-flex flex-column">
{{ partial "paige/page-header.html" $page }}
{{ with $content }}
<div class="mw-100" id="paige-content">{{ . | safeHTML }}</div>
<main class="mw-100" id="paige-content">{{ . | safeHTML }}</main>
{{ end }}
{{ partial "paige/page-footer.html" $page }}
</div>
</article>

@ -1,36 +1,38 @@
{{ $page := . }}
{{ $copyright := site.Copyright | markdownify }}
{{ $copyright := $page.Param "paige.copyright" | default site.Copyright | markdownify | and ($page.Param "paige.site.hide_copyright" | not) }}
{{ $credit := $page.Param "paige.credit" }}
{{ $first := templates.Exists "partials/paige/footer-first.html" }}
{{ $last := templates.Exists "partials/paige/footer-last.html" }}
{{ $license := $page.Param "paige.license" | markdownify | and ($page.Param "paige.site.hide_license" | not) }}
{{ $theme := "https://github.com/willfaught/paige" }}
{{ $license := $page.Param "paige.license" | markdownify }}
{{ $target := partial "paige/target.html" (dict "page" $page "url" $theme) }}
{{ if eq $credit nil }}
{{ $credit = `<a class="link-secondary text-decoration-none" href="https://github.com/willfaught/paige">Paige Theme</a>` | markdownify }}
{{ $credit = `<a class="link-secondary text-decoration-none" href="{{ $theme }}" {{ with $target }} target="{{ . }}" {{ end }}>Paige Theme</a>` | markdownify }}
{{ else }}
{{ $credit = markdownify $credit }}
{{ end }}
{{ $credit = $credit | and ($page.Param "paige.site.hide_credit" | not) }}
{{ if or $copyright $credit $first $last $license }}
<footer class="my-3" id="paige-site-footer">
<footer id="paige-site-footer">
{{ if $first }}
{{ partial "paige/footer-first.html" . }}
{{ end }}
{{ with $copyright }}
<p class="mb-0 text-center text-secondary" id="paige-copyright">{{ . }}</p>
<p class="paige-row-narrow text-center text-secondary" id="paige-copyright">{{ . }}</p>
{{ end }}
{{ with $license }}
<p class="mb-0 text-center text-secondary" id="paige-license">{{ . }}</p>
<p class="paige-row-narrow text-center text-secondary" id="paige-license">{{ . }}</p>
{{ end }}
{{ with $credit }}
<p class="mb-0 text-center text-secondary" id="paige-credit">{{ . }}</p>
<p class="paige-row-narrow text-center text-secondary" id="paige-credit">{{ . }}</p>
{{ end }}
{{ if $last }}

@ -1,15 +1,15 @@
{{ $page := . }}
{{ $ancestors := $page.Ancestors }}
{{ $basepath := path.Clean (urls.Parse (relLangURL "")).Path }}
{{ $description := $page.Param "paige.site_description" | markdownify }}
{{ $breadcrumbs := $page.Ancestors | and ($page.Param "paige.site.hide_breadcrumbs" | not) }}
{{ $description := $page.Param "paige.description" | markdownify | and ($page.Param "paige.site.hide_description" | not) }}
{{ $first := templates.Exists "partials/paige/site-header-first.html" }}
{{ $last := templates.Exists "partials/paige/site-header-last.html" }}
{{ $links := false }}
{{ $menu := site.Menus.main }}
{{ $menu := site.Menus.main | and ($page.Param "paige.site.hide_menu" | not) }}
{{ $pills := false }}
{{ $tabs := false }}
{{ $title := $page.Param "paige.site_title" | markdownify }}
{{ $title := $page.Param "paige.title" | default site.Title | markdownify | and ($page.Param "paige.site.hide_title" | not) }}
{{ $underline := false }}
{{ if eq $basepath "/" }}
@ -32,22 +32,22 @@
{{ $links = true }}
{{ end }}
{{ if or $ancestors $description $first $last $menu $title }}
<header class="my-3" id="paige-site-header">
{{ if or $breadcrumbs $description $first $last $menu $title }}
<header id="paige-site-header">
{{ if $first }}
{{ partial "paige/site-header-first.html" $page }}
{{ end }}
{{ with $title }}
<p class="display-1 fw-bold mb-2 mt-3 text-center" id="paige-site-title">{{ . }}</p>
<div class="display-1 fw-bold {{ if $description }} mb-2 {{ end }} paige-row-wide text-center" id="paige-site-title">{{ . }}</div>
{{ end }}
{{ with $description }}
<p class="lead mb-3 mt-2 text-center" id="paige-site-description">{{ . }}</p>
<div class="lead paige-row-wide text-center" id="paige-site-description">{{ . }}</div>
{{ end }}
{{ with $menu }}
<nav aria-label="{{ i18n `paige_menu` }}" class="my-3" id="paige-menu">
<nav aria-label="{{ i18n `paige_menu` }}" class="paige-row-wide" id="paige-menu">
<ul class="align-items-center justify-content-center nav {{ if $pills }} nav-pills {{ else if $tabs }} nav-tabs {{ else if $underline }} nav-underline {{ end }}">
{{ range . }}
{{ $menupath := strings.TrimPrefix $basepath .URL }}
@ -86,8 +86,8 @@
</nav>
{{ end }}
{{ with $ancestors }}
<nav aria-label="{{ i18n `paige_breadcrumbs` }}" class="my-3" id="paige-breadcrumbs">
{{ with $breadcrumbs }}
<nav aria-label="{{ i18n `paige_breadcrumbs` }}" class="paige-row-wide" id="paige-breadcrumbs">
<div class="d-flex justify-content-center">
<ol class="breadcrumb mb-0">
{{ $reverse := .Reverse }}
@ -98,7 +98,7 @@
{{ $title := $ancestor.Title }}
{{ if and (eq $i $last) (not $title) }}
{{ $title = $page.Param "paige.site_title" | default (site.Title) }}
{{ $title = $page.Param "paige.title" | default (site.Title) }}
{{ end }}
<li class="breadcrumb-item"><a href="{{ .RelPermalink }}">{{ $title | markdownify | plainify | htmlUnescape }}</a></li>

@ -39,14 +39,6 @@
padding: 0;
}
#paige-content > * {
margin-bottom: 1rem;
}
#paige-content > :last-child {
margin-bottom: 0;
}
blockquote {
padding: 0.5rem 1rem;
border-left: 0.25rem solid var(--bs-border-color);
@ -63,6 +55,7 @@ th {
display: flex;
}
.paige-row-narrow:not(:last-child),
.paige-figure .paige-quote,
.paige-figure .paige-video,
.paige-figure .highlight pre.chroma,
@ -79,7 +72,10 @@ blockquote > p:last-of-type {
.paige-gallery,
.paige-image,
.paige-quote,
.paige-row-narrow:last-child,
.paige-row-wide,
.paige-video,
#paige-content > *,
table {
margin-bottom: 1rem;
}

@ -1 +1 @@
<body class="d-flex flex-column">
<body>

@ -3,7 +3,7 @@
{{ $title := $page.Title }}
{{ if and $page.IsHome (not $title) }}
{{ $title = $page.Param "paige.site_title" | default (site.Title) }}
{{ $title = $page.Param "paige.title" | default (site.Title) }}
{{ end }}
{{ $title = $title | markdownify | plainify | htmlUnescape }}
@ -14,7 +14,7 @@
{{ $title := .Title }}
{{ if and .IsHome (not $title) }}
{{ $title = $page.Param "paige.site_title" | default (site.Title) }}
{{ $title = $page.Param "paige.title" | default (site.Title) }}
{{ end }}
{{ $titles = $titles | append ($title | markdownify | plainify | htmlUnescape) }}

Loading…
Cancel
Save