diff options
| author | Ahmed M Alaa <aa@4b.cx> | 2023-04-05 21:37:25 +0200 |
|---|---|---|
| committer | Ahmed M Alaa <aa@4b.cx> | 2023-04-05 21:37:25 +0200 |
| commit | d39edd0a30d559fb9d792481c9c3b45760408722 (patch) | |
| tree | 2a0d4e94ea0ec8084502d15fabb7df4c7ae5aef8 | |
| parent | 6496bae0a3acf9a2eded5f02269fde8d0821aac2 (diff) | |
making twitter cards optional, but on by default
| -rw-r--r-- | README.md | 9 | ||||
| -rw-r--r-- | config.toml | 1 | ||||
| -rw-r--r-- | templates/base.html | 3 |
3 files changed, 11 insertions, 2 deletions
@@ -108,6 +108,15 @@ In dark mode  +### Disable Twitter card + +Twitter metatags are generated by default, to disable them set `extra.twitter_card` to `false` in in your `config.toml` + +```toml +[extra] +twitter_card = true +``` + ## TODO - [ ] Add RTL support diff --git a/config.toml b/config.toml index 0800857..c112134 100644 --- a/config.toml +++ b/config.toml @@ -17,7 +17,6 @@ highlight_code = true [extra] author = "Ahmed Alaa" logo = "images/logo.png" -twitter = true header_nav = [ { name = "~home", url = "/" }, { name = "#tags", url = "/tags" }, diff --git a/templates/base.html b/templates/base.html index 8c737df..9206b87 100644 --- a/templates/base.html +++ b/templates/base.html @@ -60,7 +60,8 @@ {% if description %}<meta property="og:description" content="{{ description }}">{% endif %} {% if image %}<meta property="og:image" content="{{ image }}">{% endif %} - {% if config.extra.twitter %} + {% set twitter_card = config.extra.twitter_card | default(value=true) %} + {% if twitter_card != false %} <meta property="twitter:card" content="summary_large_image"> <meta property="twitter:url" content="{{ url | safe }}"> {% if title %}<meta property="twitter:title" content="{{ title }}">{% endif %} |
