add deploy target and cleanup build.sh
This commit is contained in:
parent
a274350add
commit
a92cf3edcb
5
Makefile
5
Makefile
@ -7,3 +7,8 @@ update-bootstrap:
|
|||||||
.PHONY: build
|
.PHONY: build
|
||||||
build:
|
build:
|
||||||
./build.sh
|
./build.sh
|
||||||
|
|
||||||
|
.PHONY: deploy
|
||||||
|
deploy:
|
||||||
|
rsync -av dist desk:/var/www/balki.me
|
||||||
|
|
||||||
|
26
build.sh
26
build.sh
@ -3,22 +3,16 @@
|
|||||||
# copy assets
|
# copy assets
|
||||||
cp -r assets/ dist/
|
cp -r assets/ dist/
|
||||||
|
|
||||||
make_index() {
|
make_page() {
|
||||||
cp templates/index.tmpl.html build/index.html
|
name="$1"
|
||||||
sed -i 's/<title>/&Home/' build/index.html
|
title="$2"
|
||||||
pandoc pages/index.md > build/index-content.html
|
cp templates/index.tmpl.html "build/$name.html"
|
||||||
sed -i '/<main>/r build/index-content.html' build/index.html
|
sed -i "s/<title>/&$title/" "build/$name.html"
|
||||||
cp build/index.html dist/
|
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
|
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
<li class="nav-item"><a class="nav-link" href="/"> Home </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="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="/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="https://gitea.balki.me/balki/blog"> Source </a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user