Browse Source

Merge pull request #3 from dataCobra/master

Add multilingual month support
main
Kailash Nadh 2 years ago
committed by GitHub
parent
commit
f2374971e9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 42 additions and 5 deletions
  1. +25
    -0
      README.md
  2. +12
    -0
      exampleSite/data/month.yaml
  3. +2
    -2
      layouts/_default/list.html
  4. +1
    -1
      layouts/_default/single.html
  5. +1
    -1
      layouts/_default/terms.html
  6. +1
    -1
      layouts/index.html

+ 25
- 0
README.md View File

@ -12,6 +12,7 @@ Crisp, minimal personal website and blog theme Hugo. Forked from [Ezhil](https:/
* Disqus comments
* RSS feeds
* Custom CSS/JS
* Multilingual months support
## Installation
@ -39,6 +40,30 @@ type: "page"
This is some static page where you can write about yourself.
```
## Language Settings for the month
Due to the currently unavailable feature for multilingual dates in ``.Date`` from
Go. It is possible to create a ``month.yaml`` in the data folder of your
Hugo site root directoy. There is also an example file in
``exampleSite/data/``.
```sh
cat > month.yaml << EOF
1: "Jan"
2: "Feb"
3: "Mar"
4: "Apr"
5: "May"
6: "Jun"
7: "Jul"
8: "Aug"
9: "Sep"
10: "Oct"
11: "Nov"
12: "Dec"
EOF
```
## Credits
* [Ezhil theme](https://github.com/vividvilla/ezhil) from which Ink was forked


+ 12
- 0
exampleSite/data/month.yaml View File

@ -0,0 +1,12 @@
1: "Jan"
2: "Feb"
3: "Mar"
4: "Apr"
5: "May"
6: "Jun"
7: "Jul"
8: "Aug"
9: "Sep"
10: "Oct"
11: "Nov"
12: "Dec"

+ 2
- 2
layouts/_default/list.html View File

@ -9,7 +9,7 @@
{{ if isset .Data "Term" }}
<h2>{{ .Data.Term }}</h2>
{{ else }}
<h2 class="page-title">All posts</h2>
<h2 class="page-title">{{ .Name }}</h2>
{{ end }}
<ul class="posts flat">
@ -21,7 +21,7 @@
<div class="meta">
<div class="date">
<span class="day">{{ dateFormat "02" .Date }}</span>
<span class="rest">{{ dateFormat "Jan 2006" .Date }}</span>
<span class="rest">{{ if $.Site.Data.month }}{{ index $.Site.Data.month (printf "%d" .Date.Month) }} {{ .Date.Year }}{{ else }}{{ dateFormat "Jan 2006" .Date }}{{ end }}</span>
</div>
</div>
<div class="matter">


+ 1
- 1
layouts/_default/single.html View File

@ -11,7 +11,7 @@
<div class="meta">
<div class="date">
<span class="day">{{ dateFormat "02" .Date }}</span>
<span class="rest">{{ dateFormat "Jan 2006" .Date }}</span>
<span class="rest">{{ if $.Site.Data.month }}{{ index $.Site.Data.month (printf "%d" .Date.Month) }} {{ .Date.Year }}{{ else }}{{ dateFormat "Jan 2006" .Date }}{{ end }}</span>
</div>
</div>
{{ end }}


+ 1
- 1
layouts/_default/terms.html View File

@ -6,7 +6,7 @@
<div class="container wrapper tags">
{{ partial "head.html" . }}
<h1 class="page-title">All tags</h1>
<h1 class="page-title">{{ .Name }}</h1>
{{ $biggest := 1 }}
{{ $smallest := 1 }}


+ 1
- 1
layouts/index.html View File

@ -15,7 +15,7 @@
<div class="meta">
<div class="date">
<span class="day">{{ dateFormat "02" .Date }}</span>
<span class="rest">{{ dateFormat "Jan 2006" .Date }}</span>
<span class="rest">{{ if $.Site.Data.month }}{{ index $.Site.Data.month (printf "%d" .Date.Month) }} {{ .Date.Year }}{{ else }}{{ dateFormat "Jan 2006" .Date }}{{ end }}</span>
</div>
</div>
<div class="matter">


Loading…
Cancel
Save