website/readme.md

255 lines
7.6 KiB
Markdown
Raw Normal View History

2024-04-18 14:48:19 +02:00
# VeruA.ch Website
2024-02-14 16:01:14 +00:00
<a href="https://github.com/gohugoio/hugo/releases/tag/v0.124.1" alt="Contributors">
<img src="https://img.shields.io/static/v1?label=min-HUGO-version&message=0.121.2&color=f00&logo=hugo" />
</a>
<a href="https://go.dev" alt="Contributors">
<img src="https://img.shields.io/static/v1?label=min-go-version&message=1.20.5&color=f00&logo=go" />
</a>
<a href="https://go.dev" alt="Contributors">
<img src="https://img.shields.io/static/v1?label=min-node-version&message=20&color=f00&logo=npm" />
</a>
2024-02-14 16:01:14 +00:00
<h3 >currently under development on: <a target="_blank" href="https://verua.dev-1.andreashnida.de/" rel="nofollow"> verua.dev-1.andreashnida.de 👀 </a>
2024-02-15 07:01:26 +00:00
</h3>
Development site: <a target="_blank" href="https://preview.verua.info/" rel="nofollow">preview.verua.info</a>
2024-04-18 10:58:25 +02:00
Production site: <a target="_blank" href="https://verua.info/" rel="nofollow">verua.info</a>
2024-02-14 16:01:14 +00:00
This site is based on <a href="https://github.com/zeon-studio/hugoplate">Hugoplate Boilerplate Theme for Hugo</a>. For specifics on how to use the theme, please refer to the <a href="https://github.com/zeon-studio/hugoplate/blob/main/README.md">README</a> of the theme.
2024-04-18 14:54:49 +02:00
## Table of Contents
- [Usage / Update Content](#usage--update-content)
2024-04-18 15:00:36 +02:00
- [Editing Content](#editing-content)
- [Images](#images)
- [Shortcodes](#shortcodes)
2024-04-18 14:54:49 +02:00
- [Custom Shortcodes exclusively for VeruA.ch](#custom-shortcodes-exclusively-for-veruach)
- [Alert](#alert)
- [Aligncenter](#aligncenter)
- [Card](#card)
- [Columns](#columns)
- [Font-Awesome Icon](#font-awesome-icon)
- [Section](#section)
- [formEventDropdown](#formeventdropdown)
2024-04-18 14:54:49 +02:00
- [Deployment](#deployment)
- [Development](#development)
2024-04-18 14:58:11 +02:00
## Usage / Update Content
2024-04-18 14:48:19 +02:00
To use the theme, and to update your content, you need to clone the repository, update your content in the `content` folder and push your changes to the main branch which will trigger a deployment.
```bash
# Clone the repository
git clone https://code.verua.online/rabeweb/verua.ch_src.git
# connect to your gitea instance
cd verua.ch_src
git push -u origin main
```
2024-04-18 15:00:36 +02:00
[](#table-of-contents)
2024-04-18 14:58:11 +02:00
### Editing Content
2024-04-18 14:48:19 +02:00
The content is written in the [markdown](https://www.markdownguide.org/getting-started/) format. You also use html tags to format your content but the ending still stays .md for markdown. These files are found in the `content` folder. For linking german and french content, you use the translation key syntax. This means that you put a key in the frontmatter of both files you want to link to.
```yaml
---
2024-06-11 07:42:46 +02:00
title: "VeruA ** Verwaltung und Abrechnung"
translationKey: "a-page-about-cats"
2024-04-18 14:48:19 +02:00
---
```
For example, the german version of the VeruA.ch website is located in the `content/german` folder. The french version is located in the `content/french` folder. Both are linked by the translation key `a-page-about-cats`.
2024-04-18 15:00:36 +02:00
[](#table-of-contents)
2024-04-18 14:58:11 +02:00
### Images
2024-04-18 14:48:19 +02:00
Images are stored in the `static/images` folder. You can use the `![]()` syntax to insert images into your markdown files.
Everything that is in the `static/images` folder will be copied to the `public/images` folder during the build process. This means that you can use relative paths to your images in your markdown files like this: `![](images/my-image.png)`.
2024-04-18 15:00:36 +02:00
[](#table-of-contents)
2024-04-18 14:58:11 +02:00
### Shortcodes
2024-04-18 14:48:19 +02:00
You can use shortcodes to add custom functionality to your markdown files. You can find a list of available shortcodes in the [Hugoplate documentation](https://github.com/zeon-studio/hugoplate/blob/main/README.md#shortcodes).
There are some shortcodes that are specific to the VeruA.ch website. These Shortcodes are defined in the `layouts/shortcodes` folder. You can find a list of available exclusive shortcodes like columns and sections further down in this document.
2024-04-18 15:00:36 +02:00
[](#table-of-contents)
2024-04-18 14:58:11 +02:00
## Custom Shortcodes exclusively for VeruA.ch
<small>/themes/hugoplate/layouts/shortcodes/</small>
- **Alerts**: Create alerts with custom text and styles.
- **Aligncenter**: Center content horizontally.
- **Cards**: Create beautiful cards with custom content and images.
- **Columns**: Create responsive columns with custom content and images.
- **Icons**: Use icons from the Font Awesome library to add icons to your website.
- **Sections**: Create sections with custom content and images.
2024-04-18 14:48:19 +02:00
2024-04-18 15:00:36 +02:00
[](#table-of-contents)
2024-04-18 14:58:11 +02:00
### Alert
2024-04-18 14:48:19 +02:00
The alert shortcode is used to create alerts with custom text and styles.
**Pfad:** themes/hugoplate/layouts/shortcodes/alert.html
`{{% alert background-color="slate-800" %}}`
Content
`{{% /alert %}}`
2024-04-18 15:00:36 +02:00
[](#table-of-contents)
2024-04-18 14:58:11 +02:00
### Aligncenter
2024-04-18 14:48:19 +02:00
The aligncenter shortcode is used to center content horizontally.
**Pfad:** themes/hugoplate/layouts/shortcodes/aligncenter.html
`{{% aligncenter %}}`
Content
`{{% /aligncenter %}}`
2024-04-18 15:00:36 +02:00
[](#table-of-contents)
2024-04-18 14:58:11 +02:00
### Card
2024-04-18 14:48:19 +02:00
The card shortcode is used to create beautiful cards with custom content and images.
**Pfad:** themes/hugoplate/layouts/shortcodes/card.html
`{{% card %}}`
Content
`{{% /card %}}`
Kann ein `Background` - Attribut haben:
`{{% card background="images/startseite-slide.jpg" %}}`
Kann ein `Light-Text` - Attribut haben:
`{{% card light-text="true" %}}`
Kann ein `Title` - Attribut haben:
`{{% card title="Card Title" %}}`
2024-04-18 15:00:36 +02:00
[](#table-of-contents)
2024-04-18 14:58:11 +02:00
### Columns
2024-04-18 14:48:19 +02:00
**Pfad:** themes/hugoplate/layouts/shortcodes/columns.html
Columns are seperated by the '..column..' shortcode.
`{{% columns %}}`
Content
`..column..`
Content
`..column..`
Content
`{{% /columns %}}`
2024-04-18 15:00:36 +02:00
[](#table-of-contents)
### Font-Awesome Icon
2024-04-18 14:48:19 +02:00
2024-04-18 22:49:01 +02:00
Find all open source icons on [Font Awesome](https://fontawesome.com/search?m=free&o=r)
2024-04-18 14:48:19 +02:00
`{{% icon name="user" color="black" size="5xl" %}}`
Für "size" und "color" werden Tailwind CSS Klassen benutzt.
E.g. https://tailwindcss.com/docs/text-color
die Klassennamen jeweils OHNE "text-" einfügen:
text-gray-50 -> color="gray-50"
text-5xl -> size="5xl"
2024-04-18 15:00:36 +02:00
[](#table-of-contents)
2024-04-18 14:58:11 +02:00
### Section
2024-04-18 14:48:19 +02:00
It is a good idea to use the section shortcode to separate your content into sections and keep consistent margins and page widths.
**Pfad:** themes/hugoplate/layouts/shortcodes/section.html
`{{% section %}}`
Content
`{{% /section %}}`
Kann ein `Background` - Attribut haben:
`{{% section background="images/startseite-slide.jpg" %}}`
2024-04-18 14:54:49 +02:00
2024-04-18 15:00:36 +02:00
[](#table-of-contents)
### formEventDropdown
**Pfad:** themes/hugoplate/layouts/shortcodes/formEventDropdown.html
`{{< formEventDropdown >}}`
Renders a dropdown form field with the available events. You set the events in the `schulungstermine` parameter in the frontmatter of the page.
[](#table-of-contents)
2024-04-18 14:58:11 +02:00
## Deployment
2024-04-18 14:54:49 +02:00
Deployment is done via Gitea Runners. The deployment is triggered by a push to the `main` branch. The deployment will automatically build the site and deploy it to the production or preview environment.
You can control where the site is deployed by setting the 'environment' variable in the `hugo.toml` file. The value should be either `production` or `development`.
This also controls the creation of the robots.txt file. If the value is `development`, the robots.txt file will be created with the following content:
```r
2024-04-18 14:54:49 +02:00
User-agent: *
Disallow: /
```
Credentials and targets are stored as secrets in your Gitea instance.
You can also run the site locally. Please refer to the 'Development' section for more information.
You will find the workflow file in `/.gitea/workflows/build-and-deploy-pipeline.yaml`
2024-04-18 15:00:36 +02:00
[](#table-of-contents)
2024-04-18 14:58:11 +02:00
## Development
2024-04-18 14:54:49 +02:00
To run the site locally, you can use the following commands:
```bash
2024-04-18 23:08:49 +02:00
# Project setup
npm run project-setup
2024-04-18 14:54:49 +02:00
# Install dependencies
npm install
# Start the development server
npm run dev
```
2024-04-18 15:00:36 +02:00
The site will be available at `http://localhost:8080`.