Compare commits
10 Commits
125b381c04
...
a54226801c
Author | SHA1 | Date | |
---|---|---|---|
a54226801c | |||
5392098d00 | |||
508f8ed841 | |||
83d24c4127 | |||
f06f188d38 | |||
7973ebbf9d | |||
5e13298a65 | |||
c58e328fe7 | |||
37bb9cb449 | |||
58c79a5381 |
@ -1,5 +1,4 @@
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
MathJax = {
|
||||
window.MathJax = {
|
||||
tex: {
|
||||
inlineMath: [
|
||||
['$', '$'],
|
||||
@ -11,5 +10,4 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
],
|
||||
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 (
|
||||
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/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/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-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/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.5+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
|
||||
github.com/twbs/bootstrap v5.3.6+incompatible h1:efmXVyq839m5QQ0+JBUdQQ1TrmoBqvQ5kRhUueKsH+4=
|
||||
github.com/twbs/bootstrap v5.3.6+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
|
||||
|
@ -8,7 +8,7 @@ defaultContentLanguageInSubdir = false
|
||||
pagerSize = 5
|
||||
|
||||
[params]
|
||||
theme_version = "1.0.0"
|
||||
theme_version = "1.0.2"
|
||||
|
||||
[outputs]
|
||||
home = ["HTML", "RSS", "JSON"]
|
||||
|
@ -1,5 +1,5 @@
|
||||
{{ 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_normal := where $all_posts "Params.pin" "!=" true }}
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="v%s"
|
||||
href="https://github.com/cotes2020/jekyll-theme-chirpy"
|
||||
href="https://github.com/geekifan/hugo-theme-chirpy"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
>Chirpy</a>` .Site.Params.theme_version -}}
|
||||
|
@ -89,9 +89,9 @@
|
||||
{{ if .Params.math }}
|
||||
<!-- MathJax -->
|
||||
{{ $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 id="MathJax-script" async src="{{ $data.mathjax.js }}"></script>
|
||||
<script id="MathJax-script" src="{{ $data.mathjax.js }}" defer></script>
|
||||
{{ end }}
|
||||
|
||||
<!-- Pageviews -->
|
||||
|
@ -1,4 +1,5 @@
|
||||
<div class="lang-dropdown">
|
||||
{{ if hugo.IsMultilingual }}
|
||||
<div class="lang-dropdown">
|
||||
<select class="lang-select" onchange="location = this.value;">
|
||||
{{ $currentLang := .Site.Language.Lang }}
|
||||
{{ $siteBase := strings.TrimSuffix "/" .Site.BaseURL }}
|
||||
@ -8,4 +9,5 @@
|
||||
</option>
|
||||
{{ end }}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
@ -34,12 +34,15 @@
|
||||
</li>
|
||||
<!-- .nav-item -->
|
||||
{{ end }}
|
||||
|
||||
{{ if hugo.IsMultilingual }}
|
||||
<li class="nav-item mt-4">
|
||||
<a class="nav-link no-hover">
|
||||
<i class="fa-fw fas fa-language"></i>
|
||||
{{ partial "language-selector.html" . }}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
@ -66,6 +69,8 @@
|
||||
{{ $url = printf "mailto:%s" .id }}
|
||||
{{ else if eq .type "rss" }}
|
||||
{{ $url = "index.xml" | absLangURL }}
|
||||
{{ else if eq .type "custom" }}
|
||||
{{ $url = printf "%s" .id }}
|
||||
{{ else }}
|
||||
{{ $url = .url }}
|
||||
{{ 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,10 +9,12 @@
|
||||
<!-- get all parent categories -->
|
||||
{{ $parentCategories := slice }}
|
||||
{{ range $allPages }}
|
||||
{{ if isset .Params "categories" }}
|
||||
{{ if gt (len .Params.categories) 0 }}
|
||||
{{ $parentCategories = $parentCategories | append (index .Params.categories 0) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ $parentCategories = $parentCategories | uniq | sort }}
|
||||
|
||||
<!-- create card for each parent category -->
|
||||
@ -23,6 +25,7 @@
|
||||
|
||||
<!-- get all pages and subcategories related to the parent category -->
|
||||
{{ range $allPages }}
|
||||
{{ if isset .Params "categories" }}
|
||||
{{ if gt (len .Params.categories) 0 }}
|
||||
{{ if eq (index .Params.categories 0) $parentName }}
|
||||
{{ $parentPages = $parentPages | append . }}
|
||||
@ -32,6 +35,7 @@
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ $subcategories = $subcategories | uniq | sort }}
|
||||
|
||||
<div class="card categories mb-3">
|
||||
|
Reference in New Issue
Block a user