From dc3ede1b72f5e8ff5abb7a25bc8cd0ccc90dcc63 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Tue, 11 Jul 2023 21:00:27 +0200 Subject: [PATCH] fix: utilize hugo.WorkingDir for a reliable edit page link (#665) BREAKING CHANGE: The `Edit page` uses the `hugo.WorkingDir` function of Hugo, which was introduced in v0.112.0. Due to this change, the minimum Hugo version for the theme has been raised accordingly. --- .drone.yml | 4 ++-- README.md | 2 +- exampleSite/content/en/_index.md | 2 +- layouts/partials/page-header.html | 2 +- theme.toml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.drone.yml b/.drone.yml index 028d202..0cae3c2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -26,7 +26,7 @@ steps: NPM_CONFIG_LOGLEVEL: error - name: testbuild - image: thegeeklab/hugo:0.114.0 + image: thegeeklab/hugo:0.115.2 commands: - mkdir -p exampleSite/themes/ && ln -s $(pwd)/ exampleSite/themes/hugo-geekdoc - hugo --panicOnWarning -s exampleSite/ -b http://localhost:8000/ @@ -173,7 +173,7 @@ steps: - refs/pull/** - name: build - image: thegeeklab/hugo:0.114.0 + image: thegeeklab/hugo:0.115.2 commands: - hugo --panicOnWarning -s exampleSite/ diff --git a/README.md b/README.md index 7dd7bd4..3c0ca6a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Geekdoc [![Build Status](https://img.shields.io/drone/build/thegeeklab/hugo-geekdoc?logo=drone&server=https%3A%2F%2Fdrone.thegeeklab.de)](https://drone.thegeeklab.de/thegeeklab/hugo-geekdoc) -[![Hugo Version](https://img.shields.io/badge/hugo-0.93-blue.svg)](https://gohugo.io) +[![Hugo Version](https://img.shields.io/badge/hugo-0.112-blue.svg)](https://gohugo.io) [![GitHub release](https://img.shields.io/github/v/release/thegeeklab/hugo-geekdoc)](https://github.com/thegeeklab/hugo-geekdoc/releases/latest) [![GitHub contributors](https://img.shields.io/github/contributors/thegeeklab/hugo-geekdoc)](https://github.com/thegeeklab/hugo-geekdoc/graphs/contributors) [![License: MIT](https://img.shields.io/github/license/thegeeklab/hugo-geekdoc)](https://github.com/thegeeklab/hugo-geekdoc/blob/main/LICENSE) diff --git a/exampleSite/content/en/_index.md b/exampleSite/content/en/_index.md index 36934df..febb5db 100644 --- a/exampleSite/content/en/_index.md +++ b/exampleSite/content/en/_index.md @@ -9,7 +9,7 @@ geekdocAnchor: false [![Build Status](https://img.shields.io/drone/build/thegeeklab/hugo-geekdoc?logo=drone&server=https%3A%2F%2Fdrone.thegeeklab.de)](https://drone.thegeeklab.de/thegeeklab/hugo-geekdoc) -[![Hugo Version](https://img.shields.io/badge/hugo-0.93-blue.svg)](https://gohugo.io) +[![Hugo Version](https://img.shields.io/badge/hugo-0.112-blue.svg)](https://gohugo.io) [![GitHub release](https://img.shields.io/github/v/release/thegeeklab/hugo-geekdoc)](https://github.com/thegeeklab/hugo-geekdoc/releases/latest) [![GitHub contributors](https://img.shields.io/github/contributors/thegeeklab/hugo-geekdoc)](https://github.com/thegeeklab/hugo-geekdoc/graphs/contributors) [![License: MIT](https://img.shields.io/github/license/thegeeklab/hugo-geekdoc)](https://github.com/thegeeklab/hugo-geekdoc/blob/main/LICENSE) diff --git a/layouts/partials/page-header.html b/layouts/partials/page-header.html index 876ccc0..8f146d7 100644 --- a/layouts/partials/page-header.html +++ b/layouts/partials/page-header.html @@ -1,7 +1,7 @@ {{ $geekdocRepo := default (default false .Site.Params.geekdocRepo) .Page.Params.geekdocRepo }} {{ $geekdocEditPath := default (default false .Site.Params.geekdocEditPath) .Page.Params.geekdocEditPath }} {{ if .File }} - {{ $.Scratch.Set "geekdocFilePath" (default (path.Join (default "content" .Site.Params.contentDir) .File.Path) .Page.Params.geekdocFilePath) }} + {{ $.Scratch.Set "geekdocFilePath" (default (strings.TrimPrefix hugo.WorkingDir .File.Filename) .Page.Params.geekdocFilePath) }} {{ else }} {{ $.Scratch.Set "geekdocFilePath" false }} {{ end }} diff --git a/theme.toml b/theme.toml index 16a935e..90b7cf5 100644 --- a/theme.toml +++ b/theme.toml @@ -5,7 +5,7 @@ description = "Hugo theme made for documentation" homepage = "https://geekdocs.de/" demosite = "https://geekdocs.de/" tags = ["docs", "documentation", "responsive", "simple"] -min_version = "0.93.0" +min_version = "0.112.0" [author] name = "Robert Kaussow"