Merge pull request #113 from nai888/master
Allow inverted section styling using param in config.toml
This commit is contained in:
commit
3a818c21cf
4 changed files with 7 additions and 12 deletions
|
|
@ -466,7 +466,7 @@ li {
|
|||
background: #f2efe8;
|
||||
position: relative;
|
||||
}
|
||||
.post-holder.odd {
|
||||
.post-holder.dark {
|
||||
background: #b80135;
|
||||
color: white;
|
||||
}
|
||||
|
|
@ -528,7 +528,7 @@ a.fn-item.active {
|
|||
border-top: 50px solid #f2efe8;
|
||||
border-radius: 25px;
|
||||
}
|
||||
.post-after.even {
|
||||
.post-after.light {
|
||||
left: 6%;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,17 +28,9 @@ var $sitehead = $("#site-head");
|
|||
}
|
||||
}
|
||||
$(document).ready(function () {
|
||||
$postholder.each(function (e) {
|
||||
if (e % 2 != 0) $(this).addClass("odd");
|
||||
});
|
||||
|
||||
$postafter.each(function (e) {
|
||||
var bg = $(this).parent().css("background-color");
|
||||
$(this).css("border-top-color", bg);
|
||||
|
||||
if (e % 2 == 0) {
|
||||
$(this).addClass("even");
|
||||
}
|
||||
});
|
||||
|
||||
$("a.btn.site-menu").click(function (e) {
|
||||
|
|
|
|||
|
|
@ -45,5 +45,8 @@ title = "Jane Doe - Nutrition Coach & Chef Consultant"
|
|||
# You can turn it off, but we would really appreciate if you don’t :-)
|
||||
hidedesignbyline = false
|
||||
|
||||
# The sections of the home page alternate styling. Mark invert as true to swap the styling of the sections
|
||||
invertSectionColors = false
|
||||
|
||||
[params.meta]
|
||||
keywords = "some, keywords, for, seo, you, know, google, duckduckgo, and, such"
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
<div class='fixed-nav'>
|
||||
</div>
|
||||
{{ range $index_val, $elem_val := $filtered }}
|
||||
<div class='post-holder'>
|
||||
<div class='post-holder{{ if and (ne .Site.Params.invertSectionColors true) (not (modBool $index_val 2)) }} dark{{ else if and (eq .Site.Params.invertSectionColors true) (modBool $index_val 2) }} dark{{ end }}'>
|
||||
<article id='{{ anchorize .Title }}' class='post {{ if eq $index_val 0 }}first{{ end }} {{ if eq (add $index_val 1) (len $sections) }}last{{ end }}'>
|
||||
<header class="post-header">
|
||||
<h2 class="post-title">{{ .Title | safeHTML }}</h2>
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
{{ .Content }}
|
||||
</section>
|
||||
</article>
|
||||
<div class='post-after'></div>
|
||||
<div class='post-after{{ if and (ne .Site.Params.invertSectionColors true) (modBool $index_val 2) }} light{{ else if and (eq .Site.Params.invertSectionColors true) (not (modBool $index_val 2)) }} light{{ end }}'></div>
|
||||
</div>
|
||||
{{ end }}
|
||||
</main>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue