29 lines
957 B
Bash
Executable File
29 lines
957 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# change if you'd like a different destination directory
|
|
site_folder=site
|
|
|
|
# templates folder location
|
|
templates=templates
|
|
|
|
# make site folder if doesn't exist
|
|
mkdir -p $site_folder
|
|
|
|
# copy over themes
|
|
mkdir -p "$site_folder"/css
|
|
cp -r themes/*.css "$site_folder"/css
|
|
|
|
# uncomment this section if you prefer flat hierarchy postname.md -> postname.html in single folder
|
|
# pandoc --standalone --template template.html $1 -o $site_folder/"${1%.md}.html"
|
|
|
|
# uncomment this section if you prefer posts to be in their own subfolder so permalinks are website.com/postname/
|
|
post_name="${1%.md}"
|
|
mkdir -p $site_folder/$post_name
|
|
pandoc --standalone --template $templates/post_template.html $1 -o $site_folder/$post_name/index.html
|
|
|
|
# build site index
|
|
touch $site_folder/index.md
|
|
echo "[$post_name]($post_name/)">>$site_folder/index.md
|
|
echo ""
|
|
pandoc --standalone --template $templates/site_template.html $site_folder/index.md -o $site_folder/index.html
|