Hugo内容
This commit is contained in:
@@ -0,0 +1 @@
|
||||
<a href="{{ "" | relURL }}">{{ $.Site.Params.theme_config.back_home_text }}</a>
|
||||
11
Hugo/themes/nostyleplease/layouts/partials/footer.html
Normal file
11
Hugo/themes/nostyleplease/layouts/partials/footer.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{{ if site.Params.theme_config.isShowFooter }}
|
||||
{{ $footerContent := readFile "layouts/footer.md" }}
|
||||
{{ if and $footerContent (ne $footerContent "") }}
|
||||
{{ $footerContent | markdownify }}
|
||||
{{ else }}
|
||||
{{ warnf "layouts/footer.md file is not found or empty. Falling back to default footer." }}
|
||||
<footer class="site-footer">
|
||||
<p>© {{ now.Format "2006" }} {{ site.Title }}</p>
|
||||
</footer>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
22
Hugo/themes/nostyleplease/layouts/partials/head.html
Normal file
22
Hugo/themes/nostyleplease/layouts/partials/head.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
{{ if .IsPage }} <meta name="description" content="{{ .Summary }}"> {{ end }}
|
||||
|
||||
<title>
|
||||
{{ if not .IsHome }}
|
||||
{{ .Title }}
|
||||
{{ else }}
|
||||
{{ $.Site.Title }}
|
||||
{{ end }}
|
||||
</title>
|
||||
|
||||
|
||||
<link rel="shortcut icon" type="image/x-icon" href="{{ $.Site.Params.favicon | relURL }}" />
|
||||
{{ $options := (dict "outputStyle" "compressed" "enableSourceMap" (not hugo.IsProduction)) }}
|
||||
{{ $sass := resources.Get "css/main.scss" }}
|
||||
{{ $style := $sass | css.Sass $options | resources.Fingerprint "sha512" }}
|
||||
<link rel="stylesheet" href="{{ $style.Permalink | relURL }}" integrity="{{ $style.Data.Integrity }}" />
|
||||
{{ if .Params.mathjax }} {{ partial "mathjax.html" . }} {{ end }}
|
||||
</head>
|
||||
21
Hugo/themes/nostyleplease/layouts/partials/mathjax.html
Normal file
21
Hugo/themes/nostyleplease/layouts/partials/mathjax.html
Normal file
@@ -0,0 +1,21 @@
|
||||
<script>
|
||||
MathJax = {
|
||||
tex: {
|
||||
inlineMath: [['$', '$'], ['\\(', '\\)']],
|
||||
displayMath: [['$$','$$'], ['\\[', '\\]']],
|
||||
processEscapes: true,
|
||||
processEnvironments: true
|
||||
},
|
||||
options: {
|
||||
skipHtmlTags: ['script', 'noscript', 'style', 'textarea', 'pre']
|
||||
}
|
||||
};
|
||||
|
||||
window.addEventListener('load', (event) => {
|
||||
document.querySelectorAll("mjx-container").forEach(function(x){
|
||||
x.parentElement.classList += 'has-jax'})
|
||||
});
|
||||
|
||||
</script>
|
||||
<script src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=es6"></script>
|
||||
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
|
||||
19
Hugo/themes/nostyleplease/layouts/partials/menu_item.html
Normal file
19
Hugo/themes/nostyleplease/layouts/partials/menu_item.html
Normal file
@@ -0,0 +1,19 @@
|
||||
<ul>
|
||||
{{- range $item := .collection -}}
|
||||
<li>
|
||||
{{- with $item.url -}}
|
||||
<a href="{{ $item.url | relURL }}">{{ safeHTML $item.title }}</a>
|
||||
{{- else -}}
|
||||
{{ safeHTML $item.title }}
|
||||
{{- end -}}
|
||||
</li>
|
||||
|
||||
{{- if $item.entries }}
|
||||
{{ partial "menu_item.html" (dict "context" . "collection" $item.entries) }}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $item.post_list -}}
|
||||
{{ partial "post_list.html" (dict "context" . "section" $item.post_list.section "limit" $item.post_list.limit "show_more" $item.post_list.show_more "show_more_text" $item.post_list.show_more_text "show_more_url" $item.post_list.show_more_url) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</ul>
|
||||
39
Hugo/themes/nostyleplease/layouts/partials/post_list.html
Normal file
39
Hugo/themes/nostyleplease/layouts/partials/post_list.html
Normal file
@@ -0,0 +1,39 @@
|
||||
{{- $posts := "" -}}
|
||||
|
||||
{{- if .section -}}
|
||||
{{- $posts = (where site.RegularPages "Section" .section) -}}
|
||||
{{- else -}}
|
||||
{{- if (eq .context.Kind "taxonomy") -}}
|
||||
{{- $posts = .context.Pages -}}
|
||||
{{- else -}}
|
||||
{{- if (eq .context.Kind "term") -}}
|
||||
{{- $posts = .context.Data.Pages -}}
|
||||
{{- else -}}
|
||||
{{- $posts = site.RegularPages }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $limit_exceeded:= "" -}}
|
||||
{{- if (and .limit (gt (len $posts) .limit)) -}}
|
||||
{{- $limit_exceeded = true -}}
|
||||
{{- else -}}
|
||||
{{- $limit_exceeded = false -}}
|
||||
{{ end }}
|
||||
|
||||
{{- if (gt (len $posts) 0) }}
|
||||
{{- if .limit }}
|
||||
{{ $posts = (first .limit $posts ) }}
|
||||
{{ end }}
|
||||
<ul>
|
||||
{{- range $post := $posts -}}
|
||||
<li>
|
||||
<span>{{- ($post.Date | time.Format site.Params.theme_config.date_format) }}</span>
|
||||
<a href="{{ $post.Permalink | relURL }}">{{ $post.Title }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{- if and .show_more $limit_exceeded }}
|
||||
<li><a href="{{ .show_more_url | relURL }}">{{ .show_more_text | default "Show more..." }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user