theme: some restructuring

This commit is contained in:
Sören Weber 2022-03-07 17:22:20 +01:00
parent 05fa313e59
commit 985eacea7e
No known key found for this signature in database
GPG key ID: 07D17FF580AE7589
4 changed files with 15 additions and 16 deletions

View file

@ -33,12 +33,6 @@
}
</script>
{{- end }}
<script>
window.T_Copy_to_clipboard = '{{ T "Copy-to-clipboard" | safeJS }}';
window.T_Copied_to_clipboard = '{{ T "Copied-to-clipboard" | safeJS }}';
window.T_Copy_link_to_clipboard = '{{ T "Copy-link-to-clipboard" | safeJS }}';
window.T_Link_copied_to_clipboard = '{{ T "Link-copied-to-clipboard" | safeJS }}';
</script>
<script src="{{"js/theme.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}"></script>
{{- partial "custom-footer.html" . }}
</body>

View file

@ -39,7 +39,7 @@
}
}
@media all and (-ms-high-contrast:none) {
/* IE11s understanding of positioning is weird at best */
{{ "/* IE11s understanding of positioning is weird at best */" | safeCSS }}
a#logo {
margin-top: -58px;
}

View file

@ -1,11 +1,4 @@
{{ "<!-- hack to let hugo tell us how to get to the root when using relativeURLs, it needs to be called *url= for it to do its magic: -->" | safeHTML }}
{{ "<!-- https://github.com/gohugoio/hugo/blob/145b3fcce35fbac25c7033c91c1b7ae6d1179da8/transform/urlreplacers/absurlreplacer.go#L72 -->" | safeHTML }}
<script>
var index_url={{ "index.json" | relLangURL }};
var root_url="/";
var baseUri=root_url.replace(/\/$/, '');
</script>
{{- $showvisitedlinks := .Site.Params.showVisitedLinks }}
<aside id="sidebar" class="default-animation{{ if $showvisitedlinks }} showVisitedLinks{{ end }}">
{{- $currentNode := . }}

View file

@ -15,8 +15,8 @@
{{- range .Site.Params.custom_css }}
<link href="{{(printf "%s" .) | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
{{- end }}
<style>
{{- if .Site.Params.disableInlineCopyToClipBoard }}
<style>
:not(pre) > code.copy-to-clipboard-code + span.copy-to-clipboard-button {
display: none;
}
@ -25,10 +25,22 @@
border-top-right-radius: 2px;
border-right-width: 1px;
}
{{- end }}
</style>
{{- end }}
<script src="{{"js/variant.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}"></script>
<script>
{{ "// hack to let hugo tell us how to get to the root when using relativeURLs, it needs to be called *url= for it to do its magic:" | safeJS }}
{{ "// https://github.com/gohugoio/hugo/blob/145b3fcce35fbac25c7033c91c1b7ae6d1179da8/transform/urlreplacers/absurlreplacer.go#L72" | safeJS }}
var index_url={{ "index.json" | relLangURL }};
var root_url="/";
var baseUri=root_url.replace(/\/$/, '');
{{ "// translations" | safeJS }}
window.T_Copy_to_clipboard = '{{ T "Copy-to-clipboard" | safeJS }}';
window.T_Copied_to_clipboard = '{{ T "Copied-to-clipboard" | safeJS }}';
window.T_Copy_link_to_clipboard = '{{ T "Copy-link-to-clipboard" | safeJS }}';
window.T_Link_copied_to_clipboard = '{{ T "Link-copied-to-clipboard" | safeJS }}';
{{ "// some further base stuff" | safeJS }}
var baseUriFull="{{ .Site.BaseURL | safeJS }}";
{{- $quotedthemevariants := slice }}
{{- range $themevariants }}
{{- $quotedthemevariants = $quotedthemevariants | append (printf "\"%s\"" .) }}