From 795755bf9b895843fb6572cedfcfb25ac9dd772e Mon Sep 17 00:00:00 2001 From: David Legrand <1110600+davlgd@users.noreply.github.com> Date: Tue, 13 Feb 2024 01:21:09 +0100 Subject: [PATCH] feat: add configurable edit link position - Add a `where` parameter to `editURL` - Allow user to choose between `toc` (default) and `single` - Add to single through last-updated partial --- exampleSite/hugo.yaml | 1 + layouts/partials/components/last-updated.html | 21 ++++++++++++++++++- layouts/partials/toc.html | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/exampleSite/hugo.yaml b/exampleSite/hugo.yaml index 0da0ad9..5235f23 100644 --- a/exampleSite/hugo.yaml +++ b/exampleSite/hugo.yaml @@ -142,6 +142,7 @@ params: editURL: enable: true + where: "single" # single | toc base: "https://github.com/imfing/hextra/edit/main/exampleSite/content" blog: diff --git a/layouts/partials/components/last-updated.html b/layouts/partials/components/last-updated.html index 7918fb1..22905e6 100644 --- a/layouts/partials/components/last-updated.html +++ b/layouts/partials/components/last-updated.html @@ -1,9 +1,28 @@ {{- $lastUpdated := (T "lastUpdated") | default "Last updated on" -}} +{{- $editThisPage := (T "editThisPage") | default "Edit this page"}} {{- if site.Params.displayUpdatedDate -}} +