From 1807e27097d9381d9133abbd26d20d11ff306b13 Mon Sep 17 00:00:00 2001 From: Asutosh Palai Date: Sun, 19 Jun 2016 18:58:51 +0530 Subject: [PATCH] Added category page --- _config.yml | 5 +++++ _includes/cat_header.html | 12 ++++++++++++ _includes/navbar.html | 4 +++- _layouts/category.html | 28 ++++++++++++++++++++++++++++ _layouts/layout.html | 4 +++- category/editorial/index.html | 3 +++ category/phekingnews/index.html | 3 +++ css/base.scss | 24 ++++++++++++++++++++++++ index.html | 11 +++++------ 9 files changed, 86 insertions(+), 8 deletions(-) create mode 100644 _includes/cat_header.html create mode 100644 _layouts/category.html create mode 100644 category/editorial/index.html create mode 100644 category/phekingnews/index.html diff --git a/_config.yml b/_config.yml index e724e57..4f362cc 100644 --- a/_config.yml +++ b/_config.yml @@ -16,6 +16,11 @@ defaults: type: posts # limit to posts values: is_post: true # automatically set is_post=true for all posts + - scope: + path: "category" + values: + is_category_page: true + layout: category name: WONA url: http://wona.co.in diff --git a/_includes/cat_header.html b/_includes/cat_header.html new file mode 100644 index 0000000..7eab159 --- /dev/null +++ b/_includes/cat_header.html @@ -0,0 +1,12 @@ + diff --git a/_includes/navbar.html b/_includes/navbar.html index 0769690..ef22d68 100644 --- a/_includes/navbar.html +++ b/_includes/navbar.html @@ -22,7 +22,9 @@ {{ cat.name | uppercase }} diff --git a/_layouts/category.html b/_layouts/category.html new file mode 100644 index 0000000..e2a30a1 --- /dev/null +++ b/_layouts/category.html @@ -0,0 +1,28 @@ +--- +layout: layout +no_header: true +--- + +{% include cat_header.html %} + +
+ {% for post in site.categories[page.category] %} +
+ {% if post.image != nil %} +
+ +
+
+

{{ post.title}}

+

{{ post.excerpt }}

+
+ {% else %} +
+

{{ post.title}}

+

{{ post.excerpt }}

+
+ {% endif %} +
+ {% endfor %} +
+ diff --git a/_layouts/layout.html b/_layouts/layout.html index 4ebcb32..f0f8fa6 100644 --- a/_layouts/layout.html +++ b/_layouts/layout.html @@ -7,7 +7,9 @@ {% include navbar.html %} - {% include header.html %} + {% if page.no_header %} + {% include header.html %} + {% endif %} {{ content }} diff --git a/category/editorial/index.html b/category/editorial/index.html new file mode 100644 index 0000000..59c1870 --- /dev/null +++ b/category/editorial/index.html @@ -0,0 +1,3 @@ +--- +category: editorial +--- diff --git a/category/phekingnews/index.html b/category/phekingnews/index.html new file mode 100644 index 0000000..b6204a8 --- /dev/null +++ b/category/phekingnews/index.html @@ -0,0 +1,3 @@ +--- +category: phekingnews +--- diff --git a/css/base.scss b/css/base.scss index 8613c36..fafffed 100644 --- a/css/base.scss +++ b/css/base.scss @@ -148,6 +148,11 @@ body { padding: 0; overflow: hidden; + &.category-header { + height: 300px; + box-shadow: 0 100px 125px -100px; + } + .cover { z-index: 10; color: white; @@ -439,6 +444,25 @@ footer { // ============== /FOOTER ============== // +// ============== CATEGORY-POSTS ===========// +.category-posts { + position: relative; + z-index: 10; + background: white; + padding-top: 10px; + + .category-post { + margin-bottom: 30px; + padding: 0 10px 30px; + border-bottom: 1px solid rgba(0, 0, 0, 0.05); + } + + .img-container { + height: $article-cover-img-height; + } +} +// ============= /CATEGORY-POSTS ===========// + // ============== TEAM ============== // .team { diff --git a/index.html b/index.html index 08dba91..bf73418 100644 --- a/index.html +++ b/index.html @@ -14,7 +14,7 @@ category_page: news

{{ post.title | truncatewords: 4}}

-

{{ post.tag }}

+

{{ post.category }}

@@ -26,19 +26,18 @@ category_page: news