1
0
mirror of https://github.com/tiyn/beaker-blog.git synced 2026-02-22 04:44:48 +01:00

adding config.py and switchable css

This commit is contained in:
TiynGER
2020-05-27 22:00:19 +02:00
parent a5a20398c0
commit c223a21bdd
13 changed files with 336 additions and 52 deletions

View File

@@ -5,7 +5,7 @@ import os
from os import path
import pathlib
WEBSITE = 'localhost:5000'
import config
ENTRY_DIR = 'templates/entry'
@@ -36,7 +36,7 @@ def gen_arch_string():
filename = filename.split('.', 1)[0]
content_string += '<li>'
content_string += curr_date + ' - '
content_string += title + ' ['
content_string += title + ' ['
content_string += '<a href="' + '/index.html#' + \
filename + '">' + 'link' + '</a> - '
content_string += '<a href="' + '/entry/' + \
@@ -65,7 +65,8 @@ def gen_index_string():
content_string += '<div class=\'entry\'>\n'
content_string += '<h2 id=\'' + filename + '\'>' + title + '</h2>\n'
content_string += '[<a href="' + '/entry/' + \
pathlib.PurePath(file).name + '">' + 'standalone' + '</a>]<br>\n'
pathlib.PurePath(file).name + '">' + \
'standalone' + '</a>]<br>\n'
if file.endswith('.html'):
for line in text:
content_string += line
@@ -135,7 +136,8 @@ def get_rss_string():
filename = filename.split('.', 1)[0]
content_string += '<item>\n'
content_string += '<title>' + title + '</title>\n'
content_string += '<guid>' + '/index.html#' + filename + '</guid>\n'
content_string += '<guid>' + config.WEBSITE + \
'/index.html#' + filename + '</guid>\n'
content_string += '<pubDate>' + \
datetime.fromtimestamp(os.path.getctime(file)).strftime(
'%Y-%m-%d') + '</pubDate>\n'