feat: add callout for notification

This commit is contained in:
kolaente 2024-06-24 16:54:58 +02:00
parent 52ea0bc4bc
commit 871022fee2
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
6 changed files with 73 additions and 37 deletions

View File

@ -1,4 +1,4 @@
import {defineMarkdocConfig} from '@astrojs/markdoc/config'
import {defineMarkdocConfig, component} from '@astrojs/markdoc/config'
import shiki from '@astrojs/markdoc/shiki'
export default defineMarkdocConfig({
@ -16,4 +16,12 @@ export default defineMarkdocConfig({
},
}),
],
tags: {
callout: {
render: component('./src/components/Callout.astro'),
attributes: {
type: {type: String},
},
},
},
})

View File

@ -0,0 +1,31 @@
---
interface Props {
type: 'warning' | 'info'
}
const {type} = Astro.props
function getClasses(): string {
let suffix = ''
switch (type) {
case 'info':
suffix = 'bg-primary-lighter'
break
case 'warning':
suffix = 'bg-yellow-200'
break
}
return 'callout rounded px-4 py-3 ' + suffix
}
---
<div class={getClasses()}>
<slot/>
</div>
<style>
.callout :global(> p) {
@apply m-0;
}
</style>

View File

@ -2,10 +2,10 @@
title: "German Translation Instructions"
---
<div class="notification is-warning">
<b>NOTE:</b> This document contains translation instructions specific to the german translation of Vikunja.
For instructions applicable to all languages, check out the <a href="{{< ref "./translations.md">}}">general translation instructions</a>.
</div>
{% callout type="warning" %}
This document contains translation instructions specific to the german translation of Vikunja.
For instructions applicable to all languages, check out the [general translation instructions](/translations).
{% /callout %}
{{< table_of_contents >}}

View File

@ -9,13 +9,11 @@ For all available configuration options, see [configuration]({{< ref "config.md"
After registering all your users, you might also want to [disable the user registration]({{<ref "config.md">}}#enableregistration).
<div class="notification is-warning">
<b>NOTE:</b> If you intend to run Vikunja with mysql and/or to use non-latin characters
<a href="{{< ref "utf-8.md">}}">make sure your db is utf-8 compatible</a>.<br/>
{% callout type="warning" %}
If you intend to run Vikunja with mysql and/or to use non-latin characters
[make sure your db is utf-8 compatible](/docs/utf-8-settings).
All examples on this page already reflect this and do not require additional work.
</div>
{{< table_of_contents >}}
{% /callout %}
## File permissions
@ -92,9 +90,9 @@ mkdir $PWD/files $PWD/db
chown 1000 $PWD/files $PWD/db
```
<div class="notification is-warning">
<b>NOTE:</b> If you'll use your instance with more than a handful of users, we recommend using mysql or postgres.
</div>
{% callout type="warning" %}
If you'll use your instance with more than a handful of users, we recommend using mysql or postgres.
{% /callout %}
## Example without any proxy
@ -105,10 +103,10 @@ If you want to make Vikunja available on a domain or need tls termination, check
Note that you need to change the [`VIKUNJA_SERVICE_PUBLICURL`]({{< ref "config.md" >}}#publicurl) environment variable to the public ip or hostname including the port (the docker host you're running this on) is reachable at, prefixed with `http://`.
Because the browser you'll use to access the Vikunja frontend uses that url to make the requests, it has to be able to reach it from the outside.
<div class="notification is-warning">
<b>NOTE:</b> You must ensure Vikunja has write permissions on the `files` directory before starting the stack.
To do this, <a href="#file-permissions">check out the related commands here</a>.
</div>
{% callout type="warning" %}
You must ensure Vikunja has write permissions on the `files` directory before starting the stack.
To do this, [check out the related commands here](#file-permissions).
{% /callout %}
```yaml
version: '3'
@ -159,10 +157,10 @@ We also make a few assumptions here which you'll most likely need to adjust for
* The entrypoint you want to make vikunja available from is called `https`
* The tls cert resolver is called `acme`
<div class="notification is-warning">
<b>NOTE:</b> You must ensure Vikunja has write permissions on the `files` directory before starting the stack.
To do this, <a href="#file-permissions">check out the related commands here</a>.
</div>
{% callout type="warning" %}
You must ensure Vikunja has write permissions on the `files` directory before starting the stack.
To do this, [check out the related commands here](#file-permissions).
{% /callout %}
```yaml
version: '3'
@ -227,10 +225,10 @@ vikunja.example.com {
Note that you need to change the [`VIKUNJA_SERVICE_PUBLICURL`]({{< ref "config.md" >}}#publicurl) environment variable to the ip (the docker host you're running this on) is reachable at.
Because the browser you'll use to access the Vikunja frontend uses that url to make the requests, it has to be able to reach that ip + port from the outside.
<div class="notification is-warning">
<b>NOTE:</b> You must ensure Vikunja has write permissions on the `files` directory before starting the stack.
To do this, <a href="#file-permissions">check out the related commands here</a>.
</div>
{% callout type="warning" %}
You must ensure Vikunja has write permissions on the `files` directory before starting the stack.
To do this, [check out the related commands here](#file-permissions).
{% /callout %}
Docker Compose config:
@ -317,10 +315,10 @@ You may want to change the volumes to match the rest of your setup.
After registering all your users, you might also want to [disable the user registration]({{<ref "config.md">}}#enableregistration).
<div class="notification is-warning">
<b>NOTE:</b> You must ensure Vikunja has write permissions on the `files` directory before starting the stack.
To do this, <a href="#file-permissions">check out the related commands here</a>.
</div>
{% callout type="warning" %}
You must ensure Vikunja has write permissions on the `files` directory before starting the stack.
To do this, [check out the related commands here](#file-permissions).
{% /callout %}
## Redis

View File

@ -12,10 +12,9 @@ You can also:
* Use the desktop app, which is essentially the web frontend packaged for easy installation on desktop devices
* Use the mobile app only, but as of right now it only supports the very basic features of Vikunja
<div class="notification is-warning">
<b>NOTE:</b> If you intend to run Vikunja with mysql and/or to use non-latin characters
<a href="{{< ref "utf-8.md">}}">make sure your db is utf-8 compatible</a>.
</div>
{% callout type="warning" %}
If you intend to run Vikunja with mysql and/or to use non-latin characters [make sure your db is utf-8 compatible](/docs/utf-8-settings).
{% /callout %}
Vikunja can be installed in various ways.
This document provides an overview and instructions for the different methods:

View File

@ -23,9 +23,9 @@ server {
}
```
<div class="notification is-warning">
<b>NOTE:</b> If you change the max upload size in Vikunja's settings, you'll need to also change the <code>client_max_body_size</code> in the nginx proxy config.
</div>
{% callout type="warning" %}
**NOTE:** If you change the max upload size in Vikunja's settings, you'll need to also change the `client_max_body_size` in the nginx proxy config.
{% /callout %}
## NGINX Proxy Manager (NPM)