README.md

Fedora Loves KDE website

This is source repo for the website available at https://fedoraloveskde.org/. The staging deployment is available at https://stg.fedoraloveskde.org/.

Setup

Install the extended version of Hugo from https://gohugo.io/.

Preview

Run:

hugo serve

And point your browser to: http://localhost:1313/

Build and deploy (staging & production branches)

We currently do not have support for Hugo built websites in Fedora. Thus we temporarily manually build the website and push it to the stading and production branches. Here are steps to do so:

  • Install hugo-i18n for translation support:
sudo dnf install python3-pip gettext
# python3-pylint
git clone https://invent.kde.org/websites/hugo-i18n.git
cd hugo-i18n
pip install -r requirements.txt
# Temporary: Apply patch from https://invent.kde.org/websites/hugo-i18n/-/merge_requests/6
pip install .
  • Checkout staging branch in a distinct folder as a git worktree:
git worktree add ../fedoraloveskde.org-staging staging
  • Update the translations:
export PACKAGE="websites-fedoraloveskde-org"
export FILENAME="fedoraloveskde-org"
hugoi18n extract po/fedoraloveskde-org.pot
hugoi18n compile po
hugoi18n generate
  • Build the website:
hugo --minify --config config.yaml,config_staging.yaml
  • Copy the result to the staging directory
rsync --archive --human-readable --delete-after --verbose public/ ../fedoraloveskde.org-staging/public/
  • Commit & push the result
git -C ../fedoraloveskde.org-staging add public
git -C ../fedoraloveskde.org-staging commit "Update ($(date --utc --iso-8601=min))"
git -C ../fedoraloveskde.org-staging push
  • Wait for https://stg.fedoraloveskde.org/ to be updated (happens evey hour).

  • Once satisfied with the result, repeat (without the staging config) to push to production:

git worktree add ../fedoraloveskde.org-production production
hugo --minify --config config.yaml
rsync --archive --human-readable --delete-after --verbose public/ ../fedoraloveskde.org-production/public/
git -C ../fedoraloveskde.org-production add public
git -C ../fedoraloveskde.org-production commit "Update ($(date --utc --iso-8601=min))"
git -C ../fedoraloveskde.org-production push

Working on the website

This is using hugo. layouts/index.html contains the homepage, i18n/en.yaml contains the strings and assets/sass/bulma.scss contains the style.