Skip to content

Commit

Permalink
Add Hugo documentation site with Docsy theme
Browse files Browse the repository at this point in the history
- Create initial Hugo site with Docsy theme
- Set up GitHub Pages workflow for documentation
- Add sample pages for certificates, build types, etc.
- Migrate content from existing Markdown files
- Create structure for docs, getting-started, and development sections

🤖 Generated with Claude Code
Co-Authored-By: Claude <[email protected]>
  • Loading branch information
aaronlippold committed Feb 26, 2025
1 parent a3efdd8 commit 168ffb3
Show file tree
Hide file tree
Showing 15 changed files with 894 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build and Deploy Documentation

on:
push:
branches:
- main
paths:
- 'docs-site/**'
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
name: Build Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0

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

- name: Install Node.js dependencies
run: |
cd docs-site/themes/docsy
npm install
- name: Build
run: |
cd docs-site
hugo --minify --baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./docs-site/public

deploy:
name: Deploy Documentation
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "docs-site/themes/docsy"]
path = docs-site/themes/docsy
url = https://github.com/google/docsy.git
10 changes: 10 additions & 0 deletions docs-site/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Hugo site-specific ignores
public/
resources/
.hugo_build.lock
node_modules/

# Temporary files
*.log
*.tmp
.DS_Store
108 changes: 108 additions & 0 deletions docs-site/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# ComplianceAsCode Builder Documentation

This directory contains the documentation website for the ComplianceAsCode Builder project, built with [Hugo](https://gohugo.io/) and the [Docsy](https://www.docsy.dev/) theme.

## Local Development

### Prerequisites

1. Install Hugo (Extended version)
```bash
# macOS
brew install hugo

# Windows
choco install hugo-extended

# Linux
snap install hugo --channel=extended
```

2. Install Node.js and npm (for Docsy theme dependencies)
```bash
# macOS
brew install node

# Windows
choco install nodejs

# Linux
apt install nodejs npm
```

### Setting Up

1. Install Docsy theme dependencies
```bash
cd themes/docsy
npm install
```

### Running Locally

1. Start the Hugo development server
```bash
cd docs-site
hugo server
```

2. View the site at http://localhost:1313/

## Adding Content

### Creating New Pages

1. Create a new page in the appropriate section
```bash
hugo new content/docs/my-page.md
```

2. Edit the new page with your content
```md
---
title: "My Page"
linkTitle: "My Page"
weight: 50
description: Description of my page
---

# My Page Content

This is my new page.
```

### Page Organization

- `_index.md` files define section landing pages
- `weight` in frontmatter controls the ordering
- `linkTitle` controls the navigation menu text

## Building for Production

The site is automatically built and deployed to GitHub Pages when changes are pushed to the `main` branch.

To build manually:

```bash
hugo --minify
```

The built site will be in the `public/` directory.

## Documentation Structure

- `content/` - The documentation content
- `_index.md` - Homepage
- `docs/` - Main documentation
- `getting-started/` - Getting started guides
- `development/` - Development guides
- `static/` - Static assets like images
- `layouts/` - Custom Hugo layouts (if needed)
- `themes/docsy/` - The Docsy theme (submodule)

## Style Guide

- Use Markdown for content
- Use Hugo shortcodes for complex elements
- Follow the Docsy conventions for alerts, notes, etc.
- Use relative links for internal navigation
5 changes: 5 additions & 0 deletions docs-site/archetypes/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
+++
date = '{{ .Date }}'
draft = true
title = '{{ replace .File.ContentBaseName "-" " " | title }}'
+++
67 changes: 67 additions & 0 deletions docs-site/content/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
title: "ComplianceAsCode Builder"
linkTitle: "Home"
---

# ComplianceAsCode Builder

{{% blocks/cover title="Welcome to ComplianceAsCode Builder" height="auto" %}}
A Docker-based tooling for working with the ComplianceAsCode/content project, enabling easy generation of SCAP content for various platforms.
{{% /blocks/cover %}}

{{% blocks/section color="primary" %}}
## What is ComplianceAsCode Builder?

ComplianceAsCode Builder provides a containerized environment for working with SCAP content generation. It lets you:

- Generate SCAP content for various platforms (RHEL, Ubuntu, etc.)
- Test compliance rules and profiles
- Create remediation scripts (Ansible, Bash)
- Customize security benchmarks

Our Docker-based approach ensures a consistent environment for all users, regardless of their host system.
{{% /blocks/section %}}

{{% blocks/section color="secondary" %}}
## Quick Start

```bash
# Setup the environment
./setup.sh

# Build and start the container
docker-compose build
docker-compose up -d

# Connect to the container
docker exec -it compliance-as-code bash

# Build a specific product
build-product rhel10
```

For detailed setup instructions, see [Setting Up Your Local Development Environment](/getting-started/setup/).
{{% /blocks/section %}}

{{% blocks/section color="dark" %}}
## Features

- **Two Build Configurations**: Full (pre-built products) and Minimal (build on-demand)
- **Certificate Management**: Flexible options for using organization certificates
- **Output Types**: XCCDF, OVAL, DataStreams, Ansible Playbooks, and more
- **CI/CD Integration**: GitHub Actions for automated builds and tests
- **Local Workflow Testing**: Test GitHub Actions workflows locally
{{% /blocks/section %}}

{{% blocks/section %}}
## Get Involved

ComplianceAsCode Builder is an open-source project that welcomes contributions from the community. There are many ways to contribute:

- [Star the repository](https://github.com/mitre/cac-builder)
- [Report issues](https://github.com/mitre/cac-builder/issues)
- [Submit pull requests](https://github.com/mitre/cac-builder/pulls)
- Join our community discussions

See our [contribution guidelines](/development/contributing/) for details.
{{% /blocks/section %}}
49 changes: 49 additions & 0 deletions docs-site/content/development/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: "Development"
linkTitle: "Development"
weight: 30
menu:
main:
weight: 30
---

# Development Guide

This section provides information for developers who want to contribute to the ComplianceAsCode Builder project.

## Development Environment Setup

Follow these steps to set up a development environment:

1. Clone the repository
2. Set up your environment with `./setup.sh`
3. Build the container with `docker-compose build`
4. Start the container with `docker-compose up -d`
5. Connect to the container with `docker exec -it compliance-as-code bash`

## Testing GitHub Actions Workflows

Test GitHub Actions workflows locally using the `act` tool:

```bash
# List available workflows
./scripts/test-github-actions.sh --list

# Test the build workflow
./scripts/test-github-actions.sh --workflow build-test.yml

# Test a specific job
./scripts/test-github-actions.sh --job build

# Test with arm64 architecture (for M-series Macs)
./scripts/test-github-actions.sh --arch arm64
```

## Development Topics

- [Code Style Guidelines](/development/code-style/): Coding standards for the project
- [Pull Request Process](/development/pull-requests/): How to submit changes
- [Local Development Workflow](/development/local-workflow/): Best practices for development
- [Testing](/development/testing/): How to test your changes
- [Releasing](/development/releasing/): Process for creating releases
- [Contributing](/development/contributing/): Guidelines for contributing
Loading

0 comments on commit 168ffb3

Please sign in to comment.