diff --git a/README.md b/README.md index 517f0cf9..43c45498 100644 --- a/README.md +++ b/README.md @@ -176,6 +176,7 @@ There is a single parameter object with sensible defaults that can be overridden color = "#0d6efd" # Bootstrap primary color and theme color for Safari and Windows color_scheme = "auto" # Must be "auto", "dark", or "light" external_link_new_tab = false # Open external links in new tabs +file_edit_url = "" # Example is "https://github.com/willfaught/paige/edit/master/content/%s" keyword_style = "text" # Must be "text" or "pills" math = false # Enable math typesetting site_title = "" # Appears above the menu, above the site description, if set @@ -284,13 +285,6 @@ logo = "" # Example is "/logo.webp" managing_editor = "" # Example is "will.faught@example.com (Will Faught)" web_master = "" # Example is "will.faught@example.com (Will Faught)" -[paige.file_link] # A link placed at the top of the footer for pages with files -content = "" # Example is "Edit this page" -disable = false -url = "" -# The formatting verb "%s" is replaced with the path to the file relative to the content directory. -# Example is "https://github.com/willfaught/paige/edit/master/content/%s". - [paige.git] commit_url = "" # Example is "https://github.com/willfaught/paige/commit/%s" diff --git a/exampleSite/content/customization/_index.md b/exampleSite/content/customization/_index.md index a1b849c5..c7fc6d66 100644 --- a/exampleSite/content/customization/_index.md +++ b/exampleSite/content/customization/_index.md @@ -3,8 +3,6 @@ authors: ["will-faught"] categories: ["customization", "paige"] description: "Demonstrations of Paige customization." paige: - file_link: - disable: false style: | #paige-authors, #paige-credit, diff --git a/exampleSite/content/customization/show.md b/exampleSite/content/customization/show.md index 1886a7ea..28368c90 100644 --- a/exampleSite/content/customization/show.md +++ b/exampleSite/content/customization/show.md @@ -4,8 +4,6 @@ categories: ["customization", "paige"] date: "2023-02-01" description: "Demonstration of Paige customization that shows data." paige: - file_link: - disable: false style: | #paige-authors, #paige-credit, diff --git a/exampleSite/content/customization/style.md b/exampleSite/content/customization/style.md index 8b90b69e..77c17b13 100644 --- a/exampleSite/content/customization/style.md +++ b/exampleSite/content/customization/style.md @@ -4,8 +4,6 @@ categories: ["customization", "paige"] date: "2023-01-01" description: "Demonstration of Paige customization that styles data." paige: - file_link: - disable: false style: | #paige-authors, #paige-credit, diff --git a/exampleSite/hugo.toml b/exampleSite/hugo.toml index 2af0894b..c50ebafb 100644 --- a/exampleSite/hugo.toml +++ b/exampleSite/hugo.toml @@ -91,6 +91,8 @@ taxonomy = ["atom", "html", "rss"] term = ["atom", "html", "rss"] [params.paige] +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_title = "Paige" site_description = "Powerful, pliable pixel perfection" @@ -106,11 +108,6 @@ url = "https://willfaught.com/paige" managing_editor = "will.faught@example.com (Will Faught)" web_master = "will.faught@example.com (Will Faught)" -[params.paige.file_link] -content = "Edit this page" -disable = true -url = "https://github.com/willfaught/paige/edit/master/exampleSite/content/%s" - [taxonomies] author = "authors" category = "categories" diff --git a/i18n/en.yaml b/i18n/en.yaml index b40a0270..88b81a9e 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -10,6 +10,9 @@ paige_figure: paige_aria_section_link: other: Link to this section +paige_edit_this_page: + other: Edit this page + paige_minutes: one: minute other: minutes diff --git a/layouts/partials/paige/footer.html b/layouts/partials/paige/footer.html index 4e8fa46c..ea4a7d94 100644 --- a/layouts/partials/paige/footer.html +++ b/layouts/partials/paige/footer.html @@ -2,12 +2,11 @@ {{ $copyright := site.Copyright | markdownify }} {{ $href := "https://github.com/willfaught/paige" }} -{{ $linkcontent := $page.Param "paige.file_link.content" | markdownify }} -{{ $linkurl := $page.Param "paige.file_link.url" }} +{{ $fileediturl := $page.Param "paige.file_edit_url" }} {{ $target := partial "paige/target.html" (dict "page" $page "url" $href) }} -{{ if and $linkurl $page.File }} - {{ $linkurl = printf $linkurl $page.File.Path | safeURL }} +{{ if and $fileediturl $page.File }} + {{ $fileediturl = printf $fileediturl $page.File.Path }} {{ end }}