minor refactor: title handling for blog
This commit is contained in:
parent
b4bbbf58f4
commit
31f6b8f005
2
build.sh
2
build.sh
|
@ -45,7 +45,7 @@ __process_shp() {
|
|||
__SHLVL=$((__SHLVL - 1))
|
||||
}
|
||||
|
||||
__lowdown() { lowdown --html-no-num-ent --html-no-skiphtml --html-no-escapehtml "$@"; }
|
||||
__lowdown() { lowdown --html-no-skiphtml --html-no-escapehtml "$@"; }
|
||||
|
||||
# process a pure markdown file
|
||||
# uses a special file in _INCDIR, `markdown-template.sh` to create the html
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Thoughts on yash
|
||||
# thoughts on yash
|
||||
[a few months ago](https://git.unix.dog/yosh/dotfiles/commit/8184b44fe4db724f1645cf6f8fd977550cb49f6e), I tried out the [yash shell](https://magicant.github.io/yash/). I gave it an honest go. I want to like it--it does so many things so well for a one man project; but there's just a few, very tiny, almost inconsequential hiccups that make it just out of reach for me to want to continue using it.
|
||||
|
||||
this article is going to mostly be comparisons to the "standard" shell on most linuxes: bash--what yash does differently, what it does mostly the same, all the like.
|
||||
|
|
|
@ -6,14 +6,19 @@
|
|||
<main>
|
||||
<?shp gen_titlebar "blog" green ?>
|
||||
<h1>blog</h1>
|
||||
<p>here's posts I make. you can read them if you want. follow <a href="feed.atom">atom feed</a> if you really want to</p>
|
||||
<p>here's posts I make. you can read them if you want. follow this <a href="feed.atom">atom feed</a> for these posts if you really want to</p>
|
||||
|
||||
<ul>
|
||||
<?shp
|
||||
for md in *.md; do
|
||||
# title is always on first line always separated by a space
|
||||
# title is always on first line and always separated by a space
|
||||
read -r title < "$md"
|
||||
title="${title#* }"
|
||||
title=$(__lowdown <<-EOF
|
||||
$title
|
||||
EOF
|
||||
)
|
||||
title="${title#*>}"
|
||||
title="${title%<*}"
|
||||
set_md_metadata "$md"
|
||||
printf '<li><p><time>%s</time> - <a href="%s">%s</a></li>\n' \
|
||||
"${POST_TIME%%T*}" "${md%.md}.html" "$title"
|
||||
|
|
Loading…
Reference in New Issue