mirror of
https://github.com/13hannes11/hugo-coder-timeline.git
synced 2024-09-04 00:50:58 +02:00
And notice shortcodes (#537)
* Added information panel shortcodes (#437) * Added information panel shortcodes * Fixed dark mixin * Moved mixin location to correct location Co-authored-by: Luiz F. A. de Prá <luizdepra@users.noreply.github.com> * Fix SCSS styling * Update generated files * Fix notice HTML * Fix Makefile * Rename JS file * Adsd emoji support for lang selectors * Fix notices and other things * Fix JS on template * Update example content * Update images * Update generated files * Fix netlify preview * Fix netlify preview build * Fix netlify theme path Co-authored-by: Jian Liew <jianloongliew@gmail.com>
This commit is contained in:
committed by
GitHub
parent
32ffc536aa
commit
ed1c854df2
@@ -6,7 +6,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="Content-Language" content="{{ .Site.Language.Lang }}">
|
||||
<meta name="color-scheme" content="light dark">
|
||||
|
||||
|
||||
{{ if .Site.Params.csp }}
|
||||
{{ partial "csp.html" . }}
|
||||
{{ end }}
|
||||
@@ -102,7 +102,7 @@
|
||||
{{ else if eq .Site.Params.colorScheme "auto" }}
|
||||
{{ $csClass = "colorscheme-auto" }}
|
||||
{{ end }}
|
||||
<body class="{{ $csClass }}{{ if .Site.Params.rtl }} rtl{{ end }}"
|
||||
<body class="preload-transitions {{ $csClass }}{{ if .Site.Params.rtl }} rtl{{ end }}"
|
||||
onload="{{ if .Site.Params.enableTwemoji }} twemoji.parse(document.body); {{ end }}"
|
||||
>
|
||||
{{ partial "float" . }}
|
||||
@@ -116,14 +116,12 @@
|
||||
{{ partial "footer.html" . }}
|
||||
</main>
|
||||
|
||||
{{ if not .Site.Params.hideColorSchemeToggle }}
|
||||
{{ if .Site.IsServer }}
|
||||
{{ $script := resources.Get "js/dark-mode.js" }}
|
||||
<script src="{{ $script.RelPermalink }}"></script>
|
||||
{{ else }}
|
||||
{{ $script := resources.Get "js/dark-mode.js" | minify | fingerprint }}
|
||||
<script src="{{ $script.RelPermalink }}" integrity="{{ $script.Data.Integrity }}"></script>
|
||||
{{ end }}
|
||||
{{ if .Site.IsServer }}
|
||||
{{ $script := resources.Get "js/coder.js" }}
|
||||
<script src="{{ $script.RelPermalink }}"></script>
|
||||
{{ else }}
|
||||
{{ $script := resources.Get "js/coder.js" | minify | fingerprint }}
|
||||
<script src="{{ $script.RelPermalink }}" integrity="{{ $script.Data.Integrity }}"></script>
|
||||
{{ end }}
|
||||
|
||||
{{ range .Site.Params.customJS }}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
{{ $node.Scratch.Set "separator" false }}
|
||||
{{ end }}
|
||||
<li class="navigation-item">
|
||||
<a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a>
|
||||
<a href="{{ .Permalink }}">{{ .Language.LanguageName | emojify }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
12
layouts/shortcodes/notice.html
Normal file
12
layouts/shortcodes/notice.html
Normal file
@@ -0,0 +1,12 @@
|
||||
{{- $type := .Get 0 -}}
|
||||
{{- $title := .Get 1 | default $type -}}
|
||||
{{- $inner := .Inner | .Page.RenderString | chomp -}}
|
||||
{{- $icon := dict "note" "fa-sticky-note" "tip" "fa-lightbulb-o" "example" "fa-file-text" "question" "fa-question" "info" "fa-exclamation-circle" "warning" "fa-exclamation-triangle" "error" "fa-times-circle" -}}
|
||||
<div class="notice {{ $type }}">
|
||||
<div class="notice-title">
|
||||
<i class="fa {{ index $icon $type }}" aria-hidden="true"></i>{{ i18n $title | default $title | humanize }}
|
||||
</div>
|
||||
<div class="notice-content">
|
||||
{{- $inner -}}
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user