A bunch of layout changes to support a new category and make everything work better.
This commit is contained in:
parent
a053ac1be7
commit
f5320c3717
1
.ruby-gemset
Normal file
1
.ruby-gemset
Normal file
|
@ -0,0 +1 @@
|
||||||
|
annabunches
|
1
.ruby-version
Normal file
1
.ruby-version
Normal file
|
@ -0,0 +1 @@
|
||||||
|
2.3.1
|
21
_config.yml
21
_config.yml
|
@ -23,14 +23,19 @@ timezone: America/New_York
|
||||||
markdown: kramdown
|
markdown: kramdown
|
||||||
|
|
||||||
# Category settings
|
# Category settings
|
||||||
main_categories:
|
category_metadata:
|
||||||
- technology
|
technology:
|
||||||
- media
|
title: "The Technologist"
|
||||||
|
description: This section of the blog is where I talk about technology. Tutorials, rants, and discussions about programming languages, operating systems, hardware, and more.
|
||||||
category_titles:
|
main: true
|
||||||
technology: "The Technologist"
|
media:
|
||||||
media: "The Player of Games"
|
title: "The Player of Games"
|
||||||
religion: "The Mystic"
|
description: Here I talk about media. Video games, tabletop games, movies, TV.
|
||||||
|
main: true
|
||||||
|
religion:
|
||||||
|
title: "The Mystic"
|
||||||
|
description: Discussions of my adventures with faith, spirituality, truth, and magic. Lots of woo here.
|
||||||
|
main: false
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
- scope:
|
- scope:
|
||||||
|
|
18
_includes/post_list_main.html
Normal file
18
_includes/post_list_main.html
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<ul class="post-list">
|
||||||
|
{% for post in site.posts limit:include.limit %}
|
||||||
|
{% if post.main != false && (site.category_metadata[post.category][main] || post.main == true) %}
|
||||||
|
<li style="margin-top: 30px">
|
||||||
|
<h2 style="line-height: 1">
|
||||||
|
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">
|
||||||
|
{{ post.title }}
|
||||||
|
</a>
|
||||||
|
<span class="post-meta">{{ post.date | date: "%Y-%m-%d" }}</span>
|
||||||
|
</h2>
|
||||||
|
{{ post.excerpt }}
|
||||||
|
<p>
|
||||||
|
<a href="{{ post.url | prepend: site.baseurl }}">Read More...</a>
|
||||||
|
</p>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
|
@ -8,6 +8,9 @@ layout: default
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
|
<div class="category-description">
|
||||||
|
{{ page.description }}
|
||||||
|
</div>
|
||||||
{% include post_list.html categories=page.category limit=1000000 %}
|
{% include post_list.html categories=page.category limit=1000000 %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,15 @@ class CategoryPage < Jekyll::Page
|
||||||
self.read_yaml(File.join(base, '_layouts'), 'category_index.html')
|
self.read_yaml(File.join(base, '_layouts'), 'category_index.html')
|
||||||
self.data['category'] = category
|
self.data['category'] = category
|
||||||
|
|
||||||
category_title = site.config["category_titles"][category] || category.capitalize
|
config = site.config['category_metadata'][category]
|
||||||
self.data['title'] = "#{category_title}"
|
|
||||||
|
if config.nil?
|
||||||
|
self.data['title'] = category.capitalize
|
||||||
|
self.data['description'] = ''
|
||||||
|
else
|
||||||
|
self.data['title'] = config['title']
|
||||||
|
self.data['description'] = config['description']
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -22,7 +29,7 @@ class CategoryPageGenerator < Jekyll::Generator
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
site.categories.each_key do |category|
|
site.config['category_metadata'].each_key do |category|
|
||||||
site.pages << CategoryPage.new(site, site.source, category)
|
site.pages << CategoryPage.new(site, site.source, category)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
10
index.html
10
index.html
|
@ -3,10 +3,10 @@ layout: default
|
||||||
---
|
---
|
||||||
<div class="home">
|
<div class="home">
|
||||||
<div class="category-menu">
|
<div class="category-menu">
|
||||||
{% for category in site.category_titles %}
|
{% for category in site.category_metadata %}
|
||||||
<span class="category-link">
|
<span class="category-link">
|
||||||
<a href="{{category.first | prepend: site.baseurl}}">
|
<a href="{{category.first | prepend: site.baseurl}}">
|
||||||
{{ category.last }}
|
{{ category.last["title"] }}
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -22,15 +22,15 @@ layout: default
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% include post_list.html categories=site.main_categories limit=10 %}
|
{% include post_list_main.html limit=10 %}
|
||||||
|
|
||||||
<p class="post-meta" style="margin-top: 40px">
|
<p class="post-meta" style="margin-top: 40px">
|
||||||
For more posts, choose a category:
|
For more posts, choose a category:
|
||||||
<ul>
|
<ul>
|
||||||
{% for category in site.category_titles %}
|
{% for category in site.category_metadata %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{category.first | prepend: site.baseurl}}">
|
<a href="{{category.first | prepend: site.baseurl}}">
|
||||||
{{category.last}}
|
{{ category.last["title"]}}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
---
|
|
||||||
layout: default
|
|
||||||
---
|
|
||||||
Sorry, there is nothing here yet.
|
|
Loading…
Reference in New Issue
Block a user