Hi,

Pon Arun Kumar R <ponarunku...@gmail.com> writes:

> Objective: To include additional metadata in the post content file in
> markdown. For example: lang : en-US translate="Yes" when added to the post
> markdown content file, the expected rendering of the html of the blog post
> content is <div lang="en-US" translate="Yes">.....content of the blog
> post.....</div>
>
> Example: myfirstblogpost.md
> title: my first blog post
> author: guile haunt user
> tags: haunt, guile
> lang: en-US
> translate: yes
> ---
> Sample blog post content that is expected to be in the mentioned language
> as referenced in the metadata above as lang: en-US and also provides
> additional attribute of translate: yes. so once built and served by haunt,
> the expected html of the blog post is expected to include <div lang="en-US"
> translate="yes"> Sample blog post content that is ......</div>
>
> 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

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

Attachment: signature.asc
Description: PGP signature

Reply via email to