~kungtotte/dtt

782aa0d4c437804c195b2faa9a14c4331aebcace — Thomas Landin 2 months ago 2ade301
Add a simple way of listing all blogs

dtt build accepts an argument that is the number of blog posts to list
inside the blog_posts variable (defaults to 5), passing -1 will list all
of them.

Need to figure out full listing/pagination of blogs as well, that's the
final must-have feature for this tool.
1 files changed, 1 insertions(+), 1 deletions(-)

M src/dtt.nim
M src/dtt.nim => src/dtt.nim +1 -1
@@ 121,7 121,7 @@ proc buildCmd(posts_per_page: int = 5) =
        links.add({"target": page.rel_path, "title": page.title}.toTable)

  let
    num_blogs = min(posts.len - 1, posts_per_page)
    num_blogs = if posts_per_page == -1: posts.high else: min(posts.len - 1, posts_per_page)
  sort(posts, dateSort, Descending) # Sort blogs in reverse date order
  for page in pages:
    if not needsUpdate(page.abs_path, page.out_path / page.filename):