Remove downloading posts as files because broken

This commit is contained in:
Amolith 2023-09-19 14:27:59 -04:00
parent 67e1ad61aa
commit 70bcddf210
Signed by: Amolith
GPG Key ID: 8AE30347CE28D101
2 changed files with 49 additions and 49 deletions

View File

@ -1,5 +1,6 @@
# Build everything then deploy
default: site (docs "pdf") (docs "epub") (docs "txt") images deploy
# default: site (docs "pdf") (docs "epub") (docs "txt") images deploy
default: site images deploy
# Deploy website
deploy:
@ -12,53 +13,53 @@ site:
# Building website ...
hugo --quiet
# Build documents of filetype ext
docs ext:
#!/usr/bin/env bash
echo -e '\033[1m# Checking whether there are new {{uppercase(ext)}}s to generate ...\033[0m'
export WEBROOT=public
published=$(grep -ilr --include \*.md "draft: false" content)
todo=""
# Iterate through all non-drafts
for path in $published
do
filename=$(basename "$path")
name=$(echo "${filename%.*}")
# Check whether target doc is newer than Markdown file
if [ "$path" -nt "public/$name/$name.{{ext}}" ]
then
todo+="$path "
fi
done
if [ -z "$todo" ]
then
echo "No {{uppercase(ext)}}s to generate"
exit 0
else
for path in $todo
do
filename=$(basename "$path")
name=$(echo "${filename%.*}")
echo "Generating $name.{{ext}}"
if [ "{{ext}}" == "pdf" ]
then
pandoc --quiet -f markdown -t pdf --lua-filter=pandoc_config/images.lua --pdf-engine=xelatex -V 'linkcolor:blue' --listings -H pandoc_config/styles.tex $path -o public/$name/$name.pdf
elif [ "{{ext}}" == "epub" ]
then
pandoc --quiet -f markdown -t epub3 --lua-filter=pandoc_config/images.lua --pdf-engine=xelatex -V 'linkcolor:blue' --listings -H pandoc_config/styles.tex $path -o public/$name/$name.epub
elif [ "{{ext}}" == "txt" ]
then
pandoc --quiet -f markdown -t plain --lua-filter=pandoc_config/images.lua $path -o public/$name/$name.txt
fi
done
fi
## Build documents of filetype ext
#docs ext:
# #!/usr/bin/env bash
#
# echo -e '\033[1m# Checking whether there are new {{uppercase(ext)}}s to generate ...\033[0m'
#
# export WEBROOT=public
#
# published=$(grep -ilr --include \*.md "draft: false" content)
#
# todo=""
#
# # Iterate through all non-drafts
# for path in $published
# do
# filename=$(basename "$path")
# name=$(echo "${filename%.*}")
# # Check whether target doc is newer than Markdown file
# if [ "$path" -nt "public/$name/$name.{{ext}}" ]
# then
# todo+="$path "
# fi
# done
#
# if [ -z "$todo" ]
# then
# echo "No {{uppercase(ext)}}s to generate"
# exit 0
# else
# for path in $todo
# do
# filename=$(basename "$path")
# name=$(echo "${filename%.*}")
# echo "Generating $name.{{ext}}"
#
# if [ "{{ext}}" == "pdf" ]
# then
# pandoc --quiet -f markdown -t pdf --lua-filter=pandoc_config/images.lua --pdf-engine=xelatex -V 'linkcolor:blue' --listings -H pandoc_config/styles.tex $path -o public/$name/$name.pdf
# elif [ "{{ext}}" == "epub" ]
# then
# pandoc --quiet -f markdown -t epub3 --lua-filter=pandoc_config/images.lua --pdf-engine=xelatex -V 'linkcolor:blue' --listings -H pandoc_config/styles.tex $path -o public/$name/$name.epub
# elif [ "{{ext}}" == "txt" ]
# then
# pandoc --quiet -f markdown -t plain --lua-filter=pandoc_config/images.lua $path -o public/$name/$name.txt
# fi
# done
# fi
# Generate cover images
images:

View File

@ -4,7 +4,6 @@
<div class="frontmatter">
<h1 class="post-title" style="view-transition-name: post-title-{{ .Title | urlize }}"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
<p style="view-transition-name: post-meta-{{ .Title | urlize }}"><strong>Reading Time:</strong> {{ .ReadingTime }} minutes | <strong>Published:</strong> {{ dateFormat "2006-01-02" .Date }} | <strong>Last Edited:</strong> {{ dateFormat "2006-01-02" .Lastmod }}</a></p>
<p><strong>Download this post as:</strong> <a href="{{ .Permalink | replaceRE "^[^/]+://[^/]+/(.*)/$" "$1" }}.pdf">PDF,</a> <a href="{{ .Permalink | replaceRE "^[^/]+://[^/]+/(.*)/$" "$1" }}.epub">EPUB,</a> or <a href="{{ .Permalink | replaceRE "^[^/]+://[^/]+/(.*)/$" "$1" }}.txt">plaintext</a></p>
{{- if .Params.tags }}
<p class="tags">
{{ $title := .Title }}