From a0a8007355406d37c0a9626f7e31296d7dfea01b Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Holcroft Date: Feb 22 2020 12:34:23 +0000 Subject: [PATCH 1/3] add build and preview script --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..13d8eda --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +build +public +cache diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8a10b9c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM fedora:29 + +RUN dnf -y module install nodejs:10 && \ + dnf clean all + +RUN npm i -g @antora/cli@2.0 @antora/site-generator-default@2.0 + +WORKDIR /antora +ENTRYPOINT [ "antora" ] diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..a527e3d --- /dev/null +++ b/build.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +image="docker.io/antora/antora" +cmd="--html-url-extension-style=indexify site.yml" + +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 "" + echo "This build script is using Docker container runtime to run the build in an isolated environment." + echo "" + docker run -e "ANTORA_DATE=$(date -u)" --rm -it -v $(pwd):/antora $image $cmd + +elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then + # Running on Linux. + # Check whether podman is available, else faill back to docker + # which requires root. + + if [ -f /usr/bin/podman ]; then + echo "" + echo "This build script is using Podman to run the build in an isolated environment." + echo "" + podman run -e "ANTORA_DATE=$(date -u)" --rm -it -v $(pwd):/antora:z $image $cmd + + elif [ -f /usr/bin/docker ]; then + echo "" + echo "This build script is using Docker to run the build in an isolated environment." + echo "" + + if groups | grep -wq "docker"; then + docker run -e "ANTORA_DATE=$(date -u)" --rm -it -v $(pwd):/antora:z $image $cmd + else + 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 -e "ANTORA_DATE=$(date -u)" --rm -it -v $(pwd):/antora:z $image $cmd + fi + else + echo "" + echo "Error: Container runtime haven't been found on your system. Fix it by:" + echo "$ sudo dnf install podman" + exit 1 + fi +fi diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..f7093b3 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,14 @@ +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; + } +} diff --git a/preview.sh b/preview.sh new file mode 100755 index 0000000..6c40fc9 --- /dev/null +++ b/preview.sh @@ -0,0 +1,19 @@ +#!/bin/sh + + +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 + +elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then + # Running on Linux. + # Fedora Workstation has python3 installed as a default, so using that + echo "" + echo "The preview is available at http://localhost:8080" + echo "" + cd ./public + python3 -m http.server 8080 +fi diff --git a/site.yml b/site.yml new file mode 100644 index 0000000..fbabd6d --- /dev/null +++ b/site.yml @@ -0,0 +1,24 @@ +site: + title: Local Preview - Documentation Guide + start_page: documentation-guide::index +content: + sources: + - url: . + start_path: homepage + - url: . + start_path: engineering + - url: . + start_path: mindshare +ui: + bundle: + url: https://asamalik.fedorapeople.org/ui-bundle.zip + snapshot: true + default_layout: with_menu +output: + clean: true + dir: ./public + destinations: + - provider: archive +runtime: + pull: true + cache_dir: ./cache From 43b30a62efb7e5b51dbbbe07be5fdc802e2bc657 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Holcroft Date: Feb 22 2020 12:37:51 +0000 Subject: [PATCH 2/3] add localization group --- diff --git a/mindshare/modules/ROOT/pages/index.adoc b/mindshare/modules/ROOT/pages/index.adoc index 0a236f6..3ebcc82 100644 --- a/mindshare/modules/ROOT/pages/index.adoc +++ b/mindshare/modules/ROOT/pages/index.adoc @@ -19,4 +19,6 @@ Mindshare Teams are focused on helping our community grow both the number of use * xref:ask-fedora-sops:ROOT:index.adoc[**Ask Fedora SOPs**] - Standard operating procedures for the link:https://ask.fedoraproject.org/[Ask Fedora forums]. -* xref:localization:ROOT:index.adoc[**Fedora Docs Localization Stats**] - Statistics about this site's localization. +* xref:localization:ROOT:index.adoc[**Fedora Localization Project**] - The Fedora Localization Project. + +* xref:docs-l10n:ROOT:index.adoc[**Fedora Docs Localization Stats**] - Statistics about the Fedora documentation localization progress.