Skip to content

Commit dc3ede1

Browse files
authored
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.
1 parent a56c244 commit dc3ede1

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

.drone.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ steps:
2626
NPM_CONFIG_LOGLEVEL: error
2727

2828
- name: testbuild
29-
image: thegeeklab/hugo:0.114.0
29+
image: thegeeklab/hugo:0.115.2
3030
commands:
3131
- mkdir -p exampleSite/themes/ && ln -s $(pwd)/ exampleSite/themes/hugo-geekdoc
3232
- hugo --panicOnWarning -s exampleSite/ -b http://localhost:8000/
@@ -173,7 +173,7 @@ steps:
173173
- refs/pull/**
174174

175175
- name: build
176-
image: thegeeklab/hugo:0.114.0
176+
image: thegeeklab/hugo:0.115.2
177177
commands:
178178
- hugo --panicOnWarning -s exampleSite/
179179

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Geekdoc
22

33
[![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)
4-
[![Hugo Version](https://img.shields.io/badge/hugo-0.93-blue.svg)](https://gohugo.io)
4+
[![Hugo Version](https://img.shields.io/badge/hugo-0.112-blue.svg)](https://gohugo.io)
55
[![GitHub release](https://img.shields.io/github/v/release/thegeeklab/hugo-geekdoc)](https://github.com/thegeeklab/hugo-geekdoc/releases/latest)
66
[![GitHub contributors](https://img.shields.io/github/contributors/thegeeklab/hugo-geekdoc)](https://github.com/thegeeklab/hugo-geekdoc/graphs/contributors)
77
[![License: MIT](https://img.shields.io/github/license/thegeeklab/hugo-geekdoc)](https://github.com/thegeeklab/hugo-geekdoc/blob/main/LICENSE)

exampleSite/content/en/_index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ geekdocAnchor: false
99
<!-- markdownlint-disable MD033 -->
1010

1111
<span class="badge-placeholder">[![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)</span>
12-
<span class="badge-placeholder">[![Hugo Version](https://img.shields.io/badge/hugo-0.93-blue.svg)](https://gohugo.io)</span>
12+
<span class="badge-placeholder">[![Hugo Version](https://img.shields.io/badge/hugo-0.112-blue.svg)](https://gohugo.io)</span>
1313
<span class="badge-placeholder">[![GitHub release](https://img.shields.io/github/v/release/thegeeklab/hugo-geekdoc)](https://github.com/thegeeklab/hugo-geekdoc/releases/latest)</span>
1414
<span class="badge-placeholder">[![GitHub contributors](https://img.shields.io/github/contributors/thegeeklab/hugo-geekdoc)](https://github.com/thegeeklab/hugo-geekdoc/graphs/contributors)</span>
1515
<span class="badge-placeholder">[![License: MIT](https://img.shields.io/github/license/thegeeklab/hugo-geekdoc)](https://github.com/thegeeklab/hugo-geekdoc/blob/main/LICENSE)</span>

layouts/partials/page-header.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{ $geekdocRepo := default (default false .Site.Params.geekdocRepo) .Page.Params.geekdocRepo }}
22
{{ $geekdocEditPath := default (default false .Site.Params.geekdocEditPath) .Page.Params.geekdocEditPath }}
33
{{ if .File }}
4-
{{ $.Scratch.Set "geekdocFilePath" (default (path.Join (default "content" .Site.Params.contentDir) .File.Path) .Page.Params.geekdocFilePath) }}
4+
{{ $.Scratch.Set "geekdocFilePath" (default (strings.TrimPrefix hugo.WorkingDir .File.Filename) .Page.Params.geekdocFilePath) }}
55
{{ else }}
66
{{ $.Scratch.Set "geekdocFilePath" false }}
77
{{ end }}

theme.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description = "Hugo theme made for documentation"
55
homepage = "https://geekdocs.de/"
66
demosite = "https://geekdocs.de/"
77
tags = ["docs", "documentation", "responsive", "simple"]
8-
min_version = "0.93.0"
8+
min_version = "0.112.0"
99

1010
[author]
1111
name = "Robert Kaussow"

0 commit comments

Comments
 (0)