diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2020-12-26 19:07:29 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2020-12-26 19:07:29 +0100 |
commit | eb79cee7ef6bdc4a44aabfce10617a18be2b8d96 (patch) | |
tree | df4d5555c4bd23732ad06c6893c2610855ceb5f5 /templates/base.html | |
parent | 96762ba965d60bd09493ac19cb06cbd0798e44b0 (diff) | |
download | rabalderz-eb79cee7ef6bdc4a44aabfce10617a18be2b8d96.tar.gz rabalderz-eb79cee7ef6bdc4a44aabfce10617a18be2b8d96.tar.bz2 rabalderz-eb79cee7ef6bdc4a44aabfce10617a18be2b8d96.zip |
Add opengraph support.
Diffstat (limited to 'templates/base.html')
-rw-r--r-- | templates/base.html | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/templates/base.html b/templates/base.html index 78dcb60..69e836a 100644 --- a/templates/base.html +++ b/templates/base.html @@ -5,8 +5,30 @@ <meta name="viewport" content="width=device-width initial-scale=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <title>{% if page.title %}{{ page.title }}{% else %}{{ config.title }}{% endif %}</title> - <meta name="description" content="{{ trans(key='description', lang=lang) }}"> + <title>{% if page.title %}{{ page.title }} - {% endif %}{{ config.title }}</title> + + <!-- Open Graph stuff --> + {% block opengraph %} + <meta name="description" content="{{ page.extra['opengraph']['desc'] | default(value=trans(key='description', lang=lang)) }}"> + <meta property="og:description" content="{{ page.extra['opengraph']['desc'] | default(value=trans(key='description', lang=lang)) }}"> + <meta property="og:title" content="{{ page.title | default(value=config.title) }}"> + <meta property="og:type" content="article"> + <meta property="og:url" content="{{ page.permalink | default(value=section.permalink | safe) | safe }}"> + {% if page.extra['opengraph']['img'] %} + <meta property="og:image" content="{{ current_url | safe }}{{ page.extra['opengraph']['img'] | safe }}"> + {% endif %} + + <meta name="twitter:card" content="summary_large_image"> + <meta property="twitter:domain" content="volse.net"> + <meta property="twitter:url" content="{{ page.permalink | default(value=section.permalink | safe) | safe }}"> + <meta property="twitter:title" content="{{ page.title | default(value=config.title) }}"> + <meta property="twitter:description" content="{{ page.extra['opengraph']['desc'] | default(value=trans(key='description', lang=lang)) }}"> + {% if page.extra['opengraph']['img'] %} + <meta property="twitter:image" content="{{ current_url | safe }}{{ page.extra['opengraph']['img'] | safe }}"> + {% endif %} + {% endblock opengraph %} + <meta property="og:site_name" content="{{ config.title }}"> + <link rel="stylesheet" type="text/css" href="{{ get_url(path='/styles.css') | safe }}"> <link rel="alternate" |