This technical reference provides detailed information about the CircleCI docs site's components, configuration options, and integration points.
- Antora Configuration
- Gulp Tasks
- UI Components
- Extensions API
- Content Component Reference
- Script Reference
- Environment Variables
- Build Output
The antora-playbook.yml file is the primary configuration file for the Antora site generator. It defines how components are loaded, processed, and assembled.
site:
title: CircleCI Documentation
url: https://circleci.com/docs
robots: allowtitle: The title displayed on the websiteurl: The production URL of the siterobots: Controls the robots.txt file (allow/disallow)
content:
sources:
- url: .
start_path: docs/root
- url: .
start_path: docs/guides
# Additional components...url: The repository URL (.for local repository)start_path: The path to the component in the repositorybranches: Optional list of branches to includetags: Optional list of tags to include
ui:
bundle:
url: ./ui-bundle.zipurl: The path or URL to the UI bundle
output:
dir: ./build
clean: true
destinations:
- provider: fsdir: Output directory for the generated siteclean: Whether to clean the output directory before buildingdestinations: List of output destinations
asciidoc:
attributes:
serverversion4: 4.0.6
# Additional attributes...
extensions:
- '@asciidoctor/tabs'
# Additional extensions...attributes: AsciiDoc attributes available to all pagesextensions: AsciiDoc extensions to enable
Each component has an antora.yml file with the following structure:
name: guides
title: Guides
version: ~
nav:
- modules/ROOT/nav.adoc
start_page: getting-started:first-steps.adocname: Component name (used in URLs and xrefs)title: Display name for the componentversion: Version identifier (~ for unversioned)nav: List of navigation filesstart_page: Default landing page for the component
The project uses Gulp for task automation. Here's a reference of the main tasks:
| Task | Command | Description |
|---|---|---|
| Build UI | gulp build:ui |
Builds the UI bundle |
| Build Site | gulp build:docs |
Builds the complete site |
| Preview Docs | gulp preview:docs |
Starts a server for docs preview |
| Preview UI | gulp preview:ui |
Starts a server for UI preview |
This task:
- Cleans previous UI bundle
- Installs UI dependencies if needed
- Runs the UI build process
- Copies the resulting bundle to the project root
This task:
- Ensures the UI bundle exists
- Runs Antora with the configured playbook
- Processes the output for any additional tasks
These tasks:
- Start a local server
- Watch for changes to relevant files
- Trigger rebuilds when changes are detected
- Reload the browser to show changes
The UI project is organized as follows:
ui/
├── src/
│ ├── css/ # CSS styles
│ │ ├── base.css # Base styles
│ │ ├── site.css # Site-specific styles
│ │ └── ... # Component styles
│ ├── helpers/ # Handlebars helpers
│ ├── img/ # Images
│ ├── js/ # JavaScript
│ │ ├── vendor/ # Third-party scripts
│ │ └── site.js # Main site script
│ ├── layouts/ # Page layouts
│ └── partials/ # Reusable template parts
│ ├── header.hbs # Site header
│ ├── footer.hbs # Site footer
│ └── ... # Other partials
The UI uses Handlebars for HTML templating. The main templates are:
layouts/default.hbs: Default page layoutpartials/header.hbs: Site headerpartials/footer.hbs: Site footerpartials/nav.hbs: Navigation sidebar
Templates have access to these variables:
| Variable | Description |
|---|---|
site |
Site-wide configuration |
page |
Current page information |
content |
Page content |
navigation |
Navigation structure |
components |
List of all components |
uiRootPath |
Path to UI assets |
The UI uses Tailwind CSS with custom components. Key concepts:
- Utility-first: Uses utility classes for most styling
- Component extraction: Common patterns extracted into components
- Responsive design: Mobile-first approach with breakpoints
The JavaScript is organized into modular components:
- Core modules: Basic functionality (navigation, search)
- Page-specific modules: Functionality for specific page types
- Utilities: Helper functions
Custom extensions follow this pattern:
module.exports.register = function (registry, context) {
registry.blockProcessor('myblock', function () {
// Extension logic
})
}Antora provides these extension points:
- Block processors: Process custom blocks
- Inline processors: Process inline content
- Tree processors: Modify the document AST
- Postprocessors: Work with the final document
Extensions have access to:
contentCatalog: All content pagessiteCatalog: Site structure informationplaybook: Antora playbook configuration
Each component should adhere to this structure:
component-name/
├── antora.yml
└── modules/
├── ROOT/
│ ├── nav.adoc
│ ├── pages/
│ │ ├── index.adoc
│ │ └── ...
│ ├── partials/
│ └── assets/
│ └── images/
└── [module-name]/
└── ...
Each component must have:
antora.yml: Component configurationmodules/ROOT/nav.adoc: Main navigation filemodules/ROOT/pages/index.adoc: Landing page
Components may include:
modules/*/partials/*.adoc: Reusable contentmodules/*/examples/*: Example filesmodules/*/assets/images/*: Image filesmodules/*/attachments/*: Downloadable files
| Script | Description |
|---|---|
convert_frontmatter.py |
Converts YAML frontmatter to AsciiDoc attributes |
convert_tabs.py |
Converts HTML tabs to AsciiDoc tabs |
update_image_blocks.py |
Updates image block syntax |
| Script | Description |
|---|---|
fetch-server-branches.sh |
Fetches server version branches |
gen-git-last-update-meta.sh |
Generates last update metadata |
update-xrefs.py |
Updates cross-references |
Most scripts can be run directly:
python scripts/convert_frontmatter.py path/to/file.adocOr through npm scripts defined in package.json.
| Variable | Description | Default |
|---|---|---|
FORCE_NPM_INSTALL |
Force reinstallation of UI dependencies | false |
LIVERELOAD |
Enable live reload for preview | true |
ALGOLIA_APP_ID |
Algolia search app ID | - |
ALGOLIA_API_KEY |
Algolia search API key | - |
ALGOLIA_INDEX_NAME |
Algolia search index name | - |
SEGMENT_WRITE_KEY |
Segment write key for analytics | - |
NODE_ENV |
Node environment | development |
The build process generates output in the build/ directory with this structure:
build/
├── 404.html # Not found page
├── index.html # Site landing page
├── sitemap.xml # Site map for search engines
├── robots.txt # Robots control file
├── _/ # UI assets
│ ├── css/ # Stylesheets
│ ├── js/ # JavaScript
│ ├── font/ # Fonts
│ └── img/ # Images
└── component-name/ # Component output
├── index.html # Component landing page
├── page-name/ # Directories for pages
│ └── index.html # Page output
└── _images/ # Component images
- UI assets: Stored in the
_/directory - Component assets: Stored in component-specific directories
- Images: Stored in
_images/directories - Attachments: Stored in
_attachments/directories
The URL structure follows this pattern:
- Component page:
/component-name/page-name.html - Module page:
/component-name/module-name/page-name.html - Image:
/component-name/_images/image-name.png - Attachment:
/component-name/_attachments/file-name.ext
The build process includes these optimizations:
- CSS minification: Reduces stylesheet size
- JavaScript bundling: Combines and minifies scripts
- Image optimization: Compresses images
- HTML compression: Reduces HTML size