Account for multiple categories, #11

This commit is contained in:
David Darnes 2018-01-01 20:52:03 +00:00
parent 4026a8eded
commit aead2d041d
2 changed files with 18 additions and 4 deletions

View File

@ -1,3 +1,15 @@
{% if page.categories %}
{% capture categories %}
{% for category in page.categories %}
<span class="label label--category"><a href="{{ site.baseurl }}/categories#{{ category | downcase }}">{{ category }}</a></span>{% if forloop.last == false %},{% endif %}
{% endfor %}
{% endcapture %}
{% elsif page.category %}
{% capture categories %}
<span class="label label--category"><a href="{{ site.baseurl }}/categories#{{ page.category | downcase }}">{{ page.category }}</a></span>
{% endcapture %}
{% endif %}
<small class="small post-meta">
{% if page.category %}<span class="label label--category">{{ page.category }}</span>&nbsp;&nbsp;&middot;&nbsp;&nbsp;{% endif %}<time datetime="{{ page.date | date_to_xmlschema }}" class="time">{{ page.date | date_to_string }}</time>
{{ categories | append: "&nbsp;&middot;&nbsp;" }}<time datetime="{{ page.date | date_to_xmlschema }}" class="time">{{ page.date | date_to_string }}</time>
</small>

View File

@ -2,7 +2,7 @@
Gem::Specification.new do |spec|
spec.name = "garth-jekyll-theme"
spec.version = "0.5.0"
spec.version = "0.6.0"
spec.authors = ["David Darnes"]
spec.email = ["me@daviddarnes.com"]
@ -11,10 +11,12 @@ Gem::Specification.new do |spec|
spec.homepage = "https://garth.darn.es"
spec.license = "MIT"
spec.metadata["plugin_type"] = "theme"
spec.files = `git ls-files -z`.split("\x0").select { |f| f.match(%r{^(assets|_layouts|_includes|_sass|LICENSE|README)}i) }
spec.add_runtime_dependency "jekyll", "~> 3.3"
spec.add_runtime_dependency "jekyll", "~> 3.6"
spec.add_runtime_dependency "jekyll-paginate", "~> 1.1"
spec.add_development_dependency "bundler", "~> 1.12"
spec.add_development_dependency "bundler", "~> 1.14"
end