Skip to content

Commit 098cd11

Browse files
committed
Create docusaurus site; update doc build workflow
1 parent c4ccf5d commit 098cd11

23 files changed

+20251
-28
lines changed

.github/workflows/docs-build.yml

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,36 +14,17 @@ jobs:
1414
with:
1515
persist-credentials: false
1616

17-
- name: Setup ruby
18-
uses: ruby/setup-ruby@efbf473cab83af4468e8606cc33eca9281bb213f # v1.256.0
17+
- uses: actions/setup-node@v4
1918
with:
20-
ruby-version: '3.3'
21-
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
22-
cache-version: 0 # Increment this number if you need to re-download cached gems
23-
working-directory: ./docs
19+
node-version: 20.x
2420

25-
- name: Setup pages
26-
id: pages
27-
uses: actions/configure-pages@v5
28-
29-
- name: Build with Jekyll
30-
run: bundle exec jekyll build --baseurl "$PAGES_PATH"
31-
working-directory: ./docs
32-
env:
33-
PAGES_PATH: ${{ steps.pages.outputs.base_path }}
34-
35-
- name: Check links
21+
- name: Build website
3622
run: |
37-
bundle exec htmlproofer \
38-
--disable-external \
39-
--assume_extension '.html' \
40-
--swap-urls "^${PAGES_PATH}/:/" \
41-
./_site
42-
working-directory: ./docs
43-
env:
44-
PAGES_PATH: ${{ steps.pages.outputs.base_path }}
45-
- name: Upload site assets as artifact
46-
id: deployment
23+
cd website
24+
npm ci
25+
npm run build
26+
27+
- name: Upload website artifact
4728
uses: actions/upload-pages-artifact@v3
4829
with:
49-
path: ./docs/_site
30+
path: ./website/build

website/.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*
21+
22+
# Generated docs
23+
/docs
24+
/versioned_docs
25+
/versioned_sidebars
26+
27+
# Generated versions.json
28+
/versions.json

website/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Website
2+
3+
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
4+
5+
## Installation
6+
7+
```bash
8+
yarn
9+
```
10+
11+
## Local Development
12+
13+
```bash
14+
yarn start
15+
```
16+
17+
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
18+
19+
## Build
20+
21+
```bash
22+
yarn build
23+
```
24+
25+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
26+
27+
## Deployment
28+
29+
Using SSH:
30+
31+
```bash
32+
USE_SSH=true yarn deploy
33+
```
34+
35+
Not using SSH:
36+
37+
```bash
38+
GIT_USER=<Your GitHub username> yarn deploy
39+
```
40+
41+
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

website/blog/authors.yml

Whitespace-only changes.

website/blog/tags.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
azure-linux-image-tools:
2+
label: Azure Linux Image Tools
3+
permalink: /azure-linux-image-tools
4+
description: Azure Linux Image Tools tag description

website/docusaurus.config.js

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
// @ts-check
2+
// `@type` JSDoc annotations allow editor autocompletion and type checking
3+
// (when paired with `@ts-check`).
4+
// There are various equivalent ways to declare your Docusaurus config.
5+
// See: https://docusaurus.io/docs/api/docusaurus-config
6+
7+
import { themes as prismThemes } from 'prism-react-renderer';
8+
9+
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
10+
11+
/** @type {import('@docusaurus/types').Config} */
12+
const config = {
13+
title: 'Azure Linux Image Tools',
14+
tagline: 'Tools for building Azure Linux images',
15+
favicon: 'img/favicon.ico',
16+
17+
// Future flags, see https://docusaurus.io/docs/api/docusaurus-config#future
18+
future: {
19+
v4: true, // Improve compatibility with the upcoming Docusaurus v4
20+
},
21+
22+
// When GitHub Pages is public
23+
// url: 'https://microsoft.github.io',
24+
// baseUrl: '/azure-linux-image-tools/',
25+
26+
// While GitHub Pages is private
27+
url: 'https://vigilant-adventure-5jnm363.pages.github.io/',
28+
baseUrl: '/',
29+
30+
// GitHub pages deployment config.
31+
// If you aren't using GitHub pages, you don't need these.
32+
organizationName: 'Microsoft', // Usually your GitHub org/user name.
33+
projectName: 'azure-linux-image-tools', // Usually your repo name.
34+
35+
onBrokenLinks: 'throw',
36+
onBrokenMarkdownLinks: 'warn',
37+
38+
// Even if you don't use internationalization, you can use this field to set
39+
// useful metadata like html lang. For example, if your site is Chinese, you
40+
// may want to replace "en" with "zh-Hans".
41+
i18n: {
42+
defaultLocale: 'en',
43+
locales: ['en'],
44+
},
45+
46+
presets: [
47+
[
48+
'classic',
49+
/** @type {import('@docusaurus/preset-classic').Options} */
50+
({
51+
docs: {
52+
path: '../docs',
53+
routeBasePath: '/docs/',
54+
sidebarPath: './sidebars.js',
55+
// Please change this to your repo.
56+
// Remove this to remove the "edit this page" links.
57+
editUrl:
58+
'https://github.com/microsoft/azure-linux-image-tools/tree/main/docs/',
59+
},
60+
theme: {
61+
customCss: './src/css/custom.css',
62+
},
63+
}),
64+
],
65+
],
66+
67+
themeConfig:
68+
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
69+
({
70+
// Replace with your project's social card
71+
image: 'img/docusaurus-social-card.jpg',
72+
navbar: {
73+
title: 'Azure Linux Image Tools',
74+
logo: {
75+
alt: 'Azure Linux Image Tools Logo',
76+
src: 'img/logo.svg',
77+
},
78+
items: [
79+
{
80+
type: 'doc',
81+
docId: 'imagecustomizer/README',
82+
position: 'left',
83+
label: 'Image Customizer',
84+
},
85+
{
86+
type: 'doc',
87+
docId: 'imagecreator/README',
88+
position: 'left',
89+
label: 'Image Creator',
90+
},
91+
{
92+
href: 'https://github.com/microsoft/azure-linux-image-tools',
93+
label: 'GitHub',
94+
position: 'right',
95+
},
96+
],
97+
},
98+
footer: {
99+
style: 'dark',
100+
links: [
101+
{
102+
title: 'Docs',
103+
items: [
104+
{
105+
label: 'Image Customizer',
106+
to: '/docs/imagecustomizer',
107+
},
108+
{
109+
label: 'Image Creator',
110+
to: '/docs/imagecreator',
111+
},
112+
],
113+
},
114+
{
115+
title: 'Community',
116+
items: [
117+
// {
118+
// label: 'Stack Overflow',
119+
// href: 'https://stackoverflow.com/questions/tagged/azure-linux-image-tools',
120+
// },
121+
// {
122+
// label: 'Discord',
123+
// href: 'https://discordapp.com/invite/azure-linux-image-tools',
124+
// },
125+
// {
126+
// label: 'X',
127+
// href: 'https://x.com/azure-linux-image-tools',
128+
// },
129+
],
130+
},
131+
{
132+
title: 'More',
133+
items: [
134+
{
135+
label: 'GitHub',
136+
href: 'https://github.com/microsoft/azure-linux-image-tools',
137+
},
138+
],
139+
},
140+
],
141+
// copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
142+
},
143+
prism: {
144+
theme: prismThemes.github,
145+
darkTheme: prismThemes.dracula,
146+
},
147+
}),
148+
themes: [
149+
[
150+
require.resolve("@easyops-cn/docusaurus-search-local"),
151+
/** @type {import("@easyops-cn/docusaurus-search-local").PluginOptions} */
152+
{
153+
hashed: true,
154+
},
155+
],
156+
'@docusaurus/theme-mermaid'
157+
],
158+
};
159+
export default config;

0 commit comments

Comments
 (0)