~kungtotte/dtt

120d85dbdbf9b4a9bb16b2e8ecd42f7a2c787b0c — Thomas Landin 2 months ago 2e519c1
Tweak templates for blog output
2 files changed, 15 insertions(+), 2 deletions(-)

M src/dtt.nim
M src/tmpl.nim
M src/dtt.nim => src/dtt.nim +0 -1
@@ 225,7 225,6 @@ proc buildCmd() =
    stderr.writeLine(fmt"{bin}: Could not find a config.cfg file. Is this a dtt directory?")
    quit(ord(DttError.NotADttDirectory))

  # let config = try: findConfig(wd / "config.cfg") except IOError: false
  loadMetaData(config, mcontext)
  let blogs = findBlogPosts(condir, tmpldir)
  mcontext["links"] = findLinks(condir, excludes=blogs)

M src/tmpl.nim => src/tmpl.nim +15 -1
@@ 4,6 4,7 @@ let
charset = "UTF-8"
language = "en"
title = "My Own Webpage"
blogs_per_page = "4"
license = "CC-BY-SA"
license_url = "https://creativecommons.org/licenses/by-sa/2.0/"
[Author]


@@ 30,6 31,9 @@ email = "your@email.tld"
"""
  post* = """
  <article>
    <header>
    <h2><a href="/{{blog_link}}">{{slug}}</a></h2> <time>Written on: {{date}}</time>
    </header>
    {{{content}}}
  </article>
"""


@@ 88,7 92,7 @@ nav {
  display: flex;
  position: sticky;
  width: 100%;
  height: inherit;
  min-height: 4ch;
  top: 0px;
  left: 0px;
  right: 0px;


@@ 108,6 112,16 @@ nav a, nav a:visited, nav a:hover {
h1 {
    font-size: 200%;
}
article {
  margin-bottom: 5ch;
}
article header a {
  color: var(--fg-bold);
}
article h1 {
  /* Makes blog headings play nice when listing several of them out*/
  display: none;
}
main {
  max-width: 70ch;
  font-size: 90%;