From 144c9f8ced1faf6d8c6c5216df501077aab32696 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Sun, 7 Jun 2015 22:15:03 +0200 Subject: [PATCH] category pages through one template --- _config.yml | 14 ++++++++++++++ _src/_layouts/archive.html | 29 +++++++++++++++++++++++++++++ _src/_layouts/base.html | 18 +++++++++--------- _src/design/index.html | 21 --------------------- _src/goodies/index.html | 23 ----------------------- _src/personal/index.html | 17 ----------------- _src/photography/index.html | 17 ----------------- _src/photos/index.html | 23 ----------------------- 8 files changed, 52 insertions(+), 110 deletions(-) create mode 100644 _src/_layouts/archive.html delete mode 100644 _src/design/index.html delete mode 100644 _src/goodies/index.html delete mode 100644 _src/personal/index.html delete mode 100644 _src/photography/index.html delete mode 100644 _src/photos/index.html diff --git a/_config.yml b/_config.yml index 8b741e98..639c6b55 100644 --- a/_config.yml +++ b/_config.yml @@ -57,6 +57,20 @@ gems: - jekyll-picture-tag - jekyll-archives + +# jekyll-archives +# -------------------- + +jekyll-archives: + enabled: + - categories + - tags + layout: 'archive' + permalinks: + tag: '/tag/:name/' + category: '/:name/' + + # jekyll-picture-tag # -------------------- diff --git a/_src/_layouts/archive.html b/_src/_layouts/archive.html new file mode 100644 index 00000000..3739a183 --- /dev/null +++ b/_src/_layouts/archive.html @@ -0,0 +1,29 @@ +--- +layout: base +--- + +
+ + {% if page.type == 'category' %} +

{{ page.title }}

+ {% else %} +

{{ page.type }} archive for {{ page.title }}

+ {% endif %} + + {% if page.title == 'photos' %} +
+
+ {% endif %} + + {% for post in page.posts %} + {% include articles.html %} + {% endfor %} + + {% if page.title == 'photos' %} +
+ {% endif %} + + +
+ +{% include paginator.html %} diff --git a/_src/_layouts/base.html b/_src/_layouts/base.html index 4f4dfe22..c376c3b4 100644 --- a/_src/_layouts/base.html +++ b/_src/_layouts/base.html @@ -1,24 +1,24 @@ - + {% include head.html %} {% capture id %}{{ page.url | replace:'/','-' | replace_first:'-','' | replace:'.html','' | replace:'-index','' }}{% endcapture %} - - + + {% include header.html %} - -
+ +
{{ content }}
- +
- + - -{% include footer.html %} \ No newline at end of file + +{% include footer.html %} diff --git a/_src/design/index.html b/_src/design/index.html deleted file mode 100644 index 56f48001..00000000 --- a/_src/design/index.html +++ /dev/null @@ -1,21 +0,0 @@ ---- -layout: base -title: Design -description: All the design related articles, mostly about web/ui design & front-end development -category: design -redirect_from: - - /topics/design-articles/ - - /design-articles/ ---- - -
- -

{{ page.category }}

- - {% for post in site.categories.design %} - {% include articles.html %} - {% endfor %} - -
- -{% include paginator.html %} \ No newline at end of file diff --git a/_src/goodies/index.html b/_src/goodies/index.html deleted file mode 100644 index 96cb28d1..00000000 --- a/_src/goodies/index.html +++ /dev/null @@ -1,23 +0,0 @@ ---- -layout: base -title: Goodies -description: All the goodies I've released for you to download. Those are all free for your personal use only, licensed under CC BY NC SA 3.0. Please contact me if you want to use them commercially. -category: goodies -redirect_from: - - /goodies/icon/ - - /goodies/other/ - - /goodies/wallpaper/ - - /topics/goodies/ ---- - -
- -

{{ page.category }}

- - {% for post in site.categories.goodies %} - {% include articles.html %} - {% endfor %} - -
- -{% include paginator.html %} \ No newline at end of file diff --git a/_src/personal/index.html b/_src/personal/index.html deleted file mode 100644 index e7518620..00000000 --- a/_src/personal/index.html +++ /dev/null @@ -1,17 +0,0 @@ ---- -layout: base -title: Personal -category: personal ---- - -
- -

{{ page.category }}

- - {% for post in site.categories.personal %} - {% include articles.html %} - {% endfor %} - -
- -{% include paginator.html %} \ No newline at end of file diff --git a/_src/photography/index.html b/_src/photography/index.html deleted file mode 100644 index 8efe0184..00000000 --- a/_src/photography/index.html +++ /dev/null @@ -1,17 +0,0 @@ ---- -layout: base -title: Photography -category: photography ---- - -
- -

{{ page.category }}

- - {% for post in site.categories.photography %} - {% include articles.html %} - {% endfor %} - -
- -{% include paginator.html %} \ No newline at end of file diff --git a/_src/photos/index.html b/_src/photos/index.html deleted file mode 100644 index 4a4d6b32..00000000 --- a/_src/photos/index.html +++ /dev/null @@ -1,23 +0,0 @@ ---- -layout: base -title: Photos -description: My photo posts aggregated from various sources. You can find more of my photography on 500px and Flickr. -category: photos ---- - -
- -

photos

- -
-
- - {% for post in site.categories.photos %} - {% include articles.html %} - {% endfor %} - -
- -
- -{% include paginator.html %} \ No newline at end of file