Docs: update theme (#368)
Signed-off-by: Carson Yang <yangchuansheng33@gmail.com>
This commit is contained in:
parent
bf172fab81
commit
7f1fecb84e
4
.gitignore
vendored
4
.gitignore
vendored
@ -33,4 +33,6 @@ dist/
|
|||||||
|
|
||||||
# hugo
|
# hugo
|
||||||
**/.hugo_build.lock
|
**/.hugo_build.lock
|
||||||
docSite/public/
|
docSite/public/
|
||||||
|
docSite/resources/_gen/
|
||||||
|
docSite/.vercel
|
||||||
@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"baseUrl": ".",
|
|
||||||
"paths": {
|
|
||||||
"*": [
|
|
||||||
"../../../../.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/gohugoio/hugo-mod-jslibs-dist/popperjs/v2@v2.21100.20000/package/dist/cjs/popper.js/*",
|
|
||||||
"../../../../.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/twbs/bootstrap@v5.3.0+incompatible/js/*"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -3,6 +3,6 @@ module fastgpt-docs
|
|||||||
go 1.21
|
go 1.21
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/colinwilson/lotusdocs v0.0.0-20230919015602-a9717caaab14 // indirect
|
github.com/colinwilson/lotusdocs v0.1.0 // indirect
|
||||||
github.com/gohugoio/hugo-mod-bootstrap-scss/v5 v5.20300.20003 // indirect
|
github.com/gohugoio/hugo-mod-bootstrap-scss/v5 v5.20300.20003 // indirect
|
||||||
)
|
)
|
||||||
|
|||||||
@ -6,6 +6,8 @@ github.com/colinwilson/lotusdocs v0.0.0-20230821033552-c5bcbdd9df80 h1:jKZF8sqr/
|
|||||||
github.com/colinwilson/lotusdocs v0.0.0-20230821033552-c5bcbdd9df80/go.mod h1:9zu2REJDi+zdPRcR5/bRYSUR7gkNF4NQLvV38SEoCP8=
|
github.com/colinwilson/lotusdocs v0.0.0-20230821033552-c5bcbdd9df80/go.mod h1:9zu2REJDi+zdPRcR5/bRYSUR7gkNF4NQLvV38SEoCP8=
|
||||||
github.com/colinwilson/lotusdocs v0.0.0-20230919015602-a9717caaab14 h1:ORzVQia2njOTCs/5cTQZW0Y+YRZlupgwtGx3umABTcc=
|
github.com/colinwilson/lotusdocs v0.0.0-20230919015602-a9717caaab14 h1:ORzVQia2njOTCs/5cTQZW0Y+YRZlupgwtGx3umABTcc=
|
||||||
github.com/colinwilson/lotusdocs v0.0.0-20230919015602-a9717caaab14/go.mod h1:9zu2REJDi+zdPRcR5/bRYSUR7gkNF4NQLvV38SEoCP8=
|
github.com/colinwilson/lotusdocs v0.0.0-20230919015602-a9717caaab14/go.mod h1:9zu2REJDi+zdPRcR5/bRYSUR7gkNF4NQLvV38SEoCP8=
|
||||||
|
github.com/colinwilson/lotusdocs v0.1.0 h1:oTC8pAYQp9XDNaUwE4SEY+id3ByNELxIIFrktYEGxYA=
|
||||||
|
github.com/colinwilson/lotusdocs v0.1.0/go.mod h1:9zu2REJDi+zdPRcR5/bRYSUR7gkNF4NQLvV38SEoCP8=
|
||||||
github.com/gohugoio/hugo-mod-bootstrap-scss/v5 v5.20300.20003 h1:pt/JGVD5YYRsVVijOHPZI6YKTUvbR4e0hgV9B0S6rbI=
|
github.com/gohugoio/hugo-mod-bootstrap-scss/v5 v5.20300.20003 h1:pt/JGVD5YYRsVVijOHPZI6YKTUvbR4e0hgV9B0S6rbI=
|
||||||
github.com/gohugoio/hugo-mod-bootstrap-scss/v5 v5.20300.20003/go.mod h1:mvM05r93HiefwoaxQTaYiJxtJAhTebwQtU1Xh/J+Okk=
|
github.com/gohugoio/hugo-mod-bootstrap-scss/v5 v5.20300.20003/go.mod h1:mvM05r93HiefwoaxQTaYiJxtJAhTebwQtU1Xh/J+Okk=
|
||||||
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=
|
||||||
|
|||||||
@ -18,6 +18,9 @@ defaultContentLanguage = 'zh-cn'
|
|||||||
weight = 10
|
weight = 10
|
||||||
disabled = true
|
disabled = true
|
||||||
|
|
||||||
|
[build]
|
||||||
|
noJSConfigInAssets = true
|
||||||
|
|
||||||
[module]
|
[module]
|
||||||
[module.hugoVersion]
|
[module.hugoVersion]
|
||||||
extended = true
|
extended = true
|
||||||
|
|||||||
@ -11,8 +11,12 @@
|
|||||||
{{ end -}}
|
{{ end -}}
|
||||||
|
|
||||||
{{ if .Page.Store.Get "hasMermaid" }}
|
{{ if .Page.Store.Get "hasMermaid" }}
|
||||||
<script type="module">
|
{{ $mermaid := resources.Get (printf "%s/%s" ($.Scratch.Get "pathName") "js/mermaid.js") }}
|
||||||
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.esm.min.mjs';
|
{{ if hugo.IsProduction }}
|
||||||
|
{{ $mermaid = $mermaid | minify | fingerprint "sha384" }}
|
||||||
|
{{ end }}
|
||||||
|
<script src="{{ $mermaid.RelPermalink }}" {{ if hugo.IsProduction }}integrity="{{ $mermaid.Data.Integrity }}"{{ end }}></script>
|
||||||
|
<script>
|
||||||
const config = {
|
const config = {
|
||||||
startOnLoad:true,
|
startOnLoad:true,
|
||||||
logLevel: "error",
|
logLevel: "error",
|
||||||
|
|||||||
@ -30,6 +30,8 @@
|
|||||||
<meta name="Version" content="v0.1.0" />
|
<meta name="Version" content="v0.1.0" />
|
||||||
<!-- favicon -->
|
<!-- favicon -->
|
||||||
{{ block "favicon" . }}{{ partialCached (printf "%s/%s" ($.Scratch.Get "pathName") "head/favicon.html") . }}{{ end }}
|
{{ block "favicon" . }}{{ partialCached (printf "%s/%s" ($.Scratch.Get "pathName") "head/favicon.html") . }}{{ end }}
|
||||||
|
{{- partial (printf "%s/%s" ($.Scratch.Get "pathName") "head/opengraph") . }}
|
||||||
|
{{- partial (printf "%s/%s" ($.Scratch.Get "pathName") "head/twitter_cards") . }}
|
||||||
<!-- Dark Mode -->
|
<!-- Dark Mode -->
|
||||||
{{ if eq .Site.Params.docs.darkMode true -}}
|
{{ if eq .Site.Params.docs.darkMode true -}}
|
||||||
{{ $darkModeInit := resources.Get (printf "/%s/%s" ($.Scratch.Get "pathName") "js/darkmode-init.js") | js.Build | minify -}}
|
{{ $darkModeInit := resources.Get (printf "/%s/%s" ($.Scratch.Get "pathName") "js/darkmode-init.js") | js.Build | minify -}}
|
||||||
|
|||||||
@ -42,7 +42,45 @@
|
|||||||
<ul>
|
<ul>
|
||||||
{{ range .Pages }}
|
{{ range .Pages }}
|
||||||
{{ $active := in $currentPage.RelPermalink .RelPermalink }}
|
{{ $active := in $currentPage.RelPermalink .RelPermalink }}
|
||||||
<li class="{{ if $active }}current{{ end }} {{ if eq .Site.Params.docs.sidebarIcons true -}}{{ else }}no-icon{{ end }}"><a class="sidebar-nested-link" href="{{ .Permalink }}">{{ .Title }}</a></li>
|
{{ if .IsSection }}
|
||||||
|
<li class="sidebar-dropdown nested {{ if eq .Site.Params.docs.sidebarIcons true -}}{{ else }}no-icon{{ end }} {{ if $active }}current active{{ end }}">
|
||||||
|
<button class="btn">
|
||||||
|
{{ if eq .Site.Params.docs.sidebarIcons true -}}
|
||||||
|
<!-- <span class="material-icons me-2">{{- .Params.icon }}</span> -->
|
||||||
|
{{ end }}
|
||||||
|
{{- .Title }}
|
||||||
|
</button>
|
||||||
|
<div class="sidebar-submenu {{ if $active }}d-block{{ end }}">
|
||||||
|
<ul>
|
||||||
|
{{ range .Pages }}
|
||||||
|
{{ $active := in $currentPage.RelPermalink .RelPermalink }}
|
||||||
|
{{ if .IsSection }}
|
||||||
|
<li class="sidebar-dropdown nested {{ if eq .Site.Params.docs.sidebarIcons true -}}{{ else }}no-icon{{ end }} {{ if $active }}current active{{ end }}">
|
||||||
|
<button class="btn">
|
||||||
|
{{ if eq .Site.Params.docs.sidebarIcons true -}}
|
||||||
|
<!-- <span class="material-icons me-2">{{- .Params.icon }}</span> -->
|
||||||
|
{{ end }}
|
||||||
|
{{- .Title }}
|
||||||
|
</button>
|
||||||
|
<div class="sidebar-submenu {{ if $active }}d-block{{ end }}">
|
||||||
|
<ul>
|
||||||
|
{{ range .Pages }}
|
||||||
|
{{ $active := in $currentPage.RelPermalink .RelPermalink }}
|
||||||
|
<li class="{{ if $active }}current{{ end }} {{ if eq .Site.Params.docs.sidebarIcons true -}}{{ else }}no-icon{{ end }}"><a class="sidebar-nested-link" href="{{ .Permalink }}">{{ .Title }}</a></li>
|
||||||
|
{{ end }}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
{{ else }}
|
||||||
|
<li class="{{ if $active }}current{{ end }} {{ if eq .Site.Params.docs.sidebarIcons true -}}{{ else }}no-icon{{ end }}"><a class="sidebar-nested-link" href="{{ .Permalink }}">{{ .Title }}</a></li>
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
{{ else }}
|
||||||
|
<li class="{{ if $active }}current{{ end }} {{ if eq .Site.Params.docs.sidebarIcons true -}}{{ else }}no-icon{{ end }}"><a class="sidebar-nested-link" href="{{ .Permalink }}">{{ .Title }}</a></li>
|
||||||
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user