Compare commits

..

2 commits

Author SHA1 Message Date
8ae76cc8e8 Fix language tag and improve templates 2024-08-28 14:53:54 +03:00
2b0f9c139a Improve README.md 2024-08-06 00:51:05 +03:00
13 changed files with 40 additions and 31 deletions

View file

@ -1,6 +1,11 @@
# Changelog # Changelog
This file keeps track of changes in a human-readable fashion This file keeps track of changes in a human-readable fashion
## v1.1.4
* Fixed HTML `lang` tag
* Theme CSS link is now only present if non-default is set
* Improved template consistency (backend)
## v1.1.3 ## v1.1.3
This release mostly consists of backend improvements This release mostly consists of backend improvements
* List items no longer replace hyphens with spaces for consistency * List items no longer replace hyphens with spaces for consistency

View file

@ -39,11 +39,11 @@ config
Deleting notes is done by clearing contents and clicking "Save" - the app deletes empty files when saving. Deleting notes is done by clearing contents and clicking "Save" - the app deletes empty files when saving.
### Config options: ### Config options:
Below are available configuration options and their defaults. Below are the available configuration options and their defaults.
The settings are defined as newline separated key=value pairs in config.txt. The settings are defined as newline separated `key=value` pairs in the config file.
If you do not provide an option in your config, it will be using the default. If you do not provide an option, the default will be used.
Please don't include the bash-style "comments" in your actual config, Please don't include the bash-style "comments" in your actual config,
they are provided purely for demonstration only and **will break the config if present**. they are provided purely for demonstration and **will break the config if present**.
``` ```
username=admin # Your username username=admin # Your username
password=admin # Your password password=admin # Your password
@ -51,7 +51,7 @@ port=7101 # What port to run on (probably leave on 7101 if using docker)
timezone=Local # IANA Time zone database identifier ("UTC", Local", "Europe/Moscow" etc.), Defaults to Local if can't parse. timezone=Local # IANA Time zone database identifier ("UTC", Local", "Europe/Moscow" etc.), Defaults to Local if can't parse.
grace_period=0s # Time after a new day begins, but before the switch to next day's file. e.g. 3h26m - files will change at 3:26am grace_period=0s # Time after a new day begins, but before the switch to next day's file. e.g. 3h26m - files will change at 3:26am
language=en # ISO-639 language code (available - en, ru) language=en # ISO-639 language code (available - en, ru)
theme=default # Picked theme (available - default, high-contrast, lavender, gruvbox, sans) theme="" # Picked theme (available - default (if left empty), high-contrast, lavender, gruvbox, sans)
title=🌺 Hibiscus.txt # The text in the header title=🌺 Hibiscus.txt # The text in the header
log_to_file=false # Whether to write logs to a file log_to_file=false # Whether to write logs to a file
log_file=config/log.txt # Where to store the log file if it is enabled log_file=config/log.txt # Where to store the log file if it is enabled

View file

@ -1,6 +1,7 @@
# TODO # TODO
List of things to add to this project List of things to add to this project
* Auth improvement so it DOESN'T ASK ME FOR PASSWORD EVERY DAY UGH XD
* Forward/backward buttons for days * Forward/backward buttons for days
## Brainstorming ## Brainstorming

View file

@ -41,7 +41,7 @@ var DefaultConfig = Config{
Timezone: time.Local, Timezone: time.Local,
GraceTime: 0, GraceTime: 0,
Language: "en", Language: "en",
Theme: "default", Theme: "",
Title: "🌺 Hibiscus.txt", Title: "🌺 Hibiscus.txt",
LogToFile: false, LogToFile: false,
LogFile: "config/log.txt", LogFile: "config/log.txt",

View file

@ -1,4 +1,6 @@
{ {
"lang": "en-UK",
"title.today": "Your day so far", "title.today": "Your day so far",
"title.days": "Previous days", "title.days": "Previous days",
"title.notes": "Notes", "title.notes": "Notes",

View file

@ -1,4 +1,6 @@
{ {
"lang": "ru",
"title.today": "Сегодняшний день", "title.today": "Сегодняшний день",
"title.days": "Предыдущие дни", "title.days": "Предыдущие дни",
"title.notes": "Заметки", "title.notes": "Заметки",
@ -11,7 +13,7 @@
"link.info": "системная информация", "link.info": "системная информация",
"time.date": "Сегодня", "time.date": "Сегодня",
"time.grace": "льготный период", "time.grace": "редактируется вчерашний день",
"button.save": "Сохранить", "button.save": "Сохранить",
"button.notes": "Новая заметка", "button.notes": "Новая заметка",
"prompt.notes": "Название заметки", "prompt.notes": "Название заметки",

View file

@ -15,7 +15,7 @@ type AppInfo struct {
// Info contains app information. // Info contains app information.
var Info = AppInfo{ var Info = AppInfo{
Version: "1.1.3", Version: "1.1.4",
SourceLink: "https://git.a71.su/Andrew71/hibiscus", SourceLink: "https://git.a71.su/Andrew71/hibiscus",
} }

View file

@ -5,7 +5,7 @@
</header> </header>
{{ end }} {{ end }}
{{define "base"}} {{- define "base" -}}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="{{ translatableText "lang" }}"> <html lang="{{ translatableText "lang" }}">
<head> <head>
@ -14,16 +14,16 @@
<link rel="manifest" href="/public/manifest.json" /> <link rel="manifest" href="/public/manifest.json" />
<link rel="icon" type="image/x-icon" href="/public/favicon.ico"> <link rel="icon" type="image/x-icon" href="/public/favicon.ico">
<link rel="stylesheet" href="/public/main.css"> <link rel="stylesheet" href="/public/main.css">
<link rel="stylesheet" href="/public/themes/{{ config.Theme }}.css"> {{- if config.Theme -}}<link rel="stylesheet" href="/public/themes/{{ config.Theme }}.css">{{ end }}
<script src="/public/main.js"></script> <script src="/public/main.js"></script>
<title>Hibiscus.txt</title> <title>Hibiscus.txt</title>
</head> </head>
<body> <body>
{{template "header" .}} {{- template "header" . -}}
<main> <main>
{{template "main" .}} {{- template "main" . -}}
</main> </main>
{{template "footer" .}} {{- template "footer" . -}}
<script defer> <script defer>
const langName="{{ config.Language }}"; const langName="{{ config.Language }}";
const timeZone="{{ config.Timezone }}"; const timeZone="{{ config.Timezone }}";

View file

@ -1 +0,0 @@
/* Default theme is defined in main.css */