Skip to content

Commit

Permalink
added hugo build action
Browse files Browse the repository at this point in the history
Signed-off-by: Frederic BIDON <[email protected]>
  • Loading branch information
fredbi committed Jan 29, 2024
1 parent 994c5d7 commit a461d8b
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 26 deletions.
29 changes: 22 additions & 7 deletions .github/workflows/update-doc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ name: "Update documentation"

on:
push:
branches: [ "master" , "exp/follow-up-hugo" ]
paths: [ "docs/*", "hack/hugo/*" ]
tags:
- v*
branches: [ "master" ]
paths: [ "docs/*", "hack/hugo/*", ".github/workflows/update-doc.yaml" ]

pull_request:
paths: [ "docs/*", "hack/hugo/*", ".github/workflows/update-doc.yaml" ]

permissions:
contents: read
Expand All @@ -17,6 +22,7 @@ concurrency:
defaults:
run:
shell: bash
working-directory: ./hack/hugo/hugo-test

jobs:
hugo:
Expand All @@ -25,11 +31,22 @@ jobs:
-
name: Checkout
uses: actions/checkout@v4
with:
submodules: true
# sparse-checkout: |
# hack/
# docs/
-
name: check
run: |
echo $(pwd)
ls
ls themes
ls themes/go-swagger
-
name: Run Hugo
uses: crazy-max/ghaction-hugo@v3
run:
working-directory: hack/hugo/hugo-test
with:
version: latest
extended: false
Expand All @@ -38,12 +55,10 @@ jobs:
name: Deploy to GitHub Pages
if: github.event_name != 'pull_request'
uses: crazy-max/ghaction-github-pages@v4
run:
working-directory: hack/hugo/hugo-test
with:
target_branch: gh-pages
build_dir: public
#repo: github.com/fredbi/go-swagger.github.io
repo: github.com/fredbi/go-swagger.github.io
allow_empty_commit: false
jekyll: false
verbose: true
Expand Down
4 changes: 4 additions & 0 deletions hack/hugo/hugo-test/TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* [x] edit pages
* hugo-test -> final location
* auto-build & publish
* versioning docs? tree for tagged releases
28 changes: 15 additions & 13 deletions hack/hugo/hugo-test/hugo.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
title: go-swagger
theme: hugo-book

module:
imports:
- path: "go-swagger"
- path: "go-swagger-assets"
- path: "go-swagger-static"
mounts:
- source: '../../../docs'
target: 'content'
- source: 'themes/assets'
- source: 'themes/go-swagger-assets'
target: 'assets'
- source: 'themes/go-swagger-static'
target: 'static'

sitemap:
Expand All @@ -16,6 +20,7 @@ sitemap:
priority: -1

enableRobotsTXT: true
enableGitInfo: true

menu:
before:
Expand All @@ -29,13 +34,12 @@ menu:
after:
- name: ""
pre: "<hr>"
post: '<div style="color:aqua">The go-openapi toolkit</div>'
post: '<div style="color:aqua; font-weight:bold">The go-openapi toolkit</div>'
url: "https://github.com/go-openapi"
weight: 1
children:
- name: "go-openapi/analysis"
url: "https://github.com/go-openapi/analysis"
weight: 10
- name: "go-openapi/analysis"
url: "https://github.com/go-openapi/analysis"
weight: 10
- name: "go-openapi/errors"
url: "https://github.com/go-openapi/errors"
weight: 20
Expand Down Expand Up @@ -77,11 +81,8 @@ params:
# (Optional, default favicon.png) Set the path to a favicon file.
# If the favicon is /static/favicon.png then the path would be favicon.png
BookFavicon: "favicon.png"
BookLogo: "logo.png"

# (Optional, default none) Set the path to a logo for the book.
# If the logo is /static/logo.png then the path would be logo.png
# BookLogo: /logo.png
BookLogo: "logo.png"

# (Optional, default none) Set leaf bundle to render as side menu
# When not specified file structure and weights will be used
Expand All @@ -94,19 +95,20 @@ params:

# Set source repository location.
# Used for 'Last Modified' and 'Edit this page' links.
BookRepo: 'https://github.com/go-swagger/go-swagger'
BookRepo: 'https://github.com/fredbi/go-swagger'

# (Optional, default 'commit') Specifies commit portion of the link to the page's last modified
# commit hash for 'doc' page type.
# Requires 'BookRepo' param.
# Value used to construct a URL consisting of BookRepo/BookCommitPath/<commit-hash>
# Github uses 'commit', Bitbucket uses 'commits'
# BookCommitPath: commit
BookCommitPath: commit

# Enable "Edit this page" links for 'doc' page type.
# Disabled by default. Uncomment to enable. Requires 'BookRepo' param.
# Edit path must point to root directory of repo.
#BookEditPath: edit/main/exampleSite
BookEditPath: edit/master
contentDir: docs

# Configure the date format used on the pages
# - In git information
Expand Down
4 changes: 2 additions & 2 deletions hack/hugo/hugo-test/layouts/partials/docs/inject/footer.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<p>
Copyright 2015-2024 go-swagger maintainers.
Copyright 2015-2024 the go-swagger maintainers.

This documentation is under an <a href="https://raw.githubusercontent.com/go-swagger/go-swagger/master/LICENSE" target="_blank">Apache 2.0</a> license.
This documentation is under an <a href="https://raw.githubusercontent.com/go-swagger/go-swagger/master/LICENSE" target="_blank">Apache 2.0 license</a>.
</p>

<p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
<p style="color:aqua;font-weight:bolder;font-size:30px;font-family:Helvetica,sans-serif">
go-swagger
</p>
<p>
<a href="/">README</a>
</p>
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion hack/hugo/hugo-test/themes/go-swagger
6 changes: 6 additions & 0 deletions hack/hugo/hugo-test/themes/go-swagger-assets/_custom.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
a[title]:hover::after {
content: attr(title);
position: absolute;
top: -100%;
left: 0;
}

0 comments on commit a461d8b

Please sign in to comment.