Sync with fedora-docs-template
Synced from https://gitlab.com/fedora/docs/templates/fedora-docs-template
This commit is contained in:
parent
57fc58d0b3
commit
e0e02ef160
4 changed files with 106 additions and 35 deletions
7
.gitignore
vendored
7
.gitignore
vendored
|
|
@ -1,3 +1,4 @@
|
|||
build/
|
||||
cache/
|
||||
public/
|
||||
/build/
|
||||
/cache/
|
||||
/public/
|
||||
/preview.pid
|
||||
|
|
|
|||
118
README.md
118
README.md
|
|
@ -7,55 +7,119 @@ This repository contains the Fedora Silverblue documentation.
|
|||
```
|
||||
|-- README.md
|
||||
|-- antora.yml ....................... 1.
|
||||
|-- build.sh ......................... 2.
|
||||
|-- preview.sh ....................... 3.
|
||||
|-- nginx.conf ....................... 4.
|
||||
|-- site.yml ......................... 5.
|
||||
|-- docsbuilder.sh ................... 2.
|
||||
|-- nginx.conf ....................... 3.
|
||||
|-- site.yml ......................... 4.
|
||||
`-- modules
|
||||
`-- ROOT ......................... 6.
|
||||
`-- ROOT ......................... 5.
|
||||
|-- assets
|
||||
| `-- images ............... 7.
|
||||
| `-- images ............... 6.
|
||||
| `-- *
|
||||
|-- nav.adoc ................. 8.
|
||||
`-- pages .................... 9.
|
||||
|-- *
|
||||
|-- nav.adoc ................. 7.
|
||||
`-- pages .................... 8.
|
||||
`-- *.adoc
|
||||
```
|
||||
|
||||
1. Metadata definition.
|
||||
2. A script that does a local build. Uses podman or docker.
|
||||
3. A script that shows a preview of the site in a web browser by running a local web server. Uses podman or docker.
|
||||
4. A configuration file used by the local preview web server.
|
||||
5. A definition file for the build script.
|
||||
6. A "root module of this documentation component". Please read below for an explanation.
|
||||
7. **Images** to be used on any page.
|
||||
8. **Menu definition.** Also defines the hierarchy of all the pages.
|
||||
9. **Pages with the actual content.** They can be also organised into subdirectories if desired.
|
||||
2. A script that does a local build. It shows a preview of the site in a web browser by running a local web server. Uses podman or Docker.
|
||||
3. A configuration file used by the local preview web server.
|
||||
4. A definition file for the build script.
|
||||
5. A "root module of this documentation component". Please read below for an explanation.
|
||||
6. **Images** to be used on any page.
|
||||
7. **Menu definition.** Also defines the hierarchy of all the pages.
|
||||
8. **Pages with the actual content.** They can be also organised into subdirectories if desired.
|
||||
|
||||
## Components and Modules
|
||||
|
||||
Antora introduces two new terms:
|
||||
|
||||
* **Component** — Simply put, a component is a part of the documentation website with its own menu. Components can also be versioned. In the Fedora Docs, we use separate components for user documentation, the Fedora Project, Fedora council, Mindshare, FESCO, but also subprojects such as CommOps or Modulartity.
|
||||
* **Component** — Simply put, a component is a part of the documentation website with its own menu. Components can also be versioned. In the Fedora Docs, we use separate components for user documentation, the Fedora Project, Fedora council, Mindshare, FESCO, but also subprojects such as CommOps or Modularity.
|
||||
* **Module** — A component can be broken down into multiple modules. Modules still share a single menu on the site, but their sources can be stored in different git repositories, even owned by different groups. The default module is called "ROOT" (that's what is in this example). If you don't want to use multiple modules, only use "ROOT". But to define more modules, simply duplicate the "ROOT" directory and name it anything you want. You can store modules in one or more git repositories.
|
||||
|
||||
## Local preview
|
||||
|
||||
This repo includes scripts to build and preview the contents of this repository.
|
||||
This repo includes a script to build and preview the contents of this repository.
|
||||
|
||||
**NOTE**: Please note that if you reference pages from other repositories, such links will be broken in this local preview as it only builds this repository. If you want to rebuild the whole Fedora Docs site, please see [the Fedora Docs build repository](https://pagure.io/fedora-docs/docs-fp-o/) for instructions.
|
||||
|
||||
Both scripts use either podman or docker, so please make sure you have one of the two installed on your system.
|
||||
|
||||
To enable docker run:
|
||||
|
||||
```
|
||||
$ sudo systemctl start docker && sudo systemctl enable docker
|
||||
```
|
||||
The script works on Fedora (using Podman or Docker) and macOS (using Docker).
|
||||
|
||||
To build and preview the site, run:
|
||||
|
||||
```
|
||||
$ ./build.sh && ./preview.sh
|
||||
$ ./docsbuilder.sh -p
|
||||
```
|
||||
|
||||
The result will be available at http://localhost:8080
|
||||
|
||||
To stop the preview:
|
||||
|
||||
```
|
||||
$ ./docsbuilder.sh -k
|
||||
|
||||
```
|
||||
|
||||
### Installing Podman on Fedora
|
||||
|
||||
Fedora Workstation doesn't come with Podman preinstalled by default — so you might need to install it using the following command:
|
||||
|
||||
```
|
||||
$ sudo dnf install podman
|
||||
```
|
||||
|
||||
### Preview as a part of the whole Fedora Docs site
|
||||
|
||||
You can also build the whole Fedora Docs site locally to see your changes in the whole context.
|
||||
This is especially useful for checking if your `xref` links work properly.
|
||||
|
||||
To do this, you need to clone the main [Fedora Docs build repository](https://pagure.io/fedora-docs/docs-fp-o), modify the `site.yml` file to reference a repo with your changes, and build it.
|
||||
Steps:
|
||||
|
||||
Clone the main repository and cd into it:
|
||||
|
||||
```
|
||||
$ git clone https://pagure.io/fedora-docs/docs-fp-o.git
|
||||
$ cd docs-fp-o
|
||||
```
|
||||
|
||||
Find a reference to the repository you're changing in the `site.yml` file, and change it so it points to your change.
|
||||
So for example, if I made a modification to the Modularity docs, I would find:
|
||||
|
||||
```
|
||||
...
|
||||
- url: https://pagure.io/fedora-docs/modularity.git
|
||||
branches:
|
||||
- master
|
||||
...
|
||||
```
|
||||
|
||||
And replaced it with a pointer to my fork:
|
||||
```
|
||||
...
|
||||
- url: https://pagure.io/forks/asamalik/fedora-docs/modularity.git
|
||||
branches:
|
||||
- master
|
||||
...
|
||||
```
|
||||
|
||||
I could also point to a local repository, using `HEAD` as a branch to preview the what's changed without the need of making a commit.
|
||||
|
||||
**Note:** I would need to move the repository under the `docs-fp-o` directory, because the builder won't see anything above.
|
||||
So I would need to create a `repositories` directory in `docs-fp-o` and copy my repository into it.
|
||||
|
||||
```
|
||||
...
|
||||
- url: ./repositories/modularity
|
||||
branches:
|
||||
- HEAD
|
||||
...
|
||||
```
|
||||
|
||||
To build the whole site, I would run the following in the `docs-fp-o` directory.
|
||||
|
||||
```
|
||||
$ ./docsbuilder.sh -p
|
||||
```
|
||||
# License
|
||||
|
||||
SPDX-License-Identifier: CC-BY-SA-4.0
|
||||
|
|
|
|||
16
antora.yml
16
antora.yml
|
|
@ -1,14 +1,20 @@
|
|||
# Name will be mostly visible in the URL. Treat it as an indentifier.
|
||||
# Tip: If you want to use the local preview scripts that come with this repository, please change this value in the site.yml file as well. (under site/start_page)
|
||||
# Name will be mostly visible in the URL. Treat it as an identifier.
|
||||
# Tip: If you want to use the local preview scripts that come with this
|
||||
# repository, please change this value in the site.yml file as well (under
|
||||
# site/start_page)
|
||||
name: fedora-silverblue
|
||||
|
||||
# Title will be visible on the page.
|
||||
title: Fedora Silverblue
|
||||
|
||||
# If you don't plan to have multiple versions of the docs (for example, to document multiple versions of some software), you can ignore this field. Otherwise, change "master" to a specific version.
|
||||
version: master
|
||||
# If you don't plan to have multiple versions of the docs (for example, to
|
||||
# document multiple versions of some software), you can ignore this field.
|
||||
# Otherwise, change "~" to a specific version.
|
||||
version: ~
|
||||
|
||||
# We encourage you to name the index page as "index.adoc". If you absolutely have to use a different name, please reflect it here. You can ignore this field otherwise.
|
||||
# We encourage you to name the index page as "index.adoc". If you absolutely
|
||||
# have to use a different name, please reflect it here. You can ignore this
|
||||
# field otherwise.
|
||||
start_page: ROOT:index.adoc
|
||||
|
||||
# This lists all the menu definitions of your component.
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
|
||||
location / {
|
||||
root /antora/public;
|
||||
index index.html index.htm;
|
||||
}
|
||||
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue