From 920d0ef3ac8fd38cb0bd970a5626f483a083dbdf Mon Sep 17 00:00:00 2001 From: Marc Riera Irigoyen Date: Thu, 21 Mar 2019 00:00:20 +0100 Subject: [PATCH] Begin overhaul --- config.toml | 21 +- content/_index.md | 5 + content/contacta.md | 28 ++ themes/marcriera/i18n/ca.toml | 14 + themes/marcriera/i18n/en.toml | 14 + themes/marcriera/i18n/es.toml | 14 + themes/marcriera/layouts/_default/list.html | 29 ++ themes/marcriera/layouts/_default/rss.xml | 26 ++ .../marcriera/layouts/_default/section.html | 35 +++ themes/marcriera/layouts/_default/single.html | 11 + themes/marcriera/layouts/index.html | 40 +-- themes/marcriera/layouts/partials/footer.html | 9 + themes/marcriera/layouts/partials/header.html | 51 ++++ themes/marcriera/layouts/partials/menu.html | 32 +++ .../layouts/partials/pagination.html | 16 ++ themes/marcriera/layouts/partials/tags.html | 5 + themes/marcriera/static/css/theme.css | 248 ++++++++++++++++-- themes/marcriera/theme.toml | 4 +- 18 files changed, 543 insertions(+), 59 deletions(-) create mode 100644 content/contacta.md create mode 100644 themes/marcriera/i18n/ca.toml create mode 100644 themes/marcriera/i18n/en.toml create mode 100644 themes/marcriera/i18n/es.toml create mode 100644 themes/marcriera/layouts/_default/list.html create mode 100644 themes/marcriera/layouts/_default/rss.xml create mode 100644 themes/marcriera/layouts/_default/section.html create mode 100644 themes/marcriera/layouts/_default/single.html create mode 100644 themes/marcriera/layouts/partials/footer.html create mode 100644 themes/marcriera/layouts/partials/header.html create mode 100644 themes/marcriera/layouts/partials/menu.html create mode 100644 themes/marcriera/layouts/partials/pagination.html create mode 100644 themes/marcriera/layouts/partials/tags.html diff --git a/config.toml b/config.toml index 2069eef..626f26b 100644 --- a/config.toml +++ b/config.toml @@ -4,9 +4,26 @@ theme = "marcriera" DefaultContentLanguage = "ca" removePathAccents = true +[blackfriday] + fractions = false + [params] name = "Marc Riera Irigoyen" copyright = "Marc Riera Irigoyen" logoimage = "images/logo.png" - description = "Translator and localizer" - description2 = "EN,RO > CA,ES" + +[languages] +[languages.ca] +languageName = "Català" +weight = 1 +description = "Traductor i localitzador" + +[languages.es] +languageName = "Castellano" +weight = 2 +description = "Traductor y localizador" + +[languages.en] +languageName = "English" +weight = 3 +description = "Translator and localiser" diff --git a/content/_index.md b/content/_index.md index d38d226..1b7dd4a 100644 --- a/content/_index.md +++ b/content/_index.md @@ -1,4 +1,9 @@ --- +menu: + main: + name: "Inici" + weight: 1 + url: "/" ---
diff --git a/content/contacta.md b/content/contacta.md new file mode 100644 index 0000000..6e77afa --- /dev/null +++ b/content/contacta.md @@ -0,0 +1,28 @@ +--- +title: "Contacta" +menu: + main: + name: "Contacta" + weight: 6 + url: "/contacta/" +--- + +
+ +Puc fer alguna cosa per tu? Contacta amb mi i parlem-ne, sense compromisos. + +  + +E-mail: contacte@mrtraduccions.cat + +Phone: (+34) 652 492 008 + +  + + + +Twitter: @marcrierai + +LinkedIn: Marc Riera Irigoyen + +
diff --git a/themes/marcriera/i18n/ca.toml b/themes/marcriera/i18n/ca.toml new file mode 100644 index 0000000..98b28f2 --- /dev/null +++ b/themes/marcriera/i18n/ca.toml @@ -0,0 +1,14 @@ +[menu] +other = "Menú" + +[readMore] +other = "Llegeix més" + +[newer] +other = "Més recent" + +[older] +other = "Més antic" + +[latestUpdates] +other = "Últimes actualitzacions" diff --git a/themes/marcriera/i18n/en.toml b/themes/marcriera/i18n/en.toml new file mode 100644 index 0000000..5fbde5a --- /dev/null +++ b/themes/marcriera/i18n/en.toml @@ -0,0 +1,14 @@ +[menu] +other = "Menu" + +[readMore] +other = "Read more" + +[newer] +other = "Newer" + +[older] +other = "Older" + +[latestUpdates] +other = "Latest updates" diff --git a/themes/marcriera/i18n/es.toml b/themes/marcriera/i18n/es.toml new file mode 100644 index 0000000..0a07be7 --- /dev/null +++ b/themes/marcriera/i18n/es.toml @@ -0,0 +1,14 @@ +[menu] +other = "Menú" + +[readMore] +other = "Leer más" + +[newer] +other = "Más reciente" + +[older] +other = "Más antiguo" + +[latestUpdates] +other = "Últimas actualizaciones" diff --git a/themes/marcriera/layouts/_default/list.html b/themes/marcriera/layouts/_default/list.html new file mode 100644 index 0000000..fda8482 --- /dev/null +++ b/themes/marcriera/layouts/_default/list.html @@ -0,0 +1,29 @@ +{{ partial "header.html" . }} + +
+ + {{ range sort .Paginator.Pages }} +
+

{{ .Title }}

+
+ {{ .Summary | plainify | safeHTML }} + ... + +
+
+ {{ if .Params.tags }} + {{ partial "tags" .Params.tags }} + {{ end }} + {{ end }} + {{ partial "pagination.html" . }} + +
+ +{{ partial "footer.html" . }} diff --git a/themes/marcriera/layouts/_default/rss.xml b/themes/marcriera/layouts/_default/rss.xml new file mode 100644 index 0000000..beaf943 --- /dev/null +++ b/themes/marcriera/layouts/_default/rss.xml @@ -0,0 +1,26 @@ + + + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} + {{ .Permalink }} + Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }} + Hugo -- gohugo.io{{ with .Site.LanguageCode }} + {{.}}{{end}}{{ with .Site.Author.email }} + {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }} + {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} + {{.}}{{end}}{{ if not .Date.IsZero }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} + {{ with .OutputFormats.Get "RSS" }} + {{ printf "" .Permalink .MediaType | safeHTML }} + {{ end }} + {{ range .Pages }} + + {{ .Title }} + {{ .Permalink }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} + {{ .Permalink }} + {{ .Content | html }} + + {{ end }} + + diff --git a/themes/marcriera/layouts/_default/section.html b/themes/marcriera/layouts/_default/section.html new file mode 100644 index 0000000..0b88d4f --- /dev/null +++ b/themes/marcriera/layouts/_default/section.html @@ -0,0 +1,35 @@ +{{ partial "header.html" . }} + +{{ if ne (len .Content) 0 }} +
+ {{ .Content }} +
+{{ else }} +
+ + {{ range sort .Paginator.Pages }} +
+

{{ .Title }}

+
+ {{ .Summary | plainify | safeHTML }} + ... + +
+
+ {{ if .Params.tags }} + {{ partial "tags" .Params.tags }} + {{ end }} + {{ end }} + {{ partial "pagination.html" . }} + +
+{{ end }} + +{{ partial "footer.html" . }} diff --git a/themes/marcriera/layouts/_default/single.html b/themes/marcriera/layouts/_default/single.html new file mode 100644 index 0000000..df20cc8 --- /dev/null +++ b/themes/marcriera/layouts/_default/single.html @@ -0,0 +1,11 @@ +{{ partial "header.html" . }} +
+ {{ if not .Date.IsZero }} +

{{ .Date.Format "02-01-2006" }}

+ {{ end }} + {{ .Content }} + {{ if .Params.tags }} + {{ partial "tags" .Params.tags }} + {{ end }} +
+{{ partial "footer.html" . }} diff --git a/themes/marcriera/layouts/index.html b/themes/marcriera/layouts/index.html index a3a96df..c11f0c2 100644 --- a/themes/marcriera/layouts/index.html +++ b/themes/marcriera/layouts/index.html @@ -1,41 +1,5 @@ - - - - {{ .Site.Title }} - {{ .Site.Params.Description }} - - - {{ .Hugo.Generator }} - - - - -
- - - - +{{ partial "header.html" . }}
{{ .Content }}
- - - -
- - - +{{ partial "footer.html" . }} diff --git a/themes/marcriera/layouts/partials/footer.html b/themes/marcriera/layouts/partials/footer.html new file mode 100644 index 0000000..d9ed425 --- /dev/null +++ b/themes/marcriera/layouts/partials/footer.html @@ -0,0 +1,9 @@ + + + + + + + diff --git a/themes/marcriera/layouts/partials/header.html b/themes/marcriera/layouts/partials/header.html new file mode 100644 index 0000000..54339a1 --- /dev/null +++ b/themes/marcriera/layouts/partials/header.html @@ -0,0 +1,51 @@ + + + + {{ .Site.Title }} + + + {{ .Hugo.Generator }} + + + +
+ +
+ + {{ if isset .Site.Params "logoimage" }} + + {{ end }} + + +
{{ .Site.Params.Description }}
+ + +
+ +
+ {{ if .IsTranslated }} + + {{ end }} +
+ + {{ partial "menu.html" . }} + + {{ if isset .Params "image"}} + + {{end}} +
+

{{ .Title }}

+
diff --git a/themes/marcriera/layouts/partials/menu.html b/themes/marcriera/layouts/partials/menu.html new file mode 100644 index 0000000..7c67cb2 --- /dev/null +++ b/themes/marcriera/layouts/partials/menu.html @@ -0,0 +1,32 @@ + diff --git a/themes/marcriera/layouts/partials/pagination.html b/themes/marcriera/layouts/partials/pagination.html new file mode 100644 index 0000000..9caef8d --- /dev/null +++ b/themes/marcriera/layouts/partials/pagination.html @@ -0,0 +1,16 @@ +{{ $pag := .Paginator }} +{{ if gt $pag.TotalPages 1 }} + +{{ end }} diff --git a/themes/marcriera/layouts/partials/tags.html b/themes/marcriera/layouts/partials/tags.html new file mode 100644 index 0000000..908c55e --- /dev/null +++ b/themes/marcriera/layouts/partials/tags.html @@ -0,0 +1,5 @@ +

+ Tags: {{ range . }} + {{ . }} + {{ end }} +

diff --git a/themes/marcriera/static/css/theme.css b/themes/marcriera/static/css/theme.css index d5fde54..644353c 100644 --- a/themes/marcriera/static/css/theme.css +++ b/themes/marcriera/static/css/theme.css @@ -107,6 +107,46 @@ hr { +/* Main menu */ + +nav { + clear: both; + text-align: right; +} + +nav ul { + list-style-type: none; + padding: 0; +} + +nav ul.first > li { + display: block; + text-align: center; +} + +nav ul li a { + display: block; + font-size: 90%; +} + + + +/* Language selector */ + +.language-selector { + list-style-type: none; + font-size: 90%; + text-align: center; +} + +.language-selector li { + display: inline; + margin: .5em; + text-align: center; +} + + + /* Main container */ #container { @@ -118,35 +158,28 @@ hr { } + /* Header */ -#header { +#header-left, +#header-right { padding-top: 15px; - display: block; - float: none; - width: 100%; - text-align: center; } #site-logo { - max-width:100%; - max-height:100%; - display: block; - margin-left: 20px; - margin-right: 20px; + height: 100px; + width: 100px; + padding: 0 20px 15px 20px; } #site-title { padding: 10px 20px 0 20px; font-weight: 600; font-size: 220%; - display: block; - float: none; - margin: auto; } #site-slogan { - padding: 0px 5px; + padding: 0 20px 10px 20px; } @@ -165,9 +198,7 @@ hr { #page-title { padding: 10px 20px 10px 20px; - background: #3E3E3E; - border-top: 1px solid #444444; - border-bottom: 1px solid #444444; + background: #9E4B5A; } #page-title h1 { @@ -205,3 +236,186 @@ hr { color: #CCCCCC; } + + +@media (min-width: 780px) { + +/* Main menu */ + +.burger-button { + display: none; +} + +nav { + padding-right: 1.25em; +} + +nav ul.first > li { + display: inline-block; + position: relative; + background: #9E4B5A; + padding: 10px 10px 10px 10px; +} + +nav ul.second, +nav ul.third { + display: none; + position: absolute; + background: #000000; + width: 160px; + box-shadow: 1px 1px 1px 0px rgba(0,0,0,0.25); +} + +nav ul.first li:hover ul.second, +nav ul.second li:hover ul.third { + display: block; +} + +nav ul.second li a, +nav ul.third li a { + padding: 0.75em 1em; +} + +nav ul.second { + z-index: 2; +} + +nav ul.third { + z-index: 3; +} + +nav ul.second li { + position: relative; +} + +nav ul.third { + left: 212px; + top: -1px; +} + + +/* Language selector */ + +.language-selector { + float: right; + margin-right: 30px; +} + + +/* Main container */ + +#container { + max-width: 1200px; +} + + +/* Header */ + +#header-left { + float: left; + width: 65%; +} + +#header-right { + float: right; + width: 35%; +} + +#site-logo { + float: left; +} + +} + + + +@media screen and (max-width: 779px) { + +/* Main menu */ + +.burger-button { + display: block; + background: #3E3E3E; + font-size: 100%; + padding: 5px 20px 5px 20px; + margin-top: 20px; + cursor: pointer; +} + +.burger-button:hover { + color: #DDDDDD; + background: #208DCC; +} + +#menu-entries { + display: none; +} + +.burger-toggle:checked ~ #menu-entries { + display: block; +} + +.burger-toggle:checked ~ .burger-button { + color: #DDDDDD; + background: #208DCC; +} + +nav { + text-align: center; + margin-bottom: 20px; +} + +nav ul.first > li a, +nav ul.second > li a { + display: block; + padding: 5px 20px 5px 20px; + background: #3E3E3E; +} + +nav ul.first > li a:hover, +nav ul.second > li a:hover { + color: #DDDDDD; + background: #208DCC; +} + +nav ul.first { + margin-top: 0px; +} + +nav ul.second > li a { + padding-left: 40px; +} + + +/* Language selector */ + +.language-selector { + float: none; + margin: auto; + padding: 0; +} + + +/* Header */ + +#header-left, +#header-right { + display: block; + float: none; + width: 100%; + text-align: center; +} + +#site-logo, +#site-title { + display: block; + float: none; + margin: auto; +} + +#site-title, +#site-slogan { + padding: 0px 5px; +} + +} diff --git a/themes/marcriera/theme.toml b/themes/marcriera/theme.toml index 06a048f..cfa2156 100644 --- a/themes/marcriera/theme.toml +++ b/themes/marcriera/theme.toml @@ -1,3 +1,3 @@ name = "Marc Riera" -license = "GPL" -min_version = 0.18 +license = "GPLv3" +min_version = 0.50