diff options
author | AmazingRise <8315221+AmazingRise@users.noreply.github.com> | 2022-08-26 07:43:00 +0300 |
---|---|---|
committer | AmazingRise <8315221+AmazingRise@users.noreply.github.com> | 2022-08-26 07:43:00 +0300 |
commit | 1adda175206fb128dd1dfe4935215be5bfa93b0b (patch) | |
tree | 4c84678a63fc00f16181738eaee97fa1c85ab7f8 /layouts/_default | |
parent | 5017b8bb9533ac5801918d05f67e13a9d6881859 (diff) |
Diffstat (limited to 'layouts/_default')
-rw-r--r-- | layouts/_default/baseof.html | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 757b685..5cbe2a2 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -19,6 +19,15 @@ <!-- mobile footer --> </div> {{ partial "journal.html" .}} - <script src="{{"/js/journal.js" | relURL}}"></script> + <!-- For compatibility. View https://github.com/AmazingRise/hugo-theme-diary/pull/135 for details.--> + {{- $hugoVersion := split (replaceRE ".*([0-9]+)\\.([0-9]+)\\.([0-9]+).*" "$1 $2 $3" hugo.Version) " " -}} + {{- if and (eq (int (index $hugoVersion 0)) 0) (ge (int (index $hugoVersion 1)) 101) -}} + {{- /* no leading slash */ -}} + <script src="{{"js/journal.js" | relURL}}"></script> + {{- else -}} + {{- /* with leading slash */ -}} + <script src="{{"/js/journal.js" | relURL}}"></script> + {{- end -}} + </body> </html> |