On Thu, 20 Oct 2022 at 09:19, Maxime Garnier <
maxime.g...@gmail.com> wrote:
>
> For more context, what I envision for card.tmpl would be something like
>
> <div class="card" style="justify-content: center">
> <img src="/images/${image_path}.jpg" alt="Jane" class="im-center" style="width:50%">
> <div class="container">
> <h2> ${name} Doe</h2>
> <p class="title">CEO </p>
> <p>Some text that describes me lorem ipsum ipsum lorem.</p>
> <!-- some way to upload text from a file? with %{content_path} -->
> <p>
exa...@example.com</p>
> <p><button class="button">Contact</button></p>
> </div>
> </div>
>
> which would be called in my main html by
> {{% card name=Maxime image_path=me content_path=/files/location/me.txt %}}
>
> Would something close to that be possible ?
>
> Thanks!
If you want to read a file from within the template, you could write a
simple Python function for that and expose it in the global context in
conf.py - but note this will not track dependencies correctly. If you
want dependencies to be tracked, you need a custom shortcode plugin.
Another route might be to slightly abuse the post-list mechanism:
every person gets their own page, and the post-list shows them
(including metadata and post content).
A third option would be server-side includes, but those are pretty silly IMO.
--
Chris Warrick <
https://chriswarrick.com/>
PGP: 5EAAEA16