Переглянути джерело

Require Hugo v0.18 and support section nodes as pages

* Post, Publication, and Talk nodes can now have a `_index.md` file with title and content.
* Example `_index.md` content files added to Example Site.
* Hugo v0.18+ required.
George Cushen 8 роки тому
батько
коміт
2220cd5d95

+ 3 - 0
exampleSite/content/post/_index.md

@@ -0,0 +1,3 @@
++++
+title = "Posts"
++++

+ 3 - 0
exampleSite/content/publication/_index.md

@@ -0,0 +1,3 @@
++++
+title = "Publications"
++++

+ 3 - 0
exampleSite/content/talk/_index.md

@@ -0,0 +1,3 @@
++++
+title = "Recent & Upcoming Talks"
++++

+ 0 - 11
i18n/en.yaml

@@ -87,14 +87,3 @@
 
 - id: open_project_site
   translation: Go to Project Site
-
-# Section titles
-
-- id: posts
-  translation: Posts
-
-- id: publications
-  translation: Publications
-
-- id: talks
-  translation: Talks

+ 5 - 1
layouts/section/post.html

@@ -2,7 +2,11 @@
 {{ partial "navbar.html" . }}
 <div class="container">
 
-  <h1>{{ i18n "posts" }}</h1>
+  <h1>{{ .Title | default "Posts" }}</h1>
+
+  {{ with .Content }}
+  <div class="article-style" itemprop="articleBody">{{ . }}</div>
+  {{ end }}
 
   {{ $paginator := .Paginate .Data.Pages }}
   {{ range $paginator.Pages }}

+ 5 - 1
layouts/section/publication.html

@@ -3,7 +3,11 @@
 <div class="container">
   <div class="row">
     <div class="col-md-12">
-      <h1>{{ i18n "publications" }}</h1>
+      <h1>{{ .Title | default "Publications" }}</h1>
+
+      {{ with .Content }}
+      <div class="article-style" itemprop="articleBody">{{ . }}</div>
+      {{ end }}
 
       <p>
         {{ i18n "filter_by_type" }}:

+ 6 - 2
layouts/section/talk.html

@@ -3,7 +3,11 @@
 <div class="container">
   <div class="row">
     <div class="col-md-12">
-      <h1>{{ i18n "talks" }}</h1>
+      <h1>{{ .Title | default "Talks" }}</h1>
+
+      {{ with .Content }}
+      <div class="article-style" itemprop="articleBody">{{ . }}</div>
+      {{ end }}
 
       {{ range .Data.Pages.GroupByDate "2006" }}
       <div class="row" id="talk_list">
@@ -15,7 +19,7 @@
 
             {{ range .Pages.ByDate.Reverse }}
             <li>
-              <i class="fa-li fa fa-file-text-o" aria-hidden="true"
+              <i class="fa-li fa fa-comment-o" aria-hidden="true"
                  style="color:#03396c;font-size:80%;padding-top:6px;"></i>
               {{ .Title }}
               <p>{{ partial "talk_links" (dict "content" . "is_list" 1) }}</p>

+ 1 - 1
theme.toml

@@ -3,7 +3,7 @@ license = "MIT"
 licenselink = "https://github.com/gcushen/hugo-academic/blob/master/LICENSE.md"
 description = "Easily create beautifully simple academic or personal sites"
 homepage = "https://github.com/gcushen/hugo-academic"
-min_version = 0.17
+min_version = 0.18
 tags = ["academic",
         "portfolio",
         "responsive",