debug
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
444a937d0b
commit
c50c3ca37a
27
build.sh
27
build.sh
|
@ -2,24 +2,24 @@
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
# bad start, we should build to a tmp dir
|
rm -rf _site-tmp
|
||||||
rm -rf _site
|
mkdir -p _site-tmp
|
||||||
mkdir -p _site
|
touch _site-tmp/index.md
|
||||||
touch _site/index.md
|
|
||||||
buildDate="$(date '+%d %b %Y')"
|
buildDate="$(date '+%d %b %Y')"
|
||||||
|
|
||||||
# $1=file $2=add to index
|
# $1=file $2=add to index
|
||||||
convert_md_to_html() {
|
convert_md_to_html() {
|
||||||
|
ls -la "$1"
|
||||||
fileName=$(basename "${1%.*}")
|
fileName=$(basename "${1%.*}")
|
||||||
postDate=$(date '+%d %b %Y' -d "$(stat -c %y "$1" | awk '{print $1}')")
|
postDate=$(date '+%d %b %Y' -d "$(stat -c %y "$1" | awk '{print $1}')")
|
||||||
bodyClass="page"
|
bodyClass="page"
|
||||||
|
|
||||||
if [ $2 -eq 1 ]; then
|
if [ $2 -eq 1 ]; then
|
||||||
bodyClass="post"
|
bodyClass="post"
|
||||||
echo "- [$(pandoc --template=pandoc-metadata.json "$1" | jq -r .title)](/$fileName.html) _${postDate}_" >> _site/index.md
|
echo "- [$(pandoc --template=pandoc-metadata.json "$1" | jq -r .title)](/$fileName.html) _${postDate}_" >> _site-tmp/index.md
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pandoc --template=tpl-layout.html --highlight-style=zenburn --metadata buildDate="$buildDate" --metadata postDate="$postDate" --metadata bodyClass="$bodyClass" -f markdown -t html5 "$1" > _site/"$fileName".html
|
pandoc --template=tpl-layout.html --highlight-style=zenburn --metadata buildDate="$buildDate" --metadata postDate="$postDate" --metadata bodyClass="$bodyClass" -f markdown -t html5 "$1" > _site-tmp/"$fileName".html
|
||||||
}
|
}
|
||||||
|
|
||||||
# posts
|
# posts
|
||||||
|
@ -41,12 +41,15 @@ done
|
||||||
|
|
||||||
# index
|
# index
|
||||||
# is there a better way to invert the file?
|
# is there a better way to invert the file?
|
||||||
echo "$(tac _site/index.md)" > _site/index.md
|
echo "$(tac _site-tmp/index.md)" > _site-tmp/index.md
|
||||||
pandoc --template=tpl-layout.html --metadata isIndex=1 --metadata buildDate="$buildDate" --metadata bodyClass="index" -f markdown -t html5 _site/index.md > _site/index.html
|
pandoc --template=tpl-layout.html --metadata isIndex=1 --metadata buildDate="$buildDate" --metadata bodyClass="index" -f markdown -t html5 _site-tmp/index.md > _site-tmp/index.html
|
||||||
|
|
||||||
# static files
|
# static files
|
||||||
cp -r static _site/static
|
cp -r static _site-tmp/static
|
||||||
cp -r assets _site/assets
|
cp -r assets _site-tmp/assets
|
||||||
cp -r root/* _site/
|
cp -r root/* _site-tmp/
|
||||||
# concat css
|
# concat css
|
||||||
cat static/reset.css static/styles.css > _site/static/css.css
|
cat static/reset.css static/styles.css > _site-tmp/static/css.css
|
||||||
|
|
||||||
|
rm -rf _site
|
||||||
|
mv _site-tmp _site
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
/*
|
/*
|
||||||
$styles.html()$
|
$styles.html()$
|
||||||
*/
|
*/
|
||||||
|
$highlighting-css$
|
||||||
</style>
|
</style>
|
||||||
<link rel="preload" as="font" href="/static/JetBrainsMono-Regular.woff2">
|
<link rel="preload" as="font" href="/static/JetBrainsMono-Regular.woff2">
|
||||||
<link rel="preload" as="font" href="/static/JetBrainsMono-Regular.woff">
|
<link rel="preload" as="font" href="/static/JetBrainsMono-Regular.woff">
|
||||||
|
|
Loading…
Reference in New Issue