- HTML 75.7%
- Makefile 23.1%
- TypeScript 1.2%
|
All checks were successful
Build and Deploy / build (push) Successful in -9s
|
||
|---|---|---|
| .forgejo/workflows | ||
| archetypes | ||
| assets | ||
| content | ||
| layouts | ||
| static/admin | ||
| .devcontainer.json | ||
| .gitignore | ||
| .hugo-version | ||
| .prettierrc | ||
| hugo.yaml | ||
| Makefile | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| ssh_known_hosts | ||
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
- Create this directory with
git init - Provide
.devcontainer.jsonto avoid pollution of my host system hugo new site --format yaml --force .- Update the
hugo.yamlfile with the correct configuration (see https://gohugo.io/configuration/introduction/) - Create a basic layout. See baseof.html and home.html
- Create new homepage with
hugo new content content/_index.mdand adjust the content - Run
hugo server --buildDrafts --buildFuture --buildExpiredand see first result under http://localhost:1313/
Set up Bootstrap 5.3+
npm init -y- Install Bootstrap and Icons with
npm i bootstrap bootstrap-icons - Create files
assets/css/bootstrap.scssandassets/js/main.tsso that Sass and esbuild can process them - Use
toCSSandjs.Buildso 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_DESTto 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
-
Verify the host key with
ssh-keyscan -H xyz00.hostsharing.net | tee -a ssh_known_hosts -
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/) -
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_ed25519Tip
Generate your
FORGEJO_TOKENat forge.sebatec.eu/user/settings/applications -
Remove keys from your local system:
shred id_ed25519* && rm id_ed25519* -
Write
.forgejo/workflows/deploy.yamlto deploy entire page to Hostsharing. -
Create
.hugo-versionfile. It specifies which Hugo version to use for building. Set it tolatestor a specific version number like0.155.3.