From bce6be90883b107285faa56acf0081b54daa3aa9 Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Sat, 8 Aug 2026 21:30:23 +0800 Subject: Initialize personal website --- layouts/partials/document-view.html | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 layouts/partials/document-view.html (limited to 'layouts/partials/document-view.html') diff --git a/layouts/partials/document-view.html b/layouts/partials/document-view.html new file mode 100644 index 0000000..5bfc7b6 --- /dev/null +++ b/layouts/partials/document-view.html @@ -0,0 +1,19 @@ +{{- 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 -}} + +{{- end -}} -- cgit v1.2.3