From ada7e4c8c17a6863fa21ad925cd86869767be3da Mon Sep 17 00:00:00 2001 From: Will Faught Date: Wed, 17 Jul 2024 18:25:34 -0700 Subject: [PATCH] Use config to hide values --- README.md | 169 ++++++++++------- exampleSite/content/_index.md | 21 +-- exampleSite/content/customizations/_index.md | 87 +++++---- exampleSite/content/customizations/show.md | 91 ++++----- exampleSite/content/customizations/style.md | 149 ++++++++------- exampleSite/hugo.toml | 39 +++- .../layouts/partials/paige/style-first.css | 17 -- layouts/_default/baseof.html | 24 ++- layouts/partials/paige/list-item.html | 42 ++--- layouts/partials/paige/list.html | 6 +- layouts/partials/paige/page-footer.html | 37 ++-- layouts/partials/paige/page-header.html | 174 +++++++++--------- layouts/partials/paige/page.html | 16 +- layouts/partials/paige/site-footer.html | 16 +- layouts/partials/paige/site-header.html | 24 +-- layouts/partials/paige/style.html | 12 +- layouts/partials/paige/tag-body.html | 2 +- layouts/partials/paige/tag-head.html | 4 +- 18 files changed, 501 insertions(+), 429 deletions(-) diff --git a/README.md b/README.md index b9ba3604..322ab05a 100644 --- a/README.md +++ b/README.md @@ -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 = 'Paige Theme' 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:
#paige-alert
The page alert.
-
#paige-article
-
The article.
#paige-authors
-
The authors.
+
The page authors.
#paige-breadcrumbs
-
The breadcrumbs.
+
The site breadcrumbs.
#paige-collections
-
The collections.
+
The site collection pages.
#paige-collections-header
-
The collections header.
+
The site collection pages header.
#paige-comments
-
The comments.
+
The page comments.
#paige-content
-
The content.
+
The page content.
#paige-copyright
-
The copyright.
+
The site copyright.
#paige-credit
-
The credit.
+
The site credit.
#paige-date
-
The date.
-
#paige-description
-
The description.
+
The page date.
+
#paige-edit
+
The page edit link.
#paige-file
-
The file links.
-
#paige-file-edit
-
The file edit link.
-
#paige-file-history
-
The file history link.
+
The page edit and history links.
+
#paige-history
+
The page history link.
#paige-keywords
-
The keywords.
+
The page keywords.
#paige-license
-
The license.
-
#paige-main
-
The main.
+
The site license.
#paige-menu
-
The menu.
+
The site menu.
#paige-metadata
-
The metadata.
+
The page metadata.
#paige-next
The next page link.
+
#paige-page-description
+
The page description.
+
#paige-page-footer
+
The page footer that contains the page edit, history, next, and previous links.
+
#paige-page-header
+
The page header that contains the page title, description, metadata, and table of contents.
+
#paige-page-title
+
The page title.
#paige-pages
-
The pages.
+
The page sub-pages.
#paige-pages-header
-
The pages header.
+
The page sub-pages header.
#paige-pagination
-
The sub-page pagination links.
+
The pagination of sub-pages.
#paige-prev
The previous page link.
-
#paige-prev-next
-
The container of the previous and next page links.
#paige-reading-time
-
The reading time.
-
#paige-root
-
The outermost element in the body.
+
The page reading time.
#paige-sections
-
The sections.
+
The page section sub-pages.
#paige-sections-header
-
The sections header.
+
The page section sub-pages header.
#paige-series
-
The series.
+
The page series.
+
#paige-siblings
+
The page next and previous links.
#paige-site-description
The site description.
#paige-site-footer
-
The container of the site copyright, license, and credit.
+
The site footer that contains the site copyright, license, and credit.
#paige-site-header
The site header that contains the site title, description, menu, and breadcrumbs.
#paige-site-title
The site title.
-
#paige-title
-
The title.
#paige-toc
The table of contents.
-Page and sub-page classes: +Sub-page field classes:
.paige-authors
@@ -1069,8 +1106,6 @@ Page and sub-page classes:
The date.
.paige-description
The description.
-
.paige-keyword
-
A keyword.
.paige-keywords
The keywords.
.paige-metadata
@@ -1102,7 +1137,7 @@ Page kind classes:
The container element of pages with kind "term".
-Status classes: +Page status classes:
.paige-draft
@@ -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 diff --git a/exampleSite/content/_index.md b/exampleSite/content/_index.md index 8ec5ccbe..9e6469b8 100644 --- a/exampleSite/content/_index.md +++ b/exampleSite/content/_index.md @@ -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 +++ -

{{% 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%" %}}

+{{< 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%" >}}

An advanced Hugo theme

@@ -29,6 +24,6 @@ hide_page = true Get started!

-
+
{{< paige/icon class="bi bi-github" title="GitHub" url="https://github.com/willfaught/paige" >}}
diff --git a/exampleSite/content/customizations/_index.md b/exampleSite/content/customizations/_index.md index c72cda8d..b2a28305 100644 --- a/exampleSite/content/customizations/_index.md +++ b/exampleSite/content/customizations/_index.md @@ -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 ``` diff --git a/exampleSite/content/customizations/show.md b/exampleSite/content/customizations/show.md index fe6d542f..89a2fc62 100644 --- a/exampleSite/content/customizations/show.md +++ b/exampleSite/content/customizations/show.md @@ -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 ``` diff --git a/exampleSite/content/customizations/style.md b/exampleSite/content/customizations/style.md index 53723806..a9e134ea 100644 --- a/exampleSite/content/customizations/style.md +++ b/exampleSite/content/customizations/style.md @@ -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: | - #paige-authors, - #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; - } - #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; } +```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-license, +#paige-menu, +#paige-page-title, +#paige-page-description, +#paige-reading-time, +#paige-series, +#paige-siblings, +#paige-site-title, +#paige-site-description, +#paige-toc { + 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 ``` diff --git a/exampleSite/hugo.toml b/exampleSite/hugo.toml index 72725ed8..99a82357 100644 --- a/exampleSite/hugo.toml +++ b/exampleSite/hugo.toml @@ -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" diff --git a/exampleSite/layouts/partials/paige/style-first.css b/exampleSite/layouts/partials/paige/style-first.css index 4035520c..e69de29b 100644 --- a/exampleSite/layouts/partials/paige/style-first.css +++ b/exampleSite/layouts/partials/paige/style-first.css @@ -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; -} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 6155a36c..b5be4afd 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -8,22 +8,20 @@ {{ partial "paige/body-first.html" $page }} {{ end }} -
+
-
-
- {{ if templates.Exists "partials/paige/main-first.html" }} - {{ partial "paige/main-first.html" $page }} - {{ end }} +
+ {{ 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 }} + {{ 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 }} - {{ end }} -
+ {{ if templates.Exists "partials/paige/site-last.html" }} + {{ partial "paige/site-last.html" $page }} + {{ end }}
diff --git a/layouts/partials/paige/list-item.html b/layouts/partials/paige/list-item.html index 8bae157c..65d055d3 100644 --- a/layouts/partials/paige/list-item.html +++ b/layouts/partials/paige/list-item.html @@ -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) }}
{{ with $title }} -

{{ . }}

+

{{ . }}

{{ end }} {{ with $description }} -

{{ . }}

+

{{ . }}

{{ end }} {{ with $summary }} -

{{ . }}

+

{{ . }}

{{ end }} - {{ if or $categories $tags }} -

- {{ range $i, $term := sort (append $categories $tags) "LinkTitle" -}} + {{ with $keywords }} +

+ {{ range $i, $term := . -}} {{- if $textkeywords -}} {{- if gt $i 0 }} · {{ end -}} @@ -71,7 +71,7 @@ {{ end }} {{ with $series }} -

+

{{ range $i, $series := . -}} {{- if gt $i 0 }} · {{ end -}} @@ -81,7 +81,7 @@ {{ end }} {{ with $authors }} -

+

{{ range $i, $author := . -}} {{- if gt $i 0 }} · {{ end -}} @@ -91,12 +91,12 @@ {{ end }} {{ with $date }} -

+

{{ end }} {{ with $readingtime }} -

{{ . }} {{ i18n "paige_minutes" . }}

+

{{ . }} {{ i18n "paige_minutes" . }}

{{ end }}
diff --git a/layouts/partials/paige/list.html b/layouts/partials/paige/list.html index a1fe3235..e3e0d349 100644 --- a/layouts/partials/paige/list.html +++ b/layouts/partials/paige/list.html @@ -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 }} diff --git a/layouts/partials/paige/page-footer.html b/layouts/partials/paige/page-footer.html index a7aa42f4..a3e4af98 100644 --- a/layouts/partials/paige/page-footer.html +++ b/layouts/partials/paige/page-footer.html @@ -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 }} -