From 48ebeca90c6a11b77bc53cbbaae66481a74686d3 Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Fri, 16 Oct 2026 00:21:23 +0800 Subject: Simplify source links and show HTML filenames in breadcrumbs --- layouts/partials/document-view.html | 16 +--------------- layouts/partials/site-identity.html | 3 +-- 2 files changed, 2 insertions(+), 17 deletions(-) (limited to 'layouts') diff --git a/layouts/partials/document-view.html b/layouts/partials/document-view.html index 5bfc7b6..ffe49eb 100644 --- a/layouts/partials/document-view.html +++ b/layouts/partials/document-view.html @@ -1,19 +1,5 @@ {{- if .File -}} - {{- $rawURL := "" -}} - {{- if .IsPage -}} - {{- $htmlBase := strings.TrimSuffix ".html" .RelPermalink -}} - {{- $rawURL = printf "%s/index.md" $htmlBase -}} - {{- else if .IsSection -}} - {{- $rawURL = printf "%s_index.md" .RelPermalink -}} - {{- end -}} {{- $gitBase := strings.TrimSuffix "/" site.Params.gitBase -}} {{- $gitURL := printf "%s/content/%s" $gitBase .File.Path -}} - +

source

{{- end -}} diff --git a/layouts/partials/site-identity.html b/layouts/partials/site-identity.html index 0f18d35..631969a 100644 --- a/layouts/partials/site-identity.html +++ b/layouts/partials/site-identity.html @@ -4,14 +4,13 @@ {{ $identity }} {{- if not $page.IsHome -}} {{- $path := strings.TrimSuffix "/" $page.RelPermalink -}} - {{- $path = strings.TrimSuffix ".html" $path -}} {{- $prefix := "/" -}} {{- $segments := split $path "/" -}} {{- range $index, $segment := $segments -}} {{- if ne $segment "" -}} {{- $prefix = printf "%s%s/" $prefix $segment -}} {{- if eq (add $index 1) (len $segments) -}} - {{ $segment }} + {{ $segment }}{{ if strings.HasSuffix $page.RelPermalink "/" }}{{ end }} {{- else -}} {{ $segment }} {{- end -}} -- cgit v1.2.3