oiax / tgweb

MIT License
8 stars 2 forks source link

Feature Request: passing data to article _wrapper.html component #121

Open pojiro opened 10 months ago

pojiro commented 10 months ago

When _wrapper.html is as follows,

<div class="flex justify-center gap-x-[30px] pt-[100px]">
    <tg:component name="buttons/left_link_button" data-color="bg-[#7cf200]" data-href="${prev_href}">
      <tg:insert name="text">next</tg:insert>
    </tg:component>
    <tg:component name="buttons/right_link_button" data-color="bg-[#7cf200]" data-href="${next_href}">
      <tg:insert name="text">prev</tg:insert>
    </tg:component>
</div>

can we pass prev-href, next_href from article like following?

---
[data]
prev_href= "/articles/on_air/20230908.html"
next_href= "/articles/on_air/20231001.html"
---
kuroda commented 9 months ago

can we pass prev-href, next_href from article like following?

No. The data is designed to be passed from the outside to the inside.

It is passed from the layout to the wrapper and from the wrapper to the page or article, not the other way around.

I understand your intent. In order to make what you want to achieve possible, we need to come up with a different mechanism than the data passing.