add config option to set name

This commit is contained in:
Akbar Rahman 2021-05-01 11:48:04 +01:00
parent b2c94f1e88
commit 731f71610d
2 changed files with 20 additions and 3 deletions

View File

@ -2,6 +2,11 @@
[[ "$1" == "--help" ]] && echo "USAGE: $0 [NOTES_DIRECTORY_1 [NOTES_DIRECTORY_2 [...]]]" && exit 0
for configpath in "$HOME/.notes2web.conf" "$HOME/.config/notes2web/config" ".notes2web.conf"
do
[[ -f "$configpath" ]] && source "$configpath"
done
function _renderarticle {
echo "rendering $1"
pandoc\
@ -41,9 +46,9 @@ do
done
# create an intermediate markdown file of links to each article
echo "---
title: alv's notes
---" > index.md
echo "---" > index.md
[[ -z "$name" ]] && echo "title: notes" >> index.md || echo "title: ${name}'s notes" >> index.md
echo "---" >> index.md
for file in "$@"
do

View File

@ -19,6 +19,18 @@ root directory.
Then you just have to point a webserver at your notes directory.
## Config
`notes2web` looks for a config file called `.notes2web.conf` in your current directory and your home
directory.
Right now the only config available is `name`:
```bash
name="alv"
```
If the name is not set, the title is set to 'notes'.
## Uninstall
```