aboutsummaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorC. Lente <7017340+clente@users.noreply.github.com>2023-02-01 15:06:05 -0300
committerC. Lente <7017340+clente@users.noreply.github.com>2023-02-01 15:06:05 -0300
commit3ec95503252645b87c625df10a8ac44d04563166 (patch)
tree0304691be8b7859d7e5b525807d6c0e082873553 /layouts
parent76ca2f889f35035484482bf7f9715149a5b40127 (diff)
downloadhugo-bearcub-3ec95503252645b87c625df10a8ac44d04563166.tar.gz
hugo-bearcub-3ec95503252645b87c625df10a8ac44d04563166.tar.bz2
Bring files from personal blog
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/baseof.html5
-rw-r--r--layouts/_default/list.html28
-rw-r--r--layouts/_default/single.html6
-rw-r--r--layouts/i18n/en.toml26
-rw-r--r--layouts/i18n/pt.toml26
-rw-r--r--layouts/partials/footer.html6
-rw-r--r--layouts/partials/header.html2
-rw-r--r--layouts/partials/nav.html20
-rw-r--r--layouts/partials/style.html4
-rw-r--r--layouts/robots.txt3
-rw-r--r--layouts/shortcodes/rawhtml.html2
11 files changed, 101 insertions, 27 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 6bce2dc..1f30b5d 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -11,12 +11,13 @@
{{- partial "seo_tags.html" . -}}
<meta name="referrer" content="no-referrer-when-downgrade" />
+ {{ $css := resources.Get "style.css" | minify }}
+ <link href="{{ $css.RelPermalink }}" rel="stylesheet">
+
{{ with .OutputFormats.Get "rss" -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}}
- {{- partial "style.html" . -}}
-
<!-- A partial to be overwritten by the user.
Simply place a custom_head.html into
your local /layouts/partials-directory -->
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 8b8c14b..6c4f7d0 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -1,10 +1,10 @@
{{ define "main" }}
<content>
{{ if .Data.Singular }}
- <h3 style="margin-bottom:0">Filtering for "{{ .Title }}"</h3>
- <small>
- <a href="{{ "/blog" | relURL }}">Remove filter</a>
- </small>
+ <h3 style="margin-bottom:0">{{ i18n "filter" }} "{{ .Title }}"</h3>
+ <small>
+ <a href="{{ i18n "posts" }}">{{ i18n "remove" }}</a>
+ </small>
{{ end }}
<ul class="blog-posts">
{{ range .Pages }}
@@ -16,7 +16,11 @@
</time>
</i>
</span>
- <a href="{{ .Permalink }}">{{ .Title }}</a>
+ {{ if .Params.link }}
+ <a href="{{ .Params.link }}">{{ .Title }}</a>
+ {{ else }}
+ <a href="{{ .Permalink }}">{{ .Title }}</a>
+ {{ end }}
</li>
{{ else }}
<li>
@@ -26,13 +30,11 @@
</ul>
{{ if .Data.Singular }}
{{else}}
- <small>
- <div>
- {{ range .Site.Taxonomies.tags }}
- <a href="{{ .Page.Permalink }}">#{{ .Page.Title }}</a>&nbsp;
- {{ end }}
- </div>
- </small>
- {{ end }}
+ <div>
+ {{ range .Site.Taxonomies.tags }}
+ <a class="blog-tags" href="{{ .Page.Permalink }}">#{{ .Page.Title }}</a>&nbsp;&nbsp;
+ {{ end }}
+ </div>
+ {{ end }}
</content>
{{ end }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 7d57351..40d0b03 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -1,5 +1,5 @@
{{ define "main" }}
-{{ if eq .Type "blog" }}{{ if not .Params.menu }}
+{{ if not .Params.menu }}
<h1>{{ .Title }}</h1>
<p>
<i>
@@ -8,13 +8,13 @@
</time>
</i>
</p>
-{{ end }}{{ end }}
+{{ end }}
<content>
{{ .Content }}
</content>
<p>
{{ range (.GetTerms "tags") }}
- <a href="{{ .Permalink }}">#{{ .LinkTitle }}</a>
+ <a class="blog-tags" href="{{ .Permalink }}">#{{ .LinkTitle }}</a>&nbsp;&nbsp;
{{ end }}
</p>
{{ end }}
diff --git a/layouts/i18n/en.toml b/layouts/i18n/en.toml
new file mode 100644
index 0000000..708eb64
--- /dev/null
+++ b/layouts/i18n/en.toml
@@ -0,0 +1,26 @@
+[home]
+ other = '/en'
+
+[posts]
+ other = '/en/posts'
+
+[other-lang]
+ other = "Português 🇧🇷"
+
+[other-home]
+ other = "/"
+
+[reply]
+ other = 'Reply to '
+
+[filter]
+ other = 'Filtering for'
+
+[remove]
+ other = 'Remove filter'
+
+[stone]
+ other = 'Made of stone'
+
+[stone-link]
+ other = '/en/posts/stone-websites' \ No newline at end of file
diff --git a/layouts/i18n/pt.toml b/layouts/i18n/pt.toml
new file mode 100644
index 0000000..d2f2548
--- /dev/null
+++ b/layouts/i18n/pt.toml
@@ -0,0 +1,26 @@
+[home]
+ other = '/'
+
+[posts]
+ other = '/posts'
+
+[other-lang]
+ other = "English 🇺🇸"
+
+[other-home]
+ other = "/en"
+
+[reply]
+ other = 'Resposta a '
+
+[filter]
+ other = 'Filtrando para'
+
+[remove]
+ other = 'Remover filtro'
+
+[stone]
+ other = 'Feito de pedra'
+
+[stone-link]
+ other = '/posts/sites-de-pedra' \ No newline at end of file
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index 8eca955..83a3214 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -1 +1,5 @@
-{{ if ne .Site.Params.hideMadeWithLine true }}Made with <a href="https://github.com/janraasch/hugo-bearblog/">Hugo ʕ•ᴥ•ʔ Bear</a>{{ end }}
+{{ if ne .Site.Params.hideMadeWithLine true }}
+ <small>
+ {{ .Site.Copyright }} | <a href="{{ i18n "stone-link" }}">{{ i18n "stone" }}</a>
+ </small>
+{{ end }}
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index e47df70..ba8e9ec 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -1,4 +1,4 @@
-<a href="{{ "/" | relURL }}" class="title">
+<a href="{{ i18n "home" | relURL }}" class="title">
<h2>{{ .Site.Title }}</h2>
</a>
<nav>{{- partial "nav.html" . -}}</nav>
diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html
index def9b6e..951e433 100644
--- a/layouts/partials/nav.html
+++ b/layouts/partials/nav.html
@@ -1,7 +1,15 @@
-<a href="{{ "/" | relURL }}">Home</a>
-{{ range .Site.Menus.main }}
-<a href="{{ .URL }}">{{ .Name }}</a>
-{{ end }}
-{{ with .Site.GetPage "/blog" }}
-<a href="{{ "/blog" | relURL }}">Blog</a>
+<a href={{ i18n "home" | relURL }}>Home</a>
+<a href={{ i18n "posts" }}>Blog</a>
+<a href="mailto:c@lente.dev?subject={{ i18n "reply" }}'{{ .Page.Title | default .Site.Title }}'">Email</a>
+<a href="/index.xml">RSS</a>
+
+{{ $pageLang := .Page.Lang }}
+{{ if .IsTranslated }}
+ {{ range .Translations }}
+ {{ if ne $pageLang .Lang }}
+ <a href="{{ .Permalink }}">{{ i18n "other-lang" }}</a>
+ {{ end }}
+ {{ end }}
+{{ else }}
+ <a class="disabled" href="">{{ i18n "other-lang" }}</a>
{{ end }}
diff --git a/layouts/partials/style.html b/layouts/partials/style.html
index 122a641..6ac5bc7 100644
--- a/layouts/partials/style.html
+++ b/layouts/partials/style.html
@@ -126,6 +126,10 @@
color: #8b6fcb;
}
+ h3.blog-filter {
+ margin-bottom: 0;
+ }
+
@media (prefers-color-scheme: dark) {
body {
background-color: #333;
diff --git a/layouts/robots.txt b/layouts/robots.txt
index 0326f5c..4f4ca44 100644
--- a/layouts/robots.txt
+++ b/layouts/robots.txt
@@ -1,2 +1,3 @@
-User-Agent: *
+User-agent: *
+Allow: /
Sitemap: {{ "sitemap.xml" | absURL }}
diff --git a/layouts/shortcodes/rawhtml.html b/layouts/shortcodes/rawhtml.html
new file mode 100644
index 0000000..520ec17
--- /dev/null
+++ b/layouts/shortcodes/rawhtml.html
@@ -0,0 +1,2 @@
+<!-- raw html -->
+{{.Inner}} \ No newline at end of file