What I’m trying to do
I have files that represent references to external resources. I use tags
and url
metadata fields.
In the app they look great because the url is visible and clickable. But on Publish they don’t. I would like the url at least to be visible. And I would rather keep the information in metadata since the file content might be a summary of the content.
Things I have tried
I use publish on a custom domain so having a publish.js to achieve this is an option.
I see that there is a <pre class="frontmatter language-yaml" style="display: none;" tabindex="0">
in the publish pages with the metadata. I guess I could parse it’s innerText as frontmatter to grab the url.
Is there a better api to access the current file metadata in publish.js? I was not able to find documentation on that.
Another alternative would be to have some kind of template for these external references files. I tried templater and dataview. My attempts to have some sort of base template or partial to be included in all files and have a single template code to expand url and tags have failed.
Is there a way to have this sort of base template embedded in other files and use the embedding file as context for the template?
Is there any other approach to render the metadata in a nice way in publish?
Thanks!