Skip to content

Commit

Permalink
added local compilation and fixed bug introduced by restricting to .m…
Browse files Browse the repository at this point in the history
…d files
  • Loading branch information
crvs committed Dec 29, 2019
1 parent dc7130b commit 4c9c099
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ After writing all your posts, the whole thing can be compiled by running `./make

This was written in openbsd and there may be slight differences in the syntax for sed and awk commands.

To generate a locally viewable copy simply set the `baseurl` variable in `makeposts.sh` to `file://<path-to-repo>/deploy`
To generate a locally viewable copy simply run `makeposts.sh local` and the resulting webpage saved in the `deploy` directory should be fully functional

5 changes: 5 additions & 0 deletions makeposts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
blogname="MY BLOG"
baseurl=https://my_base_url.xyz

if [ "$1" = "local" ]
then baseurl=file:///`pwd`/deploy
fi

runmarkdown () {
lowdown -e math $1 | sed "s@INSERTBASEURL@${baseurl}@g"
}
Expand Down Expand Up @@ -77,6 +81,7 @@ postmanifest=`mktemp`

for file in `ls -1 posts/*.md`;
do
file=${file##posts/}
outfile=${file%%.md}.html

getheader posts/$file > $headfile
Expand Down

0 comments on commit 4c9c099

Please sign in to comment.