mirror of
				https://github.com/thomasjsn/hugo-theme-hello-friend.git
				synced 2025-11-04 16:48:48 +01:00 
			
		
		
		
	Add configuration option to change date format
This commit is contained in:
		
							parent
							
								
									d7b27c55c2
								
							
						
					
					
						commit
						ab1714b799
					
				@ -97,6 +97,8 @@ paginate = 5
 | 
			
		||||
    newerPosts = "Newer posts"
 | 
			
		||||
    olderPosts = "Older posts"
 | 
			
		||||
    minuteReadingTime = "min read"
 | 
			
		||||
    dateFormatSingle = "2006-01-02"
 | 
			
		||||
    dateFormatList = "2006-01-02"
 | 
			
		||||
 | 
			
		||||
    [languages.en.params.logo]
 | 
			
		||||
      logoText = "hello friend"
 | 
			
		||||
 | 
			
		||||
@ -26,6 +26,8 @@ paginate = 5
 | 
			
		||||
    newerPosts = "Newer posts"
 | 
			
		||||
    olderPosts = "Older posts"
 | 
			
		||||
    minuteReadingTime = "min read"
 | 
			
		||||
    dateFormatSingle = "2006-01-02"
 | 
			
		||||
    dateFormatList = "2006-01-02"
 | 
			
		||||
 | 
			
		||||
    [languages.en.params.logo]
 | 
			
		||||
      logoText = "hello friend"
 | 
			
		||||
 | 
			
		||||
@ -9,7 +9,7 @@
 | 
			
		||||
      <h1 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
 | 
			
		||||
      <div class="post-meta">
 | 
			
		||||
        <span class="post-date">
 | 
			
		||||
          {{ .Date.Format "2006-01-02" }}
 | 
			
		||||
          {{ .Date.Format ($.Site.Params.DateFormatList | default "2006-01-02") }}
 | 
			
		||||
        </span>
 | 
			
		||||
        {{ with .Params.Author }}<span class="post-author">— {{ $.Site.Params.WrittenBy | default "Written by" }} {{ . }}</span>{{ end }}
 | 
			
		||||
        {{ if $.Site.Params.ShowReadingTime }}
 | 
			
		||||
 | 
			
		||||
@ -4,7 +4,7 @@
 | 
			
		||||
    <div class="post-meta">
 | 
			
		||||
      {{ with .Date | default nil }}
 | 
			
		||||
        <span class="post-date">
 | 
			
		||||
            {{ .Format "2006-01-02" }}
 | 
			
		||||
            {{ .Format ($.Site.Params.DateFormatSingle | default "2006-01-02") }}
 | 
			
		||||
        </span>
 | 
			
		||||
      {{ end }}
 | 
			
		||||
      {{ with .Params.Author }}<span class="post-author">— {{ $.Site.Params.WrittenBy | default "Written by" }} {{ . }}</span>{{ end }}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user