Skip to content

Commit

Permalink
fix(more-categories): keywords is not a list
Browse files Browse the repository at this point in the history
Because keywords is not a list but a string with comma separated
values, every letter was separated. Instead, just take it as a
single item and lets append it as a single item, but if empty
append an empty list.

Also, for categories, when no category and no categories plugin
is found resulted in [None].
  • Loading branch information
vokimon committed Jun 14, 2020
1 parent 26f6a89 commit a7e0cc4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion templates/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
{% endif %}
{{ super() }}
{% if article.tags or article.category or article.keywords %}
<meta name="keywords" content="{{ ((article.tags or [])+(article.categories or [article.category]|map("string")) + (article.keywords or []))|join(', ') }}" />
<meta name="keywords" content="{{ (
(article.tags | default([])) +
(article.categories | default([article.category] if article.category else []) ) +
([article.keywords] if article.keywords else [])
) | join(', ') }}" />
{% endif %}

{% from '_includes/smo_metadata.html' import smo_metadata with context %}
Expand Down

0 comments on commit a7e0cc4

Please sign in to comment.