aboutsummaryrefslogtreecommitdiff
path: root/themes/flamingo/layouts
diff options
context:
space:
mode:
authorgabrielgio <gabriel.giovanini@pm.me>2020-07-11 22:35:14 +0200
committergabrielgio <gabriel.giovanini@pm.me>2020-07-11 22:35:14 +0200
commit60fe49ea3af38d4a7d5e8de1cdb72887b167b22d (patch)
treebb05011c311b74c7c7676b7b689bbbc2c8546c9a /themes/flamingo/layouts
parent60b4299cb90a5b3f6e74ffd0ee0f51a0008fb3cf (diff)
downloadgabrielgio.me-60fe49ea3af38d4a7d5e8de1cdb72887b167b22d.tar.gz
gabrielgio.me-60fe49ea3af38d4a7d5e8de1cdb72887b167b22d.tar.bz2
gabrielgio.me-60fe49ea3af38d4a7d5e8de1cdb72887b167b22d.zip
Moving from jekyll to hugo
Diffstat (limited to 'themes/flamingo/layouts')
-rw-r--r--themes/flamingo/layouts/_default/baseof.html70
-rw-r--r--themes/flamingo/layouts/_default/list.html17
-rw-r--r--themes/flamingo/layouts/_default/projects.html22
-rw-r--r--themes/flamingo/layouts/_default/single.html32
-rw-r--r--themes/flamingo/layouts/_default/summary.html23
-rw-r--r--themes/flamingo/layouts/index.html14
-rw-r--r--themes/flamingo/layouts/partials/blog-list.html8
-rw-r--r--themes/flamingo/layouts/partials/comments.html2
-rw-r--r--themes/flamingo/layouts/partials/footer.html18
-rw-r--r--themes/flamingo/layouts/partials/header.html27
-rw-r--r--themes/flamingo/layouts/partials/log-description.html3
-rw-r--r--themes/flamingo/layouts/partials/meta.html148
-rw-r--r--themes/flamingo/layouts/partials/pagination.html9
-rw-r--r--themes/flamingo/layouts/partials/post-description.html29
-rw-r--r--themes/flamingo/layouts/partials/sidebar.html14
-rw-r--r--themes/flamingo/layouts/partials/tagbar.html10
16 files changed, 446 insertions, 0 deletions
diff --git a/themes/flamingo/layouts/_default/baseof.html b/themes/flamingo/layouts/_default/baseof.html
new file mode 100644
index 0000000..86a82c1
--- /dev/null
+++ b/themes/flamingo/layouts/_default/baseof.html
@@ -0,0 +1,70 @@
+<!DOCTYPE html>
+<html lang="{{ .Site.LanguageCode | default "en-us" }}">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+
+ <!-- Favicon -->
+ {{ with .Site.Params.favicon }}<link rel="icon" type="image/png" href="{{ . }}" />{{ end }}
+
+ <title itemprop="name">{{ .Title }} | {{ .Site.Params.description }}</title>
+ {{ with .Site.Params.description }}<meta name="description" content="{{ . }}">{{ end }}
+ {{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }}
+
+ {{ $styles := resources.Get "scss/main.scss" | resources.ToCSS | minify | fingerprint}}
+ <link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
+ <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
+
+ {{ with .OutputFormats.Get "RSS" -}}
+ {{ printf `<link rel="%s" type="%s" href="%s" title="%s">` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }}
+ {{- end }}
+
+ <!-- Meta tags -->
+ {{ partial "meta" . }}
+
+ </head>
+ <body>
+ <div class="layout">
+ {{ partial "header" . }}
+ {{ block "main" . }}{{ end }}
+ {{ partial "footer" . }}
+ </div>
+ </body>
+
+ <script>
+ // TODO
+ // Use Hugo templating to achieve this
+ // Script to check active nav menu
+ (function() {
+ const links = document.querySelectorAll("nav a")
+ const currentUrl = location.href
+
+ for (const link of links) {
+ if (location.href.split("/").length === 4 && link.href.endsWith("/posts/")) {
+ link.classList.add("active-link")
+ break;
+ }
+
+ if (link.href === currentUrl) {
+ link.classList.add("active-link")
+ }
+ }
+ }())
+ </script>
+
+ <!-- Posthog -->
+ <script>
+ !function(t,e){var o,n,p,r;e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){function g(t,e){var o=e.split(".");2==o.length&&(t=t[o[0]],e=o[1]),t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}}(p=t.createElement("script")).type="text/javascript",p.async=!0,p.src=s.api_host+"/static/array.js",(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,r);var u=e;for(void 0!==a?u=e[a]=[]:a="posthog",u.people=u.people||[],u.toString=function(t){var e="posthog";return"posthog"!==a&&(e+="."+a),t||(e+=" (stub)"),e},u.people.toString=function(){return u.toString(1)+".people (stub)"},o="capture identify alias people.set people.set_once set_config register register_once unregister opt_out_capturing has_opted_out_capturing opt_in_capturing reset".split(" "),n=0;n<o.length;n++)g(u,o[n]);e._i.push([i,s,a])},e.__SV=1)}(document,window.posthog||[]);
+ posthog.init('uZJ_bhngsKFhhPaqWyp_2lc-HyE8vY5XKneeAMWS9cE', {api_host: 'https://profhog.herokuapp.com'})
+ </script>
+
+ <!-- Ackee -->
+ <script async
+ src="https://prof-ackee.herokuapp.com/tracker.js"
+ data-ackee-server="https://prof-ackee.herokuapp.com"
+ data-ackee-domain-id="45af9210-721f-4c09-a69d-77e66fe7bc5d"
+ >
+ </script>
+
+</html>
diff --git a/themes/flamingo/layouts/_default/list.html b/themes/flamingo/layouts/_default/list.html
new file mode 100644
index 0000000..bdb11bb
--- /dev/null
+++ b/themes/flamingo/layouts/_default/list.html
@@ -0,0 +1,17 @@
+{{ define "main" }}
+ <main>
+ {{ if (or (eq .Page.Name "Posts") (.Page.IsHome)) }}
+ {{ partial "post-description.html" }}
+ {{ else if (eq .Page.Name "Logs") }}
+ {{ partial "log-description.html" }}
+ {{ end }}
+
+ <div class="blog-list">
+ {{ range .Paginator.Pages }}
+ {{ .Render "summary" }}
+ {{ end }}
+ </div>
+ <!-- {{ partial "pagination.html" . }} -->
+ </main>
+ <!-- {{ partial "sidebar.html" . }} -->
+{{ end }}
diff --git a/themes/flamingo/layouts/_default/projects.html b/themes/flamingo/layouts/_default/projects.html
new file mode 100644
index 0000000..5d97981
--- /dev/null
+++ b/themes/flamingo/layouts/_default/projects.html
@@ -0,0 +1,22 @@
+{{ define "main" }}
+<main>
+ <div class="project-board">
+ {{- range .Site.Params.projects -}}
+ <div class="card">
+ <article>
+ <h4>{{ .name }}</h4>
+ <div>
+ <span>
+ <p>{{ .description }}</p>
+ </span>
+ </div>
+ <div class="custom-card-footer" />
+ <a href={{ .sourceLink }} target="_blank" class="custom-button">source</a>
+ <a href={{ .demoLink }} target="_blank" class="custom-button">demo</a>
+ </div>
+ </article>
+ </div>
+ {{- end -}}
+ </div>
+</main>
+{{ end }}
diff --git a/themes/flamingo/layouts/_default/single.html b/themes/flamingo/layouts/_default/single.html
new file mode 100644
index 0000000..99ec989
--- /dev/null
+++ b/themes/flamingo/layouts/_default/single.html
@@ -0,0 +1,32 @@
+{{ define "main" }}
+ <main>
+ <article>
+ <h1>{{ .Title }}</h1>
+
+ {{ if .Date }}
+ <time>{{ .Date.Format "Jan 02, 2006" }}</time>
+ {{ end }}
+
+ {{ partial "tagbar.html" }}
+ {{ with .Params.tags }}
+ <div class="tags">
+ <ul>
+ {{ range . }}
+ <li><a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a></li>
+ {{ end }}
+ </ul>
+ </div>
+ {{ end }}
+
+ <div class="blog-post-content">
+ {{ .Content }}
+ </div>
+ <!-- {{ with .Site.DisqusShortname }}
+ <div>
+ {{ template "_internal/disqus.html" . }}
+ </div>
+ {{ end }}
+ </article> -->
+ </main>
+ <!-- {{ partial "sidebar.html" . }} -->
+{{ end }}
diff --git a/themes/flamingo/layouts/_default/summary.html b/themes/flamingo/layouts/_default/summary.html
new file mode 100644
index 0000000..e010313
--- /dev/null
+++ b/themes/flamingo/layouts/_default/summary.html
@@ -0,0 +1,23 @@
+<article class="list-item">
+ <div class="post-title">
+ <a href="{{ .Permalink }}">{{ .Title }}</a>
+ </div>
+
+ <!-- Add tags -->
+ <!-- {{ range .Params.tags }}
+ <a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
+ {{ end }}
+ -->
+
+ <span className="date-label">
+ {{ .Date.Format "2" }}{{ if in (slice 1 21 31) .Date.Day}}st{{ else if in (slice 2 22) .Date.Day}}nd{{ else if in (slice 3 23) .Date.Day}}rd{{ else }}th{{ end }} {{ .Date.Format "Jan, 2006" }}
+ </span>
+
+ <!-- <div>
+ {{ .Summary }}
+ {{ if .Truncated }}
+ <a href="{{ .Permalink }}">Read more...</a>
+ {{ end }}
+ </div>
+ -->
+</article>
diff --git a/themes/flamingo/layouts/index.html b/themes/flamingo/layouts/index.html
new file mode 100644
index 0000000..523eb38
--- /dev/null
+++ b/themes/flamingo/layouts/index.html
@@ -0,0 +1,14 @@
+{{ define "main" }}
+<!-- Copy of list.html -->
+<main>
+ {{ partial "post-description.html" }}
+ <div class="blog-list">
+ {{ $paginator := .Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) }}
+ {{ range .Paginator.Pages }}
+ {{ .Render "summary" }}
+ {{ end }}
+ </div>
+ <!-- {{ partial "pagination.html" . }} -->
+</main>
+<!-- {{ partial "sidebar.html" . }} -->
+{{ end }}
diff --git a/themes/flamingo/layouts/partials/blog-list.html b/themes/flamingo/layouts/partials/blog-list.html
new file mode 100644
index 0000000..59bad6e
--- /dev/null
+++ b/themes/flamingo/layouts/partials/blog-list.html
@@ -0,0 +1,8 @@
+<div>
+ <div class="blog-list">
+ {{ range .Paginator.Pages }}
+ {{ .Render "summary" }}
+ {{ end }}
+ </div>
+ <!-- {{ partial "pagination.html" . }} -->
+</div>
diff --git a/themes/flamingo/layouts/partials/comments.html b/themes/flamingo/layouts/partials/comments.html
new file mode 100644
index 0000000..d58db9e
--- /dev/null
+++ b/themes/flamingo/layouts/partials/comments.html
@@ -0,0 +1,2 @@
+<div>
+</div>
diff --git a/themes/flamingo/layouts/partials/footer.html b/themes/flamingo/layouts/partials/footer.html
new file mode 100644
index 0000000..4476494
--- /dev/null
+++ b/themes/flamingo/layouts/partials/footer.html
@@ -0,0 +1,18 @@
+<footer>
+ <div class="bottom-nav">
+ <nav>
+ <ul>
+ <li><a href="/about/">about</a></li>
+ <li><a href="/logs/">logs</a></li>
+ <li><a href="/privacy/">privacy</a></li>
+ </ul>
+ </nav>
+ </div>
+
+ {{ if eq .IsPage true }}
+ {{ if (or (eq .Section "posts") (eq .Section "logs")) }}
+ {{ partial "comments.html" }}
+ {{ end }}
+ {{ end }}
+ <!-- <p>&copy; {{ now.Year }} <a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a></p> -->
+</footer>
diff --git a/themes/flamingo/layouts/partials/header.html b/themes/flamingo/layouts/partials/header.html
new file mode 100644
index 0000000..8f26fb4
--- /dev/null
+++ b/themes/flamingo/layouts/partials/header.html
@@ -0,0 +1,27 @@
+<header>
+ <!-- title wrapper -->
+ <div class="title-wrapper">
+ <a href="/">
+ <h2 class="title">{{ .Site.Title }}</h2>
+ </a>
+ <nav>
+ <ul>
+ <li><a href="/posts/">posts</a></li>
+ <li><a href="/projects/">projects</a></li>
+ <li><a href={{ .Site.Params.resume }} target="_blank">resume</a></li>
+ <!-- <li><a href="/resume/" target="_blank" >resume</a></li> -->
+ </ul>
+ </nav>
+ </div>
+ <!-- title wrapper end -->
+
+ {{ with .Site.Menus.main }}
+ <nav>
+ <ul>
+ {{ range . }}
+ <li><a href="{{ .URL | relURL }}">{{ .Name }}</a></li>
+ {{ end }}
+ </ul>
+ </nav>
+ {{ end }}
+</header>
diff --git a/themes/flamingo/layouts/partials/log-description.html b/themes/flamingo/layouts/partials/log-description.html
new file mode 100644
index 0000000..1a6e21a
--- /dev/null
+++ b/themes/flamingo/layouts/partials/log-description.html
@@ -0,0 +1,3 @@
+<div class="slim-description">
+ <p>Unimportant, blunt and raw.</p>
+</div>
diff --git a/themes/flamingo/layouts/partials/meta.html b/themes/flamingo/layouts/partials/meta.html
new file mode 100644
index 0000000..3f417af
--- /dev/null
+++ b/themes/flamingo/layouts/partials/meta.html
@@ -0,0 +1,148 @@
+<!-- SEO !-->
+
+<meta property="og:title" content="{{ .Title }} | {{ .Site.Params.description }}" />
+<meta name="twitter:title" content="{{ .Title }} | {{ .Site.Params.description }}" />
+<meta itemprop="name" content="{{ .Title }} | {{ .Site.Params.description }}" />
+<meta name="application-name" content="{{ .Title }} | {{ .Site.Params.description }}" />
+<meta property="og:site_name" content="{{ .Site.Params.sitename }}" />
+
+<meta name="description" content="{{ .Site.Params.description }}" />
+<meta itemprop="description" content="{{ .Site.Params.description }}" />
+<meta property="og:description" content="{{ .Site.Params.description }}" />
+<meta name="twitter:description" content="{{ .Site.Params.description }}" />
+
+<base href="{{ .Permalink }}">
+<link rel="canonical" href="{{ .Permalink }}" itemprop="url" />
+<meta name="url" content="{{ .Permalink }}" />
+<meta name="twitter:url" content="{{ .Permalink }}" />
+<meta property="og:url" content="{{ .Permalink }}" />
+
+<!-- mrprofessor -->
+<meta property="og:article:author" content="mrprofessor" />
+<meta property="article:author" content="mrprofessor" />
+<meta name="author" content="mrprofessor" />
+
+
+<meta property="og:locale" content="{{ .Language.Lang }}">
+<meta name="language" content="{{ .Language.LanguageName }}">
+{{ range .AllTranslations }}
+ <link rel="alternate" hreflang="{{ .Language.Lang }}" href="{{ .Permalink }}" title="{{ .Language.LanguageName }}">
+ {{ end }}
+
+
+<meta property="og:updated_time" content={{ .Lastmod.Format "2006-01-02T15:04:05Z0700" | safeHTML }} />
+
+<!-- Sitemap & RSS Feed Tags -->
+<link rel="sitemap" type="application/xml" title="Sitemap" href="{{ .Site.BaseURL }}sitemap.xml" />
+
+<!-- FIXME -->
+{{ with .OutputFormats.Get "RSS" }}
+ <link href="{{ .Permalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}" />
+ <link href="{{ .Permalink }}" rel="feed" type="application/rss+xml" title="{{ $.Site.Title }}" />
+{{ end }}
+
+
+<!-- Pagination meta tags for list pages only -->
+<!-- To make sure this renders only in the article page, we check the section -->
+{{ if eq .Section "posts" }}
+
+<meta property="og:type" content="article" />
+<meta property="article:publisher" content="{{ .Site.Params.github }}" />
+<meta property="og:article:published_time" content={{ .Date.Format "2006-01-02T15:04:05Z0700" | safeHTML }} />
+<meta property="article:published_time" content={{ .Date.Format "2006-01-02T15:04:05Z0700" | safeHTML }} />
+
+{{ with .Site.Params.author }}
+ <meta property="og:article:author" content="{{humanize . }}" />
+ <meta property="article:author" content="{{humanize . }}" />
+ <meta name="author" content="{{humanize . }}" />
+{{ end }}
+
+<!-- FIXME -->
+{{ with .Site.Params.category }}
+ <meta name="news_keywords" content="{{ index . 0 }}" />
+ <meta property="article:section" content="{{ index . 0 }}" />
+{{ end }}
+
+ <script defer type="application/ld+json">
+ {
+ "@context": "http://schema.org",
+ "@type": "Article",
+ "headline": {{ .Title }},
+ "author": {
+ "@type": "Person",
+ "name": "{{ .Site.Params.github }}"
+ },
+ "datePublished": "{{ .Date.Format "2006-01-02" }}",
+ "description": {{ .Description }},
+ "wordCount": {{ .WordCount }},
+ "mainEntityOfPage": "True",
+ "dateModified": "{{ .Lastmod.Format "2006-01-02" }}",
+ "image": {
+ "@type": "imageObject",
+ "url": "{{ with .Params.image }}{{ .Permalink }}{{ end }}"
+ },
+ "publisher": {
+ "@type": "Organization",
+ "name": "{{ .Site.Title }}",
+ "logo": {
+ "@type": "imageObject",
+ "url": "https://rudra.dev/images/favicon.ico"
+ }
+ }
+ }
+ </script>
+{{ end }}
+
+
+{{ if eq .Section "about" }}
+<!-- Pagination meta tags for list pages only -->
+<meta property="og:type" content="website" />
+<meta name="author" content="{{ .Site.Params.author }}" />
+<script defer type="application/ld+json">
+ {
+ "@context": "http://schema.org",
+ "@type": "WebSite",
+ "url": "{{ .Permalink }}",
+ "sameAs": [
+ "{{ .Site.Params.twitter }}",
+ "{{ .Site.Params.github }}"
+ ],
+ "name": "{{ .Title }}",
+ "logo": "https://rudra.dev/images/favicon.ico"
+ // "fdf": '{{ path.Join .Site.BaseURL .Site.Params.favicon }}'
+ }
+</script>
+{{ end }}
+
+
+<!-- Search Engine Crawler Tags -->
+<meta name="robots" content="index,follow" />
+<meta name="googlebot" content="index,follow" />
+
+<!-- Specific Social Media Tags -->
+<meta name="twitter:site" content="{{ .Site.Params.twitter }}">
+<meta name="twitter:creator" content="{{ .Site.Params.twitter }}" />
+
+
+<!-- -->
+<!-- Other Tags -->
+<!-- -->
+
+<!-- Manifest File -->
+<!-- FIXME -->
+<!--<link rel="manifest" href="{{ .Site.BaseURL }}manifest.json" />-->
+
+<!-- Theme Color -->
+<meta name="theme-color" content="#141414" />
+<meta name="msapplication-TileColor" content="#141414" />
+
+<meta name="keywords" content="" />
+<meta name="imagemode" content="force" />
+<meta name="coverage" content="Worldwide" />
+<meta name="distribution" content="Global" />
+<meta name="HandheldFriendly" content="True" />
+<meta name="msapplication-tap-highlight" content="no" />
+<meta name="apple-mobile-web-app-title" content="{{ .Site.Params.sitename }}" />
+<meta name="apple-mobile-web-app-capable" content="yes" />
+<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
+<meta name="apple-touch-fullscreen" content="yes" />
diff --git a/themes/flamingo/layouts/partials/pagination.html b/themes/flamingo/layouts/partials/pagination.html
new file mode 100644
index 0000000..79f8053
--- /dev/null
+++ b/themes/flamingo/layouts/partials/pagination.html
@@ -0,0 +1,9 @@
+<div>
+{{ if .Paginator.HasPrev }}
+ <a href="{{ .Paginator.Prev.URL }}">Previous Page</a>
+{{ end }}
+{{ .Paginator.PageNumber }} of {{ .Paginator.TotalPages }}
+{{ if .Paginator.HasNext }}
+ <a href="{{ .Paginator.Next.URL }}">Next Page</a>
+{{ end }}
+</div>
diff --git a/themes/flamingo/layouts/partials/post-description.html b/themes/flamingo/layouts/partials/post-description.html
new file mode 100644
index 0000000..d542877
--- /dev/null
+++ b/themes/flamingo/layouts/partials/post-description.html
@@ -0,0 +1,29 @@
+
+<div class="slim-description">
+ <p>
+ A gathering of information about some things I do on my spare time. You
+ can find me on
+ <a
+ class="brand-icon"
+ target="_blank"
+ href="https://gitlab.com/gabrielgio"
+ >
+ <i class="fab fa-gitlab"></i>
+ </a>,
+ <a
+ class="brand-icon"
+ target="_blank"
+ href="https://twitter.com/giovaninigabs">
+ <i class="fab fa-twitter"></i>
+ </a>
+ and
+ <a
+ class="brand-icon"
+ target="_blank"
+ href="https://www.linkedin.com/in/gabriel-giovanini/">
+ <i class="fab fa-linkedin"></i>
+ </a>
+ .
+ </p>
+
+</div>
diff --git a/themes/flamingo/layouts/partials/sidebar.html b/themes/flamingo/layouts/partials/sidebar.html
new file mode 100644
index 0000000..92bbd80
--- /dev/null
+++ b/themes/flamingo/layouts/partials/sidebar.html
@@ -0,0 +1,14 @@
+<aside>
+ <div>
+ <div>
+ <h3>LATEST POSTS</h3>
+ </div>
+ <div>
+ <ul>
+ {{ range first 5 (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) }}
+ <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
+ {{ end }}
+ </ul>
+ </div>
+ </div>
+</aside>
diff --git a/themes/flamingo/layouts/partials/tagbar.html b/themes/flamingo/layouts/partials/tagbar.html
new file mode 100644
index 0000000..aa0de7f
--- /dev/null
+++ b/themes/flamingo/layouts/partials/tagbar.html
@@ -0,0 +1,10 @@
+{{ with .Params.tags }}
+<div>
+ <ul class="tags">
+ {{ range . }}
+ <p>{{ . }}</p>
+ <li><a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a></li>
+ {{ end }}
+ </ul>
+</div>
+{{ end }}