From a08d9c6e298466e09315c6126b0ab579cb551ceb Mon Sep 17 00:00:00 2001 From: chimchooree Date: Wed, 7 Oct 2020 12:15:36 -0500 Subject: [PATCH] article renders in article css; the article text is squished to the left and begins in the nav row --- src/diary/entries/{200808.tpl => 200808} | 0 src/diary/entries/{200810.tpl => 200810} | 0 src/diary/entries/{200813.tpl => 200813} | 0 src/diary/entries/{200815.tpl => 200815} | 0 src/diary/entries/{200918.tpl => 200918} | 0 src/diary/entries/{200919.tpl => 200919} | 0 src/diary/entries/{200926.tpl => 200926} | 0 src/diary/entries/{201001.tpl => 201001} | 0 src/diary/entries/{201003.tpl => 201003} | 0 src/diary/entries/raw/article-to-html.py | 7 +++++-- .../entries/raw/entries/{200808.tpl => 200808} | 0 .../entries/raw/entries/{200810.tpl => 200810} | 0 .../entries/raw/entries/{200813.tpl => 200813} | 0 .../entries/raw/entries/{200815.tpl => 200815} | 0 .../entries/raw/entries/{200918.tpl => 200918} | 0 .../entries/raw/entries/{200919.tpl => 200919} | 0 .../entries/raw/entries/{200926.tpl => 200926} | 0 .../entries/raw/entries/{201001.tpl => 201001} | 0 .../entries/raw/entries/{201003.tpl => 201003} | 0 src/index.py | 17 +++++++++-------- src/static/css/feature.css | 2 +- src/views/feature.tpl | 2 +- 22 files changed, 16 insertions(+), 12 deletions(-) rename src/diary/entries/{200808.tpl => 200808} (100%) rename src/diary/entries/{200810.tpl => 200810} (100%) rename src/diary/entries/{200813.tpl => 200813} (100%) rename src/diary/entries/{200815.tpl => 200815} (100%) rename src/diary/entries/{200918.tpl => 200918} (100%) rename src/diary/entries/{200919.tpl => 200919} (100%) rename src/diary/entries/{200926.tpl => 200926} (100%) rename src/diary/entries/{201001.tpl => 201001} (100%) rename src/diary/entries/{201003.tpl => 201003} (100%) rename src/diary/entries/raw/entries/{200808.tpl => 200808} (100%) rename src/diary/entries/raw/entries/{200810.tpl => 200810} (100%) rename src/diary/entries/raw/entries/{200813.tpl => 200813} (100%) rename src/diary/entries/raw/entries/{200815.tpl => 200815} (100%) rename src/diary/entries/raw/entries/{200918.tpl => 200918} (100%) rename src/diary/entries/raw/entries/{200919.tpl => 200919} (100%) rename src/diary/entries/raw/entries/{200926.tpl => 200926} (100%) rename src/diary/entries/raw/entries/{201001.tpl => 201001} (100%) rename src/diary/entries/raw/entries/{201003.tpl => 201003} (100%) diff --git a/src/diary/entries/200808.tpl b/src/diary/entries/200808 similarity index 100% rename from src/diary/entries/200808.tpl rename to src/diary/entries/200808 diff --git a/src/diary/entries/200810.tpl b/src/diary/entries/200810 similarity index 100% rename from src/diary/entries/200810.tpl rename to src/diary/entries/200810 diff --git a/src/diary/entries/200813.tpl b/src/diary/entries/200813 similarity index 100% rename from src/diary/entries/200813.tpl rename to src/diary/entries/200813 diff --git a/src/diary/entries/200815.tpl b/src/diary/entries/200815 similarity index 100% rename from src/diary/entries/200815.tpl rename to src/diary/entries/200815 diff --git a/src/diary/entries/200918.tpl b/src/diary/entries/200918 similarity index 100% rename from src/diary/entries/200918.tpl rename to src/diary/entries/200918 diff --git a/src/diary/entries/200919.tpl b/src/diary/entries/200919 similarity index 100% rename from src/diary/entries/200919.tpl rename to src/diary/entries/200919 diff --git a/src/diary/entries/200926.tpl b/src/diary/entries/200926 similarity index 100% rename from src/diary/entries/200926.tpl rename to src/diary/entries/200926 diff --git a/src/diary/entries/201001.tpl b/src/diary/entries/201001 similarity index 100% rename from src/diary/entries/201001.tpl rename to src/diary/entries/201001 diff --git a/src/diary/entries/201003.tpl b/src/diary/entries/201003 similarity index 100% rename from src/diary/entries/201003.tpl rename to src/diary/entries/201003 diff --git a/src/diary/entries/raw/article-to-html.py b/src/diary/entries/raw/article-to-html.py index 2986c13..75afe35 100644 --- a/src/diary/entries/raw/article-to-html.py +++ b/src/diary/entries/raw/article-to-html.py @@ -22,13 +22,16 @@ def collect_raw(d): return glob.glob(d) def clear_articles(): - files = glob.glob('../*.tpl') + files = glob.glob('../*') + print(files) + if '../raw' in files: + files.remove('../raw') for f in files: os.remove(f) def main(): clear_articles() - create_files(collect_raw('entries/*.tpl'), '..') + create_files(collect_raw('entries/*'), '..') ## Start Program ## diff --git a/src/diary/entries/raw/entries/200808.tpl b/src/diary/entries/raw/entries/200808 similarity index 100% rename from src/diary/entries/raw/entries/200808.tpl rename to src/diary/entries/raw/entries/200808 diff --git a/src/diary/entries/raw/entries/200810.tpl b/src/diary/entries/raw/entries/200810 similarity index 100% rename from src/diary/entries/raw/entries/200810.tpl rename to src/diary/entries/raw/entries/200810 diff --git a/src/diary/entries/raw/entries/200813.tpl b/src/diary/entries/raw/entries/200813 similarity index 100% rename from src/diary/entries/raw/entries/200813.tpl rename to src/diary/entries/raw/entries/200813 diff --git a/src/diary/entries/raw/entries/200815.tpl b/src/diary/entries/raw/entries/200815 similarity index 100% rename from src/diary/entries/raw/entries/200815.tpl rename to src/diary/entries/raw/entries/200815 diff --git a/src/diary/entries/raw/entries/200918.tpl b/src/diary/entries/raw/entries/200918 similarity index 100% rename from src/diary/entries/raw/entries/200918.tpl rename to src/diary/entries/raw/entries/200918 diff --git a/src/diary/entries/raw/entries/200919.tpl b/src/diary/entries/raw/entries/200919 similarity index 100% rename from src/diary/entries/raw/entries/200919.tpl rename to src/diary/entries/raw/entries/200919 diff --git a/src/diary/entries/raw/entries/200926.tpl b/src/diary/entries/raw/entries/200926 similarity index 100% rename from src/diary/entries/raw/entries/200926.tpl rename to src/diary/entries/raw/entries/200926 diff --git a/src/diary/entries/raw/entries/201001.tpl b/src/diary/entries/raw/entries/201001 similarity index 100% rename from src/diary/entries/raw/entries/201001.tpl rename to src/diary/entries/raw/entries/201001 diff --git a/src/diary/entries/raw/entries/201003.tpl b/src/diary/entries/raw/entries/201003 similarity index 100% rename from src/diary/entries/raw/entries/201003.tpl rename to src/diary/entries/raw/entries/201003 diff --git a/src/index.py b/src/index.py index c5bb48a..bf1b076 100644 --- a/src/index.py +++ b/src/index.py @@ -21,9 +21,12 @@ def list_headlines(articles): def retrieve_article(page): text = [] - with open(loc + page) as f: - text = f.readlines() - return text + string = "" + with open(loc + str(page)) as f: + text = f.readlines() + for line in text: + string += line + return string def list_snippets(articles): limit = 4 @@ -136,14 +139,12 @@ def diary(page): @route('/diary/entries/') def entry(page): - info = {'css': 'box', 'title': 'blessfrey - credits', 'year': datetime.datetime.now()} + """diary entry""" + info = {'css': 'diary', 'title': 'blessfrey - developer diary', 'year': datetime.datetime.now(), 'entry': retrieve_article(page), 'latest': list_headlines(sort_files(gather_files())[0:5]), 'page': page} abs_app_dir_path = os.path.dirname(os.path.realpath(__file__)) abs_views_path = os.path.join(abs_app_dir_path, 'views') TEMPLATE_PATH.insert(0, abs_views_path ) - return template(os.path.join(abs_views_path,'contact.tpl'), info) -# """diary entry""" -# info = {'css': 'diary', 'title': 'blessfrey - developer diary', 'year': datetime.datetime.now(), 'entry': retrieve_article(page), 'latest': list_headlines(sort_files(gather_files())[0:5]), 'page': page} -# return template('feature.tpl', info) + return template(os.path.join(abs_views_path,'feature.tpl'), info) @route('/box') def box(): diff --git a/src/static/css/feature.css b/src/static/css/feature.css index 1db45cf..7bc5144 100644 --- a/src/static/css/feature.css +++ b/src/static/css/feature.css @@ -150,7 +150,7 @@ mark { .diary-entry { grid-area: 3 / 2 / 7 / 3; - background-color: #F4A5AE; + background-color: #Ff0000; padding: 5px; } diff --git a/src/views/feature.tpl b/src/views/feature.tpl index 755b132..1a6c1b6 100644 --- a/src/views/feature.tpl +++ b/src/views/feature.tpl @@ -5,7 +5,7 @@
- {{entry}} + {{!entry}}