Skip to content

feat(http): Improve header titles, short-titles #39648

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

Merged
merged 8 commits into from
May 23, 2025

Conversation

bsmth
Copy link
Member

@bsmth bsmth commented May 23, 2025

Description

In this PR, I'm adding more content/context to page titles and using current titles -> short-titles.

Additions:

  • short-title for HTTP headers and methods

Changes:

  • Update title to say if it's a header, a Permissions-Policy or CSP directive, and that CONNECT etc. all refers to request methods.

For example all header pages:

title: Accept-CH

become

-title: Accept-CH
+title: Accept-CH header
+short-title: Accept-CH

And all CSP/Permissions Policy directives:

title: "CSP: script-src"

Become:

-title: "CSP: script-src"
+title: "Content-Security-Policy: script-src directive"
+short-title: script-src

The same change is repeated through the whole section.

Related issues and pull requests

@bsmth bsmth requested a review from a team as a code owner May 23, 2025 12:43
@bsmth bsmth requested review from hamishwillee and removed request for a team May 23, 2025 12:43
@github-actions github-actions bot added the Content:HTTP HTTP docs label May 23, 2025
@bsmth bsmth requested a review from dipikabh May 23, 2025 12:43
@github-actions github-actions bot added the size/m [PR only] 51-500 LoC changed label May 23, 2025
Copy link
Contributor

Preview URLs (231 pages)
Flaws (7)

Note! 226 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/sandbox
Title: Content-Security-Policy: sandbox directive
Flaw count: 1

  • macros:
    • Macro produces link /en-US/docs/Web/API/Window/showModalDialog which is a redirect

URL: /en-US/docs/Web/HTTP/Reference/Headers/Permissions-Policy
Title: Permissions-Policy header
Flaw count: 1

  • macros:
    • Macro produces link /en-US/docs/Web/HTTP/Reference/Headers/Permissions-Policy/document-domain which is a redirect

URL: /en-US/docs/Web/HTTP/Reference/Headers/Prefer
Title: Prefer header
Flaw count: 1

  • macros:
    • Macro produces link /en-US/docs/Glossary/Forbidden_header_name which is a redirect

URL: /en-US/docs/Web/HTTP/Reference/Headers/Preference-Applied
Title: Preference-Applied header
Flaw count: 1

  • macros:
    • Macro produces link /en-US/docs/Glossary/Forbidden_header_name which is a redirect

URL: /en-US/docs/Web/HTTP/Reference/Methods/TRACE
Title: TRACE request method
Flaw count: 3

  • unknown:
    • No generic content config found
    • no blog root
    • no blog root

@bsmth bsmth changed the title Http header titles feat(http): Improve header titles, short-titles May 23, 2025
Copy link
Contributor

@dipikabh dipikabh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat! The update looks good, thanks.

Also leaving this food for thought here: Should we also add "HTTP" to the header titles? Might help with searchability. As in:

title: Accept-CH HTTP header

@bsmth
Copy link
Member Author

bsmth commented May 23, 2025

Neat! The update looks good, thanks.

Also leaving this food for thought here: Should we also add "HTTP" to the header titles? Might help with searchability. As in:

title: Accept-CH HTTP header

Thank you! I thought about this, but rari is already adding HTTP in the page <title>, so I avoided for now. We do this for HTML attributes, though: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/autocomplete

@bsmth bsmth merged commit ee756fd into mdn:main May 23, 2025
7 checks passed
@bsmth bsmth deleted the http-header-titles branch May 23, 2025 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:HTTP HTTP docs size/m [PR only] 51-500 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants