htmly icon indicating copy to clipboard operation
htmly copied to clipboard

Confusion about static.html.php

Open CharliePoole opened this issue 1 year ago • 6 comments

The docs do not make it very clear what this is used for. I had assumed it would be used as the main layout for any static pages, but I see that's not true. In fact, I can't find any code in either htmly.php or dispatch.php that uses this file and if I force it to be used, it doesn't work.

In the docs, you use the word "template" for this file and the code in it appears to be partial. So I'm assuming it should be copied into some other file. But I can't see any example of exactly how that is supposed to be done. Can you help?

My goal is to not display the post information in the aside column on some of my static pages.

CharliePoole avatar Mar 31 '24 18:03 CharliePoole

Oh the layout for static page is layout--static.html.php (all static page), you can read about custom template here. Please remember the static.html.php (or any partial) is printed using content() in any layout files.

danpros avatar Mar 31 '24 23:03 danpros

OK, I was beginning to think that might be the case, but I had to actually read the code to get there. FWIW, I would have liked a bit more in the docs to point me in the right direction. Funny, I just had to answer an issue about unclear docs on one of my own projects, so karma. :-)

CharliePoole avatar Mar 31 '24 23:03 CharliePoole

Yes, the documentation really needs to be updated, especially the information for customizing templates etc. 😃

danpros avatar Apr 01 '24 00:04 danpros

It's too bad the doc source isn't online - I'd try to write what I imagine I could have used.

On Sun, Mar 31, 2024 at 5:39 PM Dan @.***> wrote:

Yes, the documentation really needs to be updated, especially the information for customizing templates etc. 😃

— Reply to this email directly, view it on GitHub https://github.com/danpros/htmly/issues/711#issuecomment-2028972825, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUN7BKKGUSOIYRYWPZIKSDY3CUDRAVCNFSM6AAAAABFQTYXYOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRYHE3TEOBSGU . You are receiving this because you authored the thread.Message ID: @.***>

CharliePoole avatar Apr 01 '24 00:04 CharliePoole

Yes, the documentation really needs to be updated, especially the information for customizing templates etc. 😃

I'd be willing to look into contributing towards documentation, too. This is a rather low-hanging fruit.

Could the docs be put into a GitHub wiki or something so more people can help you?

thopanX avatar Apr 04 '24 20:04 thopanX

@thopanX Thanks! I will try to upload the docs to github so anyone can improve it.

danpros avatar Apr 05 '24 02:04 danpros

@thopanX Already upload the docs to GitHub: https://github.com/danpros/htmly-docs

I will close this one. Thanks.

danpros avatar Jun 03 '24 11:06 danpros