aboutsummaryrefslogtreecommitdiff
path: root/themes/terrassa/layouts
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2019-03-16 17:43:05 +0100
committerDimitri Staessens <dimitri@ouroboros.rocks>2019-03-16 17:43:05 +0100
commit79acfcf1599496e67b20c39c00a100b07c383ab1 (patch)
tree0651646a631545b2ff56074f4c8f492d69dbb170 /themes/terrassa/layouts
parent4b98568dbdc0dddf8255abbbb08565821b79f839 (diff)
downloadwebsite-79acfcf1599496e67b20c39c00a100b07c383ab1.tar.gz
website-79acfcf1599496e67b20c39c00a100b07c383ab1.zip
theme: Add terrassa theme
Diffstat (limited to 'themes/terrassa/layouts')
-rw-r--r--themes/terrassa/layouts/404.html5
-rw-r--r--themes/terrassa/layouts/_default/baseof.html11
-rw-r--r--themes/terrassa/layouts/_default/card.html28
-rw-r--r--themes/terrassa/layouts/_default/list.html11
-rw-r--r--themes/terrassa/layouts/_default/single.html31
-rw-r--r--themes/terrassa/layouts/_default/tags.html12
-rw-r--r--themes/terrassa/layouts/contact/list.html46
-rw-r--r--themes/terrassa/layouts/index.html4
-rw-r--r--themes/terrassa/layouts/partials/cta-btn.html4
-rw-r--r--themes/terrassa/layouts/partials/footer.html66
-rw-r--r--themes/terrassa/layouts/partials/hamburger-menu.html18
-rw-r--r--themes/terrassa/layouts/partials/head.html21
-rw-r--r--themes/terrassa/layouts/partials/header.html14
-rw-r--r--themes/terrassa/layouts/partials/hero.html10
-rw-r--r--themes/terrassa/layouts/partials/menu.html13
-rw-r--r--themes/terrassa/layouts/partials/scripts.html8
-rw-r--r--themes/terrassa/layouts/partials/section.html6
-rw-r--r--themes/terrassa/layouts/partials/sections.html10
-rw-r--r--themes/terrassa/layouts/partials/separator.html3
-rw-r--r--themes/terrassa/layouts/partials/styles.html9
20 files changed, 330 insertions, 0 deletions
diff --git a/themes/terrassa/layouts/404.html b/themes/terrassa/layouts/404.html
new file mode 100644
index 0000000..2384d5a
--- /dev/null
+++ b/themes/terrassa/layouts/404.html
@@ -0,0 +1,5 @@
+{{ define "main" }}
+<main class="notfound">
+ <h1 class="notfound__title">404</h1>
+</main>
+{{ end }} \ No newline at end of file
diff --git a/themes/terrassa/layouts/_default/baseof.html b/themes/terrassa/layouts/_default/baseof.html
new file mode 100644
index 0000000..6e1a936
--- /dev/null
+++ b/themes/terrassa/layouts/_default/baseof.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html lang="en">
+{{- partial "head.html" . -}}
+
+<body>
+ {{- partial "header.html" . -}}
+ {{- block "main" . }}{{- end }}
+ {{- partial "footer.html" . -}}
+</body>
+
+</html> \ No newline at end of file
diff --git a/themes/terrassa/layouts/_default/card.html b/themes/terrassa/layouts/_default/card.html
new file mode 100644
index 0000000..6a184f1
--- /dev/null
+++ b/themes/terrassa/layouts/_default/card.html
@@ -0,0 +1,28 @@
+<article class="card">
+ <header class="card__header">
+ <h1 class="card__header__title">
+ <a href="{{ .Permalink }}" class="card__header__link" alt="{{ .Title }}.">
+ {{ .Title }}
+ </a>
+ </h1>
+ {{ if ne .Type "page" }}
+ {{ if and $.Site.Params.posts.showDate $.Site.Params.posts.showAuthor }}
+ <p class="card__header__date date">
+ {{ dateFormat $.Site.Params.posts.dateFormat .Date }} By {{ $.Params.author }}.
+ </p>
+ {{ else if $.Site.Params.posts.showDate }}
+ <p class="card__header__date date">{{ dateFormat $.Site.Params.posts.dateFormat .Date }}</p>
+ {{ else if $.Site.Params.posts.showAuthor }}
+ <p class="card__header__author author">By {{ $.Params.author }}.</p>
+ {{ end }}
+ {{ end }}
+ </header>
+
+ <main class="card__body">
+ {{ .Content | truncate 480 }}
+ </main>
+
+ <footer class="card__footer">
+ {{ .Render "tags" }}
+ </footer>
+</article> \ No newline at end of file
diff --git a/themes/terrassa/layouts/_default/list.html b/themes/terrassa/layouts/_default/list.html
new file mode 100644
index 0000000..c01a3b6
--- /dev/null
+++ b/themes/terrassa/layouts/_default/list.html
@@ -0,0 +1,11 @@
+{{ define "main" }}
+<main class="content">
+ {{ $paginator := .Paginate (where .Data.Pages.ByDate.Reverse "Type" "posts") }}
+
+ {{ range $paginator.Pages }}
+ {{ .Render "card" }}
+ {{ end }}
+
+ {{ template "_internal/pagination.html" . }}
+</main>
+{{ end }} \ No newline at end of file
diff --git a/themes/terrassa/layouts/_default/single.html b/themes/terrassa/layouts/_default/single.html
new file mode 100644
index 0000000..f6b15ae
--- /dev/null
+++ b/themes/terrassa/layouts/_default/single.html
@@ -0,0 +1,31 @@
+{{ define "main" }}
+<article class="post">
+ <header class="post__header">
+ <h1 class="post__title">{{ .Title }}</h1>
+ {{ if .Description }}
+ <p class="post__subtitle">{{ .Description }}</p>
+ {{ end }}
+ {{ if ne .Type "page" }}
+ {{ if and $.Site.Params.posts.showDate $.Site.Params.posts.showAuthor }}
+ <p class="post__date date">
+ {{ dateFormat $.Site.Params.posts.dateFormat .Date }} By {{ $.Params.author }}.
+ </p>
+ {{ else if $.Site.Params.posts.showDate }}
+ <p class="post__date date">{{ dateFormat $.Site.Params.posts.dateFormat .Date }}</p>
+ {{ else if $.Site.Params.posts.showAuthor }}
+ <p class="post__author author">By {{ $.Params.author }}.</p>
+ {{ end }}
+ {{ end }}
+ </header>
+
+ <main class="post__body">
+ {{ .Content }}
+ </main>
+
+ {{ if ne .Type "page" }}
+ <footer class="post__footer">
+ {{ .Render "tags" }}
+ </footer>
+ {{ end }}
+</article>
+{{ end }} \ No newline at end of file
diff --git a/themes/terrassa/layouts/_default/tags.html b/themes/terrassa/layouts/_default/tags.html
new file mode 100644
index 0000000..4618ae3
--- /dev/null
+++ b/themes/terrassa/layouts/_default/tags.html
@@ -0,0 +1,12 @@
+{{ if and $.Site.Params.posts.showTags .Params.Tags }}
+<ul class="tags">
+ {{ range .Params.Tags }}
+ {{ $url := printf "%stags/%s/" $.Site.BaseURL . }}
+ <li class="tags__tag">
+ <a href="{{ $url }}" class="tag__link" alt="{{ . }}.">
+ #{{ . }}
+ </a>
+ </li>
+ {{ end }}
+</ul>
+{{ end }}
diff --git a/themes/terrassa/layouts/contact/list.html b/themes/terrassa/layouts/contact/list.html
new file mode 100644
index 0000000..83b7402
--- /dev/null
+++ b/themes/terrassa/layouts/contact/list.html
@@ -0,0 +1,46 @@
+{{ define "main" }}
+<main class="contact">
+ <h1 class="contact__title">{{ .Title }}</h1>
+ <p class="contact__content">{{ .Description }}</p>
+
+ {{ if $.Site.Params.form.netlify }}
+ <form name="contact" method="POST" data-netlify="true" class="contact__form" id="contactForm">
+ {{ else }}
+ <form action="{{ $.Site.Params.form.action }}" method="{{ lower $.Site.Params.form.method }}" class="contact__form"
+ id="contactForm">
+ {{ end }}
+
+ <!-- Name -->
+ <div class="contact__field contact__field--name">
+ <label for="{{ $.Site.Params.form.inputNameName }}">{{ $.Site.Params.form.inputNameLabel }}</label>
+ <input type="text" name="{{ $.Site.Params.form.inputNameName }}" placeholder="{{ $.Site.Params.form.inputNamePlaceholder }}"
+ class="contact__form__input contact__form__name" id="{{ $.Site.Params.form.inputNameName }}"
+ aria-labelledby="{{ $.Site.Params.form.inputNameName }}" required>
+ </div>
+
+ <!-- Email -->
+ <div class="contact__field contact__field--email">
+ <label for="{{ $.Site.Params.form.inputEmailName }}">{{ $.Site.Params.form.inputEmailLabel }}</label>
+ <input type="email" name="{{ $.Site.Params.form.inputEmailName }}" placeholder="{{ $.Site.Params.form.inputEmailPlaceholder }}"
+ class="contact__form__input contact__form__email" id="{{ $.Site.Params.form.inputEmailName }}"
+ aria-labelledby="{{ $.Site.Params.form.InputEmailName }}" required>
+ </div>
+
+ <!-- Message -->
+ <div class="contact__field contact__field--msg">
+ <label for="{{ $.Site.Params.form.inputMsgName }}">{{ $.Site.Params.form.inputMsgLabel }}</label>
+ <textarea name="{{ $.Site.Params.form.inputMsgName }}" id="{{ $.Site.Params.form.inputMsgName }}" form="contactForm"
+ maxlength="{{ $.Site.Params.form.inputMsgLength }}" id="{{ $.Site.Params.form.inputMsgName }}"
+ arial-labelledby="{{ $.Site.Params.form.InputMsgName }}" required></textarea>
+ </div>
+
+ <!-- Submit -->
+ <div class="contact__field contact__field--submit">
+ <button type="submit" class="ripple-btn submit" onclick="cleanForm" aria-label="{{ $.Site.Params.form.inputSubmitValue }}">
+ {{ $.Site.Params.form.inputSubmitValue }}
+ </button>
+ </div>
+
+ </form>
+</main>
+{{ end }} \ No newline at end of file
diff --git a/themes/terrassa/layouts/index.html b/themes/terrassa/layouts/index.html
new file mode 100644
index 0000000..8575e89
--- /dev/null
+++ b/themes/terrassa/layouts/index.html
@@ -0,0 +1,4 @@
+{{ define "main" }}
+{{ partial "hero.html" . }}
+{{ partial "sections.html" . }}
+{{ end }} \ No newline at end of file
diff --git a/themes/terrassa/layouts/partials/cta-btn.html b/themes/terrassa/layouts/partials/cta-btn.html
new file mode 100644
index 0000000..1d7b73f
--- /dev/null
+++ b/themes/terrassa/layouts/partials/cta-btn.html
@@ -0,0 +1,4 @@
+<a href="{{ $.Site.BaseURL }}{{ $.Site.Params.cta.link }}" class="ripple-btn cta__btn" alt="{{ $.Site.Params.cta.cta }}"
+ aria-label="{{ $.Site.Params.cta.cta }}}">
+ {{ .Site.Params.cta.cta }}
+</a> \ No newline at end of file
diff --git a/themes/terrassa/layouts/partials/footer.html b/themes/terrassa/layouts/partials/footer.html
new file mode 100644
index 0000000..b2b27bc
--- /dev/null
+++ b/themes/terrassa/layouts/partials/footer.html
@@ -0,0 +1,66 @@
+<footer class="footer">
+ {{ if $.Site.Params.social }}
+ {{ $items := $.Site.Params.social }}
+ {{ $len := (len $items) }}
+
+ {{ if gt $len 0 }}
+ <div class="footer__social">
+ {{ range $k, $v := $items }}
+ {{ if $v}}
+ <a href="{{ $v }}" class="footer__social__link" alt="{{ $k }}" target="_blank" aria-label="{{ $v }}" rel="noopener">
+ <span>
+ <i class="fab fa-{{ $k }}"></i>
+ </span>
+ </a>
+ {{ end }}
+ {{ end }}
+ </div>
+ {{ end }}
+ {{ end }}
+
+ <address class="footer__contact">
+ {{ if $.Site.Params.contact.email }}
+ <p class="footer__contact__item">
+ <span><i class="far fa-envelope"></i></span>
+ <a href="mailto:{{ $.Site.Params.contact.email}}" class="footer__contact__link" alt="Email">
+ {{ $.Site.Params.contact.email }}
+ </a>
+ </p>
+ {{ end }}
+
+ {{ if $.Site.Params.contact.phone }}
+ <p class="footer__contact__item">
+ <span><i class="fas fa-phone"></i></span>
+ <a href="tel:{{ $.Site.Params.contact.phone }}" class="footer__contact__link" alt="Phone">
+ {{ $.Site.Params.contact.phone }}
+ </a>
+ </p>
+ {{ end }}
+
+ {{ if $.Site.Params.contact.skype }}
+ <p class="footer__contact__item">
+ <span><i class="fab fa-skype"></i></span>
+ <a href="skype:{{ $.Site.Params.contact.skype }}" class="footer__contact__link" alt="Skype">
+ {{ $.Site.Params.contact.skype }}
+ </a>
+ </p>
+ {{ end }}
+
+ {{ if $.Site.Params.contact.address }}
+ <p class="footer__contact__item">
+ <span><i class="fas fa-map-marker-alt"></i></span>
+ {{ $.Site.Params.contact.address }}
+ </p>
+ {{ end }}
+ </address>
+
+ <div class="copy">
+ {{ if $.Site.Params.copy.copy }}
+ <p>{{ $.Site.Params.copy.copy }}</p>
+ {{ else }}
+ <p>© {{ now.Format "2006" }} - {{ $.Site.Title }}</p>
+ {{ end }}
+ </div>
+
+ {{ partial "scripts.html" . }}
+</footer> \ No newline at end of file
diff --git a/themes/terrassa/layouts/partials/hamburger-menu.html b/themes/terrassa/layouts/partials/hamburger-menu.html
new file mode 100644
index 0000000..40a9ad8
--- /dev/null
+++ b/themes/terrassa/layouts/partials/hamburger-menu.html
@@ -0,0 +1,18 @@
+<nav class="hamburger-menu" aria-label="mobile-menu">
+ <div class="toggle">
+ <input type="checkbox" class="hamburger__toggle" id="hamburgerToggle" name="hamburger toggle" aria-label="Hamburguer menu">
+ <label class="hamburger__toggle__icon" for="hamburgerToggle">
+ <i class="fas fa-bars"></i>
+ </label>
+
+ <ul class="hamburger__items" aria-label="mobile-menu">
+ {{ range .Site.Menus.main }}
+ <li class="hamburger__items__item" aria-label="{{ .Name }}">
+ <a href="{{ .URL }}" class="hamburger__items__item__link" alt="{{ .Name }}" role="menuitem">
+ {{ .Name }}
+ </a>
+ </li>
+ {{ end }}
+ </ul>
+ </div>
+</nav> \ No newline at end of file
diff --git a/themes/terrassa/layouts/partials/head.html b/themes/terrassa/layouts/partials/head.html
new file mode 100644
index 0000000..a2885d2
--- /dev/null
+++ b/themes/terrassa/layouts/partials/head.html
@@ -0,0 +1,21 @@
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="robots" content="index, follow">
+ <meta name="googlebot" content="index, follow, noarchive">
+ <title>{{ .Site.Title }} - {{ .Title }}</title>
+ <link rel="icon" href="{{ $.Site.BaseURL }}{{ $.Site.Params.favicon }}">
+ <meta name="description" content="{{ $.Site.Params.description }}">
+
+ {{ .Hugo.Generator }}
+
+ {{ if .Site.GoogleAnalytics }}
+ {{ template "_internal/google_analytics.html" . }}
+ {{ end }}
+
+ {{ template "_internal/twitter_cards.html" . }}
+ {{ template "_internal/opengraph.html" . }}
+
+ <!-- CSS -->
+ {{ partial "styles.html" . }}
+</head> \ No newline at end of file
diff --git a/themes/terrassa/layouts/partials/header.html b/themes/terrassa/layouts/partials/header.html
new file mode 100644
index 0000000..73142ae
--- /dev/null
+++ b/themes/terrassa/layouts/partials/header.html
@@ -0,0 +1,14 @@
+<header class="header">
+ <div class="header__title">
+ <a href="{{ $.Site.BaseURL }}" class="header__title__link" alt="Home">
+ {{ if $.Site.Params.logo }}
+ <img src="{{ $.Site.BaseURL }}{{ $.Site.Params.logo }}" class="header__title__logo" alt="{{ $.Site.Title }}">
+ {{ else }}
+ {{ $.Site.Title }}
+ {{ end }}
+ </a>
+ </div>
+
+ {{ partial "menu.html" . }}
+ {{ partial "hamburger-menu.html" . }}
+</header>
diff --git a/themes/terrassa/layouts/partials/hero.html b/themes/terrassa/layouts/partials/hero.html
new file mode 100644
index 0000000..138d674
--- /dev/null
+++ b/themes/terrassa/layouts/partials/hero.html
@@ -0,0 +1,10 @@
+<main class="hero" {{ if $.Params.images }} style="background-image: url('{{ $.Site.BaseURL }}images/{{ print (index $.Params.images 0) }}');"
+ {{ end }}>
+ <div class="hero__caption" {{ if $.Site.Params.hero.textColor }} style="color: {{ $.Site.Params.hero.textColor }};"
+ {{ end }}>
+ {{ .Content }}
+ {{ if .Site.Params.cta.show }}
+ {{ partial "cta-btn.html" . }}
+ {{ end }}
+ </div>
+</main> \ No newline at end of file
diff --git a/themes/terrassa/layouts/partials/menu.html b/themes/terrassa/layouts/partials/menu.html
new file mode 100644
index 0000000..abfb92b
--- /dev/null
+++ b/themes/terrassa/layouts/partials/menu.html
@@ -0,0 +1,13 @@
+<nav class="menu" aria-label="menu">
+ <ul class="menu__items" aria-label="menu">
+ {{ $current := . }}
+ {{ range .Site.Menus.main }}
+ <li class="menu__items__item" aria-label="{{ .Name }}">
+ <a href="{{ .URL }}" class="menu__items__item__link {{ if $current.IsMenuCurrent "main" . }}active{{ end }}"
+ alt="{{ .Name }}" role="menuitem">
+ {{ .Name }}
+ </a>
+ </li>
+ {{ end }}
+ </ul>
+</nav> \ No newline at end of file
diff --git a/themes/terrassa/layouts/partials/scripts.html b/themes/terrassa/layouts/partials/scripts.html
new file mode 100644
index 0000000..46beb79
--- /dev/null
+++ b/themes/terrassa/layouts/partials/scripts.html
@@ -0,0 +1,8 @@
+{{ $header := resources.Get "js/header.js" }}
+{{ $form := resources.Get "js/form.js" }}
+{{ $bundle := slice $header $form | resources.Concat "js/bundle.js" }}
+{{ $js := $bundle | resources.Minify | resources.Fingerprint "sha512" }}
+
+<script src="{{ $js.Permalink }}"></script>
+<script defer src="https://use.fontawesome.com/releases/v5.6.1/js/all.js" integrity="sha384-R5JkiUweZpJjELPWqttAYmYM1P3SNEJRM6ecTQF05pFFtxmCO+Y1CiUhvuDzgSVZ"
+ crossorigin="anonymous"></script> \ No newline at end of file
diff --git a/themes/terrassa/layouts/partials/section.html b/themes/terrassa/layouts/partials/section.html
new file mode 100644
index 0000000..ef05877
--- /dev/null
+++ b/themes/terrassa/layouts/partials/section.html
@@ -0,0 +1,6 @@
+<section class="section">
+ <h1 class="section__title">{{ .Title }}</h1>
+ <div class="section__content">
+ {{ .Content }}
+ </div>
+</section> \ No newline at end of file
diff --git a/themes/terrassa/layouts/partials/sections.html b/themes/terrassa/layouts/partials/sections.html
new file mode 100644
index 0000000..6d4cfc3
--- /dev/null
+++ b/themes/terrassa/layouts/partials/sections.html
@@ -0,0 +1,10 @@
+{{ $items := (where $.Site.RegularPages "Type" "sections") }}
+{{ $len := (len $items) }}
+
+{{ range $i, $e := $items }}
+{{ partial "section.html" .}}
+
+{{ if ne (add $i 1) $len }}
+{{ partial "separator.html" . }}
+{{ end }}
+{{ end}} \ No newline at end of file
diff --git a/themes/terrassa/layouts/partials/separator.html b/themes/terrassa/layouts/partials/separator.html
new file mode 100644
index 0000000..e890b22
--- /dev/null
+++ b/themes/terrassa/layouts/partials/separator.html
@@ -0,0 +1,3 @@
+<div class="separator">
+ <i class="fas fa-circle"></i>
+</div> \ No newline at end of file
diff --git a/themes/terrassa/layouts/partials/styles.html b/themes/terrassa/layouts/partials/styles.html
new file mode 100644
index 0000000..4dd5827
--- /dev/null
+++ b/themes/terrassa/layouts/partials/styles.html
@@ -0,0 +1,9 @@
+{{ $reset := resources.Get "css/reset.css" }}
+{{ $base := resources.Get "css/base.css" }}
+{{ $style := resources.Get "css/style.css" }}
+{{ $media := resources.Get "css/media-queries.css" }}
+{{ $animations := resources.Get "css/animations.css" }}
+{{ $bundle := slice $reset $base $style $media $animations | resources.Concat "css/bundle.css" }}
+{{ $css := $bundle | resources.Minify | resources.Fingerprint "sha512" }}
+
+<link rel="stylesheet" href="{{ $css.Permalink }}"> \ No newline at end of file