Created
March 22, 2013 18:12
-
-
Save acdimalev/5223493 to your computer and use it in GitHub Desktop.
make website
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CONTENT = $(addsuffix .html,$(addprefix http/,$(notdir $(wildcard content/*)))) | |
all: $(CONTENT) http/index.html | |
clean: | |
rm -r http | |
mkdir http | |
http/%.html: content/% script.content.html.sh template.content.html | |
mkdir -p $(dir $@) | |
sh script.content.html.sh $< < template.content.html > $@ | |
http/index.html: content/* script.index.html.sh template.index.html | |
sh script.index.html.sh < template.index.html > http/index.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export content="$(markdown $1)" | |
python script.format.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from string import Template | |
from sys import stdin | |
from os import environ | |
import re | |
d = dict() | |
for key in environ: | |
if (not re.match("[a-z]", key)): continue | |
d[key] = environ[key] | |
print Template(stdin.read()).substitute(d), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
content='' | |
for item in $(ls content | sort -rn | head -n8); do | |
content="$content<div><a href=\"$item.html\">$item</a></div>" | |
done | |
export content | |
python script.format.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head><title>scribblebound.com</title></head> | |
<body>$content</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head><title>scribblebound.com</title></head> | |
<body>$content</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment