変更履歴リンクを追加した
右上に「変更履歴」リンクを追加した。現在はArchieというテーマを使用しているので(CSSは一部custom.cssで変更している)、これをフォークしてhead.html
に下記を追加した。
{{- $githubHistory := $.Site.Params.historyBaseURL }}
{{ with .Page.File }}
{{- $currentRelPath := .Path -}}
<a class="change-history" alia-label="See change histories of this page" href="{{ print $githubHistory $currentRelPath }}">変更履歴</a>
{{ else }}
<a class="change-history" alia-label="See change histories of this page" href="{{ print $githubHistory }}">変更履歴</a>
{{ end }}
各投稿ページではGitHubのそれぞれの変更履歴に飛び、トップページやタグ一覧では全体の変更履歴に飛ぶようになっている。
historyBaseURL
はconfig.toml
で下記のように定義できる。
[params]
historyBaseURL = "https://github.com/kozmof/kozmof.github.io/commits/main/content/"