KosmosisDire / obsidian-webpage-export

Export html from single files, canvas pages, or whole vaults. Direct access to the exported HTML files allows you to publish your digital garden anywhere. Focuses on flexibility, features, and style parity.
https://docs.obsidianweb.net/
MIT License
841 stars 70 forks source link

Add option for adding content at the start/end of every webpage. #533

Open WinnerWind opened 1 week ago

WinnerWind commented 1 week ago

Is your feature request related to a problem? Please describe. I like to link a page on my website that takes the viewer to the Contact page where they can contact me for further queries or corrections. image This needs to be manually added to every single file, which takes up space and makes it hard to edit down the line (Eg. I move where the contact's page is down the line)

Describe the solution you'd like An option to add a header template and a footer template file as defined by the user, which automatically appends the contents of those files to the start/end of every page/defined pages

Describe alternatives you've considered Copy pasting each and every note using templates Using tags to quickly find the place where this contact's footer is found frontmatter

Additional context There exists an option to use Head content for the plugin, especially with regards to my use case, but I am not sure how to use it for this purpose. It seems perfect, but I am not sure how to use it. A guide would be helpful.

KosmosisDire commented 6 days ago

Yes this should be acomplished using the head content. I will create a tutorial for document modifications eventually. But basically you can just upload a javascript file that would add the element dynamically to each page when it loads. You can explore the available frontend api by opening the dev tools on your exported site and typing in ObsidianSite. and exploruing the different objects and options available to interact with.

WinnerWind commented 23 hours ago

Hi there. It seems my email didn't go through.

I'm looking forward to that tutorial. I looked around in ObsidianSite. but couldn't find anything that was relevant to my needs. Could you point me to the most relevant function?