A Hugo-based static site demo showcasing how to create and deploy a website to Hostsharing e.G. Includes Bootstrap 5.3+ integration, Sass/esbuild processing, and rsync-based deployment. https://demo.sebatec.eu/
  • HTML 75.7%
  • Makefile 23.1%
  • TypeScript 1.2%
Find a file
Sebastian Schulz 0a244e3574
All checks were successful
Build and Deploy / build (push) Successful in -9s
Replace custom forgejo runner feature in devcontainer
2026-02-27 18:52:58 +01:00
.forgejo/workflows Add Sveltia CMS 2026-02-20 00:49:09 +01:00
archetypes Initial commit 2026-02-12 17:49:34 +01:00
assets Setup boostrap 2026-02-12 19:08:24 +01:00
content Update Posts “hallo-welt” 2026-02-19 23:32:53 +00:00
layouts Remove warnings of hugo 2026-02-12 22:16:07 +01:00
static/admin Add Sveltia CMS 2026-02-20 00:49:09 +01:00
.devcontainer.json Replace custom forgejo runner feature in devcontainer 2026-02-27 18:52:58 +01:00
.gitignore Add deployment step 2026-02-13 00:00:54 +01:00
.hugo-version Add deploy workflow 2026-02-13 15:54:28 +01:00
.prettierrc Setup boostrap 2026-02-12 19:08:24 +01:00
hugo.yaml Remove warnings of hugo 2026-02-12 22:16:07 +01:00
Makefile Add deploy workflow 2026-02-13 15:54:28 +01:00
package-lock.json Remove dartsass due to security rules of hugo 2026-02-12 19:34:07 +01:00
package.json Remove dartsass due to security rules of hugo 2026-02-12 19:34:07 +01:00
README.md Add deploy workflow 2026-02-13 15:54:28 +01:00
ssh_known_hosts Add deploy workflow 2026-02-13 15:54:28 +01:00

Demo site

This repository should be a showcase of how to create and deploy a page with Hugo.

Quickstart

The following steps show how this repository was set up.

Scaffolding Hugo's most basic files

  1. Create this directory with git init
  2. Provide .devcontainer.json to avoid pollution of my host system
  3. hugo new site --format yaml --force .
  4. Update the hugo.yaml file with the correct configuration (see https://gohugo.io/configuration/introduction/)
  5. Create a basic layout. See baseof.html and home.html
  6. Create new homepage with hugo new content content/_index.md and adjust the content
  7. Run hugo server --buildDrafts --buildFuture --buildExpired and see first result under http://localhost:1313/

Set up Bootstrap 5.3+

  1. npm init -y
  2. Install Bootstrap and Icons with npm i bootstrap bootstrap-icons
  3. Create files assets/css/bootstrap.scss and assets/js/main.ts so that Sass and esbuild can process them
  4. Use toCSS and js.Build so that CSS and JavaScript are loaded on the page.

Makefile (optional)

The following Makefile targets are available:

setup:
Installs tools, libraries, and frameworks
build:
Builds the final artifacts
publish:
Publishes the built site to a remote server via rsync. Requires RSYNC_DEST to be set. Example: RSYNC_DEST=xzy00-website@xzy00.hostsharing.net:doms/example.com/htdocs-ssl/ make publish
dev:
Runs Hugo's development server
clean:
Cleans up build artifacts

Set up Forgejo Workflow

  1. Verify the host key with ssh-keyscan -H xyz00.hostsharing.net | tee -a ssh_known_hosts

  2. Confirm the key fingerprint with ssh-keygen -lf ssh_known_hosts | grep --color 'SHA256:ABC' (see https://www.hostsharing.net/doc/managed-operations-platform/hostkeys/)

  3. Upload the deployment key to the secret store and to .ssh/authorized_keys (see https://forge.sebatec.eu/actions/setup-ssh#how-to-provide-ssh-key):

    export FORGEJO_TOKEN="your_api_key_here"
    bash <(curl -s https://forge.sebatec.eu/actions/setup-ssh/raw/tag/v1/upload-secret.sh) -r examples/demo.sebatec.eu -s DEPLOY_KEY -f id_ed25519
    

    Tip

    Generate your FORGEJO_TOKEN at forge.sebatec.eu/user/settings/applications

  4. Remove keys from your local system: shred id_ed25519* && rm id_ed25519*

  5. Write .forgejo/workflows/deploy.yaml to deploy entire page to Hostsharing.

  6. Create .hugo-version file. It specifies which Hugo version to use for building. Set it to latest or a specific version number like 0.155.3.