From 79c20a3f8d94bdb4cfde08830747f32b0d2aabd9 Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Holcroft <jean-baptiste@holcroft.fr>
Date: May 17 2019 09:36:42 +0000
Subject: [PATCH 1/2] automatic generation of site.yml for languages


---

diff --git a/prepare-translated.py b/prepare-translated.py
new file mode 100755
index 0000000..d81f9bb
--- /dev/null
+++ b/prepare-translated.py
@@ -0,0 +1,48 @@
+#!/usr/bin/env python3
+"""Prepare site.yml for each translated sites"""
+
+import os
+import subprocess
+import tempfile
+import yaml
+
+def main():
+    """ Read site.yml content, replace `sources` content with localized content"""
+    lang_sources = get_language_sources()
+
+    with open("site.yml", 'r') as stream:
+        data_loaded = yaml.load(stream, Loader=yaml.SafeLoader)
+
+    for lang in lang_sources:
+        print(lang)
+
+        with open('site-'+lang+'.yml', 'w') as outfile:
+            data_loaded['content']['sources'] = lang_sources[lang]
+            yaml.dump(data_loaded, outfile, default_flow_style=False)
+
+
+def get_language_sources():
+    """ Get the list of languages + modules + branches from translated-sources"""
+    sources = {}
+    with tempfile.TemporaryDirectory() as tmp:
+        t_sources_url = "https://pagure.io/fedora-docs/translated-sources.git"
+        subprocess.run(["git", "clone", t_sources_url], check=True, cwd=tmp)
+
+        path = tmp+"/translated-sources"
+
+        # we don't want ".git" folder
+        langs = [d for d in next(os.walk(path))[1] if not d[0] == '.']
+        for lang in langs:
+            sources[lang] = []
+            for module in next(os.walk(path+"/"+lang))[1]:
+                for branch in next(os.walk(path+"/"+lang + "/" + module))[1]:
+                    hop = {}
+                    hop["url"] = t_sources_url
+                    hop["start_path"] = lang+"/"+module+"/"+branch
+                    sources[lang].append(hop)
+
+    return sources
+
+
+if __name__ == '__main__':
+    main()
diff --git a/site-cs.yml b/site-cs.yml
index 56dc56d..4d407cb 100644
--- a/site-cs.yml
+++ b/site-cs.yml
@@ -1,141 +1,80 @@
-site: 
-  title: Fedora Docs Site 
-  url: https://docs.fedoraproject.org
-  start_page: docs::index.adoc
+asciidoc:
+  extensions:
+  - ./lib/extensions/package-inline-macro.js
 content:
   branches: master
   sources:
-##### Translated sources #####
-
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: cs/project/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: cs/docs/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: cs/quick-docs/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: cs/engineering/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: cs/badges/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: cs/containers/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: cs/mentored-projects/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: cs/fedora-silverblue/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: cs/diversity-inclusion/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: cs/fesco/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: cs/neurofedora/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: cs/fedora/rawhide
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: cs/fedora/f28
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: cs/fedora/f26
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: cs/fedora/f29
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: cs/fedora/f27
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: cs/teleirc-sig/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: cs/remix-building/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: cs/java-packaging-howto/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: cs/mindshare/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: cs/iot/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: cs/modularity/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: cs/mindshare-committee/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: cs/packaging-guidelines/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: cs/flatpak/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: cs/commops/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: cs/fedora-docs/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: cs/council/master
-
-##### Original sources #####
-# (Translated pieces are commented out)
-
-#  - url: .
-#    start_path: pages/homepage
-#   - url: .
-#     start_path: pages/engineering
-#   - url: .
-#     start_path: pages/mindshare
-#   - url: https://pagure.io/fedora-docs/release-docs-home.git
-#     branches:
-#     - master
-#    - f29
-#    - f28
-#     - f27
-#     - f26
-#   - url: https://pagure.io/fedora-docs/install-guide.git
-#     branches:
-#     - master
-#    - f29
-#    - f28
-#     - f27
-#     - f26
-#   - url: https://pagure.io/fedora-docs/system-administrators-guide.git
-#     branches:
-#     - master
-#     - f29
-#     - f28
-#     - f27
-#     - f26
-#   - url: https://pagure.io/fedora-docs/release-notes.git
-#     branches:
-#     - master
-#    - f29
-#    - f28
-#     - f27
-#     - f26
-#   - url: https://pagure.io/fedora-docs/quick-docs.git
-#   - url: https://pagure.io/mentored-projects.git
-#   - url: https://pagure.io/fedora-commops.git
-#     start_path: docs
-#   - url: https://pagure.io/Fedora-Council/council-docs.git
-#     start_path: council
-#   - url: https://pagure.io/Fedora-Council/council-docs.git
-#     start_path: project
-#   - url: https://pagure.io/fedora-docs/modularity.git
-#   - url: https://pagure.io/fedora-docs/documentation-contributors-guide.git
-#   - url: https://pagure.io/fedora-docs/flatpak.git
-#   - url: https://pagure.io/fedora-diversity.git
-#   - url: https://pagure.io/packaging-committee.git
-#     start_path: guidelines
-#   - url: https://pagure.io/mindshare.git
-#     start_path: website
-#   - url: https://pagure.io/fesco/fesco-docs.git
-#     start_path: fesco
-#   - url: https://pagure.io/fedora-iot/iot-docs.git
-#   - url: https://pagure.io/fedora-badges.git
-#     start_path: docs
+  - start_path: cs/teleirc-sig/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: cs/remix-building/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: cs/quick-docs/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: cs/project/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: cs/packaging-guidelines/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: cs/neurofedora/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: cs/modularity/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: cs/mindshare/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: cs/mindshare-committee/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: cs/mentored-projects/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: cs/java-packaging-howto/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: cs/iot/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: cs/flatpak/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: cs/fesco/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: cs/fedora/rawhide
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: cs/fedora/f29
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: cs/fedora/f28
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: cs/fedora/f27
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: cs/fedora/f26
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: cs/fedora-silverblue/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: cs/fedora-docs/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: cs/engineering/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: cs/docs/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: cs/diversity-inclusion/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: cs/council/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: cs/containers/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: cs/commops/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: cs/badges/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+output:
+  clean: true
+  destinations:
+  - provider: archive
+  dir: ./public/en-US
+runtime:
+  cache_dir: ./cache
+  pull: true
+site:
+  start_page: docs::index.adoc
+  title: Fedora Docs Site
+  url: https://docs.fedoraproject.org/en-US/
 ui:
   bundle:
-    url: https://asamalik.fedorapeople.org/docs-translations/ui-bundle.zip
     snapshot: true
+    url: https://asamalik.fedorapeople.org/docs-translations/ui-bundle.zip
   default_layout: with_menu
   supplemental_files: ./supplemental-ui
-output: 
-  clean: true 
-  dir: ./public/cs
-  destinations: 
-  - provider: archive 
-runtime:
-  pull: true
-  cache_dir: ./cache
-asciidoc:
-  extensions:
-  - ./lib/extensions/package-inline-macro.js
diff --git a/site-fr.yml b/site-fr.yml
index 8e463a2..0f86a5c 100644
--- a/site-fr.yml
+++ b/site-fr.yml
@@ -1,141 +1,84 @@
-site: 
-  title: Fedora Docs Site 
-  url: https://docs.fedoraproject.org
-  start_page: docs::index.adoc
+asciidoc:
+  extensions:
+  - ./lib/extensions/package-inline-macro.js
 content:
   branches: master
   sources:
-##### Translated sources #####
-
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: fr/project/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: fr/docs/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: fr/quick-docs/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: fr/engineering/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: fr/badges/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: fr/containers/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: fr/mentored-projects/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: fr/fedora-silverblue/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: fr/diversity-inclusion/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: fr/fesco/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: fr/neurofedora/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: fr/fedora/rawhide
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: fr/fedora/f28
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: fr/fedora/f26
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: fr/fedora/f29
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: fr/fedora/f27
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: fr/teleirc-sig/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: fr/remix-building/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: fr/java-packaging-howto/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: fr/mindshare/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: fr/iot/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: fr/modularity/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: fr/mindshare-committee/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: fr/packaging-guidelines/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: fr/flatpak/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: fr/commops/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: fr/fedora-docs/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: fr/council/master
-
-##### Original sources #####
-# (Translated pieces are commented out)
-
-#  - url: .
-#    start_path: pages/homepage
-#   - url: .
-#     start_path: pages/engineering
-#   - url: .
-#     start_path: pages/mindshare
-#   - url: https://pagure.io/fedora-docs/release-docs-home.git
-#     branches:
-#     - master
-#    - f29
-#    - f28
-#     - f27
-#     - f26
-#   - url: https://pagure.io/fedora-docs/install-guide.git
-#     branches:
-#     - master
-#    - f29
-#    - f28
-#     - f27
-#     - f26
-#   - url: https://pagure.io/fedora-docs/system-administrators-guide.git
-#     branches:
-#     - master
-#     - f29
-#     - f28
-#     - f27
-#     - f26
-#   - url: https://pagure.io/fedora-docs/release-notes.git
-#     branches:
-#     - master
-#    - f29
-#    - f28
-#     - f27
-#     - f26
-#   - url: https://pagure.io/fedora-docs/quick-docs.git
-#   - url: https://pagure.io/mentored-projects.git
-#   - url: https://pagure.io/fedora-commops.git
-#     start_path: docs
-#   - url: https://pagure.io/Fedora-Council/council-docs.git
-#     start_path: council
-#   - url: https://pagure.io/Fedora-Council/council-docs.git
-#     start_path: project
-#   - url: https://pagure.io/fedora-docs/modularity.git
-#   - url: https://pagure.io/fedora-docs/documentation-contributors-guide.git
-#   - url: https://pagure.io/fedora-docs/flatpak.git
-#   - url: https://pagure.io/fedora-diversity.git
-#   - url: https://pagure.io/packaging-committee.git
-#     start_path: guidelines
-#   - url: https://pagure.io/mindshare.git
-#     start_path: website
-#   - url: https://pagure.io/fesco/fesco-docs.git
-#     start_path: fesco
-#   - url: https://pagure.io/fedora-iot/iot-docs.git
-#   - url: https://pagure.io/fedora-badges.git
-#     start_path: docs
+  - start_path: fr/teleirc-sig/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: fr/taiga-docs/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: fr/remix-building/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: fr/quick-docs/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: fr/project/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: fr/packaging-guidelines/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: fr/neurofedora/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: fr/modularity/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: fr/mindshare/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: fr/mindshare-committee/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: fr/mentored-projects/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: fr/java-packaging-howto/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: fr/iot/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: fr/flatpak/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: fr/fesco/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: fr/fedora/rawhide
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: fr/fedora/f29
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: fr/fedora/f28
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: fr/fedora/f27
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: fr/fedora/f26
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: fr/fedora-silverblue/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: fr/fedora-docs/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: fr/engineering/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: fr/docs/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: fr/diversity-inclusion/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: fr/council/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: fr/containers/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: fr/commops/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: fr/ci/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: fr/badges/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+output:
+  clean: true
+  destinations:
+  - provider: archive
+  dir: ./public/en-US
+runtime:
+  cache_dir: ./cache
+  pull: true
+site:
+  start_page: docs::index.adoc
+  title: Fedora Docs Site
+  url: https://docs.fedoraproject.org/en-US/
 ui:
   bundle:
-    url: https://asamalik.fedorapeople.org/docs-translations/ui-bundle.zip
     snapshot: true
+    url: https://asamalik.fedorapeople.org/docs-translations/ui-bundle.zip
   default_layout: with_menu
   supplemental_files: ./supplemental-ui
-output: 
-  clean: true 
-  dir: ./public/fr
-  destinations: 
-  - provider: archive 
-runtime:
-  pull: true
-  cache_dir: ./cache
-asciidoc:
-  extensions:
-  - ./lib/extensions/package-inline-macro.js
diff --git a/site-ja.yml b/site-ja.yml
new file mode 100644
index 0000000..3633ba2
--- /dev/null
+++ b/site-ja.yml
@@ -0,0 +1,80 @@
+asciidoc:
+  extensions:
+  - ./lib/extensions/package-inline-macro.js
+content:
+  branches: master
+  sources:
+  - start_path: ja/teleirc-sig/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: ja/remix-building/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: ja/quick-docs/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: ja/project/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: ja/packaging-guidelines/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: ja/neurofedora/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: ja/modularity/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: ja/mindshare/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: ja/mindshare-committee/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: ja/mentored-projects/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: ja/java-packaging-howto/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: ja/iot/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: ja/flatpak/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: ja/fesco/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: ja/fedora/rawhide
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: ja/fedora/f29
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: ja/fedora/f28
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: ja/fedora/f27
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: ja/fedora/f26
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: ja/fedora-silverblue/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: ja/fedora-docs/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: ja/engineering/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: ja/docs/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: ja/diversity-inclusion/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: ja/council/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: ja/containers/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: ja/commops/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+  - start_path: ja/badges/master
+    url: https://pagure.io/fedora-docs/translated-sources.git
+output:
+  clean: true
+  destinations:
+  - provider: archive
+  dir: ./public/en-US
+runtime:
+  cache_dir: ./cache
+  pull: true
+site:
+  start_page: docs::index.adoc
+  title: Fedora Docs Site
+  url: https://docs.fedoraproject.org/en-US/
+ui:
+  bundle:
+    snapshot: true
+    url: https://asamalik.fedorapeople.org/docs-translations/ui-bundle.zip
+  default_layout: with_menu
+  supplemental_files: ./supplemental-ui
diff --git a/site-jp.yml b/site-jp.yml
deleted file mode 100644
index 9bd7669..0000000
--- a/site-jp.yml
+++ /dev/null
@@ -1,141 +0,0 @@
-site: 
-  title: Fedora Docs Site 
-  url: https://docs.fedoraproject.org
-  start_page: docs::index.adoc
-content:
-  branches: master
-  sources:
-##### Translated sources #####
-
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: jp/project/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: jp/docs/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: jp/quick-docs/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: jp/engineering/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: jp/badges/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: jp/containers/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: jp/mentored-projects/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: jp/fedora-silverblue/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: jp/diversity-inclusion/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: jp/fesco/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: jp/neurofedora/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: jp/fedora/rawhide
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: jp/fedora/f28
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: jp/fedora/f26
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: jp/fedora/f29
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: jp/fedora/f27
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: jp/teleirc-sig/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: jp/remix-building/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: jp/java-packaging-howto/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: jp/mindshare/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: jp/iot/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: jp/modularity/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: jp/mindshare-committee/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: jp/packaging-guidelines/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: jp/flatpak/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: jp/commops/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: jp/fedora-docs/master
-  - url: https://pagure.io/fedora-docs/translated-sources.git
-    start_path: jp/council/master
-
-##### Original sources #####
-# (Translated pieces are commented out)
-
-#  - url: .
-#    start_path: pages/homepage
-#   - url: .
-#     start_path: pages/engineering
-#   - url: .
-#     start_path: pages/mindshare
-#   - url: https://pagure.io/fedora-docs/release-docs-home.git
-#     branches:
-#     - master
-#    - f29
-#    - f28
-#     - f27
-#     - f26
-#   - url: https://pagure.io/fedora-docs/install-guide.git
-#     branches:
-#     - master
-#    - f29
-#    - f28
-#     - f27
-#     - f26
-#   - url: https://pagure.io/fedora-docs/system-administrators-guide.git
-#     branches:
-#     - master
-#     - f29
-#     - f28
-#     - f27
-#     - f26
-#   - url: https://pagure.io/fedora-docs/release-notes.git
-#     branches:
-#     - master
-#    - f29
-#    - f28
-#     - f27
-#     - f26
-#   - url: https://pagure.io/fedora-docs/quick-docs.git
-#   - url: https://pagure.io/mentored-projects.git
-#   - url: https://pagure.io/fedora-commops.git
-#     start_path: docs
-#   - url: https://pagure.io/Fedora-Council/council-docs.git
-#     start_path: council
-#   - url: https://pagure.io/Fedora-Council/council-docs.git
-#     start_path: project
-#   - url: https://pagure.io/fedora-docs/modularity.git
-#   - url: https://pagure.io/fedora-docs/documentation-contributors-guide.git
-#   - url: https://pagure.io/fedora-docs/flatpak.git
-#   - url: https://pagure.io/fedora-diversity.git
-#   - url: https://pagure.io/packaging-committee.git
-#     start_path: guidelines
-#   - url: https://pagure.io/mindshare.git
-#     start_path: website
-#   - url: https://pagure.io/fesco/fesco-docs.git
-#     start_path: fesco
-#   - url: https://pagure.io/fedora-iot/iot-docs.git
-#   - url: https://pagure.io/fedora-badges.git
-#     start_path: docs
-ui:
-  bundle:
-    url: https://asamalik.fedorapeople.org/docs-translations/ui-bundle.zip
-    snapshot: true
-  default_layout: with_menu
-  supplemental_files: ./supplemental-ui
-output: 
-  clean: true 
-  dir: ./public/jp
-  destinations: 
-  - provider: archive 
-runtime:
-  pull: true
-  cache_dir: ./cache
-asciidoc:
-  extensions:
-  - ./lib/extensions/package-inline-macro.js

From 746dcc7711444816c3190f9b4f802a72619ca054 Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Holcroft <jean-baptiste@holcroft.fr>
Date: May 17 2019 09:50:28 +0000
Subject: [PATCH 2/2] automatically detect list of languages


---

diff --git a/build-translated.sh b/build-translated.sh
index 9317248..11b657c 100755
--- a/build-translated.sh
+++ b/build-translated.sh
@@ -1,6 +1,14 @@
 #!/bin/bash
 
-languages="cs fr jp"
+languages=""
+
+for file in site-*;
+do
+    # we have site-???.yml, we want ???
+    suffix=${file:5} # remove "site-"
+    lang=${suffix%.yml}   # remove ".yml"
+    languages="$languages $lang"
+done
 
 create_language_menu() {
     {

