| .forgejo/workflows | ||
| content | ||
| layouts | ||
| static | ||
| themes | ||
| .gitignore | ||
| .gitmodules | ||
| config.toml | ||
| Makefile | ||
| README.md | ||
How to build the web site
Initial Setup
You need git and hugo to build the website. On Debian or similar Linux Distributions, install them like this:
$ sudo apt install git hugo
Now you can clone the repository:
$ git clone ssh://forgejo@git.hamburg.ccc.de/Cryptoparty/cryptoparty-website.git
If this doesn't work, you may need to add a ssh authentication key to your Forgejo profile on this page:
Furthermore, you need to checkout the submodules:
$ cd website-content
website-content $ git submodule init
website-content $ git submodule update
Let's configure git:
$ git config user.name "Jane Doe"
$ git config user.email "jane@doe.org"
Building and making changes
Now you can build the site using make, it will be put into public.
make server will launch a local server that is useful while editing
the web site. To view the site while you are editing it, go to
http://localhost:1313.
Creating a new post
First, make sure your checkout is up-to-date:
$ git pull
Then, create a new branch for you post:
$ git checkout -b my-new-post
Now, to create a new post for a meetup, do:
$ hugo new termine/2020-januar.md
$ editor content/termine/2020-januar.md
Fill out the scaffolded header on top. Add content below the ---
marker. After the first paragraph, insert <!--more--> to mark the
first paragraph as the introduction to be used on the front page. Use
make server to view your changes.
If you are satisfied, add it to the branch, and push it to the server:
$ git add content/termine/2020-januar.md
$ git commit -m 'Added new post.'
$ git push
Then, create a pull request on Forgejo. Press the button labeled
New pull request. On the following site, select the branch you want to merge
(my-new-post) in the pull from: dropdown, press the New pull request
button and then finally the Create pull request button. The CI will now build
a website with your changes. Once that's done and you verified everything looks
alright, you can then merge the pull request to publish the change.
How this is set up on the server
The website gets built and deployed using Forgejo Actions, see
.forgejo/workflows/deploy.yaml. It's using the same mechanism for hosting and
deployment as the CCCHH Website and is therefore using the CCCHH
infrastructure, see ansible-infra and nix-infra.