Merge branch 'no-twitter' into 'no-twitter'

templates/base: allow excluding twitter stuff from page source

See merge request 4bcx/no-style-please!3
This commit is contained in:
Ahmed Alaa 2023-04-05 19:14:29 +00:00
commit 6496bae0a3
2 changed files with 3 additions and 0 deletions

View file

@ -17,6 +17,7 @@ highlight_code = true
[extra]
author = "Ahmed Alaa"
logo = "images/logo.png"
twitter = true
header_nav = [
{ name = "~home", url = "/" },
{ name = "#tags", url = "/tags" },

View file

@ -60,11 +60,13 @@
{% if description %}<meta property="og:description" content="{{ description }}">{% endif %}
{% if image %}<meta property="og:image" content="{{ image }}">{% endif %}
{% if config.extra.twitter %}
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="{{ url | safe }}">
{% if title %}<meta property="twitter:title" content="{{ title }}">{% endif %}
{% if description %}<meta property="twitter:description" content="{{ description }}">{% endif %}
{% if image %}<meta property="twitter:image" content="{{ image }}">{% endif %}
{% endif %}
<link rel="canonical" href="{{ url | safe }}">
{% if image %}<link rel="shortcut icon" type="image/x-icon" href="{{ get_url(path=config.extra.logo, trailing_slash=false) }}">{% endif %}