This is the main documentation repository for the documentation available at https://docs.giantswarm.io.
It holds the main content of our documentation. The documentation site is created using the static site generator HUGO based on markdown files in the src/content/ directory of the docs repository.
Additional content is tied in through the scripts
scripts/aggregate-changelogs: Aggregates changelog entries into thesrc/content/changesdestination.scripts/collect-changelog-entries: Collects changelog entries from all apps defined ingiantswarm/githubrepository to create a weekly update.scripts/update-crd-reference: Generates reference pages for our custom resource definitions in thesrc/content/reference/platform-apidestination.scripts/update-external-repos: Tutorials that need their own code repository. They must have adocssubfolder with the Markdown content and optionally some images. Configuration is found inscripts/update-external-repos/repositories.txt.scripts/update-helm-chart-reference: Creates the cluster apps pages in thesrc/content/reference/platform-apidestination.
To update these external content types, the Makefile provides specific targets:
make changesmake update-external-reposmake collect-changelog-entriesmake update-cluster-app-referencemake update-crd-reference
All pull requests to this repository will trigger a build of the documentation site. The site is hosted in a Cluster API environment (gazelle) and it's deployed to https://docs.giantswarm.io automatically thanks to GitOps setup.
We welcome any contributions on content to this repository in the form of pull requests!
Please review the style guidelines before contributing.
While making changes, please use
make devto render the results. This serves the web content on http://localhost:1313/ by default. Please check if your changes display correctly before opening a pull request.
This repository provides a dev container configuration. When making changes to documentation content, we encourage you to use the container and give feedback to SIG docs. Prerequisites:
- IDE with dev container support (e.g. Visual Studio Code with the "Dev Containers" (
ms-vscode-remote.remote-containers) extension. - Docker
- at least 4 GiB of memory dedicated to Docker
Each documentation page consists of a markdown file that starts with some metadata called front matter. Some hints:
- Please look at the other pages to get an idea of what the front matter is good for.
- When your page's
titleis too long for the navigation menu, add alinkTitlefield with a short title. - Please double-check whether the
descriptionis still up-to-date or could be improved. It will often show up Google search results.
Special front matter fields we use:
last_review_date: Date of the last time somebody checked the entire page for validity.menu: The menu entry under which the page should appear. Currently it'sprincipalfor the main menu, vintage documentation is undermain.owner: List of GitHub team URLs for the team(s) or SIG(s) owning the page. The owning team/SIG is the one responsible for keeping the content up-to-date and useful.user_questions: List of questions this article answers. Written from a user's perspective. E. g. How do I ....
Shortcodes allow the use of a string in any number of places in the docs, while maintaining it only in one place. We use these to place, for example, configuration details. The goal here is to give users accurate, complete and up-to-date information.
Shortcodes exist as one file each in the folder src/layouts/shortcodes.
A shortcode is used in a markdown file like this:
## Using mixed instance types (only {{% impl_title "capa_ec2" %}})When writing docs content, the linters can help you a great deal to keep the content consistent and clean. Ideally run the linters as pre-commit hooks.
To install: pre-commit install --install-hooks.
Linters will then be executed automatically before committing.
The vale linter will check spelling. If vale complaints about a word that is spelled correctly, add it to the dictionary. If the term is a technical identifier like CAPMOXDatastoreAlloc, don't add it to the dictionary, and wrap it in backticks instead.
When editing content in Microsoft Visual Studio Code, you can also use the vale-vscode extension to see errors and editing suggestions while you write.
To keep third party style rules up-to-date, please run make lint-prose-update and commit the resulting changes.
Search on https://docs.giantswarm.io is self-hosted. The search button in the header opens a modal that searches as you type and lists the matching documentation pages, with release notes from /changes in a separate Changes group. If a request fails or runs into the rate limit, the modal offers a Google site: search instead.
The modal queries /searchapi, a gateway on docs-proxy. That gateway is the only public path to sitesearch, the OpenSearch instance that also holds internal indexes, so it takes a query string and a type filter and nothing else. docs-indexer fills the docs index from this repository, so a merged page becomes searchable without waiting for a crawler.
Three files make up the search:
src/assets/scripts/gs_scripts.jsdrives the modal and calls the gateway.scripts/update-website-content/search-modal.htmlholds the modal markup.scripts/update-website-content/overrides.cssholds the styles.
The markup and styles also appear in src/layouts/partials/gs_header.html and src/layouts/partials/gs_header_styles.html, but make update-website-content generates both of those from the two files above. Edit the sources, never the generated partials.
To try search locally, run make dev. It starts scripts/search-proxy/searchapi-proxy.js alongside the Hugo server, which forwards /searchapi to the production site, so the modal works from a single local origin.
Search analytics go to TelemetryDeck from src/layouts/partials/telemetry.html. They are switched off, because the privacy policy does not document the collection yet. Once it does, set searchTelemetry: true in src/config.yaml to turn them on.
scripts/search-eval/ measures how often search returns a correct page. Run it again after a ranking or index change to confirm the hit rate holds.
We use mermaid for diagrams. You need to annotate the page previously in the front matter to load the mermaid code (mermaid: true). Then you can use the shortcode {{< mermaid >}} to add the diagram code.
The header and footer are to be kept in sync with www.giantswarm.io. In order to do this we copy the HTML and CSS specific to those parts of the page.
Files starting with gs_ are involved in making the header and footer appear and behave correctly.
partials/gs_header.html - The unedited html of the header at www.giantswarm.io
partials/gs_mobile_menu.html - The unedited html of the mobile navigation menu at www.giantswarm.io
partials/gs_footer.html - The unedited html of the footer at www.giantswarm.io
partials/gs_styles.html - Automatically extracted styles which apply to
elements found in the header and footer, as well
as hand written override styles to make it play nicely
with CSS already present in docs.
scripts/gs_menu.js - Hand written javascript that recreates the interactive
functionality of the navigation menus.
The content in this repository is licensed under the Creative Commons Attribution ShareAlike license.
For attribution, please use either:
- Giant Swarm
- giantswarm.io
and link, if possible, to https://www.giantswarm.io/