Fix various deprecation warning (#113)
* .Site.IsServer was deprecated in Hugo v0.120.0, replaced by hugo.IsServer * .Site.DisqusShortname was deprecated in Hugo v0.120.0, replaced by .Site.Config.Services.Disqus.Shortname * Use .RenderString instead of markdownify (solves #104) * The "tweet" shortcode requires two named parameters user and id. * Replace .Site.BaseURL by absURL (solves #103)
This commit is contained in:
parent
a1ecb22846
commit
c194169315
|
@ -21,7 +21,7 @@ description: Here is a demo of all shortcodes available in Hugo.
|
|||
|
||||
## Tweet
|
||||
|
||||
{{< tweet 877500564405444608 >}}
|
||||
{{< tweet user="GoHugoIO" id="877500564405444608" >}}
|
||||
|
||||
## Vimeo
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
</div>
|
||||
{{- $.Scratch.Set "isDisqus" true -}}
|
||||
<!-- Check if disqus short name is given -->
|
||||
{{ if not .Site.DisqusShortname }}
|
||||
{{ if not .Site.Config.Services.Disqus.Shortname }}
|
||||
{{- $.Scratch.Set "isDisqus" false -}}
|
||||
{{ end }}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<main class="list">
|
||||
<div class="site-description">
|
||||
{{- if isset .Site.Params "subtitle" -}}
|
||||
<p>{{ .Site.Params.Subtitle | markdownify }}</p>
|
||||
<p>{{ .Site.Params.Subtitle | .Page.RenderString }}</p>
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
|
||||
|
|
|
@ -9,11 +9,11 @@
|
|||
var dsq = document.createElement('script');
|
||||
dsq.type = 'text/javascript';
|
||||
dsq.async = true;
|
||||
var disqus_shortname = '{{ .Site.DisqusShortname }}';
|
||||
var disqus_shortname = '{{ .Site.Config.Services.Disqus.Shortname }}';
|
||||
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||
})();
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by
|
||||
Disqus.</a></noscript>
|
||||
<a href="http://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
|
||||
<a href="http://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
href="https://github.com/athul/archie">Archie Theme</a> | Built with <a href="https://gohugo.io">Hugo</a>
|
||||
</div>
|
||||
</footer>
|
||||
{{ if not .Site.IsServer }}
|
||||
{{ if not hugo.IsServer }}
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
{{ end }}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<header>
|
||||
<div class="main">
|
||||
<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
|
||||
<a href="{{ absURL "/" }}">{{ .Site.Title }}</a>
|
||||
</div>
|
||||
<nav>
|
||||
{{ range .Site.Menus.main }}
|
||||
|
@ -8,7 +8,7 @@
|
|||
{{ end }}
|
||||
{{ if eq .Site.Params.mode "toggle" -}}
|
||||
| <span id="dark-mode-toggle" onclick="toggleTheme()"></span>
|
||||
<script src="{{ .Site.BaseURL }}js/themetoggle.js"></script>
|
||||
<script src="{{ absURL "js/themetoggle.js" }}"></script>
|
||||
{{ end }}
|
||||
</nav>
|
||||
</header>
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
{{ if and (isset .Site.Params "social") (.Site.Params.useCDN | default false) -}}
|
||||
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
||||
{{- else if or (isset .Site.Params "social") (eq .Site.Params.mode "toggle") -}}
|
||||
<script src="{{ .Site.BaseURL }}js/feather.min.js"></script>
|
||||
<script src="{{ absURL "js/feather.min.js" }}"></script>
|
||||
{{ end }}
|
||||
{{ if .Site.Params.useCDN | default false -}}
|
||||
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@1,500&display=swap" rel="stylesheet">
|
||||
|
@ -49,7 +49,7 @@
|
|||
<script type="text/javascript"
|
||||
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
</script>
|
||||
|
||||
|
||||
<!-- inline Mathjax -->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
|
@ -71,7 +71,7 @@
|
|||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.15.2/dist/katex.min.css">
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.2/dist/katex.min.js"></script>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.2/dist/contrib/auto-render.min.js" onload="renderMathInElement(document.body);"></script>
|
||||
|
||||
|
||||
<!-- inline KaTeX -->
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
|
@ -84,7 +84,7 @@
|
|||
});
|
||||
</script>
|
||||
{{ end }}
|
||||
|
||||
|
||||
<!-- Custom CSS style get applied last -->
|
||||
{{- if isset .Site.Params "customcss" }}
|
||||
{{ range .Site.Params.customCSS }}
|
||||
|
@ -98,7 +98,7 @@
|
|||
{{- else if (hasPrefix . "<script")}}
|
||||
{{ .| safeHTML }}
|
||||
{{- else }}
|
||||
<script src="{{ $.Site.BaseURL }}{{ . }}"></script>
|
||||
<script src="{{ absURL . }}"></script>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</head>
|
||||
|
|
Loading…
Reference in a new issue