Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 5 additions & 21 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,29 @@ on: pull_request
jobs:
build:
name: Build docs
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: '~1.17'
- name: Get Go module cache directory path
id: go-module-cache-dir-path
run: echo "dir=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
- name: Initialize Go module cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.go-module-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download Go dependencies
run: make go.deps
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '~16'
- name: Get Yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(npx yarn cache dir)" >> $GITHUB_OUTPUT
- name: Initialize Yarn module cache
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Download Yarn dependencies
run: make js.deps
- name: Initialize Hugo binary cache
id: cache-hugo
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: hugo.linux
key: ${{ runner.os }}-hugo-${{ hashFiles('**/go.sum') }}
Expand Down
36 changes: 11 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,37 @@ on:
branches:
- master

permissions:
contents: write

jobs:
release:
name: Release docs
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: '~1.17'
- name: Get Go module cache directory path
id: go-module-cache-dir-path
run: echo "dir=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
- name: Initialize Go module cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.go-module-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download Go dependencies
run: make go.deps
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '~16'
- name: Get Yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(npx yarn cache dir)" >> $GITHUB_OUTPUT
- name: Initialize Yarn module cache
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Download Yarn dependencies
run: make js.deps
- name: Initialize Hugo binary cache
id: cache-hugo
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: hugo.linux
key: ${{ runner.os }}-hugo-${{ hashFiles('**/go.sum') }}
Expand All @@ -63,8 +50,7 @@ jobs:
HUGO: ./hugo.linux
HUGO_BASE_URL: https://www.thethingsnetwork.org/docs
- name: Deploy documentation to Github pages
uses: JamesIves/github-pages-deploy-action@releases/v3
uses: JamesIves/github-pages-deploy-action@v4
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: public
branch: gh-pages
folder: public
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,6 @@ $RECYCLE.BIN/

### Internal docs build
/internal/

### Hugo build lock
.hugo_build.lock
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ clean.public:
.PHONY: clean.deps
clean.deps:
rm -rf $(FREQUENCY_PLAN_DEST)
rm -rf $(YARN_DEPS)

.PHONY: build.internal
build.internal:
Expand All @@ -57,16 +56,12 @@ new:
@:

.PHONY: deps
deps: hooks | go.deps js.deps
deps: hooks | go.deps

.PHONY: go.deps
go.deps:
go mod download

.PHONY: js.deps
js.deps:
yarn --cwd $(DOC_ROOT)

hugo.exe: go.mod go.sum
GOOS=windows go build -o $@ $(HUGO_BUILD_FLAGS) $(HUGO_MODULE)

Expand Down
24 changes: 20 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,29 @@ Data for generated documentation like the glossary is stored in `doc/data`.

## Development Environment Dependencies

The Things Network Documentation development tooling uses [Go](https://golang.org/doc/install) and [Yarn](https://yarnpkg.com/en/docs/install).
The Things Network Documentation development tooling uses [Go](https://golang.org/doc/install)
(Hugo is pinned in `go.mod` and built with `make deps`). The theme has no JavaScript build step.

- Follow [Go's installation guide](https://golang.org/doc/install) to install Go.
- Follow [Yarn's installation guide](https://yarnpkg.com/en/docs/install) to install Yarn.

In order to build the documentation site with the right theme, you need to run
`make deps` from time to time. This will install [Yarn](https://yarnpkg.com/) on Mac and Unix systems if it is not already installed.
## Theme

The theme lives in `doc/layouts` + `doc/assets` (plain CSS and JS, no Bulma/TTUI). The global
header and footer render from `doc/data/site_nav.json`, and icons from `doc/data/icons.json`. Both
are **generated** from www.thethingsnetwork.org's single navigation source — do not edit them by
hand; re-export them from the platform repo instead:

```
node scripts/export-docs-chrome.mjs <path to this repo>/doc/data
```

Nav hrefs are root-relative and prefixed with `params.ttnOrigin` (default
`https://www.thethingsnetwork.org`); for a local all-in-one preview run Hugo with
`HUGO_PARAMS_TTNORIGIN=http://localhost:3000`.

Section landing pages can use the `lead`, `actions`/`button`, `chapters`, `feature` and `topics`
shortcodes (see `doc/content/lorawan/_index.md`); a section's numbered course is its `chapters`
front matter and its topic index the `topics` front matter.

## Getting Started

Expand Down
25 changes: 0 additions & 25 deletions doc/assets/css/common/fonts.scss

This file was deleted.

Loading
Loading