Luiz de Prá 7 лет назад
Родитель
Сommit
b79cb616ea
3 измененных файлов с 6 добавлено и 4 удалено
  1. 2 0
      exampleSite/config.toml
  2. 1 1
      layouts/partials/list.html
  3. 3 3
      layouts/partials/post.html

+ 2 - 0
exampleSite/config.toml

@@ -22,6 +22,8 @@ disqusShortname = "yourdiscussshortname"
     avatarurl = "images/avatar.jpg"
     avatarurl = "images/avatar.jpg"
     footercontent = "Enter a text here."
     footercontent = "Enter a text here."
 
 
+    dateformat = "January 2, 2006"
+
     hideCredits = false
     hideCredits = false
     hideCopyright = false
     hideCopyright = false
 
 

+ 1 - 1
layouts/partials/list.html

@@ -3,7 +3,7 @@
   <ul>
   <ul>
     {{ range .Paginator.Pages }}
     {{ range .Paginator.Pages }}
     <li>
     <li>
-      <span>{{ .Date.Format "January 2, 2006" }}</span><a href="{{ .URL }}">{{ .Title }}</a>
+      <span>{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}</span><a href="{{ .URL }}">{{ .Title }}</a>
     </li>
     </li>
     {{ end }}
     {{ end }}
   </ul>
   </ul>

+ 3 - 3
layouts/partials/post.html

@@ -2,7 +2,7 @@
   <article>
   <article>
     <header>
     <header>
       <h1 class="title">{{ .Title }}</h1>
       <h1 class="title">{{ .Title }}</h1>
-      <h2 class="date">{{ .Date.Format "January 2, 2006" }}</h2>
+      <h2 class="date">{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}</h2>
 
 
       {{ if eq .Params.math "true" }}
       {{ if eq .Params.math "true" }}
         <script type="text/javascript" async
         <script type="text/javascript" async
@@ -38,5 +38,5 @@
   {{ if and (not (eq .Site.DisqusShortname "" )) (eq (.Params.disable_comments | default false) false)}}
   {{ if and (not (eq .Site.DisqusShortname "" )) (eq (.Params.disable_comments | default false) false)}}
       {{ template "_internal/disqus.html" . }}
       {{ template "_internal/disqus.html" . }}
   {{ end }}
   {{ end }}
-  
-</section>
+
+</section>