Преглед изворни кода

Update CSS to dynamically color alternate home sections

George Cushen пре 9 година
родитељ
комит
6a91758b80
2 измењених фајлова са 8 додато и 5 уклоњено
  1. 3 3
      layouts/index.html
  2. 5 2
      static/css/hugo-academic.css

+ 3 - 3
layouts/index.html

@@ -9,7 +9,7 @@
     <!-- Biography Section -->
     {{ range $index, $page := where .Site.Pages "Section" "=" "home" }}
     {{ if eq .Title "about" }}
-    <section id="bio" class="home-section-wrapper full_width home alt" style="padding-top: 0;">
+    <section id="bio" class="home-section-wrapper full_width home" style="padding-top: 0;">
         {{ partial "home_biography" . }}
     </section>
     {{ end }}
@@ -39,7 +39,7 @@
 
 
     <!-- Blog Posts Section -->
-    <section id="posts" class="home-section-wrapper full_width home alt">
+    <section id="posts" class="home-section-wrapper full_width home">
         <div class="row">
             <div class="col-xs-12 col-md-4">
                 <h2>Posts</h2>
@@ -93,7 +93,7 @@
     {{ range $index, $page := where .Site.Pages "Section" "=" "home" }}
     {{ if and (isset .Params "section_id") (not (eq .Params.section_id 0)) }}
     {{ $title_words := split $page.Title " " }}
-    <section id="{{ range $k, $v := $title_words }}{{ if eq $k 0 }}{{ . | urlize | lower }}{{ end }}{{ end }}" class="home-section-wrapper full_width home alt">
+    <section id="{{ range $k, $v := $title_words }}{{ if eq $k 0 }}{{ . | urlize | lower }}{{ end }}{{ end }}" class="home-section-wrapper full_width home">
         <div class="row">
             <div class="col-xs-12 col-md-4">
                 <h2>{{ title $page.Title }}</h2>

+ 5 - 2
static/css/hugo-academic.css

@@ -129,13 +129,16 @@ footer p.powered-by {
     margin-bottom: 0px;
     width: 1905px;
     margin-left: -382.5px;
-    background-color: rgb(247, 247, 247);
 }
 
-.home-section-wrapper.full_width.home.alt {
+.home-section-wrapper.full_width.home:nth-child(even) {
     background-color: rgb(255, 255, 255);
 }
 
+.home-section-wrapper.full_width.home:nth-child(odd) {
+    background-color: rgb(247, 247, 247);
+}
+
 /*************************************************
  *  Blog Articles
  **************************************************/