ソースを参照

featurette widget: Add support for title and subtitle

Close #664
George Cushen 7 年 前
コミット
c375fb41ef

+ 7 - 2
exampleSite/content/home/skills.md

@@ -1,8 +1,13 @@
 +++
 # Feature/Skill widget.
-widget = "featurette"
+widget = "featurette"  # Do not modify this line!
+date = 2017-09-20T00:00:00
+
+# Activate this widget? true/false
 active = false
-date = "2017-11-21"
+
+title = ""
+subtitle = ""
 
 # Order that this section will appear in.
 weight = 20

+ 13 - 0
layouts/partials/widgets/featurette.html

@@ -2,6 +2,19 @@
 {{ $page := .page }}
 
 <div class="row featurette">
+  {{ with $page.Title }}
+  <div class="col-md-12 section-heading">
+    <h1>{{ . | markdownify | emojify }}</h1>
+    {{ if $page.Params.subtitle }}<p>{{ $page.Params.subtitle | markdownify | emojify }}</p>{{ end }}
+  </div>
+  {{ end }}
+
+  {{ with $page.Content }}
+  <div class="col-md-12">
+    <p>{{ . | markdownify }}</p>
+  </div>
+  {{ end }}
+
   {{ range $page.Params.feature }}
   {{ $pack := or .icon_pack "fa" }}
   <div class="col-sm-4">