Skip to content

Commit

Permalink
readme: update server and file structure
Browse files Browse the repository at this point in the history
  • Loading branch information
noxilixon authored and FFHener committed Aug 20, 2024
1 parent 933810e commit f407857
Showing 1 changed file with 11 additions and 20 deletions.
31 changes: 11 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Freifunk Berlin

This is the repository for the website of the [Freifunk Community Berlin](https://berlin.freifunk.net).

The website is built using the static website generator Hugo.
This is the repository for the website of the [Freifunk Community Berlin](https://berlin.freifunk.net). The website is built using the static website generator Hugo.

## Install

Expand All @@ -12,47 +10,40 @@ The website is built using the static website generator Hugo.
- Install [Node](https://nodejs.org/en/download/package-manager/current) (>=20)
- Load js dependencies with `npm install`

## Run for development
## Development

For quick start you can use the hugo development server.

```console
hugo server -w
```

You can change the base address `-b` and the bind address `--bind` if your run it on a remote machine.

```console
hugo server -w -b http://localhost:1313/ --bind 0.0.0.0
```
## Production

You can set the environment variables `HUGO_MATRIX_ACCESS_TOKEN`, `HUGO_MATRIX_HOME_SERVER` and `HUGO_GITHUB_ACCESS_TOKEN` to get real activity informations. Else some dummy data is used.
First you must generate the content. You can set the environment variables `HUGO_MATRIX_ACCESS_TOKEN`, `HUGO_MATRIX_HOME_SERVER` and `HUGO_GITHUB_ACCESS_TOKEN` to get real activity informations. Else some dummy data is used.

```console
HUGO_GITHUB_ACCESS_TOKEN="secret" HUGO_MATRIX_ACCESS_TOKEN="secret" HUGO_MATRIX_HOME_SERVER="htps://matrix.org" hugo server -w
HUGO_GITHUB_ACCESS_TOKEN="<github_secret>" HUGO_MATRIX_ACCESS_TOKEN="<matrix_secret>" HUGO_MATRIX_HOME_SERVER="htps://matrix.org" hugo --minify -b <baseURL>
```

## Build for production

```console
hugo build --minify -b <baseURL>
```
The files are generated in the `public` directory and need to be served with a webserver (see deployment chapter).

## Structure

```text
├── .github/workflows # Config for pipelines to test and deploy
├── archetypes # Template for new content
├── content # Pages as markdown files
├── layouts/partials # Reusable elements
├── layouts # Reusable elements
├── static # Images and videos
├── themes # Theme, integrated via submodule
└── apache # Server configs
└── themes # Theme, integrated via submodule
```

## Deployment

The website is deployed automatically via GitHub actions. The main branch is at [berlin.freifunk.net](https://berlin.freifunk.net). The other branches could be accessed via `dev.berlin.freifunk.net/<BRANCH_NAME>/`.

The actions are defined in `.github/workflows` and could be configured with [GitHub variables and secrets](https://github.com/freifunk-berlin/berlin.freifunk.net/settings/secrets/actions). The configurations for the production and development webserver are in the `apache` directory.
The actions are defined in `.github/workflows` and could be configured with [GitHub variables and secrets](https://github.com/freifunk-berlin/berlin.freifunk.net/settings/secrets/actions). The content is served with [caddy](https://caddyserver.com/) on the Freifunk servers. The configurations for the production and development webserver are in the [Caddyfile](https://github.com/freifunk-berlin/ansible/blob/main/templates/Caddyfile_website.j2) as part of the ansible setup.

## Data fetching

Expand Down

0 comments on commit f407857

Please sign in to comment.