Compare commits

...

5 Commits

Author SHA1 Message Date
davidovski 191ba69fb9 using h2 for blog posts title 2022-05-22 17:35:37 +01:00
davidovski f131e30fcb changed blog entries to ul 2022-05-22 17:35:04 +01:00
davidovski 6483537665 changed h2 in article titles to span 2022-05-22 17:31:11 +01:00
davidovski 79482e692d removed hr bewtween articles 2022-05-22 17:30:40 +01:00
davidovski 255ddf90ed removed text from blog entries 2022-05-22 17:27:42 +01:00
4 changed files with 15 additions and 9 deletions

View File

@ -38,13 +38,14 @@ def listPages():
"source_file" : path,
"source_content" : content,
"html" : markdown.markdown("\n".join(content.split("\n...\n"))),
"title" : content.split("\n")[0].replace("# ", ""),
"summary" : lowerHeadings(markdown.markdown(content.split("\n...\n")[0])),
"timestamp" : timestamp,
"date": time.strftime(date_format, time.localtime(timestamp)),
"name" : name,
"url" : f"entries/{name}.html"
})(".".join(p.split(".")[:-1]))
)(os.stat(path).st_ctime)
)(os.stat(path).st_mtime)
)(open(path, "r").read())
)(os.path.join(source, p)) for p in os.listdir(source)
]
@ -86,17 +87,17 @@ def make():
summary_templ = getTemplateHTML("summary.html")
summariesHTML = getTemplateHTML("about.html") + "\n<hr>\n"+ "\n<hr>\n".join(
summariesHTML = getTemplateHTML("about.html") + "\n<hr><ul>\n"+ "\n".join(
[
formatEntry(summary_templ, page)
.replace(
"%content%",
page["summary"] + (f"<a href={page['url']}>read more...</a>" if len(page["source_content"].split("\n...\n")) > 1 else "")
)
).replace("%title%", page["title"])
for page in pages
][: : -1]
)
) + "</ul>"
entry_templ = getTemplateHTML("page.html")

View File

@ -1,3 +1,5 @@
# welcome
welcome. i decided to turn this webpage into blog-style site... i havent got a topic or anything, so expect either: quality tutorials and very interesting techy things; or just random shitposts or rambles about things.
originally i was going to make this blog on [b.davidovski.xyz](https://b.davidovski.xyz) using [nanoblogger](http://nanoblogger.sourceforge.net/) (you might be able to still see the start of that) but nb itself seemed quite dead, and i couldn't really be asked to customise it all myself. So i made my own script to generate this static site: [kblg](https://github.com/davidovski/kblg/). Right now its probably just the bare minimum needed for this, but I am planning to add more things to it as I go along (including rss, if anyone would be interested?)

View File

@ -14,4 +14,5 @@
<hr>
<hr>
<h1 class="header">blog posts</h1>
<h2 class="header">blog posts</h2>

View File

@ -1,4 +1,6 @@
<div class="entry">
<div class="small">%date% <a href="%url%">🔗</a></div>
%content%
</div>
<li class="entry">
<a href="%url%">
<div class="small">%date%</div>
<span>%title%</span>
</a>
</li>