From 2f2fa568ef43a676da19a460ab86ea7df0b24ff9 Mon Sep 17 00:00:00 2001 From: Jannik Beyerstedt Date: Sun, 17 Apr 2016 00:23:20 +0200 Subject: [PATCH] [SITE] add template, blueprint, css for the blog --- .brackets.json | 2 - assets/css/blog.css | 69 +++++++++++++++++++ assets/css/blog.css.map | Bin 0 -> 4023 bytes assets/css/main.css | 2 +- assets/css/main.css.map | Bin 7680 -> 7703 bytes assets/scss/blog.scss | 105 +++++++++++++++++++++++++++++ assets/scss/main.scss | 2 +- site/blueprints/blog.yaml | 16 +++++ site/blueprints/blogarticle.yaml | 23 +++++++ site/snippets/base/cont-header.php | 8 +-- site/snippets/blog-htmlhead.php | 40 +++++++++++ site/snippets/blogexcerpt.php | 22 ++++++ site/templates/blog.php | 83 +++++++++++++++++++++++ site/templates/blogarticle.php | 57 ++++++++++++++++ 14 files changed, 421 insertions(+), 8 deletions(-) create mode 100644 assets/css/blog.css create mode 100644 assets/css/blog.css.map create mode 100644 assets/scss/blog.scss create mode 100644 site/blueprints/blog.yaml create mode 100644 site/blueprints/blogarticle.yaml create mode 100644 site/snippets/blog-htmlhead.php create mode 100644 site/snippets/blogexcerpt.php create mode 100644 site/templates/blog.php create mode 100644 site/templates/blogarticle.php diff --git a/.brackets.json b/.brackets.json index d9915da..083120f 100644 --- a/.brackets.json +++ b/.brackets.json @@ -11,7 +11,6 @@ "sourceComments": false, "outputStyle": "nested" }, - "linting.collapsed": false }, "assets/scss/templates/*": { "sass.enabled": true, @@ -23,7 +22,6 @@ "sourceComments": false, "outputStyle": "nested" }, - "linting.collapsed": true }, "assets/vendors/bootstrap/scss/*": { "sass.enabled": true, diff --git a/assets/css/blog.css b/assets/css/blog.css new file mode 100644 index 0000000..44e53ff --- /dev/null +++ b/assets/css/blog.css @@ -0,0 +1,69 @@ +/* STYLE for jannikbeyerstedt.de + * for specific template + */ +h2 { + margin-bottom: 5px; } + +a:hover, a:active, a:focus { + text-decoration: none; } + +main.blog .container { + max-width: 700px; } + +main.blog h1 a { + color: inherit; } + +main.blog article div.meta { + color: #a6a6a6; } + main.blog article div.meta span.tags { + margin-left: 5px; + border-left: 1px solid #a6a6a6; + padding-left: 6px; } + main.blog article div.meta span.tags a { + color: inherit; } + main.blog article div.meta span.tags a:after { + content: ','; } + main.blog article div.meta span.tags a:last-child:after { + content: ''; } + +main.blog article.excerpt { + padding-bottom: 30px; + margin-top: 25px; + border-bottom: 1px solid #a6a6a6; + margin-bottom: 20px; } + main.blog article.excerpt a.more { + font-size: 1.7em; + line-height: 1rem; + position: relative; + top: 0.03em; } + +main.blog article.blogarticle { + margin-top: 30px; + padding-bottom: 60px; + border-bottom: 2px solid silver; + margin-bottom: 50px; } + +main.blog div.teasers article.excerpt:last-child { + border-bottom: none; } + +nav.pagination { + float: none; + text-align: center; + height: 45px; + color: #a6a6a6; } + nav.pagination a.button { + display: inline-block; + padding: 5px 14px; + background-color: #fff; + border: 1px solid #d9d9d9; + border-radius: 10px; + color: inherit; } + nav.pagination a.button.older { + float: left; } + nav.pagination a.button.newer { + float: right; } + nav.pagination span.num-pages { + position: relative; + top: 0.5em; } + +/*# sourceMappingURL=blog.css.map */ \ No newline at end of file diff --git a/assets/css/blog.css.map b/assets/css/blog.css.map new file mode 100644 index 0000000000000000000000000000000000000000..c18f489a60425b67aa1b9fc2a7b2357f49647b9e GIT binary patch literal 4023 zcmb_f-&5O241Vul!Q|P7GWXEC%aiOF6CflMdbHehn6NX+PD;7C|Gkpd#tt!s zW!fi4tM8NaN!l&{z1!OxZKSG_A|L&|_lHHlmq{w|$0$gPct5PF5nHQbtwLGh!N2H) zZu|QO6`mfj8-1~#KG?`SDiod-MP1cOl-l(+Tvv6G?Z47{BUB=SR93GAWXXM!?|5^T zx0y(CQ$o#ma2qHo?#d#`>mBlEDs7Rg0@ZzG`Yk5OL@W(4wTKN7N>;MAvDdY6f(T6> zOf#%PC1q}-l96%1H-xK2U@r@tw>QaB%lq08NDy0Q+my|GetcrDM7%UeXJ4!a#IMW?p z7AiB=L=`cvo+%7BA(gf&z8e-7i13a?$s?QZ&D?le3WdVhN<@kA8pec@=J#!wN}-m? zyh29-LrA$!)25I3n11a)ux^ppSUA12+MbEBO!Ams-Vxxx@z@8? z9|MSE%LDK%7r-5R;7%-oMs4!}rj`$rZ_XG!r?JCc7U8WKz^p@R+Zl)x%*H6tM+c#(1=<8Y=1wS}9oDX{b>7eTufG-^$3qQWXqv^1Gzp8sEN%v9a z(j8;t-BuNxuSREBQqD&M6}notXJr0GxNaN~tD3-^Iybl(VhAX(|Jws|L$*>_O?2&D z3YdqFQseN^jOD|F&hAWfK_iK^ta!8{D+CC;jiCWnj@}C{kk*Kd*j>?I-R(hmaR1SR z;K6&scdpGEo}3}cEP7s`t=yVcv#nj$L!QyICp${AZ_Oy@i^kNkxKb_xzb?rW#o--e zBaYAyf#)zO#8!#oDX?8M;UNYache^DAF@XFm)?QBB1T@Eif zlRc5`Nt^kUX9z>#)?gUCBfET>=1gW3X7-^`XA5;iprE&E?Lgf06liNeeetuoxm(9a z@W#8=Tj)dP(T#f==yq%c?Dw9_!PI%J7aGixV>bjfw03&NPF)P$-d?c-fKN-;C`4`g zX?Cb~()3+H^gCjav2=QBV1{(TpD*xazIaVJTr8`Eh1CvjvwPknY+G`Mg#O3hK!{cG pOLmTePlq!kx%9i!zK1C?Jt*wEgB~F{GINL-3Z_g6! delta 57 zcmbPk(_phfpOZ0kvLUC6nzN&0n6;;)bB2?Sx1*!Cj;m*tledn)qoc2myH~lBv$Zu) LG->lh&NdMM&;Jlc diff --git a/assets/scss/blog.scss b/assets/scss/blog.scss new file mode 100644 index 0000000..20cf861 --- /dev/null +++ b/assets/scss/blog.scss @@ -0,0 +1,105 @@ +/* STYLE for jannikbeyerstedt.de + * for specific template + */ +@import "custom"; +@import "variables"; +@import "mixins"; + +@import "mainvariables"; + +$blog_color_meta: #a6a6a6; + +// change main.scss behavior +body { + +} +h2 { + margin-bottom: 5px; +} + +a:hover, a:active, a:focus { + text-decoration: none; +} + + +// additional css +main.blog { + .container { + max-width: 700px; + } + h1 a { + color: inherit; + } + + article { + div.meta { + color: $blog_color_meta; + span.tags { + margin-left: 5px; + border-left: 1px solid $blog_color_meta; + padding-left: 6px; + a {color: inherit;} + a:after {content: ',';} + a:last-child:after {content: '';} + } + } + } + + article.excerpt { + padding-bottom: 30px; + margin-top: 25px; + border-bottom: 1px solid $blog_color_meta; + margin-bottom: 20px; + + a.more { + font-size: 1.7em; + line-height: 1rem; + position: relative; + top: 0.03em; + } + } + + article.blogarticle { + margin-top: 30px; + + padding-bottom: 60px; + border-bottom: 2px solid lighten($blog_color_meta, 10%); + margin-bottom: 50px; + } + + div.teasers { + article.excerpt:last-child { + border-bottom: none; + } + } +} + +nav.pagination { + float: none; + text-align: center; + height: 45px; + color: $blog_color_meta; + a.button { + display: inline-block; + padding: 5px 14px; + background-color: #fff; + border: 1px solid lighten($blog_color_meta, 20%); + border-radius: 10px; + color: inherit; + &.older { + float: left; + } + &.newer { + float: right; + } + } + span.num-pages { + position: relative; + top: 0.5em; + } +} + + + +// ---- from boostrap ---- +//@import "images"; diff --git a/assets/scss/main.scss b/assets/scss/main.scss index bf4264e..ee6c06b 100644 --- a/assets/scss/main.scss +++ b/assets/scss/main.scss @@ -28,7 +28,7 @@ p { } a { color: $link_color; - &:active, &:hover { + &:active, &:hover, &:focus { color: $link_active; } } diff --git a/site/blueprints/blog.yaml b/site/blueprints/blog.yaml new file mode 100644 index 0000000..55055b1 --- /dev/null +++ b/site/blueprints/blog.yaml @@ -0,0 +1,16 @@ +title: Blog +pages: + template: + - blogarticle + num: date + sort: flip + +files: true + +fields: + title: + label: Title + type: text + text: + label: Text + type: textarea diff --git a/site/blueprints/blogarticle.yaml b/site/blueprints/blogarticle.yaml new file mode 100644 index 0000000..1d9f660 --- /dev/null +++ b/site/blueprints/blogarticle.yaml @@ -0,0 +1,23 @@ +title: Blog Article +pages: false + +files: true + +fields: + title: + label: Title + type: text + date: + label: Date + type: date + width: 1/4 + tags: + label: Tags + type: tags + width: 3/4 + text: + label: Text + type: textarea + meta-robots: + label: Metatag robots + type: text diff --git a/site/snippets/base/cont-header.php b/site/snippets/base/cont-header.php index dbeec4a..917285c 100644 --- a/site/snippets/base/cont-header.php +++ b/site/snippets/base/cont-header.php @@ -9,12 +9,12 @@ $subnav = false; if ($page->depth() == 1) { $baseSec = $page; - if ( $page->isVisible() && $baseSec->hasVisibleChildren() ) { + if ( $page->isVisible() && $baseSec->hasVisibleChildren() && $page->template() != 'blog' ) { $subnav = true; } }else if ($page->depth() == 2) { $baseSec = $page->parent(); - if ( $page->isVisible() && $baseSec->hasVisibleChildren() ) { + if ( $page->isVisible() && $baseSec->hasVisibleChildren() && $page->template() != 'blogarticle' ) { $subnav = true; } } @@ -26,7 +26,7 @@ if ($page->depth() == 1) {