diff --git a/Makefile b/Makefile index 0f96efe81adf69d6570426056eda1b5cd9c08340..d721e515e92263a9f3f45e30488567537a0cf9cd 100644 --- a/Makefile +++ b/Makefile @@ -46,6 +46,7 @@ help: html: "$(PELICAN)" "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(CONFFILE)" $(PELICANOPTS) + ./scripts/create_default_pages.sh clean: [ ! -d "$(OUTPUTDIR)" ] || rm -rf "$(OUTPUTDIR)" diff --git a/pelicanconf.py b/pelicanconf.py index f7f171946e49d9256af19d378efe3f97188769c6..1b0945d16aa47135d27685ac54b4f9b0d0967bd6 100644 --- a/pelicanconf.py +++ b/pelicanconf.py @@ -1,6 +1,6 @@ AUTHOR = "Funkwhale Collective" SITENAME = "Funkwhale" -SITEURL = "http://localhost:8000" +SITEURL = "" PATH = "content" OUTPUT_PATH = "public/" @@ -41,6 +41,11 @@ THEME = "theme" PAGE_PATHS = [""] ARTICLE_PATHS = ["articles"] +PAGE_LANG_URL = "{slug}" +# We write all pages in their language and have a rule in the makefile to +# use the english one as fallback if there is no translated version for a +# language +PAGE_LANG_SAVE_AS = "{slug}/{lang}.html" PAGE_URL = "{slug}" PAGE_SAVE_AS = "{slug}/index.html" diff --git a/scripts/create_default_pages.sh b/scripts/create_default_pages.sh new file mode 100755 index 0000000000000000000000000000000000000000..a2c519ff634a8103641a19bae00d4611db41bd30 --- /dev/null +++ b/scripts/create_default_pages.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +for f in $(find public -name en.html); do + newfile=${f/en.html/index.html} + if [ ! -f "$newfile" ]; then + mv $f $newfile + fi +done