From e81acc2a92cc79583543dd2d7f923625a2f5c2a5 Mon Sep 17 00:00:00 2001 From: Will Faught Date: Fri, 7 Apr 2023 23:24:18 -0700 Subject: [PATCH] Rename commit_url_prefix to commit_url, change to format string --- README.md | 2 +- exampleSite/config.yaml | 2 +- layouts/partials/paige/metadata.html | 4 ++-- layouts/partials/paige/page.html | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1149f1be..adcdbba4 100644 --- a/README.md +++ b/README.md @@ -214,7 +214,7 @@ paige: format: ":date_long" # Hugo date format source: "published" # Displayed date in single pages; must be "published" or "modified" git: - commit_url_prefix: "" # Example is "https://github.com/willfaught/paige/commit/" + commit_url: "" # Example is "https://github.com/willfaught/paige/commit/%s" math: false # Enable math typesetting menu: breakpoint: "sm" # Bootstrap breakpoint at which to display all menu items diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 12c4e6a7..ef1e620e 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -72,7 +72,7 @@ params: name: "Will Faught" paige: git: - commit_url_prefix: "https://github.com/willfaught/paige/commit/" + commit_url: "https://github.com/willfaught/paige/commit/%s" taxonomies: author: "authors" category: "categories" diff --git a/layouts/partials/paige/metadata.html b/layouts/partials/paige/metadata.html index 84ca0cfd..cdc53983 100644 --- a/layouts/partials/paige/metadata.html +++ b/layouts/partials/paige/metadata.html @@ -12,8 +12,8 @@ {{ $tags := $page.Params.tags | default slice | uniq }} {{ $title := $page.Title | markdownify }} -{{ if and ($page.Param "paige.git.commit_url_prefix") $page.GitInfo }} - {{ $commiturl = print ($page.Param "paige.git.commit_url_prefix") $page.GitInfo.Hash }} +{{ if and ($page.Param "paige.git.commit_url") $page.GitInfo }} + {{ $commiturl = printf ($page.Param "paige.git.commit_url") $page.GitInfo.Hash }} {{ end }}
diff --git a/layouts/partials/paige/page.html b/layouts/partials/paige/page.html index 7c0d0d70..dd12ec7c 100644 --- a/layouts/partials/paige/page.html +++ b/layouts/partials/paige/page.html @@ -19,8 +19,8 @@ {{ $title := $page.Title | markdownify }} {{ $titlelink := $page.RelPermalink }} -{{ if and (.Param "paige.git.commit_url_prefix") .GitInfo }} - {{ $commiturl = print (.Param "paige.git.commit_url_prefix") .GitInfo.Hash }} +{{ if and (.Param "paige.git.commit_url") .GitInfo }} + {{ $commiturl = printf (.Param "paige.git.commit_url") .GitInfo.Hash }} {{ end }} {{ if $draft }}