Updated `mkpage` and README.md.
Signed-off-by: Aoi Koizumi <novaburst@kalli.st>
This commit is contained in:
parent
21f64d8f8f
commit
29a14cced9
|
@ -37,8 +37,10 @@ The content filename is the basename of the shellscript with the type of
|
|||
markup file appended to it (.html or .md), for example the file
|
||||
pages/html-example.html.
|
||||
|
||||
If `mkpage` is used the filename is an UUID and a .md file with the same name.
|
||||
Example: 082ea44f-8633-4dc9-9ff2-f25ee6618013.sh + 082ea44f-8633-4dc9-9ff2-f25ee6618013.md => output/082ea44f-8633-4dc9-9ff2-f25ee6618013.html
|
||||
If `mkpage` is used the filename is a value from `openssl rand -hex 3` and a .md file with the same name.
|
||||
Example: ddc7ac.sh + ddc7ac.md => output/ddc7ac.html
|
||||
|
||||
(either LibreSSL or regular OpenSSL should work)
|
||||
|
||||
Markdown is supported. By default "smu"[0] is set as a Markdown processor,
|
||||
to change this set $markdown to your favorite Markdown-to-HTML converter in
|
||||
|
|
|
@ -2,10 +2,9 @@
|
|||
# Metadata generator for static-site-scripts
|
||||
# It can also generate either the markdown pages or the html pages
|
||||
|
||||
UUID_GEN_TOOL="uuidgen"
|
||||
VERSION=$(git rev-parse --short HEAD)
|
||||
|
||||
page_id="$(which $UUID_GEN_TOOL)"
|
||||
page_id="$(openssl rand -hex 3)"
|
||||
|
||||
gen_html() {
|
||||
touch pages/${page_id}.html
|
||||
|
@ -15,14 +14,14 @@ gen_markdown() {
|
|||
}
|
||||
gen_metadata() {
|
||||
cat << EOF > pages/${page_id}.sh
|
||||
#!/bin/sh
|
||||
title="$2"
|
||||
description="$3"
|
||||
timecreated="$(date +%Y-%m-%d)"
|
||||
timeupdated="$(date +%Y-%m-%d)"
|
||||
author="$4"
|
||||
id="${page_id}"
|
||||
url="${page_id}.html"
|
||||
#!/bin/sh
|
||||
title="$2"
|
||||
description="$3"
|
||||
timecreated="$(date +%Y-%m-%d)"
|
||||
timeupdated="$(date +%Y-%m-%d)"
|
||||
author="$4"
|
||||
id="${page_id}"
|
||||
url="${page_id}.html"
|
||||
EOF
|
||||
}
|
||||
show_help() {
|
||||
|
|
Loading…
Reference in New Issue