Skip to content

Commit

Permalink
Merge pull request #59 from YCloudYUSA/sept-updates
Browse files Browse the repository at this point in the history
feat: Docsy 0.7, Bootstrap 5, and Netlify
  • Loading branch information
podarok authored Oct 4, 2023
2 parents c5dc389 + 9bff07b commit ac3b723
Show file tree
Hide file tree
Showing 13 changed files with 253 additions and 27 deletions.
1 change: 0 additions & 1 deletion .gitmodules

This file was deleted.

21 changes: 19 additions & 2 deletions assets/scss/_styles_project.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
YMCA Website Services style overrides.
*/

// Remove the site title
a.navbar-brand span + span {
display: none;
}

main a {
// Underline links by default
// @todo Remove when https://github.com/google/docsy/pull/1684 is committed.
main a:not(.btn) {
text-decoration: underline;
}

Expand Down Expand Up @@ -84,4 +87,18 @@ kbd {

footer .text-center .ml-1 a {
color: white;
}
}

// Hide the sidebar taxonomy cloud because `taxonomyCloud = []` stopped working
aside .taxonomy-terms-cloud {
display: none;
}

// Fix links in dark sections
.td-box--dark a {
color: #dddddd;

&:hover {
color: darken(#dddddd,10);
}
}
3 changes: 1 addition & 2 deletions assets/scss/_variables_project.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Add styles or override variables from the theme here.
*/

$primary: black;
$primary-light: lighten($primary, 80%) !default;
$primary: #333333;
$secondary: #A92B31;
$link-color: #A92B31;
8 changes: 5 additions & 3 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,10 @@ github_branch= "main"
# Google Custom Search Engine ID. Remove or comment out to disable search.
# gcs_engine_id = "d72aa9b2712488cc3"

# Enable Algolia DocSearch
algolia_docsearch = true
[params.search.algolia]
appId = "IKYHW432S0"
apiKey = "daf6dd319fdc9982386b73a0d53d9f89"
indexName = "ds-y"

# Enable Lunr.js offline search
offlineSearch = false
Expand All @@ -147,7 +149,7 @@ navbar_translucent_over_cover_disable = false
sidebar_menu_compact = true
sidebar_menu_foldable = true
# Set to true to hide the sidebar search box (the top nav search box will still be displayed if search is enabled)
sidebar_search_disable = true
sidebar_search_disable = false

# Adds a H2 section titled "Feedback" to the bottom of each doc. The responses are sent to Google Analytics as events.
# This feature depends on [services.googleAnalytics] and will be disabled if "services.googleAnalytics.id" is not set.
Expand Down
15 changes: 9 additions & 6 deletions content/en/_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

+++

{{< blocks/cover title="Welcome to the YMCA Digital Services Documentation" image_anchor="top" height="med" color="orange" >}}
{{< blocks/cover title="Welcome to the YMCA Digital Services Documentation" image_anchor="top" height="med" color="dark" >}}
<div class="mx-auto">
<a class="btn btn-lg btn-primary mr-3 mb-4" href="{{< relref "/docs" >}}">
Read the Docs<i class="fas fa-arrow-alt-circle-right ml-2"></i>
<a class="btn btn-lg btn-primary me-3 mb-4" href="{{< relref "/docs" >}}">
Read the Docs<i class="fas fa-arrow-alt-circle-right ms-2"></i>
</a>
<a class="btn btn-lg btn-secondary mr-3 mb-4" href="https://github.com/YCloudYUSA/yusaopeny-project#installation">
Install YMCA Website Services <i class="fab fa-github ml-2 "></i>
<a class="btn btn-lg btn-secondary me-3 mb-4" href="https://github.com/YCloudYUSA/yusaopeny-project#installation">
Install YMCA Website Services <i class="fab fa-github ms-2 "></i>
</a>
<p class="lead mt-5"></p>
</div>
Expand All @@ -21,7 +21,7 @@
YMCA Website Services is a digital transformation platform for YMCAs.
{{% /blocks/lead %}}

{{< blocks/section color="dark" >}}
{{< blocks/section color="dark" type="row">}}

{{% blocks/feature icon="fa-user-friends" title="Visit the message board!" %}}
Get updates and ask questions.
Expand All @@ -40,3 +40,6 @@
{{% /blocks/feature %}}

{{< /blocks/section >}}

{{% blocks/lead color="primary" %}}
<a href="https://www.netlify.com"> <img src="https://www.netlify.com/v3/img/components/netlify-dark.svg" alt="Deploys by Netlify" /> </a>{{% /blocks/lead %}}
2 changes: 1 addition & 1 deletion content/en/community/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ Being an open-source project, YMCA Website Services depends on many projects acr
- [<i class="fab fa-github"></i> ynorth-projects](https://github.com/ynorth-projects): Functionality contributed by YNorth
- [<i class="fab fa-drupal"></i> Drupal YMCA "Ecosystem"](https://www.drupal.org/project/openy/ecosystem): Themes and other modules that live on Drupal.org

{{% /blocks/section %}}
{{% /blocks/section %}}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module github.com/open-y-subprojects/openy_docs

go 1.18

require github.com/google/docsy v0.6.0 // indirect
require github.com/google/docsy v0.7.2-0.20230818151232-5295589fd575 // indirect
7 changes: 7 additions & 0 deletions go.sum
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=
71 changes: 71 additions & 0 deletions layouts/partials/head.html
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 -}}
7 changes: 0 additions & 7 deletions layouts/partials/hooks/body-end.html

This file was deleted.

1 change: 0 additions & 1 deletion layouts/partials/hooks/head-end.html

This file was deleted.

125 changes: 125 additions & 0 deletions layouts/partials/scripts.html
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 -}}
17 changes: 14 additions & 3 deletions netlify.toml
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"

0 comments on commit ac3b723

Please sign in to comment.