web-infra-dev / rspress

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

feat: display title in frontmatter as heading fallback #1556

Open JounQin opened 2 weeks ago

JounQin commented 2 weeks ago

Summary

Related Issue

close #1440

Checklist

netlify[bot] commented 2 weeks ago

Deploy Preview for aquamarine-blini-95325f ready!

Name Link
Latest commit 46cffafe696d6e057545ddca1e8d8dcdbd6955f6
Latest deploy log https://app.netlify.com/sites/aquamarine-blini-95325f/deploys/672a3aaabf6b130009197801
Deploy Preview https://deploy-preview-1556--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: 71 (🔴 down 19 from production)
Accessibility: 97 (no change from production)
Best Practices: 92 (no change from production)
SEO: 100 (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 2 weeks ago

Thanks, I think this should be an opt-in feature with documented.

chenjiahan commented 1 week ago

@Timeless0911 This feature should be the default behavior as it does not introduce breaking changes. Do you have any concerns?

Timeless0911 commented 1 week ago

@Timeless0911 This feature should be the default behavior as it does not introduce breaking changes. Do you have any concerns?

The behavior of automatically adding titles should be made optional with exclude options. Users may insert relevant titles by themselves through other slots or scripts, and we also need some ways to disable this behavior on some pages such as overview page.

chenjiahan commented 1 week ago

Users may insert relevant titles by themselves through other slots or scripts,

This doesn't seem to be common. It's relatively rare for the page title to be different from the h1 heading. I prefer providing an option to opt-out rather than opt-in.

Timeless0911 commented 1 week ago

This doesn't seem to be common. It's relatively rare for the page title to be different from the h1 heading. I prefer providing an option to opt-out rather than opt-in.

Agreed. Providing an options is needed, and the default value can be true though.📌