hfactor / hfactor.github.io

My Zettelkasten / Working Notes / Digital garden | http://hiran.in
MIT License
7 stars 6 forks source link

Printing meta for logs #3

Open tothlp opened 1 month ago

tothlp commented 1 month ago

Hey there, I was curious about your template, and found the following in Post layout:

<div class="meta-values" style="padding-bottom: var(--padding-broad);">
    {% for item in page.meta %}
        {{ item | last }}
        {% if forloop.last %}{% else %} • {% endif %}
    {% endfor %}
    • <a href = "{{ page.link }}"> Link </a>
</div>

In theory, the meta tags should print, but they don't. I believe, that instead of the following format,

meta-people: James Stewart, K Roméy
meta-pub: HarperCollins

you should use:

meta:
  people: James Stewart, K Roméy
  pub: HarperCollins

And inside the post layout:

<div class="meta-values" style="padding-bottom: var(--padding-broad);">
    {% for item in page.meta %}
        {{ item.last }}
        {% if forloop.last %}{% else %} • {% endif %}
    {% endfor %}
    • <a href = "{{ page.link }}"> Link </a>
</div>

I am sorry if it is no interest to you, but though I'd help. :)

hfactor commented 1 month ago

Thanks a lot of going through my stupid code. The code is broken, not following the basic logic, and I have made some more changes, making it more complex! :D

Regarding the meta, it's not getting published since I don't have added those info to any front-matter, other than for testing purpose. I initially wanted to group meta, but that's not supported in Obsidian properties, hence I went with meta-people, meta-pub etc. Will clean up as soon as I can!

I am making some more modifications, and I would love if you can help me in code-review. (Probably will be updating by mid June.)

tothlp commented 1 month ago

That sounds great! I am not a pro at all with templates, but I will try helping out :)