how I build my homepage

Write

  • I write content in asciidoc markup (plain text files)

  • preview is possible with tools (intellij, vs studio code, local hugo)

  • then I commit and push to a gitlab git repository

Write (Sample)

markup asciidoc sample
..

= how I build my homepage

== Write

* I write content in _asciidoc markup_
* preview is possible with tools ..
..

Write (Show)

editor
git

Build

  • I use the gitlab ci pipeline to

  • run the hugo static site generator to generate html

  • generate these html slides you see currently

Build (Sample)

starting hugo site generator inside a docker container during ci build

gitlab-ci.yml
..
pages:
  environment:
    name: homepage
  stage: generate
  image: hugomods/hugo:ci
  when: always
  script:
    - hugo version
..
    - hugo
..

Deploy

  • I use the gitlab ci pipeline again

  • run copy the generated html pages with sftp

Deploy (Sample)

install an use a sftp client to copy the html pages

gitlab-ci.yml
..
deploy-homepage:
  stage: deploy-sftp
  image: ubuntu:latest
  when: on_success
  before_script:
..
    - apt-get install -y lftp
    - apt-get install -y openssh-client
..
  script:
    - lftp -u "$FTP_USERNAME","$FTP_PASSWORD" sftp://xxxx.yyyy-data.host -e "mirror --reverse --verbose ./public /; quit"
..

Deploy (Show)

gitlab ci pipeline

Result

Motivation

  • keep it simple to write (simple textfiles)

  • keep it simple to set up (editor + git is enough)

  • keep it cheap (not runtime required, static webhosting space is enough)

  • keep a history (git versioning)

  • no vendor lock in (compare: wordpress)

Used Software

complete open source and free..