Skip to content

Commit

Permalink
Bump GitHub action workflows
Browse files Browse the repository at this point in the history
Fix npm dependencies, update outdated npm lockfile
Use docsy theme as hugo module
  • Loading branch information
deining committed Apr 27, 2024
1 parent 0f5df43 commit 79b33e4
Show file tree
Hide file tree
Showing 9 changed files with 869 additions and 2,690 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '12' ]
node: [ '20' ]
name: Node ${{ matrix.node }} Setup
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install node module
Expand All @@ -28,22 +28,18 @@ jobs:
npm audit fix
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.75.1'
hugo-version: '0.125.4'
extended: true

- name: Download Hugo Theme
run: |
git clone --recurse-submodules --depth 1 https://github.com/google/docsy.git themes/docsy
- name: Build
run: |
hugo --minify
echo 'gin-gonic.com' > public/CNAME
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/master'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
public
resources
node_modules
.hugo_build.lock
9 changes: 9 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module github.com/gin-gonic/website

go 1.22.2

require (
github.com/google/docsy v0.9.2-0.20240426161215-e9eca0fcb3b5 // indirect
github.com/FortAwesome/Font-Awesome v0.0.0-20240402185447-c0f460dca7f7 // indirect
github.com/twbs/bootstrap v5.3.3+incompatible // indirect
)
12 changes: 12 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
github.com/FortAwesome/Font-Awesome v0.0.0-20240108205627-a1232e345536/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
github.com/FortAwesome/Font-Awesome v0.0.0-20240402185447-c0f460dca7f7 h1:2aWEKCRLqQ9nPyXaz4/IYtRrDr3PzEiX0DUSUr2/EDs=
github.com/FortAwesome/Font-Awesome v0.0.0-20240402185447-c0f460dca7f7/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
github.com/FortAwesome/Font-Awesome v4.7.0+incompatible h1:3trjm7NtX5NXlju1AxSWSzedDMq2hsfH78Qtqrc8EgY=
github.com/FortAwesome/Font-Awesome v4.7.0+incompatible/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
github.com/google/docsy v0.9.1 h1:+jqges1YCd+yHeuZ1BUvD8V8mEGVtPxULg5j/vaJ984=
github.com/google/docsy v0.9.1/go.mod h1:saOqKEUOn07Bc0orM/JdIF3VkOanHta9LU5Y53bwN2U=
github.com/google/docsy v0.9.2-0.20240426161215-e9eca0fcb3b5 h1:EDs9FRTZ75agHdnMeO3HjfqJV10jKpdsM6XEARy/FsM=
github.com/google/docsy v0.9.2-0.20240426161215-e9eca0fcb3b5/go.mod h1:c0nIAqmRTOuJ01F85U/wJPQtc3Zj9N58Kea9bOT2AJc=
github.com/twbs/bootstrap v5.2.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
github.com/twbs/bootstrap v5.3.3+incompatible h1:goFoqinzdHfkeegpFP7pvhbd0g+A3O2hbU3XCjuNrEQ=
github.com/twbs/bootstrap v5.3.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
56 changes: 33 additions & 23 deletions config.toml → hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ title = "Gin Web Framework"

enableRobotsTXT = true

# Hugo allows theme composition (and inheritance). The precedence is from left to right.
theme = "docsy"

# Will give values to .Lastmod etc.
enableGitInfo = true

Expand All @@ -16,7 +13,7 @@ defaultContentLanguageInSubdir = false
# Useful when translating.
enableMissingTranslationPlaceholders = true

disableKinds = ["RSS", "taxonomy", "taxonomyTerm"]
disableKinds = ["RSS", "taxonomy"]

# Highlighting config
pygmentsCodeFences = true
Expand All @@ -32,8 +29,6 @@ pygmentsStyle = "tango"

#disqusShortname = "gin-gonic"

googleAnalytics = "UA-42425385-2"

# Configure how URLs look like per section.
[permalinks]
blog = "/:section/:year/:month/:day/:slug/"
Expand Down Expand Up @@ -61,84 +56,93 @@ id = "UA-42425385-2"
[languages]
[languages.en]
title = "Gin Web Framework"
description = "Gin Web Framework"
languageName = "English"
# Weight used for sorting.
weight = 1
[languages.en.params]
description = "Gin Web Framework"

[languages.zh-cn]
title = "Gin Web Framework"
description = "Gin Web Framework"
languageName = "简体中文"
contentDir = "content/zh-cn"
[languages.zh-cn.params]
description = "Gin Web Framework"
time_format_default = "02.01.2006"
time_format_blog = "02.01.2006"

[languages.zh-tw]
title = "Gin Web Framework"
description = "Gin Web Framework"
languageName = "繁體中文"
contentDir = "content/zh-tw"
[languages.zh-tw.params]
description = "Gin Web Framework"
time_format_default = "02.01.2006"
time_format_blog = "02.01.2006"

[languages.ja]
title = "Gin Web Framework"
description = "Gin Web Framework"
languageName = "日本語"
contentDir = "content/ja"
[languages.ja.params]
description = "Gin Web Framework"
time_format_default = "02.01.2006"
time_format_blog = "02.01.2006"

[languages.ko-kr]
title = "Gin Web Framework"
description = "Gin Web Framework"
languageName = "한국어"
contentDir = "content/ko-kr"
[languages.ko-kr.params]
description = "Gin Web Framework"
time_format_default = "02.01.2006"
time_format_blog = "02.01.2006"

[languages.es]
title = "Gin Web Framework"
description = "Gin Web Framework"
languageName = "Español"
contentDir = "content/es"
[languages.es.params]
description = "Gin Web Framework"
time_format_default = "02.01.2006"
time_format_blog = "02.01.2006"

[languages.fa]
title = "Gin Web Framework"
description = "Gin Web Framework"
languageName = "Persian"
contentDir = "content/fa"
[languages.fa.params]
description = "Gin Web Framework"
time_format_default = "02.01.2006"
time_format_blog = "02.01.2006"

[languages.tr]
title = "Gin Web Framework"
description = "Gin Web Framework"
languageName = "Turkish"
contentDir = "content/tr"
[languages.tr.params]
description = "Gin Web Framework"
time_format_default = "02.01.2006"
time_format_blog = "02.01.2006"

[languages.pt]
title = "Gin Web Framework"
description = "A Abstração de Web Gin"
languageName = "Português"
contentDir = "content/pt"
[languages.pt.params]
description = "A Abstração de Web Gin"
time_format_default = "02.01.2006"
time_format_blog = "02.01.2006"

[languages.ru]
title = "Gin Web Framework"
description = "Gin Web Framework"
languageName = "Russian"
contentDir = "content/ru"
[languages.ru.params]
description = "Gin Web Framework"
time_format_default = "02.01.2006"
time_format_blog = "02.01.2006"


[markup]
[markup.goldmark]
[markup.goldmark.renderer]
Expand Down Expand Up @@ -185,12 +189,6 @@ github_branch = "master"
# Google Custom Search Engine ID. Remove or comment out to disable search.
gcs_engine_id = "005538359705255204576:q0elqbxmlfs"

# Enable Algolia DocSearch
algolia_docsearch = false

# Enable Lunr.js offline search
offlineSearch = false

# User interface configuration
[params.ui]
# Enable to show the side bar menu in its compact state.
Expand Down Expand Up @@ -248,3 +246,15 @@ no = 'Sorry to hear that. Please <a href="https://github.com/USERNAME/REPOSITORY
# icon = "fa fa-envelope"
# desc = "Discuss development issues around the project"

[module]
# Uncomment the next line to build and serve using local docsy clone declared in the named Hugo workspace:
# workspace = "docsy.work"
[module.hugoVersion]
extended = true
min = "0.110.0"
[[module.mounts]]
source = "scss"
targets = "scss"
[[module.imports]]
path = "github.com/google/docsy"
disable = false
4 changes: 2 additions & 2 deletions layouts/partials/google-analytics.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<script>
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = 'https://www.googletagmanager.com/gtag/js?id=' + {{ .Site.GoogleAnalytics }};
s.src = 'https://www.googletagmanager.com/gtag/js?id=' + {{ .Site.Config.Services.GoogleAnalytics.ID }};
s.setAttribute('async', '');
(d.head || d.body).appendChild(s);
})();
Expand All @@ -12,6 +12,6 @@
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', {{ .Site.GoogleAnalytics }});
gtag('config', {{ .Site.Config.Services.GoogleAnalytics.ID }});
</script>

4 changes: 2 additions & 2 deletions layouts/partials/scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
{{ $jsBase := resources.Get "js/base.js" }}
{{ $jsSearch := resources.Get "js/search.js" | resources.ExecuteAsTemplate "js/search.js" .Site.Home }}
{{ $js := (slice $jsBase $jsSearch) | resources.Concat "js/main.js" }}
{{ if .Site.IsServer }}
{{ if hugo.IsServer }}
<script src="{{ $js.RelPermalink }}"></script>
{{ else }}
{{ $js := $js | minify | fingerprint }}
<script src="{{ $js.RelPermalink }}" integrity="{{ $js.Data.Integrity }}"></script>
{{ end }}
{{ partial "hooks/body-end.html" . }}

{{ if (.Site.GoogleAnalytics) }}
{{ if (.Site.Config.Services.GoogleAnalytics.ID) }}
{{ partial "google-analytics.html" . }}
{{ end }}
Loading

0 comments on commit 79b33e4

Please sign in to comment.