Skip to content

Add support for meta description #72

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

Conversation

hugovk
Copy link
Contributor

@hugovk hugovk commented Oct 20, 2022

Fixes #65.

Re: #65 (comment).

When ogp_enable_meta_description=True, only add a generated <meta name="description" content="..."> tag if the page doesn't already have a manual one.

For example, a manual override may have been added using this RST:

.. meta::
   :description: My manual description

Also fix a bug where it was adding multiple meta descriptions for subpages.

TODO:

@TheTripleV
Copy link
Collaborator

Looks good so far. Please see the comments on #65 and #71

@hugovk hugovk force-pushed the no-override-manual-meta-description branch from ab44d47 to 5025905 Compare October 21, 2022 10:46
@hugovk
Copy link
Contributor Author

hugovk commented Oct 21, 2022

Rebased to resolve conflicts, and renamed option to ogp_enable_meta_description. Still need to address #65 (comment) and document.

@hugovk hugovk marked this pull request as draft October 21, 2022 10:47
@hugovk hugovk force-pushed the no-override-manual-meta-description branch from 5025905 to 161f2b5 Compare October 22, 2022 20:10
@hugovk
Copy link
Contributor Author

hugovk commented Oct 22, 2022

Updated for #65 (comment).

Still TODO: add documentation.

@hugovk
Copy link
Contributor Author

hugovk commented Oct 22, 2022

Docs added, ready for review!

@hugovk hugovk marked this pull request as ready for review October 22, 2022 20:29
@TheTripleV TheTripleV changed the title Don't overwrite a page's existing manual meta description tag Add support for meta description Oct 26, 2022
@TheTripleV TheTripleV merged commit a2d9acc into sphinx-doc:main Oct 26, 2022
@hugovk hugovk deleted the no-override-manual-meta-description branch October 26, 2022 18:21
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is it possible to use the og:description for the regular meta description as well?
2 participants