yous / whiteglass

Minimal, responsive Jekyll theme for hackers
https://yous.github.io/whiteglass/
MIT License
732 stars 200 forks source link

Keywords im YAML Front Matter #7

Closed Weishaupt closed 7 years ago

Weishaupt commented 7 years ago

Why are keywords a comma-separated list, instead of sequence inside the keyword-mapping like

keyword:
  - food
  - recipe
  - avocado

Right now the keywords cannot be processed for anything else, if I understand this correctly.

Great theme by the way. 😊

yous commented 7 years ago

Hi @Weishaupt, thank you for the report!

As keywords of meta tag should be a comma-separated list, it just uses the input as-is so we can avoid an accident comma in one keyword. For now, it's used on _includes/head.html only.

But if you want to use them in somewhere else, you can use split to page.keywords, for example:

{% assign words = page.keywords | split: ', ' %}
{% for word in words %}
  {{ word }}
{% endfor %}

Also, if you still want to assign keywords using list, please let me know your thoughts.

Weishaupt commented 7 years ago

Hey Yous,

thank you for the reply. I'd consider the YAML sequence style more intuitive, because it is inside the YAML block. Of course this is just convention.

For further processing (like a list of keywords on a separate page or something) I'd figure the YAML syntax easier for processing, too.

yous commented 7 years ago

Yes, we can make the theme to handle keywords of an array. Past posts use keywords of a string, so I think it's backward compatible.

yous commented 7 years ago

I just updated to support list for keywords in fe32072527e70bb57ef8135dc49a2700992d7f6b, so please have a look.