Skip to content

Commit 8c9946d

Browse files
committed
implement doc hosting and syncing
Signed-off-by: Scott Haddlesey <haddscot@amazon.com>
1 parent 7a09fba commit 8c9946d

File tree

23 files changed

+227
-80
lines changed

23 files changed

+227
-80
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Sync-Documentation
2+
3+
on:
4+
schedule:
5+
- cron: '0 3 * * *'
6+
7+
jobs:
8+
update-documentationmd:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- name: Update documentation
13+
id: vars
14+
run: make refresh-docs

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ node_modules/
77
# Hugo-generated assets
88
public/
99
resources/
10+
.hugo_build.lock
1011

1112
# Link checker assets
1213
bin/
1314
tmp/
15+
16+
# Documentation synced from other repos
17+
content/docs/v*
18+
static/docs/*

.gitmodules

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[submodule "containerd1.7"]
2+
path = containerd1.7
3+
url = https://github.com/containerd/containerd.git
4+
branch = release/1.7
5+
[submodule "containerd1.6"]
6+
path = containerd1.6
7+
url = https://github.com/containerd/containerd.git
8+
branch = release/1.6

Makefile

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,20 @@
1515
clean:
1616
rm -rf public resources
1717

18-
containerd-1.7.x:
19-
git clone --branch v1.7.0 --depth 1 https://github.com/containerd/containerd.git containerd-1.7.x
18+
refresh-docs:
19+
./tools/refresh-docs.sh
2020

21-
content/v1.7.x: containerd-1.7.x
22-
cp -r containerd-1.7.x/docs content/v1.7.x
23-
24-
containerd-1.6.x:
25-
git clone --branch v1.6.19 --depth 1 https://github.com/containerd/containerd.git containerd-1.6.x
26-
27-
content/v1.6.x: containerd-1.6.x
28-
cp -r containerd-1.6.x/docs content/v1.6.x
29-
30-
serve: content/v1.7.x content/v1.6.x
21+
serve: refresh-docs
3122
hugo server \
3223
--buildDrafts \
3324
--buildFuture \
3425
--disableFastRender
3526

36-
production-build: content/v1.7.x content/v1.6.x
27+
production-build: refresh-docs
3728
hugo \
3829
--minify
3930

40-
preview-build: content/v1.7.x content/v1.6.x
31+
preview-build: refresh-docs
4132
hugo \
4233
--baseURL $(DEPLOY_PRIME_URL) \
4334
--buildDrafts \

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,13 @@ You can also access the deploy preview for a pull request by clicking **Show all
3838

3939
## Contributing to the documentation
4040

41-
All of containerd's documentation is written in [GitHub-flavored Markdown](https://github.github.com/gfm/) and contained in the [`content/docs`](content/docs) folder.
41+
The source of truth for containerd's documentation is the [`docs folder`](https://github.com/containerd/containerd/tree/main/docs) in the containerd/containerd repo. Documentation is syncronized to this repo daily using the [Sync-Documentation](/.github/workflows/sync-documentation.yml) workflow.
4242

4343
### Adding new docs
4444

45-
To create a new doc, add a Markdown file to `content/docs`. The name of the file will determine its URL. This doc, for example, would be available at `https://containerd.io/docs/client-libraries`:
45+
All of containerd's documentation is written in [GitHub-flavored Markdown](https://github.github.com/gfm/). To create a new doc, add a Markdown file in the [`docs folder`](https://github.com/containerd/containerd/tree/main/docs) in the containerd/containerd repo, and it will automatically be cloned into this repo. **DO NOT WRITE DOCUMENTATION DIRECTLY TO THIS REPO -- IT WILL BE DELETED BY THE SYNC-DOCUMENTATION WORKFLOW.**
4646

47-
```shell
48-
touch content/docs/client-libraries.md
49-
```
47+
The name, path, and release branch of the file in the containerd/containerd repo will determine its URL on this site. For example, a document committed to `https://github.com/containerd/containerd/blob/release/1.7/docs/NRI.md` would be available at `https://containerd.io/docs/v1.7.x/nri/`.
5048

5149
Once you've added the doc you'll need to add the following page metadata at the top, as YAML:
5250

containerd1.6

Submodule containerd1.6 added at d68034c

containerd1.7

Submodule containerd1.7 added at dcf2847

content/docs/_index.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@ short: Overview
44
weight: 1
55
---
66

7-
Welcome to the containerd documentation! This document contains some basic project-level information about containerd.
7+
## Overview
88

9-
If you'd like to get started running containerd locally on your machine, see the [Getting started](https://github.com/containerd/containerd/blob/main/docs/getting-started.md) guide.
9+
Welcome to the containerd documentation! This document contains some basic project-level information about containerd.
1010

11-
See also other docs: https://github.com/containerd/containerd/tree/main/docs
11+
If you'd like to get started running containerd locally on your machine, see the [getting started](#getting-started) guide.
1212

1313
## Repositories
1414

15-
The containerd project is encapsulated in a variety of [GitHub](https://github.com) repositories.
15+
The containerd project is encapsulated in a variety of GitHub repositories; see https://github.com/containerd .
16+
17+
## Getting Started
1618

17-
See https://github.com/containerd .
19+
- [1.7.x](v1.7.x/docs/getting-started/)
20+
- [1.6.x](v1.6.x/docs/getting-started/)

content/docs/getting-started.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ short: Getting started
44
weight: 2
55
---
66

7-
- [1.7.x](/v1.7.x/getting-started/)
8-
- [1.6.x](/v1.6.x/getting-started/)
7+
This page has been consolidated to the [overview page](/docs/#getting-started)

netlify.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ publish = "public"
33
command = "make production-build"
44

55
[build.environment]
6-
HUGO_VERSION = "0.111.3"
6+
HUGO_VERSION = "0.116.0"
77

88
[context.deploy-preview]
99
command = "make preview-build"

0 commit comments

Comments
 (0)