diff options
author | EuAndreh <eu@euandre.org> | 2023-04-04 12:10:54 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2023-04-04 12:10:54 -0300 |
commit | bf4a390c23a860ff8bda9538942f2b16cdcf8c05 (patch) | |
tree | ddc45415eeb7e8908605745294f58647fd18f533 /v2/src/development | |
parent | Revamp v2/ (diff) | |
download | euandre.org-bf4a390c23a860ff8bda9538942f2b16cdcf8c05.tar.gz euandre.org-bf4a390c23a860ff8bda9538942f2b16cdcf8c05.tar.xz |
Makefile: Add ShellCheck to "check" target
Diffstat (limited to '')
-rwxr-xr-x | v2/src/development/genhtml.sh | 93 | ||||
-rwxr-xr-x | v2/src/development/getconf.sh | 14 |
2 files changed, 56 insertions, 51 deletions
diff --git a/v2/src/development/genhtml.sh b/v2/src/development/genhtml.sh index cb8fd73..d816fe6 100755 --- a/v2/src/development/genhtml.sh +++ b/v2/src/development/genhtml.sh @@ -72,6 +72,7 @@ FILENAME="${1:-}" eval "$(assert_arg "$FILENAME" 'FILENAME')" +# shellcheck source=/dev/null . "${FILENAME%.md}.conf" # @@ -185,14 +186,16 @@ add_headings_anchors() { } emit_body() { - cat "${FILENAME%.md}.entry-content" | + < "${FILENAME%.md}.content" \ markdown_to_html | extract_plaintext_snippets | add_line_numbers | add_headings_anchors } - +if false; then + emit_body +fi @@ -202,22 +205,22 @@ emit_body() { cat <<-EOF <!DOCTYPE html> - <html lang="$lang"> + <html lang="${lang:?}"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> - <link rel="stylesheet" type="text/css" href="$style_url" /> - <link rel="icon" type="image/svg+xml" href="$favicon_url" /> + <link rel="stylesheet" type="text/css" href="${style_url:?}" /> + <link rel="icon" type="image/svg+xml" href="${favicon_url:?}" /> <title>$$title_html</title> <meta name="author" content="EuAndreh" /> - <meta property="og:site_name" content="$site_name" /> - <meta property="og:locale" content="$lang" /> - <meta property="og:title" content="$title_html" /> + <meta property="og:site_name" content="${site_name:?}" /> + <meta property="og:locale" content="${lang:?}" /> + <meta property="og:title" content="${title_html:?}" /> - <link rel="canonical" href="$url" /> - <meta property="og:url" content="$url" /> + <link rel="canonical" href="${url:?}" /> + <meta property="og:url" content="${url:?}" /> </head> <body> <header> @@ -237,41 +240,41 @@ EOF exit -.md.rehtml: - F="$<"; . "$${F%.md}.conf"; envsubst < src/lib/reamble."$$lang".html > $@ - -.md.osthtml: - F="$<"; . "$${F%.md}.conf"; envsubst < src/lib/ostamble."$$lang".html > $@ - - - <p class="post-footer"> - <a href="mailto:~euandreh/public-inbox@lists.sr.ht?Subject=Re%3A%20$URI_TITLE">Comment</a> - and see - <a href="https://lists.sr.ht/~euandreh/public-inbox?search=$URI_TITLE">existing discussions</a> - | - <a href="https://euandre.org/git/euandre.org/tree/$FILENAME">view source</a> - </p> - </article> - </main> - <footer> - <hr /> - <ul> - <li> - <img class="svg-icon" src="$(url-for 'static/envelope.svg')" alt="a envelope icon representing an email address" /> - <a href="mailto:$email">$email</a> - </li> - <li> - <img class="svg-icon" src="$(url-for 'static/lock.svg')" alt="a lock icon representing a GPG public key" /> - <a href="$(url-for 'static/public.asc.txt')">81F90EC3CD356060</a> - </li> - </ul> - <p> - The content for this site is licensed under <a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a>. The <a href="https://euandre.org/git/euandre.org">code</a> is <a rel="license" href="https://euandre.org/git/euandre.org/tree/COPYING">AGPLv3 or later</a>. Patches welcome. - </p> - </footer> - </body> - </html> -EOF +# .md.rehtml: +# F="$<"; . "$${F%.md}.conf"; envsubst < src/lib/reamble."$$lang".html > $@ +# +# .md.osthtml: +# F="$<"; . "$${F%.md}.conf"; envsubst < src/lib/ostamble."$$lang".html > $@ +# +# +# <p class="post-footer"> +# <a href="mailto:~euandreh/public-inbox@lists.sr.ht?Subject=Re%3A%20$URI_TITLE">Comment</a> +# and see +# <a href="https://lists.sr.ht/~euandreh/public-inbox?search=$URI_TITLE">existing discussions</a> +# | +# <a href="https://euandre.org/git/euandre.org/tree/$FILENAME">view source</a> +# </p> +# </article> +# </main> +# <footer> +# <hr /> +# <ul> +# <li> +# <img class="svg-icon" src="$(url-for 'static/envelope.svg')" alt="a envelope icon representing an email address" /> +# <a href="mailto:$email">$email</a> +# </li> +# <li> +# <img class="svg-icon" src="$(url-for 'static/lock.svg')" alt="a lock icon representing a GPG public key" /> +# <a href="$(url-for 'static/public.asc.txt')">81F90EC3CD356060</a> +# </li> +# </ul> +# <p> +# The content for this site is licensed under <a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a>. The <a href="https://euandre.org/git/euandre.org">code</a> is <a rel="license" href="https://euandre.org/git/euandre.org/tree/COPYING">AGPLv3 or later</a>. Patches welcome. +# </p> +# </footer> +# </body> +# </html> +# EOF # FIXMEs: # - feeds diff --git a/v2/src/development/getconf.sh b/v2/src/development/getconf.sh index dd623f7..4b615a8 100755 --- a/v2/src/development/getconf.sh +++ b/v2/src/development/getconf.sh @@ -74,7 +74,7 @@ escape() { } { - cat src/lib/base-conf | tee "$FILENAME".tmp + tee "$FILENAME".tmp < src/lib/base-conf DELIMITER=0 while read -r line; do if [ "$line" = '---' ]; then @@ -92,9 +92,11 @@ escape() { VALUE="$(printf '%s' "$line" | cut -d: -f2- | sed 's|^ ||' | escape)" printf '%s="%s"\n' "$KEY" "$VALUE" done < "$FILENAME" | tee -a "$FILENAME".tmp + # shellcheck source=/dev/null . "$FILENAME".tmp - cat src/lib/base."$lang".conf + cat src/lib/base."${lang:?}".conf + # shellcheck source=/dev/null . src/lib/base."$lang".conf title="${title:-"$site_name"}" @@ -105,10 +107,10 @@ escape() { printf 'filename="%s"\n' "$FILENAME" printf 'url_part="%s"\n' "$url_part" printf 'url="%s"\n' "$(url-for "$url_part" | absolute)" - printf 'date_formatted="%s"\n' "$(LANG="$lang" date -d "$date" +"$date_fmt" | escape)" - printf 'mailto_uri="%s%s"\n' "$mailto_uri_prefix" "$(uri "$title")" - printf 'discussions_url="%s%s"\n' "$discussions_url_prefix" "$(uri "$title")" - printf 'sourcecode_url="%s%s"\n' "$sourcecode_url_prefix" "$FILENAME" + printf 'date_formatted="%s"\n' "$(LANG="$lang" date -d "${date:?}" +"${date_fmt:?}" | escape)" + printf 'mailto_uri="%s%s"\n' "${mailto_uri_prefix:?}" "$(uri "$title")" + printf 'discussions_url="%s%s"\n' "${discussions_url_prefix:?}" "$(uri "$title")" + printf 'sourcecode_url="%s%s"\n' "${sourcecode_url_prefix:?}" "$FILENAME" printf 'lang_url="%s"\n' "$(url-for "$lang"/)" |