Skip to content

Commit 2e7cc61

Browse files
authored
Add new docs (#486)
* Add initial new docs based on astro starlight * Add consolidated changes Add Dan's tweaks for the NIST pages * Direct to NIST pages
1 parent 30d4a1a commit 2e7cc61

38 files changed

+5793
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Build documentation site to nist-pages
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
env:
18+
BUILD_PATH: "."
19+
SITE_PATH: "https://pages.nist.gov/"
20+
BASE_PATH: "/macos_security"
21+
22+
jobs:
23+
build:
24+
name: Build
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
- name: Setup PNPM
30+
uses: pnpm/action-setup@v2
31+
with:
32+
version: 8
33+
- name: Setup Node
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: "20"
37+
cache: pnpm
38+
cache-dependency-path: ${{ env.BUILD_PATH }}/docs/pnpm-lock.yaml
39+
- name: Install dependencies
40+
run: pnpm install
41+
working-directory: ${{ env.BUILD_PATH }}/docs
42+
- name: Build with Astro
43+
run: |
44+
pnpm astro build \
45+
--site "${{ env.SITE_PATH }}" \
46+
--base "${{ env.BASE_PATH }}"
47+
working-directory: ${{ env.BUILD_PATH }}/docs
48+
- name: Upload to nist-pages
49+
uses: peaceiris/actions-gh-pages@v3
50+
with:
51+
github_token: ${{ secrets.GITHUB_TOKEN }}
52+
publish_dir: ${{ env.BUILD_PATH }}/docs/dist
53+
publish_branch: nist-pages

docs/astro.config.mjs

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
2+
import { defineConfig } from 'astro/config';
3+
import starlight from '@astrojs/starlight';
4+
5+
export default defineConfig({
6+
integrations: [
7+
starlight({
8+
title: 'macOS Security Compliance Project',
9+
favicon: '/favicon.png',
10+
logo: {
11+
src: './src/assets/logo.png',
12+
},
13+
customCss: [
14+
// Path to your custom CSS file
15+
'./src/styles/custom.css',
16+
],
17+
head: [
18+
{
19+
tag: 'link',
20+
attrs: {
21+
rel: 'stylesheet',
22+
href: './nist-combined.css',
23+
},
24+
},
25+
{
26+
tag: 'script',
27+
attrs: {
28+
src: './nist-header-footer.js',
29+
type: 'text/javascript',
30+
defer: 'defer',
31+
},
32+
},
33+
],
34+
social: {
35+
slack: 'https://macadmins.slack.com/archives/C0158JKQTC5',
36+
github: 'https://github.com/usnistgov/macos_security',
37+
},
38+
sidebar: [
39+
{
40+
label: 'Introduction',
41+
items: [
42+
{ label: 'Home', link: '/' },
43+
{ label: 'Introduction', link: '/guides/introduction/' },
44+
{ label: 'Getting Started', link: '/guides/getting-started/' },
45+
],
46+
},
47+
{
48+
label: 'How To',
49+
collapsed: false,
50+
items: [
51+
{ label: 'Generate a Baseline', link: '/guides/how-to/generate-baseline/' },
52+
{ label: 'Tailoring', link: '/guides/how-to/tailoring/' },
53+
{ label: 'Generate Guidance', link: '/guides/how-to/generate-guidance/' },
54+
{ label: 'Generate Configuration Profiles', link: '/guides/how-to/generate-profiles/' },
55+
{ label: 'Generate DDM Components', link: '/guides/how-to/generate-declarative/' },
56+
{ label: 'Compliance Script', link: '/guides/how-to/compliance-script/' },
57+
{ label: 'Exemptions', link: '/guides/how-to/exemptions/' },
58+
{ label: 'Customization', link: '/guides/how-to/customization/' },
59+
{ label: 'Generate Mapping', link: '/guides/how-to/generate-mapping/' },
60+
{ label: 'Generate SCAP', link: '/guides/how-to/generate-scap/' },
61+
],
62+
},
63+
{
64+
label: 'Repository',
65+
collapsed: true,
66+
items: [
67+
{ label: 'Layout', link: '/reference/layout/' },
68+
{ label: 'Baselines', link: '/reference/baselines/' },
69+
{ label: 'Includes', link: '/reference/includes/' },
70+
{ label: 'Rules', link: '/reference/rules/' },
71+
{ label: 'Sections', link: '/reference/sections/' },
72+
{ label: 'Scripts', link: '/reference/scripts/' },
73+
],
74+
},
75+
{
76+
label: 'More Information',
77+
collapsed: true,
78+
items: [
79+
{ label: 'mSCP Resources', link: '/reference/more/resources/' },
80+
{ label: 'Contributing', link: '/reference/more/contributing/' },
81+
{ label: 'Vendor Attribution', link: '/reference/more/vendor-attribution/' },
82+
{ label: 'FAQ', link: '/reference/more/faq/' },
83+
],
84+
},
85+
],
86+
}),
87+
],
88+
});

docs/package.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "docs",
3+
"type": "module",
4+
"version": "0.0.1",
5+
"scripts": {
6+
"dev": "astro dev",
7+
"start": "astro dev",
8+
"build": "astro build",
9+
"preview": "astro preview",
10+
"astro": "astro"
11+
},
12+
"dependencies": {
13+
"@astrojs/starlight": "^0.32.4",
14+
"astro": "^5.5.3",
15+
"sharp": "^0.33.5"
16+
}
17+
}

0 commit comments

Comments
 (0)