From 591686138c4bc46b77aa65bbd15b427785ca8b2c Mon Sep 17 00:00:00 2001
From: Alexander Bilz <mail@alexbilz.com>
Date: Tue, 05 Jan 2021 10:30:47 +0000
Subject: [PATCH] Merge branch 'master' into utterances
---
exampleSite/config.toml | 9 ++++
layouts/_default/baseof.html | 3 +
layouts/_default/list.html | 5 ++
layouts/_default/single.html | 5 ++
layouts/partials/analytics/simpleanalytics.html | 7 +++
layouts/index.html | 5 ++
assets/css/style.css | 3 -
README.md | 20 ++++++++++
i18n/pt-br.toml | 24 ++++++++++++
9 files changed, 75 insertions(+), 6 deletions(-)
diff --git a/README.md b/README.md
index dea9cf4..9ebfd4d 100644
--- a/README.md
+++ b/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]`:
diff --git a/assets/css/style.css b/assets/css/style.css
index ab5bbd6..01ce335 100644
--- a/assets/css/style.css
+++ b/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 */
\ No newline at end of file
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 91a7cbe..4782677 100644
--- a/exampleSite/config.toml
+++ b/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/"
\ No newline at end of file
+ url = "/contact/"
diff --git a/i18n/pt-br.toml b/i18n/pt-br.toml
new file mode 100644
index 0000000..2456fa9
--- /dev/null
+++ b/i18n/pt-br.toml
@@ -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"
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 8542ce5..dc92dba 100644
--- a/layouts/_default/baseof.html
+++ b/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>
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 9a8254c..cad95c8 100644
--- a/layouts/_default/list.html
+++ b/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>
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 08749d3..0773a1e 100644
--- a/layouts/_default/single.html
+++ b/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>
diff --git a/layouts/index.html b/layouts/index.html
index 7b91878..c5ec3a3 100644
--- a/layouts/index.html
+++ b/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"
diff --git a/layouts/partials/analytics/simpleanalytics.html b/layouts/partials/analytics/simpleanalytics.html
new file mode 100644
index 0000000..1d6c745
--- /dev/null
+++ b/layouts/partials/analytics/simpleanalytics.html
@@ -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 }}
--
Gitblit v1.10.0