Skip to content

Commit

Permalink
Fix issue where twitter cards not registering (#29)
Browse files Browse the repository at this point in the history
* Fix issue where twitter cards not registering

* fix

* Apply suggestions from code review

Co-authored-by: Mikhail Andrenkov <[email protected]>

* Update xanadu_sphinx_theme/layout.html

Co-authored-by: Mikhail Andrenkov <[email protected]>

* Update _version.py

* Update xanadu_sphinx_theme/layout.html

Co-authored-by: Mikhail Andrenkov <[email protected]>
  • Loading branch information
josh146 and Mandrenkov authored Nov 17, 2022
1 parent c304d58 commit 8efda02
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
14 changes: 14 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## Release 0.3.4 (current release)

### Bug fixes

* Fixed an issue where the `meta` directive in ReST files was not properly registering
an Open Graph Twitter card.
[#29](https://github.com/XanaduAI/xanadu-sphinx-theme/pull/29)

### Contributors

This release contains contributions from (in alphabetical order):

[Josh Izaac](https://github.com/josh146).

## Release 0.3.4

### Improvements
Expand Down
4 changes: 4 additions & 0 deletions doc/tutorials/tutorial_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
Example Sphinx-Gallery demo
===========================
.. meta::
:property="og:description": An example demo using the Xanadu Sphinx Theme generated using Sphinx Gallery.
:property="og:image": https://pennylane.ai/qml/_static/wigner.png
This tutorial is an example demo generated using Sphinx Gallery. Here are a few
references to see what they look like [#stokes2019]_ [#sweke2019]_.
Expand Down
2 changes: 1 addition & 1 deletion xanadu_sphinx_theme/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
using the following format: <major>.<minor>.<patch>[-<pre-release>].
"""

__version__ = "0.3.4"
__version__ = "0.3.5"
12 changes: 12 additions & 0 deletions xanadu_sphinx_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

{# Do this so that bootstrap is included before the main CSS file. #}
{%- block htmltitle %}


<meta property="og:title" content="{{ title|striptags|e }} &#8212; PennyLane">
<meta property="og:url" content="{{ pageurl }}">
<meta property="og:type" content="website">
<meta name="twitter:card" content="summary_large_image">

{% if metatags is defined %}
{% set description = metatags.split('\n') %}
{{ description[0] }}
{% endif %}

<!-- Google Fonts -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Noto+Serif">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto&display=swap">
Expand Down

0 comments on commit 8efda02

Please sign in to comment.