Compare commits
10 Commits
125b381c04
...
a54226801c
Author | SHA1 | Date | |
---|---|---|---|
a54226801c | |||
5392098d00 | |||
508f8ed841 | |||
83d24c4127 | |||
f06f188d38 | |||
7973ebbf9d | |||
5e13298a65 | |||
c58e328fe7 | |||
37bb9cb449 | |||
58c79a5381 |
@ -1,15 +1,13 @@
|
|||||||
document.addEventListener('DOMContentLoaded', () => {
|
window.MathJax = {
|
||||||
MathJax = {
|
tex: {
|
||||||
tex: {
|
inlineMath: [
|
||||||
inlineMath: [
|
['$', '$'],
|
||||||
['$', '$'],
|
['\\(', '\\)']
|
||||||
['\\(', '\\)']
|
],
|
||||||
],
|
displayMath: [
|
||||||
displayMath: [
|
['$$', '$$'],
|
||||||
['$$', '$$'],
|
['\\[', '\\]']
|
||||||
['\\[', '\\]']
|
],
|
||||||
],
|
tags: 'ams'
|
||||||
tags: 'ams'
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
});
|
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
title: Test 2
|
||||||
|
date: 2025-04-11 00:34:00 +0800
|
||||||
|
description: >-
|
||||||
|
Test 2
|
||||||
|
---
|
6
exampleSite/content/post/tutorials/python/python-test.md
Normal file
6
exampleSite/content/post/tutorials/python/python-test.md
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
title: Test 3
|
||||||
|
date: 2025-04-11 00:34:00 +0800
|
||||||
|
description: >-
|
||||||
|
Test 3
|
||||||
|
---
|
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
title: Test 4
|
||||||
|
date: 2025-04-11 00:34:00 +0800
|
||||||
|
description: >-
|
||||||
|
Test 4
|
||||||
|
---
|
8
exampleSite/content/post/tutorials/test1.en.md
Normal file
8
exampleSite/content/post/tutorials/test1.en.md
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
title: Test 1
|
||||||
|
date: 2025-04-11 00:34:00 +0800
|
||||||
|
description: >-
|
||||||
|
Test 1
|
||||||
|
---
|
||||||
|
|
||||||
|
123
|
3
go.mod
3
go.mod
@ -5,5 +5,6 @@ go 1.24.2
|
|||||||
require (
|
require (
|
||||||
github.com/geekifan/chirpy-static-assets v0.0.0-20250507021825-887e490b15f2 // indirect
|
github.com/geekifan/chirpy-static-assets v0.0.0-20250507021825-887e490b15f2 // indirect
|
||||||
github.com/gohugoio/hugo-mod-bootstrap-scss/v5 v5.20300.20400 // indirect
|
github.com/gohugoio/hugo-mod-bootstrap-scss/v5 v5.20300.20400 // indirect
|
||||||
github.com/twbs/bootstrap v5.3.5+incompatible // indirect
|
github.com/gohugoio/hugo-mod-jslibs-dist/popperjs/v2 v2.21100.20000 // indirect
|
||||||
|
github.com/twbs/bootstrap v5.3.6+incompatible // indirect
|
||||||
)
|
)
|
||||||
|
5
go.sum
5
go.sum
@ -2,7 +2,8 @@ github.com/geekifan/chirpy-static-assets v0.0.0-20250507021825-887e490b15f2 h1:r
|
|||||||
github.com/geekifan/chirpy-static-assets v0.0.0-20250507021825-887e490b15f2/go.mod h1:F58Ey9QK/tEgIxwcQSqAgV4ZA24mCb714B58D4Syv/0=
|
github.com/geekifan/chirpy-static-assets v0.0.0-20250507021825-887e490b15f2/go.mod h1:F58Ey9QK/tEgIxwcQSqAgV4ZA24mCb714B58D4Syv/0=
|
||||||
github.com/gohugoio/hugo-mod-bootstrap-scss/v5 v5.20300.20400 h1:L6+F22i76xmeWWwrtijAhUbf3BiRLmpO5j34bgl1ggU=
|
github.com/gohugoio/hugo-mod-bootstrap-scss/v5 v5.20300.20400 h1:L6+F22i76xmeWWwrtijAhUbf3BiRLmpO5j34bgl1ggU=
|
||||||
github.com/gohugoio/hugo-mod-bootstrap-scss/v5 v5.20300.20400/go.mod h1:uekq1D4ebeXgduLj8VIZy8TgfTjrLdSl6nPtVczso78=
|
github.com/gohugoio/hugo-mod-bootstrap-scss/v5 v5.20300.20400/go.mod h1:uekq1D4ebeXgduLj8VIZy8TgfTjrLdSl6nPtVczso78=
|
||||||
|
github.com/gohugoio/hugo-mod-jslibs-dist/popperjs/v2 v2.21100.20000 h1:GZxx4Hc+yb0/t3/rau1j8XlAxLE4CyXns2fqQbyqWfs=
|
||||||
github.com/gohugoio/hugo-mod-jslibs-dist/popperjs/v2 v2.21100.20000/go.mod h1:mFberT6ZtcchrsDtfvJM7aAH2bDKLdOnruUHl0hlapI=
|
github.com/gohugoio/hugo-mod-jslibs-dist/popperjs/v2 v2.21100.20000/go.mod h1:mFberT6ZtcchrsDtfvJM7aAH2bDKLdOnruUHl0hlapI=
|
||||||
github.com/twbs/bootstrap v5.3.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
|
github.com/twbs/bootstrap v5.3.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
|
||||||
github.com/twbs/bootstrap v5.3.5+incompatible h1:6XrrFNMsiTTFcVTBf2886FO2XUNtwSE+QPv1os0uAA4=
|
github.com/twbs/bootstrap v5.3.6+incompatible h1:efmXVyq839m5QQ0+JBUdQQ1TrmoBqvQ5kRhUueKsH+4=
|
||||||
github.com/twbs/bootstrap v5.3.5+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
|
github.com/twbs/bootstrap v5.3.6+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
|
||||||
|
@ -8,7 +8,7 @@ defaultContentLanguageInSubdir = false
|
|||||||
pagerSize = 5
|
pagerSize = 5
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
theme_version = "1.0.0"
|
theme_version = "1.0.2"
|
||||||
|
|
||||||
[outputs]
|
[outputs]
|
||||||
home = ["HTML", "RSS", "JSON"]
|
home = ["HTML", "RSS", "JSON"]
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
{{ $all_posts := where .Site.RegularPages "Section" "post" }}
|
{{ $all_posts := where .Site.RegularPages "Type" "post" }}
|
||||||
{{ $all_pinned := where $all_posts "Params.pin" true }}
|
{{ $all_pinned := where $all_posts "Params.pin" true }}
|
||||||
{{ $all_normal := where $all_posts "Params.pin" "!=" true }}
|
{{ $all_normal := where $all_posts "Params.pin" "!=" true }}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
data-bs-toggle="tooltip"
|
data-bs-toggle="tooltip"
|
||||||
data-bs-placement="top"
|
data-bs-placement="top"
|
||||||
title="v%s"
|
title="v%s"
|
||||||
href="https://github.com/cotes2020/jekyll-theme-chirpy"
|
href="https://github.com/geekifan/hugo-theme-chirpy"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener"
|
rel="noopener"
|
||||||
>Chirpy</a>` .Site.Params.theme_version -}}
|
>Chirpy</a>` .Site.Params.theme_version -}}
|
||||||
|
@ -89,9 +89,9 @@
|
|||||||
{{ if .Params.math }}
|
{{ if .Params.math }}
|
||||||
<!-- MathJax -->
|
<!-- MathJax -->
|
||||||
{{ $mathjaxConfig := resources.Get "js/mathjax.js" | minify | fingerprint }}
|
{{ $mathjaxConfig := resources.Get "js/mathjax.js" | minify | fingerprint }}
|
||||||
<script src="{{ $mathjaxConfig.RelPermalink }}"></script>
|
<script src="{{ $mathjaxConfig.RelPermalink }}" defer></script>
|
||||||
<script async src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=es6"></script>
|
<script async src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=es6"></script>
|
||||||
<script id="MathJax-script" async src="{{ $data.mathjax.js }}"></script>
|
<script id="MathJax-script" src="{{ $data.mathjax.js }}" defer></script>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
<!-- Pageviews -->
|
<!-- Pageviews -->
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
<div class="lang-dropdown">
|
{{ if hugo.IsMultilingual }}
|
||||||
<select class="lang-select" onchange="location = this.value;">
|
<div class="lang-dropdown">
|
||||||
{{ $currentLang := .Site.Language.Lang }}
|
<select class="lang-select" onchange="location = this.value;">
|
||||||
{{ $siteBase := strings.TrimSuffix "/" .Site.BaseURL }}
|
{{ $currentLang := .Site.Language.Lang }}
|
||||||
{{ range .Site.Languages }}
|
{{ $siteBase := strings.TrimSuffix "/" .Site.BaseURL }}
|
||||||
<option value="{{ $siteBase }}/{{ .Lang }}/" {{ if eq .Lang $currentLang }}selected{{ end }}>
|
{{ range .Site.Languages }}
|
||||||
{{ .LanguageName }}
|
<option value="{{ $siteBase }}/{{ .Lang }}/" {{ if eq .Lang $currentLang }}selected{{ end }}>
|
||||||
</option>
|
{{ .LanguageName }}
|
||||||
{{ end }}
|
</option>
|
||||||
</select>
|
{{ end }}
|
||||||
</div>
|
</select>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
@ -34,12 +34,15 @@
|
|||||||
</li>
|
</li>
|
||||||
<!-- .nav-item -->
|
<!-- .nav-item -->
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<li class="nav-item mt-4">
|
|
||||||
<a class="nav-link no-hover">
|
{{ if hugo.IsMultilingual }}
|
||||||
<i class="fa-fw fas fa-language"></i>
|
<li class="nav-item mt-4">
|
||||||
{{ partial "language-selector.html" . }}
|
<a class="nav-link no-hover">
|
||||||
</a>
|
<i class="fa-fw fas fa-language"></i>
|
||||||
</li>
|
{{ partial "language-selector.html" . }}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
@ -57,7 +60,7 @@
|
|||||||
{{ range .Site.Params.social.links }}
|
{{ range .Site.Params.social.links }}
|
||||||
{{ $url := "" }}
|
{{ $url := "" }}
|
||||||
{{ $rel := "" }}
|
{{ $rel := "" }}
|
||||||
|
|
||||||
{{ if eq .type "github" }}
|
{{ if eq .type "github" }}
|
||||||
{{ $url = printf "https://github.com/%s" .id }}
|
{{ $url = printf "https://github.com/%s" .id }}
|
||||||
{{ else if eq .type "twitter" }}
|
{{ else if eq .type "twitter" }}
|
||||||
@ -66,6 +69,8 @@
|
|||||||
{{ $url = printf "mailto:%s" .id }}
|
{{ $url = printf "mailto:%s" .id }}
|
||||||
{{ else if eq .type "rss" }}
|
{{ else if eq .type "rss" }}
|
||||||
{{ $url = "index.xml" | absLangURL }}
|
{{ $url = "index.xml" | absLangURL }}
|
||||||
|
{{ else if eq .type "custom" }}
|
||||||
|
{{ $url = printf "%s" .id }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ $url = .url }}
|
{{ $url = .url }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
50
layouts/section/list.html
Normal file
50
layouts/section/list.html
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
{{ define "main" }}
|
||||||
|
<main class="section-page">
|
||||||
|
<header class="section-header">
|
||||||
|
<h1>{{ .Title }}</h1>
|
||||||
|
{{ with .Description }}
|
||||||
|
<p class="section-description">{{ . }}</p>
|
||||||
|
{{ end }}
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div class="section-content">
|
||||||
|
{{ .Content }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{ if .Pages }}
|
||||||
|
<div class="section-pages">
|
||||||
|
<h2>Subsections & Pages</h2>
|
||||||
|
<ul class="page-list">
|
||||||
|
{{ range .Pages }}
|
||||||
|
<li>
|
||||||
|
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
|
||||||
|
{{ if .IsSection }}
|
||||||
|
<span class="badge">Section</span>
|
||||||
|
{{ end }}
|
||||||
|
{{ with .Description }}
|
||||||
|
<p class="page-description">{{ . }}</p>
|
||||||
|
{{ end }}
|
||||||
|
</li>
|
||||||
|
{{ end }}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if .Sections }}
|
||||||
|
<div class="section-subsections">
|
||||||
|
<h2>Subsections</h2>
|
||||||
|
<div class="subsection-grid">
|
||||||
|
{{ range .Sections }}
|
||||||
|
<div class="subsection-card">
|
||||||
|
<h3><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3>
|
||||||
|
{{ with .Description }}
|
||||||
|
<p>{{ . }}</p>
|
||||||
|
{{ end }}
|
||||||
|
<a href="{{ .RelPermalink }}" class="btn">View Section</a>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
</main>
|
||||||
|
{{ end }}
|
@ -9,8 +9,10 @@
|
|||||||
<!-- get all parent categories -->
|
<!-- get all parent categories -->
|
||||||
{{ $parentCategories := slice }}
|
{{ $parentCategories := slice }}
|
||||||
{{ range $allPages }}
|
{{ range $allPages }}
|
||||||
{{ if gt (len .Params.categories) 0 }}
|
{{ if isset .Params "categories" }}
|
||||||
{{ $parentCategories = $parentCategories | append (index .Params.categories 0) }}
|
{{ if gt (len .Params.categories) 0 }}
|
||||||
|
{{ $parentCategories = $parentCategories | append (index .Params.categories 0) }}
|
||||||
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ $parentCategories = $parentCategories | uniq | sort }}
|
{{ $parentCategories = $parentCategories | uniq | sort }}
|
||||||
@ -23,11 +25,13 @@
|
|||||||
|
|
||||||
<!-- get all pages and subcategories related to the parent category -->
|
<!-- get all pages and subcategories related to the parent category -->
|
||||||
{{ range $allPages }}
|
{{ range $allPages }}
|
||||||
{{ if gt (len .Params.categories) 0 }}
|
{{ if isset .Params "categories" }}
|
||||||
{{ if eq (index .Params.categories 0) $parentName }}
|
{{ if gt (len .Params.categories) 0 }}
|
||||||
{{ $parentPages = $parentPages | append . }}
|
{{ if eq (index .Params.categories 0) $parentName }}
|
||||||
{{ if gt (len .Params.categories) 1 }}
|
{{ $parentPages = $parentPages | append . }}
|
||||||
{{ $subcategories = $subcategories | append (index .Params.categories 1) }}
|
{{ if gt (len .Params.categories) 1 }}
|
||||||
|
{{ $subcategories = $subcategories | append (index .Params.categories 1) }}
|
||||||
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
Reference in New Issue
Block a user