From 32f211876da794180fd2c5994306a846fdc294ce Mon Sep 17 00:00:00 2001 From: daniel-Jones Date: Sun, 10 Sep 2017 16:52:34 +0930 Subject: added meta data to the template, remove new line strips when reading source files --- generatesite.py | 4 ++-- template.txt | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/generatesite.py b/generatesite.py index 7f6af81..e2972cf 100644 --- a/generatesite.py +++ b/generatesite.py @@ -30,7 +30,7 @@ def generateindex(): print("generating {}/index.html from {}".format(outdir, indexsrc)); copyfile(template, outdir + "/index.html"); with open(indexsrc, "r") as contentfile: - content = contentfile.read().replace('\n', ''); + content = contentfile.read(); replace(outdir + "/index.html", "{TITLE}", cfg.get("index", "title")); replace(outdir + "/index.html", "{INFO}", cfg.get("index", "header")); replace(outdir + "/index.html", "{CONTENT}", content); @@ -54,7 +54,7 @@ def generateportfolio(): print("generating {}/portfolio.html from {}".format(outdir, portfoliosrc)); copyfile(template, outdir + "/portfolio.html"); with open(portfoliosrc, "r") as contentfile: - content = contentfile.read().replace('\n', ''); + content = contentfile.read(); replace(outdir + "/portfolio.html", "{TITLE}", cfg.get("portfolio", "title")); replace(outdir + "/portfolio.html", "{INFO}", cfg.get("portfolio", "header")); replace(outdir + "/portfolio.html", "{CONTENT}", content); diff --git a/template.txt b/template.txt index 5184c14..2e8b62a 100644 --- a/template.txt +++ b/template.txt @@ -1,7 +1,11 @@ - - + + + + + + {TITLE} -- cgit v1.2.3