Skip to content

Commit

Permalink
Init documentation on GitHub Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
charphi committed Jun 23, 2022
1 parent 373f5f2 commit 9e73a3b
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Documentation deployment

on: [ push ]

jobs:
deploy:
if: startsWith(github.repository, 'nbbrd/') && ((github.ref == 'refs/heads/develop') || startsWith(github.ref, 'refs/tags/v'))
name: Deploy to GitHub Pages
runs-on: ubuntu-latest

env:
THEME_VERSION: v0.32.3
DOC_SLUG: ${{ github.ref_name }}
DOC_URL: "http://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/docs/${{ github.ref_name }}"

steps:
- name: Checkout source code
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0

- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 'latest'

- name: Download theme
run: |
mkdir -p docs/themes/hugo-geekdoc/
curl -sSL https://github.com/thegeeklab/hugo-geekdoc/releases/download/${{ env.THEME_VERSION }}/hugo-geekdoc.tar.gz | tar -xz -C docs/themes/hugo-geekdoc/ --strip-components=1
- name: Build pages
run: |
hugo --source docs -b ${{ env.DOC_URL }}
touch ./docs/public/.nojekyll
- name: Deploy pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/public
destination_dir: ./docs/${{ env.DOC_SLUG }}

- name: Create summary
run: echo "Documentation available at ${{ env.DOC_URL }}" >> $GITHUB_STEP_SUMMARY
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
target/
dependency-reduced-pom.xml
/docs/themes
/docs/.hugo_build.lock
/docs/public
6 changes: 6 additions & 0 deletions docs/archetypes/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
---

25 changes: 25 additions & 0 deletions docs/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
baseURL = "http://nbbrd.github.io/sdmx-dl/develop"
title = "sdmx-dl"
theme = "hugo-geekdoc"

pluralizeListTitles = false

# Geekdoc required configuration
pygmentsUseClasses = true
pygmentsCodeFences = true
disablePathToLower = true

# Required if you want to render robots.txt template
enableRobotsTXT = true

# Needed for mermaid shortcodes
[markup]
[markup.goldmark.renderer]
# Needed for mermaid shortcode
unsafe = true
[markup.tableOfContents]
startLevel = 1
endLevel = 9

[taxonomies]
tag = "tags"

0 comments on commit 9e73a3b

Please sign in to comment.