diff options
author | Oxore <oxore@protonmail.com> | 2019-09-29 18:47:44 +0300 |
---|---|---|
committer | Oxore <oxore@protonmail.com> | 2019-09-29 18:47:44 +0300 |
commit | 4c346e747ea7110ea4d95f0d62293b9601b2b590 (patch) | |
tree | 542f52f59c7fa34931d48c45c932f84b561d5b2f | |
parent | 057ccd0a39eaf7ef3c9e6cf3e70044cac14c6bcf (diff) |
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | build.py | 9 | ||||
-rw-r--r-- | index.html | 2 | ||||
-rw-r--r-- | templates/orly-memes.html.j2 (renamed from templates/oreily-memes.html.j2) | 4 |
4 files changed, 10 insertions, 7 deletions
@@ -1,3 +1,3 @@ *.png *.jpg -oreily-memes.html +orly-memes.html @@ -18,6 +18,9 @@ def get_memes(directory): def bake_thumbnails(memes): for meme in memes: if not os.access(meme.get("thumb"), os.F_OK): + thumb_path = os.path.dirname(meme.get("thumb")) + if not os.access(thumb_path, os.F_OK): + os.mkdir(thumb_path, int('0775', 8)) os.system("convert {} -resize 320x320^\> {}" .format(meme.get("orig"), meme.get("thumb"))) @@ -30,11 +33,11 @@ def render_template(template_fname, output_fname, memes): outdir = "." -memes_dir = "oreily-memes" +memes_dir = "orly-memes" # The "om_" prefix means "oreily memes" -om_template_fname = "templates/oreily-memes.html.j2" +om_template_fname = "templates/orly-memes.html.j2" om_outdir = outdir -om_output_fname = om_outdir + "/" + "oreily-memes.html" +om_output_fname = om_outdir + "/" + "orly-memes.html" if not os.access(outdir, os.F_OK): os.mkdir(outdir, int('0775', 8)) @@ -12,7 +12,7 @@ <a href="http://git.oxore.tk">cgit</a> </p> <p> - <a href=oreily-memes.html>O'Reily memes</a> + <a href=orly-memes.html>O'RLY memes</a> </p> </body> </html> diff --git a/templates/oreily-memes.html.j2 b/templates/orly-memes.html.j2 index b1a8ce0..8555c06 100644 --- a/templates/oreily-memes.html.j2 +++ b/templates/orly-memes.html.j2 @@ -1,14 +1,14 @@ <!DOCTYPE html> <html> <head> - <title>O'Reily Memes</title> + <title>O'RLY Memes</title> <style> img.meme {width: 24%;} </style> </head> <body> - <h1>O'Reily Memes</h1> + <h1>O'RLY Memes</h1> <p>{% for meme in memes %} <a href="{{ meme.orig }}"><img class=meme src="{{ meme.thumb }}"></a>{% endfor %} </p> |