Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Trailing commas in meta keywords when no tags or no keywords in metadata #618

Open
1 of 3 tasks
vokimon opened this issue Jun 7, 2020 · 0 comments
Open
1 of 3 tasks
Labels
bug Well, it shouldn’t be doing that. Let’s fix it!

Comments

@vokimon
Copy link

vokimon commented Jun 7, 2020

Mandatory Step

  • I am using latest production release of Elegant

Recommended Step

  • I have attached link to my blog source code repository, so that developers can try to reproduce the issue at the end
  • I can't my source code but I have linked my pelican configuration files to help developers reproduce the issue

Description

Trailing commas appear in the content of the meta-keywords tag, whenever no tags or no keywords are set.

If you define *no keywords then a trailing comma will appear at the end.

<meta name="keywords" content="mytag1, mytag2, mycategory, " />

Likewise when metadata has no tags, a trailing comma appear at the end of the

<meta name="keywords" content=", mycategory, kwd1, kwd2" />

When both, keywords and tags, are missing, trailing commas appear at both sides:

<meta name="keywords" content=", mycategory, " />

While the expected outcome would be:

<meta name="keywords" content="mycategory" />

To reproduce it create a page with category but no tags or no keywords and generate the website. Then look at the generated meta-keyword tag.

The problem is that when there is no tags or no keywords, instead of a comma separated string 'tag' or 'tag1, tag2', an empty string '' is joined. The solution could be generating lists of keywords, tags, and the category, adding them as a single list and then applying the join.

@vokimon vokimon added the bug Well, it shouldn’t be doing that. Let’s fix it! label Jun 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Well, it shouldn’t be doing that. Let’s fix it!
Development

No branches or pull requests

1 participant