the static site generator, generate.ignore.py, is done
This commit is contained in:
parent
d8afa67553
commit
d9cadd8f63
@ -1,18 +0,0 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
{% block head %}
|
||||
<meta charset="utf-8">
|
||||
<title>{% block title %}Writings by Shoofle{% endblock %}</title>
|
||||
<script src="/static/jquery.min.js" type="text/javascript"></script>
|
||||
<link href="/static/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css">
|
||||
<link href="/static/bootstrap/css/bootstrap-responsive.css" rel="stylesheet" type="text/css">
|
||||
<link href="/static/shoofle.css" rel="stylesheet" type="text/css">
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
{% block body -%}
|
||||
{%- include target -%}
|
||||
{%- endblock %}
|
||||
</body>
|
||||
</html>
|
@ -1,21 +0,0 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
{% block head %}
|
||||
<meta charset="utf-8">
|
||||
<title>{% block title %}Writings by Shoofle{% endblock %}</title>
|
||||
<script src="/static/jquery-2.0.3.js" type="text/javascript"></script>
|
||||
<link href="/static/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css">
|
||||
<link href="/static/bootstrap/css/bootstrap-responsive.css" rel="stylesheet" type="text/css">
|
||||
<link href="/static/shoofle.css" rel="stylesheet" type="text/css">
|
||||
<style type="text/css">
|
||||
body { transform: scale(0.5); transform-origin: 0% 0% }
|
||||
</style>
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
{% block body -%}
|
||||
{%- include target -%}
|
||||
{%- endblock %}
|
||||
</body>
|
||||
</html>
|
@ -1,15 +0,0 @@
|
||||
{% extends "articles/article.template.html" %}
|
||||
|
||||
{% block title -%}
|
||||
Features for a game-focused programming language or library
|
||||
{%- endblock %}
|
||||
|
||||
{% block body -%}
|
||||
<p>I like making games but sometimes I spend a lot of time doing stuff that is just annoying. What if a language or environment were designed to make those things easy?</p>
|
||||
<hr>
|
||||
{%- include "articles/snorlax_evaluation.article.html" -%}
|
||||
<hr>
|
||||
{%- include "articles/time_integration.article.html" -%}
|
||||
<hr>
|
||||
{%- include "articles/easy_peasy_state_machinesy.article.html" -%}
|
||||
{%- endblock %}
|
@ -1,16 +0,0 @@
|
||||
{% extends "articles/article.template.html" %}
|
||||
|
||||
{% block title -%}
|
||||
Features for a game-focused programming language or library
|
||||
{%- endblock %}
|
||||
|
||||
{% block body -%}
|
||||
<style type="text/css"> body { transform: scale(0.5); transform-origin: 0% 0%; } </style>
|
||||
<p>I like making games but sometimes I spend a lot of time doing stuff that is just annoying. What if a language or environment were designed to make those things easy?</p>
|
||||
<hr>
|
||||
{%- include "articles/snorlax_evaluation.article.html" -%}
|
||||
<hr>
|
||||
{%- include "articles/time_integration.article.html" -%}
|
||||
<hr>
|
||||
{%- include "articles/easy_peasy_state_machinesy.article.html" -%}
|
||||
{%- endblock %}
|
0
finalized/static/WHA.epub
Executable file → Normal file
0
finalized/static/WHA.epub
Executable file → Normal file
0
finalized/static/sleepy.html
Executable file → Normal file
0
finalized/static/sleepy.html
Executable file → Normal file
@ -1,9 +0,0 @@
|
||||
{% extends "articles/article.template.html" %}
|
||||
|
||||
{% block title -%}
|
||||
How should this website be laid out?
|
||||
{%- endblock %}
|
||||
|
||||
{% block body -%}
|
||||
{%- include "articles/auriga.article.html" -%}
|
||||
{%- endblock %}
|
@ -1,9 +0,0 @@
|
||||
{% extends "articles/article.template.html" %}
|
||||
|
||||
{% block title -%}
|
||||
Impromptu Soundsystems would be a good name for a band.
|
||||
{%- endblock %}
|
||||
|
||||
{% block body -%}
|
||||
{%- include "articles/distributed_speakers.article.html" -%}
|
||||
{%- endblock %}
|
@ -1,9 +0,0 @@
|
||||
{% extends "articles/article.template.html" %}
|
||||
|
||||
{% block title -%}
|
||||
I occasionally play some videogames.
|
||||
{%- endblock %}
|
||||
|
||||
{% block body -%}
|
||||
{%- include "articles/game_log.article.html" -%}
|
||||
{%- endblock %}
|
@ -1,15 +0,0 @@
|
||||
{% extends "articles/article.template.html" %}
|
||||
|
||||
{% block title -%}
|
||||
Features for a game-focused programming language or library
|
||||
{%- endblock %}
|
||||
|
||||
{% block body -%}
|
||||
<p>I like making games but sometimes I spend a lot of time doing stuff that is just annoying. What if a language or environment were designed to make those things easy?</p>
|
||||
<hr>
|
||||
{%- include "articles/snorlax_evaluation.article.html" -%}
|
||||
<hr>
|
||||
{%- include "articles/time_integration.article.html" -%}
|
||||
<hr>
|
||||
{%- include "articles/easy_peasy_state_machinesy.article.html" -%}
|
||||
{%- endblock %}
|
@ -1,9 +0,0 @@
|
||||
{% extends "articles/article.template.html" %}
|
||||
|
||||
{% block title -%}
|
||||
The Mindjail Engine!
|
||||
{%- endblock %}
|
||||
|
||||
{% block body -%}
|
||||
{%- include "articles/mindjail_engine.article.html" -%}
|
||||
{%- endblock %}
|
@ -1,9 +0,0 @@
|
||||
{% extends "articles/article.template.html" %}
|
||||
|
||||
{% block title -%}
|
||||
I have used OAuth, and lived to tell the tale.
|
||||
{%- endblock %}
|
||||
|
||||
{% block body -%}
|
||||
{%- include "articles/oauth.article.html" -%}
|
||||
{%- endblock %}
|
@ -1,9 +0,0 @@
|
||||
{% extends "articles/article.template.html" %}
|
||||
|
||||
{% block title -%}
|
||||
Play For X
|
||||
{%- endblock %}
|
||||
|
||||
{% block body -%}
|
||||
{%- include "articles/play_for_x.article.html" -%}
|
||||
{%- endblock %}
|
@ -1,9 +0,0 @@
|
||||
{% extends "articles/article.template.html" %}
|
||||
|
||||
{% block title -%}
|
||||
Javascript DDR Clone
|
||||
{%- endblock %}
|
||||
|
||||
{% block body -%}
|
||||
{%- include "articles/shoof_shoof_revolution.article.html" -%}
|
||||
{%- endblock %}
|
@ -1,9 +0,0 @@
|
||||
{% extends "articles/article.template.html" %}
|
||||
|
||||
{% block title -%}
|
||||
I spin things around!
|
||||
{%- endblock %}
|
||||
|
||||
{% block body -%}
|
||||
{%- include "articles/spinning.article.html" -%}
|
||||
{%- endblock %}
|
@ -1,9 +0,0 @@
|
||||
{% extends "articles/article.template.html" %}
|
||||
|
||||
{% block title -%}
|
||||
Tamari Lattices: very pretty.
|
||||
{%- endblock %}
|
||||
|
||||
{% block body -%}
|
||||
{%- include "articles/tamari.article.html" -%}
|
||||
{%- endblock %}
|
@ -1,9 +0,0 @@
|
||||
{% extends "articles/article.template.html" %}
|
||||
|
||||
{% block title -%}
|
||||
contentEditable: Text Editors Made Easy?
|
||||
{%- endblock %}
|
||||
|
||||
{% block body -%}
|
||||
{%- include "articles/text_editors_with_contenteditable.article.html" -%}
|
||||
{%- endblock %}
|
46
generate.py
46
generate.py
@ -5,14 +5,12 @@ import shutil
|
||||
import argparse
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("destination", help="where to put the rendered site")
|
||||
parser.add_argument("-i", "--input", type=Path, help="source materials")
|
||||
parser.add_argument("-o", "--output", type=Path, help="where to put the rendered site")
|
||||
args = parser.parse_args()
|
||||
|
||||
root_folder = Path(__file__).parent
|
||||
source = root_folder / "source"
|
||||
finals = root_folder / "finalized"
|
||||
if args.destination:
|
||||
finals = args.destination()
|
||||
source = args.input
|
||||
finals = args.output
|
||||
|
||||
env = Environment(
|
||||
loader=FileSystemLoader(source),
|
||||
@ -20,14 +18,36 @@ env = Environment(
|
||||
|
||||
# clear out the folder finalized
|
||||
|
||||
shutil.copytree(source, finals)
|
||||
|
||||
# walk the source directory and make all the corresponding files into finalized
|
||||
for path_to_file in (source / "articles").glob("*"):
|
||||
rel_path = path_to_file.relative_to(source)
|
||||
|
||||
if ".article.html" in str(path_to_file):
|
||||
with open(finals / rel_path, "w") as output:
|
||||
article_template = env.get_template("articles/article.template.html")
|
||||
output.write(article_template.render(title="Article", target=str(path_to_file.relative_to(source))))
|
||||
|
||||
for path_to_source in source.glob("**/*"):
|
||||
rel_path = path_to_source.relative_to(source)
|
||||
path_to_output = finals / rel_path
|
||||
|
||||
if ".ignore" in str(rel_path):
|
||||
continue
|
||||
|
||||
if path_to_source.is_dir():
|
||||
pass
|
||||
|
||||
elif ".article.html" in str(path_to_source):
|
||||
path_to_output = path_to_output.parent / path_to_output.name.replace(".article","")
|
||||
with open(path_to_output, "w") as output_file:
|
||||
os.makedirs(path_to_output.parent, exist_ok=True)
|
||||
output_file.write(article_template.render(title="Article", target=str(rel_path)))
|
||||
|
||||
elif ".renderme" in str(path_to_source):
|
||||
path_to_output = path_to_output.parent / path_to_output.name.replace(".renderme","")
|
||||
with open(path_to_output, "w") as output_file:
|
||||
os.makedirs(path_to_output.parent, exist_ok=True)
|
||||
output_file.write(env.get_template(rel_path).render())
|
||||
|
||||
elif ".template.html" in str(path_to_source):
|
||||
pass
|
||||
|
||||
else:
|
||||
os.makedirs(path_to_output.parent, exist_ok=True)
|
||||
shutil.copy(path_to_source, path_to_output)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user