ajout fonctionnalité de titre custom
This commit is contained in:
parent
f37c0cb962
commit
4921b15074
2 changed files with 6 additions and 1 deletions
|
|
@ -30,3 +30,8 @@ put your files in the "content" folder
|
||||||
or
|
or
|
||||||
|
|
||||||
``` ./genlog.sh /path/to/your/choosen/folder ```
|
``` ./genlog.sh /path/to/your/choosen/folder ```
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
you can optionally add a text at the end of the HTML page title
|
||||||
|
```./genlog.sh /path/to/your/choosen/folder "Your custom title"```
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ find "$source_path" -wholename "*.gmi" -type f | while read -r gmi_file
|
||||||
do
|
do
|
||||||
|
|
||||||
# récupérer la 1ère ligne du fichier .gmi et remplacer "# " par ""
|
# récupérer la 1ère ligne du fichier .gmi et remplacer "# " par ""
|
||||||
title="$(sed -n '1{s/# //p}' "$gmi_file")"
|
title="$(sed -n '1{s/# //p}' "$gmi_file") $2"
|
||||||
|
|
||||||
# dans le header.html, remplacer "<\-- TITLE -->" par le titre récupéré
|
# dans le header.html, remplacer "<\-- TITLE -->" par le titre récupéré
|
||||||
# puis enregistrer le fichier ainsi modifié dans "temp/header.html"
|
# puis enregistrer le fichier ainsi modifié dans "temp/header.html"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue