Add paige.credit config

This commit is contained in:
Will Faught
2024-07-12 12:27:37 -07:00
parent deef18c0c3
commit 2c4716de39
7 changed files with 18 additions and 15 deletions

View File

@@ -176,6 +176,7 @@ There is a single parameter object with sensible defaults that can be overridden
[paige]
color = "#0d6efd" # Bootstrap primary color and theme color for Safari and Windows
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
external_link_new_tab = false # Open external links in new tabs
file_edit_url = "" # Example: "https://github.com/account/project/edit/master/content/%s"
@@ -1145,8 +1146,6 @@ Shortcode classes:
<dd>The container element of <code>paige/youtube</code> shortcodes.</dd>
</dl>
If you hide `#paige-credit`, please credit this project in a post to help others find it.
### Minimal look
By default, everything is shown.
@@ -1156,7 +1155,6 @@ try the following in `yoursite/layouts/partials/paige/style-first.css`:
```css
#paige-authors,
#paige-collections,
#paige-credit,
#paige-keywords,
#paige-prev-next,
#paige-reading-time,

View File

@@ -6,9 +6,9 @@ series = ["series-demo"]
tags = ["sections"]
title = "Customizations"
[paige]
credit = "Paige Theme"
style = """
#paige-authors,
#paige-credit,
#paige-date,
#paige-file,
#paige-keywords,
@@ -36,11 +36,11 @@ This page has the following parameters:
```yaml
paige:
credit: "Paige Theme"
file_link:
disable: false
style: |
#paige-authors,
#paige-credit,
#paige-date,
#paige-file,
#paige-keywords,

View File

@@ -7,9 +7,9 @@ series = ["series-demo"]
tags = ["show", "singles"]
title = "Show Data"
[paige]
credit = "Paige Theme"
style = """
#paige-authors,
#paige-credit,
#paige-date,
#paige-file,
#paige-keywords,
@@ -38,11 +38,11 @@ This page has the following parameters:
```yaml
paige:
credit: "Paige Theme"
file_link:
disable: false
style: |
#paige-authors,
#paige-credit,
#paige-date,
#paige-file,
#paige-keywords,

View File

@@ -7,9 +7,9 @@ series = ["series-demo"]
tags = ["singles", "style"]
title = "Style Data"
[paige]
credit = "Paige Theme"
style = """
#paige-authors,
#paige-credit,
#paige-date,
#paige-file,
#paige-keywords,
@@ -36,7 +36,6 @@ style = """
#paige-title { font-style: italic; }
#paige-toc { font-style: italic; }
#paige-copyright { font-style: italic; }
#paige-credit { font-style: italic; }
.paige-authors { font-style: italic; }
.paige-date { font-style: italic; }
.paige-keyword { font-style: italic; }
@@ -55,11 +54,11 @@ This page has the following parameters:
```yaml
paige:
credit: "Paige Theme"
file_link:
disable: false
style: |
#paige-authors,
#paige-credit,
#paige-date,
#paige-file,
#paige-keywords,
@@ -86,7 +85,6 @@ paige:
#paige-title { font-style: italic; }
#paige-toc { font-style: italic; }
#paige-copyright { font-style: italic; }
#paige-credit { font-style: italic; }
.paige-authors { font-style: italic; }
.paige-date { font-style: italic; }
.paige-keyword { font-style: italic; }

View File

@@ -91,6 +91,7 @@ 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"

View File

@@ -1,6 +1,5 @@
#paige-authors,
#paige-breadcrumbs,
#paige-credit,
#paige-date,
#paige-file,
#paige-keywords,

View File

@@ -1,12 +1,19 @@
{{ $page := . }}
{{ $copyright := site.Copyright | markdownify }}
{{ $credit := $page.Param "paige.credit" }}
{{ $theme := "https://github.com/willfaught/paige" }}
{{ $fileediturl := $page.Param "paige.file_edit_url" }}
{{ $filehistoryurl := $page.Param "paige.file_history_url" }}
{{ $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 }}
{{ else }}
{{ $credit = markdownify $credit }}
{{ end }}
{{ if $page.File }}
{{ if $fileediturl }}
{{ $fileediturl = printf $fileediturl $page.File.Path }}
@@ -58,9 +65,9 @@
<p class="mb-0" id="paige-copyright">{{ . }}</p>
{{ end }}
<p class="mb-0" id="paige-credit">
<a class="link-secondary text-decoration-none" href="{{ $theme }}" {{ with $target }} target="{{ . }}" {{ end }}>Paige Theme</a>
</p>
{{ with $credit }}
<p class="mb-0" id="paige-credit">{{ . }}</p>
{{ end }}
{{ if templates.Exists "partials/paige/footer-last.html" }}
{{ partial "paige/footer-last.html" . }}