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}}