add deploy target and cleanup build.sh

This commit is contained in:
Balakrishnan Balasubramanian 2023-03-18 05:29:58 -04:00
parent a274350add
commit a92cf3edcb
3 changed files with 19 additions and 20 deletions

View File

@ -7,3 +7,8 @@ update-bootstrap:
.PHONY: build
build:
./build.sh
.PHONY: deploy
deploy:
rsync -av dist desk:/var/www/balki.me

View File

@ -3,22 +3,16 @@
# copy assets
cp -r assets/ dist/
make_index() {
cp templates/index.tmpl.html build/index.html
sed -i 's/<title>/&Home/' build/index.html
pandoc pages/index.md > build/index-content.html
sed -i '/<main>/r build/index-content.html' build/index.html
cp build/index.html dist/
make_page() {
name="$1"
title="$2"
cp templates/index.tmpl.html "build/$name.html"
sed -i "s/<title>/&$title/" "build/$name.html"
pandoc "pages/$name.md" > "build/$name-content.html"
sed -i "/<main>/r build/$name-content.html" "build/$name.html"
cp "build/$name.html" dist/
}
make_index
make_page index Home
make_page stuff Stuff
make_stuff() {
cp templates/index.tmpl.html build/stuff.html
sed -i 's/<title>/&Stuff/' build/stuff.html
pandoc pages/stuff.md > build/stuff-content.html
sed -i '/<main>/r build/stuff-content.html' build/stuff.html
cp build/stuff.html dist/
}
make_stuff

View File

@ -19,10 +19,10 @@
<nav>
<ul class="nav">
<li class="nav-item"><a class="nav-link" href="/"> Home </a></li>
<li class="nav-item"><a class="nav-link" href="https://blog.balki.me"> Blog </a></li>
<li class="nav-item"><a class="nav-link" href="/stuff.html"> Stuff </a></li>
<li class="nav-item"><a class="nav-link" href="/source"> Source </a></li>
<li class="nav-item"><a class="nav-link" href="/"> Home </a></li>
<li class="nav-item"><a class="nav-link" href="https://blog.balki.me"> Blog </a></li>
<li class="nav-item"><a class="nav-link" href="/stuff.html"> Stuff </a></li>
<li class="nav-item"><a class="nav-link" href="https://gitea.balki.me/balki/blog"> Source </a></li>
</ul>
</nav>