From 4197ad460afd96ab508d421939b92f80bbcdc5ca Mon Sep 17 00:00:00 2001 From: straightupjac Date: Tue, 3 May 2022 01:51:15 -0400 Subject: [PATCH 1/2] fix github info --- .github/workflows/deploy.yaml | 2 ++ config.toml | 3 +++ 2 files changed, 5 insertions(+) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 6a223674..ee51d3ee 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -10,6 +10,8 @@ jobs: runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod - name: Build Link Index uses: jackyzha0/hugo-obsidian@v2.12 diff --git a/config.toml b/config.toml index 5c4dfcb4..5efa9f34 100644 --- a/config.toml +++ b/config.toml @@ -28,3 +28,6 @@ enableGitInfo = true lineNumbersInTable = true style = "dracula" tabWidth = 4 + [frontmatter] + lastmod = ["lastmod", ":git", "date", "publishDate"] + publishDate = ["publishDate", "date"] \ No newline at end of file From 97607c3ca5ac837f7f6bc7a048b72a8271fbd570 Mon Sep 17 00:00:00 2001 From: benbohmer <103453816+benbohmer@users.noreply.github.com> Date: Tue, 3 May 2022 09:10:45 +0200 Subject: [PATCH 2/2] fix: keep / at end of URL to avoid redirects Removed strings.TrimRight "/" in line 10 to keep the trailing slash at the end of URLs in regular links. This avoids having every single internal link being a 301 redirect. --- layouts/_default/_markup/render-link.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html index cdacfc13..4757b728 100644 --- a/layouts/_default/_markup/render-link.html +++ b/layouts/_default/_markup/render-link.html @@ -7,7 +7,7 @@ {{$spacedurl := replace $trimmed "%20" " " }} {{$fixedUrl := (cond (hasPrefix $spacedurl "/") $spacedurl (print "/" $spacedurl)) | urlize}} {{$nonexistent := eq (.Page.GetPage $spacedurl).RelPermalink ""}} -{{$rooted := default $spacedurl (strings.TrimRight "/" (.Page.GetPage $spacedurl).RelPermalink) }} +{{$rooted := default $spacedurl ((.Page.GetPage $spacedurl).RelPermalink) }}