forked from open-y-subprojects/openy_docs
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from YCloudYUSA/sept-updates
feat: Docsy 0.7, Bootstrap 5, and Netlify
- Loading branch information
Showing
13 changed files
with
253 additions
and
27 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
github.com/FortAwesome/Font-Awesome v0.0.0-20210804190922-7d3d774145ac/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo= | ||
github.com/FortAwesome/Font-Awesome v0.0.0-20220831210243-d3a7818c253f/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo= | ||
github.com/FortAwesome/Font-Awesome v0.0.0-20230327165841-0698449d50f2/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo= | ||
github.com/google/docsy v0.2.0 h1:DN6wfyyp2rXsjdV1K3wioxOBTRvG6Gg48wLPDso2lc4= | ||
github.com/google/docsy v0.2.0/go.mod h1:shlabwAQakGX6qpXU6Iv/b/SilpHRd7d+xqtZQd3v+8= | ||
github.com/google/docsy v0.5.1 h1:D/ZdFKiE29xM/gwPwQzmkyXhcbQGkReRS6aGrF7lnYk= | ||
github.com/google/docsy v0.5.1/go.mod h1:maoUAQU5H/d+FrZIB4xg1EVWAx7RyFMGSDJyWghm31E= | ||
github.com/google/docsy v0.6.0 h1:43bVF18t2JihAamelQjjGzx1vO2ljCilVrBgetCA8oI= | ||
github.com/google/docsy v0.6.0/go.mod h1:VKKLqD8PQ7AglJc98yBorATfW7GrNVsn0kGXVYF6G+M= | ||
github.com/google/docsy v0.7.1 h1:DUriA7Nr3lJjNi9Ulev1SfiG1sUYmvyDeU4nTp7uDxY= | ||
github.com/google/docsy v0.7.1/go.mod h1:JCmE+c+izhE0Rvzv3y+AzHhz1KdwlA9Oj5YBMklJcfc= | ||
github.com/google/docsy v0.7.2-0.20230818151232-5295589fd575 h1:OILvXMvvQVbngTwUfGo4kbF0NNmYCmRmyuL5owISXb8= | ||
github.com/google/docsy v0.7.2-0.20230818151232-5295589fd575/go.mod h1:JCmE+c+izhE0Rvzv3y+AzHhz1KdwlA9Oj5YBMklJcfc= | ||
github.com/google/docsy/dependencies v0.2.0/go.mod h1:2zZxHF+2qvkyXhLZtsbnqMotxMukJXLaf8fAZER48oo= | ||
github.com/google/docsy/dependencies v0.5.1/go.mod h1:EDGc2znMbGUw0RW5kWwy2oGgLt0iVXBmoq4UOqstuNE= | ||
github.com/google/docsy/dependencies v0.6.0/go.mod h1:EDGc2znMbGUw0RW5kWwy2oGgLt0iVXBmoq4UOqstuNE= | ||
github.com/google/docsy/dependencies v0.7.1/go.mod h1:gihhs5gmgeO+wuoay4FwOzob+jYJVyQbNaQOh788lD4= | ||
github.com/twbs/bootstrap v4.6.1+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0= | ||
github.com/twbs/bootstrap v4.6.2+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0= | ||
github.com/twbs/bootstrap v5.2.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
{{ hugo.Generator }} | ||
{{ range .AlternativeOutputFormats -}} | ||
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}"> | ||
{{ end -}} | ||
|
||
{{ $outputFormat := partial "outputformat.html" . -}} | ||
{{ if and hugo.IsProduction (ne $outputFormat "print") -}} | ||
<meta name="robots" content="index, follow"> | ||
{{ else -}} | ||
<meta name="robots" content="noindex, nofollow"> | ||
{{ end -}} | ||
|
||
{{ partialCached "favicons.html" . }} | ||
<title> | ||
{{- if .IsHome -}} | ||
{{ .Site.Title -}} | ||
{{ else -}} | ||
{{ with .Title }}{{ . }} | {{ end -}} | ||
{{ .Site.Title -}} | ||
{{ end -}} | ||
</title> | ||
<meta name="description" content="{{ template "partials/page-description.html" . }}"> | ||
{{ template "_internal/opengraph.html" . -}} | ||
{{ template "_internal/schema.html" . -}} | ||
{{ template "_internal/twitter_cards.html" . -}} | ||
{{ partialCached "head-css.html" . "asdf" -}} | ||
<script | ||
src="https://code.jquery.com/jquery-3.6.3.min.js" | ||
integrity="sha512-STof4xm1wgkfm7heWqFJVn58Hm3EtS31XFaagaa8VMReCXAkQnJZ+jEy8PCC/iT18dFy95WcExNHFTqLyp72eQ==" | ||
crossorigin="anonymous"></script> | ||
{{ if .Site.Params.offlineSearch -}} | ||
<script defer | ||
src="https://unpkg.com/lunr@2.3.9/lunr.min.js" | ||
integrity="sha384-203J0SNzyqHby3iU6hzvzltrWi/M41wOP5Gu+BiJMz5nwKykbkUx8Kp7iti0Lpli" | ||
crossorigin="anonymous"></script> | ||
{{ end -}} | ||
|
||
{{ if .Site.Params.prism_syntax_highlighting -}} | ||
<link rel="stylesheet" href="{{ "css/prism.css" | relURL }}"/> | ||
{{ end -}} | ||
|
||
{{ template "algolia/head" . -}} | ||
|
||
{{ partial "hooks/head-end.html" . -}} | ||
|
||
{{/* To comply with GDPR, cookie consent scripts places in head-end must execute before Google Analytics is enabled */ -}} | ||
{{ if hugo.IsProduction -}} | ||
{{ $enableGtagForUniversalAnalytics := not .Site.Params.disableGtagForUniversalAnalytics -}} | ||
{{ if (or $enableGtagForUniversalAnalytics (hasPrefix .Site.GoogleAnalytics "G-")) -}} | ||
{{ template "_internal/google_analytics_gtag.html" . -}} | ||
{{ else -}} | ||
{{ template "_internal/google_analytics_async.html" . -}} | ||
{{ end -}} | ||
{{ end -}} | ||
|
||
{{ define "algolia/head" -}} | ||
|
||
{{ if and .Site.Params.search (isset .Site.Params.search "algolia") -}} | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3.5.2" | ||
integrity="sha512-TW5eKlwwg7OfQUVBqxjp94/uqtjJJbhkRE3++XGEQjAL1n3y//QVqS3acPkwqkzInaFRtj+w05uyxDbfDXiI1A==" | ||
crossorigin="anonymous" /> | ||
{{ end -}} | ||
|
||
{{ if ne .Site.Params.algolia_docsearch nil -}} | ||
{{ warnf `Config 'params.algolia_docsearch' is deprecated: use 'params.search.algolia' | ||
For details, see https://www.docsy.dev/docs/adding-content/search/#algolia-docsearch.` -}} | ||
{{ end -}} | ||
|
||
{{ end -}} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
{{ $needKaTeX := or .Site.Params.katex.enable .Params.math .Params.chem -}} | ||
{{ $needmhchem := or .Site.Params.katex.mhchem.enable .Params.chem -}} | ||
{{ $needmermaid := .Site.Params.mermaid.enable -}} | ||
{{ if ge hugo.Version "0.93.0" -}} | ||
{{ with .Site.Params.mermaid }} | ||
{{ $needmermaid = true }} | ||
{{ end }} | ||
{{ $needKaTeX = or $needKaTeX (.Page.Store.Get "hasKaTeX") (.Page.Store.Get "hasmhchem") -}} | ||
{{ $needmhchem = or $needmhchem (.Page.Store.Get "hasmhchem") -}} | ||
{{ $needmermaid = or $needmermaid (.Page.Store.Get "hasmermaid") -}} | ||
{{ else -}} | ||
{{ if or $needKaTeX $needmhchem $needmermaid -}} | ||
{{ warnf "Outdated Hugo version %s, consider upgrading to make full use of all theme features" hugo.Version }} | ||
{{ end -}} | ||
{{ end -}} | ||
|
||
{{ if .Site.Params.markmap.enable -}} | ||
<style> | ||
.markmap > svg { | ||
width: 100%; | ||
height: 300px; | ||
} | ||
</style> | ||
<script> | ||
window.markmap = { | ||
autoLoader: { | ||
manual: true, | ||
onReady() { | ||
const { autoLoader, builtInPlugins } = window.markmap; | ||
autoLoader.transformPlugins = builtInPlugins.filter(plugin => plugin.name !== 'prism'); | ||
}, | ||
}, | ||
}; | ||
</script> | ||
<script src="https://cdn.jsdelivr.net/npm/markmap-autoloader"></script> | ||
{{ end -}} | ||
|
||
{{ if .Site.Params.plantuml.enable -}} | ||
<script src='{{ "js/deflate.js" | relURL }}'></script> | ||
{{ end -}} | ||
|
||
{{ if $needKaTeX -}} | ||
{{/* load stylesheet and scripts for KaTeX support */ -}} | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.4/dist/katex.min.css" | ||
integrity="sha512-mQwom8Ns4op+H29oDkD/LXO/OsXPvCFfkgZkFAVrhhePzRLU8NUI3Nkm43NhWUSmj3p5Cca2HTEkMQmXQRwDQQ==" crossorigin="anonymous"> | ||
{{/* The loading of KaTeX is deferred to speed up page rendering */ -}} | ||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.4/dist/katex.min.js" | ||
integrity="sha512-sHSNLECRJSK+BFs7E8DiFc6pf6n90bLI85Emiw1jhreduZhK3VXgq9l4kAt9eTIHYAcuQBKHL01QKs4/3Xgl8g==" | ||
crossorigin="anonymous"> | ||
</script> | ||
{{ if $needmhchem -}} | ||
{{/* To add support for displaying chemical equations and physical units, load the mhchem extension: */ -}} | ||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.4/dist/contrib/mhchem.min.js" | ||
integrity="sha512-V1hl0fnOXW6Cdqe5ZVqtw8TBpJVpu3XRDRQti96j/04+tMarPrCdXEUE3UdfvfKYTpOn9DV4zEZBVr0HhDiuiQ==" | ||
crossorigin="anonymous"> | ||
</script> | ||
{{ end -}} | ||
{{/* To automatically render math in text elements, include the auto-render extension: */ -}} | ||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.4/dist/contrib/auto-render.min.js" | ||
integrity="sha512-iWiuBS5nt6r60fCz26Nd0Zqe0nbk1ZTIQbl3Kv7kYsX+yKMUFHzjaH2+AnM6vp2Xs+gNmaBAVWJjSmuPw76Efg==" crossorigin="anonymous" | ||
{{ printf "onload='renderMathInElement(%s, %s);'" (( $.Page.Site.Params.katex.html_dom_element | default "document.body" ) | safeJS ) ( printf "%s" ( $.Page.Site.Params.katex.options | jsonify )) | safeHTMLAttr }}> | ||
</script> | ||
{{ end -}} | ||
|
||
{{ $jsBs := resources.Get "vendor/bootstrap/dist/js/bootstrap.bundle.js" -}} | ||
{{ $jsBase := resources.Get "js/base.js" -}} | ||
{{ $jsAnchor := resources.Get "js/anchor.js" -}} | ||
{{ $jsSearch := resources.Get "js/search.js" | resources.ExecuteAsTemplate "js/search.js" .Site.Home -}} | ||
{{ $jsMermaid := resources.Get "js/mermaid.js" | resources.ExecuteAsTemplate "js/mermaid.js" . -}} | ||
{{ $jsMarkmap := resources.Get "js/markmap.js" | resources.ExecuteAsTemplate "js/markmap.js" . -}} | ||
{{ $jsPlantuml := resources.Get "js/plantuml.js" | resources.ExecuteAsTemplate "js/plantuml.js" . -}} | ||
{{ $jsDrawio := resources.Get "js/drawio.js" | resources.ExecuteAsTemplate "js/drawio.js" . -}} | ||
{{ if .Site.Params.offlineSearch -}} | ||
{{ $jsSearch = resources.Get "js/offline-search.js" -}} | ||
{{ end -}} | ||
|
||
{{ $jsArray := slice $jsBs $jsBase $jsAnchor $jsSearch $jsPlantuml $jsMarkmap $jsDrawio -}} | ||
|
||
{{ if $needmermaid -}} | ||
{{ $jsArray = $jsArray | append $jsMermaid -}} | ||
<script src="https://cdn.jsdelivr.net/npm/mermaid@9.3.0/dist/mermaid.min.js" integrity="sha512-ku2nmBrzAXY5YwohzTqLYH1/lvyMrpTVxgQKrvTabd/b/uesqltLORdmpVapYv6QhZVCLUX6wkvFaKOAY4xpUA==" crossorigin="anonymous"></script> | ||
{{ end -}} | ||
|
||
{{ $js := $jsArray | resources.Concat "js/main.js" -}} | ||
{{ if hugo.IsProduction -}} | ||
{{ $js := $js | minify | fingerprint -}} | ||
<script src="{{ $js.RelPermalink }}" integrity="{{ $js.Data.Integrity }}" crossorigin="anonymous"></script> | ||
{{ else -}} | ||
<script src="{{ $js.RelPermalink }}"></script> | ||
{{ end -}} | ||
|
||
{{ if .Site.Params.prism_syntax_highlighting -}} | ||
<script src='{{ "js/prism.js" | relURL }}'></script> | ||
{{ else if ( not .Site.Params.disable_click2copy_chroma ) -}} | ||
{{ $c2cJS := resources.Get "js/click-to-copy.js" -}} | ||
{{ if hugo.IsProduction -}} | ||
{{ $c2cJS = $c2cJS | minify | fingerprint -}} | ||
{{ end -}} | ||
<script defer src="{{ $c2cJS.RelPermalink }}" {{ with $c2cJS.Data.Integrity -}} | ||
integrity="{{ . }}" {{ end -}} | ||
crossorigin="anonymous"></script> | ||
{{ end -}} | ||
|
||
{{ if and .Site.Params.search (isset .Site.Params.search "algolia") -}} | ||
{{ template "algolia/scripts" .Site.Params.search.algolia -}} | ||
{{ end -}} | ||
<script src='{{ "js/tabpane-persist.js" | relURL }}'></script> | ||
{{ partial "hooks/body-end.html" . -}} | ||
|
||
{{ define "algolia/scripts" -}} | ||
<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@3.5.2" | ||
integrity="sha512-LzxWPDNELae1RSIsDRSitKYPJpRtjYo22GbOl+d+xLcjKiZQRRdxSTI3cRRHw7O05e0MbIIu33QnU2rt6ymQ6A==" | ||
crossorigin="anonymous" ></script> | ||
<script type="text/javascript"> | ||
const containers = ['#docsearch-0', '#docsearch-1']; | ||
for (let c of containers) { | ||
docsearch({ | ||
container: c, | ||
appId: {{ .appId | default "R2IYF7ETH7" }}, | ||
apiKey: {{ .apiKey | default "599cec31baffa4868cae4e79f180729b" }}, | ||
indexName: {{ .indexName | default "docsearch" }}, | ||
}); | ||
} | ||
</script> | ||
{{ end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,15 @@ | ||
[build] | ||
[build.environment] | ||
HUGO_VERSION = "0.96.0" | ||
GO_VERSION = "1.18" | ||
publish = "public" | ||
command = "hugo --gc --minify -e development" | ||
|
||
[build.environment] | ||
HUGO_VERSION = "0.113.0" | ||
HUGO_ENABLEGITINFO = "true" | ||
GO_VERSION = "1.18" | ||
GOFLAGS="-mod=readonly" | ||
|
||
[context.deploy-preview] | ||
command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL -e development" | ||
|
||
[context.branch-deploy] | ||
command = "hugo --gc --minify -b $DEPLOY_PRIME_URL -e development" |