apply template update

from https://pagure.io/fedora-docs/template
This commit is contained in:
sobek 2022-04-21 00:13:56 +02:00 committed by bcotton
commit 1bbd03327e
6 changed files with 31 additions and 25 deletions

View file

@ -38,14 +38,14 @@ This repository contains a minimal source structure for a new Fedora Docs source
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 Poject, 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.
**NOTE**: Please note that if you reference pages from other repositoreis, 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.
**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 work on Fedora (using Podman) and macOS (using Docker).

View file

@ -2,13 +2,13 @@
# 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: program_management # <---- PLEASE MODIFY
# Title will be visible on the page.
# Title will be visible on the page.
title: Fedora Program Management # <---- PLEASE MODIFY
# 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
# 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.

View file

@ -3,25 +3,30 @@
image="docker.io/antora/antora"
cmd="--html-url-extension-style=indexify site.yml"
if [ "$(uname)" == "Darwin" ]; then
if uname | grep -iwq darwin; then
# Running on macOS.
# Let's assume that the user has the Docker CE installed
# which doesn't require a root password.
echo ""
echo "This build script is using Docker container runtime to run the build in an isolated environment."
echo ""
docker run --rm -it -v $(pwd):/antora $image $cmd
docker run --rm -it -v "$(pwd):/antora" "${image}" ${cmd}
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
elif uname | grep -iq linux; then
# Running on Linux.
# there isn't an antora/aarch64 container, antora can be installed locally
# Check whether podman is available, else faill back to docker
# which requires root.
if [ -f /usr/bin/podman ]; then
if [ -f /usr/local/bin/antora ]; then
/usr/local/bin/antora "${cmd}"
elif uname -m | grep -iwq aarch64; then
echo "no antora/aarch64 container try just \`npm install -g @antora/cli @antora/site-generator-default\`"
elif [ -f /usr/bin/podman ]; then
echo ""
echo "This build script is using Podman to run the build in an isolated environment."
echo ""
podman run --rm -it -v $(pwd):/antora:z $image $cmd
podman run --rm -it -v "$(pwd):/antora:z" "${image}" ${cmd}
elif [ -f /usr/bin/docker ]; then
echo ""
@ -29,13 +34,14 @@ elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
echo ""
if groups | grep -wq "docker"; then
docker run --rm -it -v $(pwd):/antora:z $image $cmd
docker run --rm -it -v "$(pwd):/antora:z" "${image}" ${cmd}
else
echo "You might be asked for your password."
echo "You can avoid this by adding your user to the 'docker' group,"
echo "but be aware of the security implications."
echo "See https://docs.docker.com/install/linux/linux-postinstall/"
echo ""
echo "This build script is using $runtime to run the build in an isolated environment. You might be asked for your password."
echo "You can avoid this by adding your user to the 'docker' group, but be aware of the security implications. See https://docs.docker.com/install/linux/linux-postinstall/."
echo ""
sudo docker run --rm -it -v $(pwd):/antora:z $image $cmd
sudo docker run --rm -it -v "$(pwd):/antora:z" "${image}" ${cmd}
fi
else
echo ""

View file

@ -1,13 +1,13 @@
#!/bin/sh
if [ "$(uname)" == "Darwin" ]; then
if [ "$(uname)" = "Darwin" ]; then
# Running on macOS.
# Let's assume that the user has the Docker CE installed
# which doesn't require a root password.
echo "The preview will be available at http://localhost:8080/"
docker run --rm -v $(pwd):/antora:ro -v $(pwd)/nginx.conf:/etc/nginx/conf.d/default.conf:ro -p 8080:80 nginx
docker run --rm -v "$(pwd):/antora:ro" -v "$(pwd)/nginx.conf:/etc/nginx/conf.d/default.conf:ro" -p 8080:80 nginx
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
elif [ "$(expr substr "$(uname -s)" 1 5)" = "Linux" ]; then
# Running on Linux.
# Fedora Workstation has python3 installed as a default, so using that
echo ""

View file

@ -2,13 +2,13 @@
# 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: releases # <---- PLEASE MODIFY
# Title will be visible on the page.
# Title will be visible on the page.
title: Fedora Linux Releases # <---- PLEASE MODIFY
# 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
# 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.

View file

@ -1,6 +1,6 @@
site:
site:
title: Local Preview
start_page: program_management:ROOT:index.adoc
start_page: program_management::index.adoc
content:
sources:
- url: .
@ -13,11 +13,11 @@ ui:
url: https://gitlab.com/fedora/docs/docs-website/ui-bundle/-/jobs/artifacts/HEAD/raw/build/ui-bundle.zip?job=bundle-stable
snapshot: true
default_layout: with_menu
output:
clean: true
output:
clean: true
dir: ./public
destinations:
- provider: archive
destinations:
- provider: archive
runtime:
fetch: true
cache_dir: ./cache