seethroughdev / obsidian-recipe-grabber

MIT License
59 stars 8 forks source link

Make website name available to template? #41

Open deafmute1 opened 2 months ago

deafmute1 commented 2 months ago

Would be nice to be able to add the name of the website to tags / metadata for the purposes of grouping recipes from the same source. I see this isn't in the json schema, but shouldn't be too hard to just parse <title> from the domain's root page?

Main barrier would be that there is no existing HTML parsing in the project, but grabbing the contents of seems like it could be just done with regex/string manip on the full html content - I'm not familiar with HTML parsing in JS.</p> <p>Happy to PR this myself when I have a second if it would be as easy as I'm imagining, but want to check the idea is possible first.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/seethroughdev"><img src="https://avatars.githubusercontent.com/u/203779?v=4" />seethroughdev</a> commented <strong> 2 months ago</strong> </div> <div class="markdown-body"> <p>Lol. I am SO sorry @deafmute1! I am deleting my previous message. I forgot we already do add the tags. I will 100% add name in there! I think we should go with <code>name</code> from the <a href="https://schema.org/Recipe">https://schema.org/Recipe</a> instead of the <title> though. Do you agree or would you prefer the HTML title?</p> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>