Skip to content

Commit

Permalink
website/: add static website generation
Browse files Browse the repository at this point in the history
Signed-off-by: Thilo Fromm <[email protected]>
  • Loading branch information
t-lo committed Oct 24, 2022
1 parent 5bfabd9 commit ae32180
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: GitHub Pages

on:
push:
branches:
- main
pull_request:

jobs:
deploy:
if: github.repository == 'uapi-group/kernel'
runs-on: ubuntu-22.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0

- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.104.3'
extended: true

- name: Build
run: cd website && hugo --minify -d ../public

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
website/public
website/.hugo_build.lock
website/resources/_gen
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "website/themes/hugo-book"]
path = website/themes/hugo-book
url = https://github.com/alex-shpak/hugo-book
29 changes: 29 additions & 0 deletions website/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Static website generation for UAPI group specifications

This repository uses Hugo for static HTML generation.
See https://gohugo.io/getting-started/quick-start/ for a brief intro.

The website uses the [hugo-book](https://github.com/alex-shpak/hugo-book) theme; it is included in this repo as a git submodule.
After cloning this repo please run `git submodule init; git submodule update`.
If you check out a branch or tag, make sure the submodule is up to date by running `git submodule update`.

## Website repo layout

Content resides in the [content](content/) folder.
The top-level README.md is soft-linked to `content/_index.md` and serves as index page.

To add content, either put files into the `content/docs` folder.
Documents there are automatically added to the naviation menu on the left.

## Making changes and testing

You'll need [hugo installed](https://gohugo.io/getting-started/installing/) for rendering changes.

First, make your edits.
Then, start hugo locally (in the repo's `website` directory)to review your changes:

```shell
$ hugo server --minify --disableFastRender
```

Review your changes at http://localhost:1313/kernel/ .
6 changes: 6 additions & 0 deletions website/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
---

5 changes: 5 additions & 0 deletions website/assets/_variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$body-min-width: 20rem;
$container-max-width: 110rem;

$menu-width: 15rem;
$toc-width: 15rem;
7 changes: 7 additions & 0 deletions website/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
baseURL = "https://uapi-group.org/kernel"
languageCode = "en-us"
title = "UAPI group generic documents and meeting minutes"
theme = "hugo-book"

[markup.goldmark.renderer]
unsafe = true # Allow HTML in md files
1 change: 1 addition & 0 deletions website/content/_index.md
1 change: 1 addition & 0 deletions website/themes/hugo-book
Submodule hugo-book added at 9e9c7d

0 comments on commit ae32180

Please sign in to comment.