You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-14Lines changed: 15 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -62,36 +62,37 @@ ogp_custom_meta_tags = [
62
62
```
63
63
64
64
## Per Page Overrides
65
-
[Field lists](https://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html) are used to allow you to override certain settings on each page.
65
+
[Field lists](https://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html) are used to allow you to override certain settings on each page and set unsupported arbitrary OpenGraph tags.
66
66
67
67
Make sure you place the fields at the very start of the document such that Sphinx will pick them up and also won't build them into the html.
68
68
69
69
### Overrides
70
+
These are some overrides that can be used, you can actually override any tag and field lists will always take priority.
70
71
71
-
*`:ogp-description-length:`
72
-
* Configure the amount of characters to grab for the description of the page. If the value isn't a number it will fall back to `ogp_description_length`.
73
-
*`:ogp-description:`
72
+
*`:og_description_length:`
73
+
* Configure the amount of characters to grab for the description of the page. If the value isn't a number it will fall back to `ogp_description_length`. Note the slightly different syntax because this isn't directly an OpenGraph tag.
74
+
*`:og:description:`
74
75
* Lets you override the description of the page.
75
-
*`:ogp-title:`
76
+
*`:og:title:`
76
77
* Lets you override the title of the page.
77
-
*`:ogp-type:`
78
+
*`:og:type:`
78
79
* Override the type of the page, for the list of available types take a look at https://ogp.me/#types.
79
-
*`:ogp-image:`
80
+
*`:ogp:image:`
80
81
* Set the image for the page.
81
-
*`:ogp-image-alt:`
82
-
*Will be ignored if the image isn't set with the above field, if the image is set, sets the alt text for it.
82
+
*`:ogp:image:alt:`
83
+
*Sets the alt text. Will be ignored if there is no image set.
83
84
84
85
### Example
85
86
Remember that the fields **must** be placed at the very start of the file. You can verify Sphinx has picked up the fields if they aren't shown in the final html file.
86
87
87
88
```rst
88
-
:ogp-description: New description
89
-
:ogp-image: http://example.org/image.png
90
-
:ogp-image-alt: Example Image
89
+
:og:description: New description
90
+
:og:image: http://example.org/image.png
91
+
:og:image:alt: Example Image
91
92
```
92
93
93
-
## Arbitrary Tags
94
-
Additionally, you can use field lists to add any arbitrary OpenGraph tag not supported by the extension. The syntax for arbitrary tags is `:og:tag: content`. For Example:
94
+
###Arbitrary Tags
95
+
Additionally, you can use field lists to add any arbitrary OpenGraph tag not supported by the extension. The syntax for arbitrary tags is the same with `:og:tag: content`. For Example:
0 commit comments