web-infra-dev / rspress

🦀💨 A fast Rspack-based static site generator.
https://rspress.dev
MIT License
1.19k stars 107 forks source link

feat(docs): use frontmatter to customize metadata #1205

Closed zmzlois closed 4 days ago

zmzlois commented 4 days ago

Summary

Add "using frontmatter to generate metadata" in docs

Related Issue

None

Checklist

netlify[bot] commented 4 days ago

Deploy Preview for aquamarine-blini-95325f ready!

Name Link
Latest commit 24e19c4c8fe629404fbb5ac2a307c8226eb9618f
Latest deploy log https://app.netlify.com/sites/aquamarine-blini-95325f/deploys/667a52e1dfb8b100081e2ff2
Deploy Preview https://deploy-preview-1205--aquamarine-blini-95325f.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

Lighthouse
1 paths audited
Performance: 93 (🟢 up 4 from production)
Accessibility: 97 (no change from production)
Best Practices: 92 (no change from production)
SEO: 92 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Timeless0911 commented 4 days ago

There is already some docs about that, see https://rspress.dev/api/config/config-frontmatter#head and https://rspress.dev/api/config/config-basic#head

zmzlois commented 4 days ago

There is already some docs about that, see https://rspress.dev/api/config/config-frontmatter#head and https://rspress.dev/api/config/config-basic#head

should I close this or is it better off keep it and leave back linking to this page?

I didn't find this page either doing search on the site since it's not indexed with ##

Timeless0911 commented 4 days ago

I will close it, thanks~

zmzlois commented 4 days ago

Although this is closed - IMO is still better to mention things even if it means talking about it twice

  1. head is not a common term people would think about to google or search for but metadata and open graph is (maybe it is in China but I have no context to know that)
  2. on doc site first entry after clicking on Get started it starts on a general guide, and then my eyes are glued to the left panel tried to figure out where to find it. Attention wise I wouldn't even found there is an api page talk about what api is exposed

tagging @chenjiahan because I don't mind annoying him x

chenjiahan commented 4 days ago

Yes, it can be helpful to add more content to the guide sections and then link to specific configs such as head.

chenjiahan commented 4 days ago

The branch has been deleted, so I can not re-open the pull request. Can you re-send a PR? ❤️

We can add a Custom Tags section like:

## Custom Tags

### Using head config

some content

### Using frontmatter

some content
zmzlois commented 3 days ago

The branch has been deleted, so I can not re-open the pull request. Can you re-send a PR? ❤️

We can add a Custom Tags section like:

## Custom Tags

### Using head config

some content

### Using frontmatter

some content

thanks @chenjiahan added the section - changed the title to "Customize header tag" and "Generate metadata for better SEO" to explain the value proposition clearer.

PR here https://github.com/web-infra-dev/rspress/pull/1206