-
Notifications
You must be signed in to change notification settings - Fork 397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(gnoweb): add metadata to md content #3797
feat(gnoweb): add metadata to md content #3797
Conversation
🛠 PR Checks SummaryAll Automated Checks passed. ✅ Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):🟢 Maintainers must be able to edit this pull request (more info) ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
Codecov ReportAttention: Patch coverage is 📢 Thoughts on this report? Let us know! |
Could you also add the front matter to some example realm to showcase the usage? 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've never used goldmark or its extension system, but compared to the column PR, this one looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
What will happen if i embed more data apart from title and description?
Also, since this can technically be changed after deployment with proper functionality in realms, will this have an impact on SEO or similar? Just considering different cases.
It is possible to add more variables in the frontmatter, but they will not be used by gnoweb. However, it would be appropriate to add others, such as canonical or even a style definition to customize the rendering within gnoweb. While the frontmatter can be used to store any type of content, in this case, it is added specifically for gnoweb. For SEO and accessibility in this case. Therefore, aside from specific methods, continuing to use Markdown-native properties to manage what gnoweb renders from Markdown makes sense in my opinion. |
Fixes #3333 This PR introduces a way to customize HTML `head` metadata (`title`, `description`, and maybe soon, `canonical`) from realm markdown content. It adds a `front-matter` option that can be used at the very top of any realm markdown file. This front-matter is then read by our Markdown parser, Goldmark, to populate the `Title` and `Description` fields in gnoweb. The PR provides default content where these fields were previously blank and maintains a fallback setup using h.Static.Domain + " - " + gnourl.Path for the `Title`. Additionally, regardless of the provided Title, it will always be followed by ` - gnourl.Path` (` - gno.land` in our case). For now, only `Title` and `Description` are supported. Any other variables in the front-matter are ignored. Usage example: ``` --- Title: Mon Titre Description: Ma description --- ```
=> #3910 |
This reverts commit d1db75e.
This reverts commit d1db75e (#3797). See #3910. Let's revert this now. Then we can try to improve SEO automatically by extracting the first H1 and the first paragraph, as this PR did manually. After that, we should take more time to consider aspects such as frontmatter and everything involved in allowing developers to specify "invisible" elements.
Fixes #3333
This PR introduces a way to customize HTML
head
metadata (title
,description
, and maybe soon,canonical
) from realm markdown content. It adds afront-matter
option that can be used at the very top of any realm markdown file. This front-matter is then read by our Markdown parser, Goldmark, to populate theTitle
andDescription
fields in gnoweb.The PR provides default content where these fields were previously blank and maintains a fallback setup using h.Static.Domain + " - " + gnourl.Path for the
Title
.Additionally, regardless of the provided Title, it will always be followed by
- gnourl.Path
(- gno.land
in our case).For now, only
Title
andDescription
are supported. Any other variables in the front-matter are ignored.Usage example: