浏览代码

[new feature] footer links option added

zzossig 5 年之前
父节点
当前提交
72c5af2363

+ 34 - 1
assets/sass/layout/_footer.scss

@@ -8,6 +8,39 @@
     border-top: 1px solid themed('border-line-color');
   }
 
-  padding: 0.5rem;
+  padding: 1rem;
   text-align: center;
+
+  &__section {
+    @include flexbox();
+    @include flex-direction(column);
+    @include flex-grow(1);
+    @include align-items(flex-start);
+
+    &--wrapper {
+      @include flexbox();
+    }
+
+    &--title {
+      font-family: $title-font;
+      font-size: 1rem;
+      font-weight: bold;
+      margin: 1rem 0 0.5rem 0;
+    }
+
+    &--link {
+      display: block;
+      text-align: left;
+      padding: 0.15rem 0.35rem;
+    }
+  }
+
+  &__contents {
+    width: 100%;
+    margin: 2rem 0;
+
+    @include flexbox();
+    @include align-items(flex-start);
+    @include flex-direction(column);
+  }
 }

文件差异内容过多而无法显示
+ 0 - 0
exampleSite/resources/_gen/assets/scss/sass/main.scss_b4f67ac5085b89b62b54c1923e5a9145.content


+ 29 - 5
layouts/partials/footer/footer.html

@@ -3,11 +3,35 @@
   <footer class="footer">
     <div class="divider">
       <div class="lmr">
-        <p class="caption">
-          {{ with $.Site.Copyright }}{{ replace . "{year}" now.Year | markdownify}}{{ end }}
-        </p>
-        {{ if $.Param "showPoweredBy" }}
-            <p class="caption">Powered by <a href="https://gohugo.io/" rel="noreferrer">Hugo</a> and the <a href="https://github.com/zzossig/hugo-theme-zdoc" rel="noreferrer">zDoc theme</a></p>
+        {{ with .Params.footer }}
+          <div class="footer__section--wrapper">
+            {{ range .sections }}
+              <div class="footer__section">
+                <div class="footer__section--title">
+                  {{ .title }}
+                </div>
+                <ul>
+                  {{ range .links }}
+                    <a href="{{ .link }}" class="footer__section--link" target="_blank" rel="noreferrer">
+                      {{ .title }}
+                    </a>
+                  {{ end }}
+                </ul>
+              </div>
+            {{ end }}
+          </div>
+          {{ with .contents }}
+            <div class="footer__contents {{ if .applySinglePageCss }}single__contents{{ end }}">
+              {{ .markdown | markdownify }}
+            </div>
+          {{ end }}
+        {{ else }}
+          <p class="caption">
+            {{ with $.Site.Copyright }}{{ replace . "{year}" now.Year | markdownify }}{{ end }}
+          </p>
+          {{ if $.Param "showPoweredBy" }}
+              <p class="caption">Powered by <a href="https://gohugo.io/" rel="noreferrer">Hugo</a> and the <a href="https://github.com/zzossig/hugo-theme-zdoc" rel="noreferrer">zDoc theme</a></p>
+          {{ end }}
         {{ end }}
       </div>
     </div>

+ 26 - 23
layouts/partials/main/landing/home-landing.html

@@ -1,30 +1,32 @@
+{{ with .Params.landing }}
+{{ $landing := . }}
 <div class="divider">
   <div class="lmr">
     <div class="home__landing">
-      {{ if $.Param "landingImage" }}
+      {{ if .image }}
         <div class="home__landing--img">
-          <img src="{{ $.Param "landingImage" | relURL }}" alt="Site Landing Page image">
+          <img src="{{ .image | relURL }}" alt="Site Landing Page image">
         </div>
         <div class="home__landing--txt">
-          {{ if $.Param "landingTitle" }}
-            {{ range $.Param "landingTitle" }}
-            <div class="title" style="{{ with $.Param "titleColor" }}color:{{ . }}{{ end }};">
-              {{ . }}
-            </div>
+          {{ if .title }}
+            {{ range .title }}
+              <div class="title" style="{{ with $landing.titleColor }}color:{{ . }}{{ end }};">
+                {{ . }}
+              </div>
             {{ end }}
           {{ end }}
-            {{ if $.Param "spaceBetweenTitleText" }}
-              <div style="height: {{ $.Param "spaceBetweenTitleText" }}px"></div>
+            {{ if .spaceBetweenTitleText }}
+              <div style="height: {{ .spaceBetweenTitleText }}px"></div>
             {{ end }}
-          {{ if $.Param "landingText" }}
-            {{ range $.Param "landingText" }}
-              <div class="text" style="{{ with $.Param "textColor" }}color:{{ . }}{{ end }};">
+          {{ if .text }}
+            {{ range .text }}
+              <div class="text" style="{{ with $landing.textColor }}color:{{ . }}{{ end }};">
                 {{ . }}
               </div>
             {{ end }}
           {{ end }}
 
-          {{ range .Params.buttons }}
+          {{ range .buttons }}
             <a href="{{ .link }}" target="{{ if in .link "http" }}_blank{{ else }}_self{{ end }}" rel="noreferrer" class="home__landing--link">
               <button class="button home__landing--btn" aria-label="{{ .text }}" data-color="{{ with .color }}{{ . }}{{ end }}">
                 {{ .text }}
@@ -34,26 +36,26 @@
         </div>
       {{ else }}
         <div class="home__landing--txt">
-          {{ if $.Param "landingTitle" }}
-            {{ range $.Param "landingTitle" }}
-            <div class="title" style="{{ with $.Param "titleColor" }}color:{{ . }}{{ end }};">
+          {{ if .title }}
+            {{ range .title }}
+            <div class="title" style="{{ with $landing.titleColor }}color:{{ . }}{{ end }};">
               {{ . }}
             </div>
             {{ end }}
           {{ end }}
-            {{ if $.Param "spaceBetweenTitleText" }}
-              <div style="height: {{ $.Param "spaceBetweenTitleText" }}px"></div>
+            {{ if .spaceBetweenTitleText }}
+              <div style="height: {{ .spaceBetweenTitleText }}px"></div>
             {{ end }}
-          {{ if $.Param "landingText" }}
-            {{ range $.Param "landingText" }}
-              <div class="text" style="{{ with $.Param "textColor" }}color:{{ . }}{{ end }};">
+          {{ if .text }}
+            {{ range .text }}
+              <div class="text" style="{{ with $landing.textColor }}color:{{ . }}{{ end }};">
                 {{ . }}
               </div>
             {{ end }}
           {{ end }}
         </div>
         <div class="flexcolumn">
-          {{ range .Params.buttons }}
+          {{ range .buttons }}
             <a href="{{ .link }}" target="{{ if in .link "http" }}_blank{{ else }}_self{{ end }}" rel="noreferrer" class="home__landing--link">
               <button class="button home__landing--btn2" aria-label="{{ .text }}" data-color="{{ with .color }}{{ . }}{{ end }}">
                 {{ .text }}
@@ -64,4 +66,5 @@
       {{ end }}
     </div>
   </div>
-</div>
+</div>
+{{ end }}

部分文件因为文件数量过多而无法显示