Thank you Tomas and Dave for sharing your inputs!

I tried the following steps
1. Downloaded haunt-0.3.0.tar.gz
2. Extracted the source code tar -xvzf haunt-0.3.0.tar.gz
3. tried ./configure
4. Installed guile-3.0-dev using apt-get install guile-3.0-dev
5. export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig
6. ./configure
7. make
8. make install
9. added the following in haunt/post.scm
    (define (post-metadata-lang post)
    (assq-ref (post-metadata post) 'lang))

    (define (post-lang post)
    "Return the lang of POST, or #f if no title is specified."
    (post-ref post 'lang))

     And in the module definition of haunt post updated the #:export to
include post-lang and post-metadata-lang
10. add the following in haunt/builder/blog.scm in the
ugly-default-post-template definition
      (h2 , (post-ref post 'lang))
      (h1, (post-metadata-lang))
11. then a) ./configure b) make  c) make install
12. created the following haunt.scm under a new folder named homesite
(use-modules (haunt asset)
             (haunt site)
             (haunt builder blog)
             (haunt builder atom)
             (haunt reader commonmark))

(site #:title "Haunt Homesite"
      #:domain "homesite.com"
      #:default-metadata
      '((author . "Guile User")
        (email  . "guileu...@guile.com"))
      #:readers (list commonmark-reader)
      #:builders (list (blog)
                       (atom-feed)
                       (atom-feeds-by-tag)))
13. created the file hello.md under homesite/posts
title: My first blog post
date: 2025-03-18 18:53
lang: en-US
author: Metadata Guile User
---
# My First Blog Post
## lets learn to haunt using guile
Haunt seems to be the best static site generator *SSG* using *guile*

14. haunt build
13. haunt serve
14. the rendered http://localhost:8080/my-first-blog-post.html was not
retrieving the 'en-US' value from lang: en-US keyvalue pair from the
metadata section of the markdown file hello.md
<!DOCTYPE html><head><meta charset="utf-8" /><title>My first blog post —
Haunt Homesite</title></head><body><h1>Haunt Homesite</h1><h2>My first blog
post</h2><h3>by Metadata Guile User — Tue 18 March 2025</h3><div><h1>My
First Blog Post</h1><h2>lets learn to haunt using guile</h2><p>Haunt seems
to be the best static site generator <em>SSG</em> using
<em>guile</em></p></div></body>

16. the changes in step 10 above were not reflected in the result in step
14. (I am not sure how to trace and check whether the values from the .md
file are getting parsed and set into the post-metadata object.

Questions:
A) Do I need to try and use guix shell, download the source code for haunt,
install the guile development version and then try to configure, build and
serve the changes to test?
B) How to setup a development environment for this code base in VS Code so
that debugging could be enabled to see where the value is being passed?
C) How to setup a development environment to debug haunt code base?
D) While the theme template for rendering the html is part of the blog
builder, what approach is recommended to create a module for theme template
so that based on the requirement or by updating the metadata section within
the markdown file (for example: theme: ugly-default-post-template), the
respective template could be applied?

Expected outcome:
By incorporating the changes with attributes such as lang: en-US,
translate: yes | no and theme: ugly-default-post-template as key value
pairs in the markdown file, the rendered post is expected to be
customizable and also the overall blog with the list of posts could have
multi language posts in the same blog and could also enable translations
for other languages based on the translate: yes attribute.

On Fri, Mar 21, 2025 at 8:01 AM Thompson, David <dthomps...@worcester.edu>
wrote:

> On Thu, Mar 20, 2025 at 5:50 PM Tomas Volf <~@wolfsden.cz> wrote:
> >
> > Pon Arun Kumar R <ponarunku...@gmail.com> writes:
> >
> > > Questions:
> > > 1. Which module in haunt needs to be modified? is it the module where
> the
> > > metadata key value pairs are passed on to render the html?
> >
> > I do not think there is anything in haunt that you need to modify.  You
> > can just add your extra metadata and access the full alist using
> > post-metadata procedure.  You can even define additional accessors in
> > your own code as:
> >
> > --8<---------------cut here---------------start------------->8---
> > (define (post-metadata-lang post)
> >   (assq-ref (post-metadata post) 'lang))
> > --8<---------------cut here---------------end--------------->8---
> >
> > > 2. How to code and extend so that the global attributes, local
> attributes
> > > and HTML5 elements are supported with(in) haunt posts?
> >
> > You can just modify your theme, in particular the procedure passed to
> > #:post-template argument, to inspect the post-metadata and adjust the
> > generated HTML based on your requirements.
>
> Tomas is correct. Thanks for answering faster than I could. :)
>
> - Dave
>

Reply via email to