Bonus - Cron Auto Switch Theme

This commit is contained in:
Kos-M 2021-02-07 20:39:39 +02:00 committed by GitHub
parent dc7dfbe07d
commit 91bea2fd83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -82,3 +82,18 @@ Creating new theme:
- update README.md with activate instructions and screenshots for new theme.
- commit & push to your fork
- create a pull request.
## Bonus - Cron Auto Switch Theme (Example)
- Requires GogsThemes installed ( see above , steps )
- Create tmpl file called `night.tmpl` in our GOGS_ROOT/custom/templates/inject/night.tmpl
- add for example dark theme
```css
<link rel="stylesheet" href="/css/themes/dark_theme.css">
```
- > crontab -e
- Enter bellow code:
```cron
30 17 * * * sudo cat /home/git/gogs/custom/templates/inject/night.tmpl > /home/git/gogs/custom/templates/inject/head.tmpl ; sudo service gogs restart
0 7 * * * cd /home/git/gogs/custom/templates/inject/; sudo echo "" > head.tmpl ; sudo service gogs restart
```
*in above example GOGS_ROOT is `/home/git/gogs/`