mirror of https://github.com/lxndrblz/anatole.git

Alexander Bilz
05.30.2021 591686138c4bc46b77aa65bbd15b427785ca8b2c
Merge branch 'master' into utterances
7 files modified
2 files added
81 ■■■■■ changed files
README.md 20 ●●●●● patch | view | raw | blame | history
assets/css/style.css 3 ●●●● patch | view | raw | blame | history
exampleSite/config.toml 9 ●●●● patch | view | raw | blame | history
i18n/pt-br.toml 24 ●●●●● patch | view | raw | blame | history
layouts/_default/baseof.html 3 ●●●●● patch | view | raw | blame | history
layouts/_default/list.html 5 ●●●● patch | view | raw | blame | history
layouts/_default/single.html 5 ●●●● patch | view | raw | blame | history
layouts/index.html 5 ●●●● patch | view | raw | blame | history
layouts/partials/analytics/simpleanalytics.html 7 ●●●●● patch | view | raw | blame | history
README.md
@@ -19,6 +19,7 @@
- 100⁄100 Google Lighthouse score
- Google Analytics (optional)
- Comments powered by Disqus or Utteranc.es (optional)
- SimpleAnalytics (optional)
- Katex support (optional)
- Formspree Contact Form (optional)
- Twitter Cards support
@@ -128,6 +129,15 @@
doNotLoadAnimations = true # Animations are loaded by default
```
### Control the date Format
You can change the default date formating for the `list.html`, the `single.html` and the `index.html`. Simply configure the matching parameters.
```toml
[params]
singleDateFormat = "Mon, Jan 2, 2006"
indexDateFormat = "Mon, Jan 2, 2006"
listDateFormat = "Jan 2"
```
### Have a static page as a home page
If you prefer having a static page as your home page rather than a listing of the latest posts, then make sure you leave the `mainSections` parameter blank:
```toml
@@ -222,6 +232,16 @@
googleAnalytics = "UA-123-45"
```
### Simple Analytics
To use Simple Analytics, it has to be enabled by setting the parameter to true. If you are using a custom subdomain to evade Adblockers, then specify the URL without a trailing slash.
```toml
[params.simpleAnalytics]
enable = true
# customurl = "https://analytics.example.com"
```
### Google Site Verification
To use Google Site Verification, add the following line to the `[params]`:
assets/css/style.css
@@ -891,7 +891,6 @@
        display: block;
        flex-grow: 0;
        flex-shrink: 0;
        display: block;
        line-height: 2.5;
        padding: .5rem .75rem;
        position: relative;
@@ -1073,4 +1072,4 @@
    border: 1px solid var(--form-button-hover-border-color);
}
/* (CONTACT) FORM END */
/* (CONTACT) FORM END */
exampleSite/config.toml
@@ -37,6 +37,13 @@
#contactFormAction = "https://formspree.io/f/your-form-hash-here"
# Google Site Verify
#googleSiteVerify = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
# indexDateFormat = "Mon, Jan 2, 2006"
# listDateFormat = "Jan 2"
# singleDateFormat = "Mon, Jan 2, 2006"
[params.simpleAnalytics]
# enable = true
# customurl = "https://analytics.example.com"
## Math settings
[params.math]
@@ -91,4 +98,4 @@
  name = "Contact"
  weight = 400
  identifier = "contact"
  url = "/contact/"
  url = "/contact/"
i18n/pt-br.toml
New file
@@ -0,0 +1,24 @@
[category]
other = "categoria"
[tag]
other = "etiqueta"
[reading_time]
one = "Tempo de leitura: 1 minuto"
other = "Tempo de leitura: {{ .Count }} minutos"
[page_not_found]
other = "Página não encontrada"
[page_does_not_exist]
other = "Desculpa, esta página não existe."
[head_back]
other = "Retornar à <a href=\"{{ . }}\">página inicial</a>."
[comments]
other = "comentários"
[send]
other = "Enviar"
layouts/_default/baseof.html
@@ -14,6 +14,9 @@
</div>
{{- partial "footer.html" . -}}
{{- if (eq .Site.Params.simpleAnalytics.enable true) -}}
    {{- partial "analytics/simpleanalytics.html" . -}}
{{- end -}}
</body>
</html>
layouts/_default/list.html
@@ -7,7 +7,10 @@
                    <ul class="listing">
                        <div class="listing-item">
                            <div class="listing-post"><a href="{{ .Permalink }}" title="{{ .Title }}">{{ .Title }}</a>
                                <div class="post-time"><span class="date">{{.Date.Format "Jan 2" }}</span></div>
                                <div class="post-time"><span class="date">{{ if isset .Site.Params "listdateformat" }}
                                                                            {{ .Date.Format .Site.Params.listDateFormat }}
                                                                            {{ else }} {{.Date.Format "Jan 2"}}
                                                                            {{ end }}</span></div>
                            </div>
                        </div>
                    </ul>
layouts/_default/single.html
@@ -6,7 +6,10 @@
                {{ if eq .Type "post"}}
                    <div class="info">
                        <em class="fas fa-calendar-day"></em>
                        <span class="date">{{ .Date.Format "Mon, Jan 2, 2006" }}</span>
                        <span class="date">{{ if isset .Site.Params "singledateformat" }}
                                                {{ .Date.Format .Site.Params.singleDateFormat }}
                                           {{ else }} {{.Date.Format "Mon, Jan 2, 2006"}}
                                           {{ end }}</span>
                        <em class="fas fa-stopwatch"></em>
                        <span class="reading-time">{{ i18n "reading_time" .ReadingTime }}</span>
                    </div>
layouts/index.html
@@ -24,7 +24,10 @@
            <div class="post-footer">
                <div class="meta">
                    <div class="info"><em class="fas fa-calendar-day"></em><span
                                class="date">{{ .Date.Format "Mon, Jan 2, 2006" }}</span>
                                class="date">{{ if isset .Site.Params "indexdateformat" }}
                                                 {{ .Date.Format .Site.Params.indexDateFormat }}
                                             {{ else }} {{.Date.Format "Mon, Jan 2, 2006"}}
                                             {{ end }}</span>
                        {{ with .Params.tags }}
                            {{- range $index, $el := . -}}
                                <a class="tag"
layouts/partials/analytics/simpleanalytics.html
New file
@@ -0,0 +1,7 @@
{{ with .Site.Params.simpleAnalytics.customUrl }}
<script async defer src="{{ . | relURL }}/latest.js"></script>
<noscript><img src="{{ . | relURL }}/noscript.gif" alt=""/></noscript>
{{ else }}
<script async defer src=" https://scripts.simpleanalyticscdn.com/latest.js"></script>
<noscript><img src="https://queue.simpleanalyticscdn.com/noscript.gif" alt=""/></noscript>
{{ end }}