Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions exampleSite/content/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ params:

Here `{Year}` means the year in which the site is built (usually the current year).

The format for displaying dates can be defined in `.Params.dateFormat`. The value of this configuration should be based on [Go's reference time](https://gohugo.io/functions/time/format/#layout-string). For instance, to display the date as `YYYY-MM-DD` the value of this site paramter should be `2006-01-02`.

## Custom layouts

There are two layout files under `layouts/_partials/` that you may want to override: `head_custom.html` and `foot_custom.html`. This is how you inject arbitrary HTML code to the head and foot areas. For example, this site has a file `layouts/_partials/foot_custom.html` to support LaTeX math via KaTeX and center images automatically:
Expand Down
2 changes: 1 addition & 1 deletion layouts/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ <h1>{{ .Title | markdownify }}</h1>
{{ if .IsHome }}{{ $pages = .Site.RegularPages }}{{ end }}
{{ range (where $pages "Section" "!=" "") }}
<li>
<span class="date">{{ .Date.Format "2006/01/02" }}</span>
<span class="date">{{ .Date.Format (default "2006/01/02" .Site.Params.dateFormat) }}</span>
<a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a>
</li>
{{ end }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="article-meta">
<h1><span class="title">{{ .Title | markdownify }}</span></h1>
{{ with .Params.author }}<h2 class="author">{{ . }}</h2>{{ end }}
{{ if (gt .Params.date 0) }}<h2 class="date">{{ .Date.Format "2006/01/02" }}</h2>{{ end }}
{{ if (gt .Params.date 0) }}<h2 class="date">{{ .Date.Format (default "2006/01/02" .Site.Params.dateFormat) }}</h2>{{ end }}
</div>

<main>
Expand Down