From 932f5651d0e2ec8e5117f54b911fb126e7b1b32c Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Tue, 25 Aug 2015 20:41:32 +0200 Subject: Move post and post header to separate partials, and change styling. --- blog/_assets/stylesheets/_config.scss | 6 ++++-- blog/_assets/stylesheets/_navbar.scss | 5 +---- blog/_assets/stylesheets/_post.scss | 29 +++++++++++++++++++++++++++++ blog/_assets/stylesheets/main.scss | 24 +++++------------------- blog/_i18n/en.yml | 1 + blog/_i18n/nb.yml | 1 + blog/_includes/post-excerpt.html | 9 +++++++++ blog/_includes/post-header.html | 7 +++++++ blog/_layouts/post.html | 8 +++----- blog/index.html | 12 +----------- 10 files changed, 61 insertions(+), 41 deletions(-) create mode 100644 blog/_assets/stylesheets/_post.scss create mode 100644 blog/_includes/post-excerpt.html create mode 100644 blog/_includes/post-header.html diff --git a/blog/_assets/stylesheets/_config.scss b/blog/_assets/stylesheets/_config.scss index 2b91952..8477f0a 100644 --- a/blog/_assets/stylesheets/_config.scss +++ b/blog/_assets/stylesheets/_config.scss @@ -1,10 +1,12 @@ $body-bg: black; $text-color: #aaa; +$heading-color: #3379BF; $dimmed-text-color: darken($text-color, 20%); -$link-color: #686; +$link-color: #93A2B1; //#686; $link-hover-color: lighten(#686, 5%); $side-bar-background: rgba(20, 20, 20, 0.7); -$menu-bar-background: rgba(128, 256, 128, 0.15); +$menu-bar-background: transparentize(#243B48, 0.2); //rgba(128, 256, 128, 0.15); +$post-header-background: $menu-bar-background; $nav-link-padding: 5px 10px; diff --git a/blog/_assets/stylesheets/_navbar.scss b/blog/_assets/stylesheets/_navbar.scss index f5c46f5..90c2c20 100644 --- a/blog/_assets/stylesheets/_navbar.scss +++ b/blog/_assets/stylesheets/_navbar.scss @@ -5,10 +5,7 @@ } @include round-corners; width: 100%; - border: { - bottom: 1px solid darkgray; - top: 1px solid darkgray; - } + padding: 1mm; a { text-decoration: none; diff --git a/blog/_assets/stylesheets/_post.scss b/blog/_assets/stylesheets/_post.scss new file mode 100644 index 0000000..6278c17 --- /dev/null +++ b/blog/_assets/stylesheets/_post.scss @@ -0,0 +1,29 @@ +.post-header { + background-color: $post-header-background; + padding: 2mm; + date { + font-size: 10pt; + } + h1 { + font: { + size: 13pt; + weight: bold; + } + margin: { + bottom: 0; + top: 0; + } + a { + text-decoration: none; + } + } +} + +.post { +} + +.post-body { + background-color: transparentize(#182530, 0.3); + padding: 2mm; + margin-bottom: 2mm; +} \ No newline at end of file diff --git a/blog/_assets/stylesheets/main.scss b/blog/_assets/stylesheets/main.scss index f2a84a7..fbf13e5 100644 --- a/blog/_assets/stylesheets/main.scss +++ b/blog/_assets/stylesheets/main.scss @@ -3,6 +3,7 @@ @import "header"; @import "navbar"; @import "pagination"; +@import "post"; body { background-color: black; @@ -24,6 +25,10 @@ a { } } +h1, h2, h3, h4, h5, h6 { + color: $heading-color; +} + h1 { font-size: 20pt; } @@ -98,25 +103,6 @@ h1 { float: left; margin-right: 5mm; - header { - date { - font-size: 10pt; - } - h1 { - font: { - size: 13pt; - weight: bold; - } - margin: { - bottom: 5mm; - top: 0; - } - a { - text-decoration: none; - } - } - } - &.wide { width: 100%; float: none; diff --git a/blog/_i18n/en.yml b/blog/_i18n/en.yml index b99a612..1c812b4 100644 --- a/blog/_i18n/en.yml +++ b/blog/_i18n/en.yml @@ -2,6 +2,7 @@ global: norwegian: norsk english: English + read_more: Read more... titles: home: Home diff --git a/blog/_i18n/nb.yml b/blog/_i18n/nb.yml index ad7edd2..e0216c5 100644 --- a/blog/_i18n/nb.yml +++ b/blog/_i18n/nb.yml @@ -2,6 +2,7 @@ global: norwegian: norsk english: English + read_more: Les mer... titles: home: Hjem diff --git a/blog/_includes/post-excerpt.html b/blog/_includes/post-excerpt.html new file mode 100644 index 0000000..73c4478 --- /dev/null +++ b/blog/_includes/post-excerpt.html @@ -0,0 +1,9 @@ +{% assign post = include.post %} +
+ {% include post-header.html post = post%} +
+ {{ post.excerpt }} + +

{% t global.read_more %}

+
+
diff --git a/blog/_includes/post-header.html b/blog/_includes/post-header.html new file mode 100644 index 0000000..e1baeb8 --- /dev/null +++ b/blog/_includes/post-header.html @@ -0,0 +1,7 @@ +{% assign post = include.post %} +
+ {{ post.date | date_to_string }} +

+ {{ post.title }} +

+
diff --git a/blog/_layouts/post.html b/blog/_layouts/post.html index 93adac3..ff650ae 100644 --- a/blog/_layouts/post.html +++ b/blog/_layouts/post.html @@ -2,11 +2,9 @@ layout: default --- -
-
-

{{ page.title }}

-
-
+
+ {% include post-header.html post = page %} +
{{ content }}
\ No newline at end of file diff --git a/blog/index.html b/blog/index.html index 3ed591a..0387f41 100644 --- a/blog/index.html +++ b/blog/index.html @@ -7,17 +7,7 @@ layout: default

{% t home.latest_news %}

{% for p in paginator.posts %} -
-
- {{ p.date | date_to_string }} -

- {{ p.title }} -

-
-
- {{ p.excerpt }} -
-
+ {% include post-excerpt.html post=p %} {% endfor %} {% include pagination.html %} -- cgit v1.2.3