diff options
author | Sebastian Pech <windows@spech.de> | 2019-09-22 13:15:32 +0300 |
---|---|---|
committer | Sebastian Pech <windows@spech.de> | 2019-09-22 13:15:32 +0300 |
commit | a5e2f02738330f0a01d5f8043d87f62006c6a081 (patch) | |
tree | 84dcbb737a44fa3a6a6e4ffa9ccf9e7d563cc6e2 /layouts | |
parent | 8b2e9b2b66e6ad75249a81be1cb48840db001960 (diff) |
reworked most of the theme, added fa
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/404.html | 0 | ||||
-rw-r--r-- | layouts/_default/baseof.html | 13 | ||||
-rw-r--r-- | layouts/_default/list.html | 49 | ||||
-rw-r--r-- | layouts/_default/single.html | 11 | ||||
-rw-r--r-- | layouts/_default/terms.html | 31 | ||||
-rw-r--r-- | layouts/index.html | 26 | ||||
-rw-r--r-- | layouts/partials/content.html | 9 | ||||
-rw-r--r-- | layouts/partials/content_card_body.html | 39 | ||||
-rw-r--r-- | layouts/partials/content_card_footer.html | 16 | ||||
-rw-r--r-- | layouts/partials/content_card_header.html | 31 | ||||
-rw-r--r-- | layouts/partials/content_index.html | 10 | ||||
-rw-r--r-- | layouts/partials/footer.html | 38 | ||||
-rw-r--r-- | layouts/partials/head.html | 42 | ||||
-rw-r--r-- | layouts/partials/header.html | 32 | ||||
-rw-r--r-- | layouts/partials/js.html | 18 | ||||
-rw-r--r-- | layouts/partials/seo_schema.html | 26 | ||||
-rw-r--r-- | layouts/partials/social.html | 135 | ||||
-rw-r--r-- | layouts/shortcodes/optfigure.html | 41 |
18 files changed, 567 insertions, 0 deletions
diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/layouts/404.html diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..410efe5 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,13 @@ +<!DOCTYPE html> +<html lang="{{ with .Site.LanguageCode }}{{ . }}{{ else }}en{{ end }}"> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> + {{- partial "seo_schema" . -}} + <title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title> + {{- partial "head.html" . -}} + <body> + {{- partial "header.html" . -}} + {{- block "main" . }}{{- end }} + {{- partial "footer.html" . -}} + {{- partial "js.html" . -}} + </body> +</html> diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..df8b989 --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,49 @@ +{{- define "main" -}} + +{{ $customDateFormat := "02.01.2006" }} +{{ with .Site.Params.customDateFormat }}{{ $customDateFormat = . }}{{ end }} +{{ $sitetitle := (.Title) }} + +<div class="container"> + {{ if .Site.Params.showListsGrouped }} + <div class="mb-3"> + <div class="card"> + <div class="card-body"> + <h1>{{ $sitetitle }}</h1> + {{ range $key, $value := .Pages.GroupByDate "2006" }} + <a href="#{{ .Key | urlize }}" class="badge badge-primary"><span>{{ .Key }}</span> <span class="badge badge-light">{{ len .Pages }}</span></a> + {{ end}} + </div> + </div> + </div> + {{ range .Pages.GroupByDate "2006" }} + <div class="mb-3"> + <div class="card"> + <div class="card-body"> + <h2 id="{{ .Key | urlize }}">{{ .Key }}</h2> + <ul> + {{ range .Pages }} + <li>{{ .PublishDate.Format $customDateFormat }} - <a href="{{ .RelPermalink }}" title="{{ .Title }}">{{ .Title }}</a></li> + {{ end}} + </ul> + </div> + </div> + </div> + {{ end }} + {{ else }} + <div class="mb-3"> + <div class="card"> + <div class="card-body"> + <h1>{{ .Title }}</h1> + <ul> + {{ range .Pages.ByPublishDate.Reverse }} + <li>{{ .PublishDate.Format $customDateFormat }} - <a href="{{ .RelPermalink }}" title="{{ .Title }}">{{ .Title }}</a></li> + {{ end}} + </ul> + </div> + </div> + </div> + {{ end }} +</div> + +{{- end -}} diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..180764f --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,11 @@ +{{ define "title" }} + {{ .Title }} – {{ .Site.Title }} +{{ end }} + +{{ define "main" }} + + <div class="container"> + {{- partial "content.html" . -}} + </div> + +{{ end }} diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html new file mode 100644 index 0000000..306e228 --- /dev/null +++ b/layouts/_default/terms.html @@ -0,0 +1,31 @@ +{{ define "main" }} + +<div class="container"> + <div class="mb-3"> + <div class="card"> + <div class="card-body"> + <h1>{{ .Title }}</h1> + {{ range $key, $value := .Data.Terms }} + <a href="#{{ $key | urlize }}" class="badge badge-primary"><span>{{ $key }}</span> <span class="badge badge-light">{{ $value.Count }}</span></a> + {{ end}} + </div> + </div> + </div> + + {{ range $key, $value := .Data.Terms }} + <div class="mb-3"> + <div class="card"> + <div class="card-body"> + <h2 id="{{ $key | urlize }}">{{ $key }}</h2> + <ul> + {{ range $value.Pages.ByDate.Reverse }} + <li><a href="{{ .RelPermalink }}" title="{{ .Title }}">{{ .Title }}</a></li> + {{ end}} + </ul> + </div> + </div> + </div> + {{ end}} +</div> + +{{ end }} diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..46ff728 --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,26 @@ +{{ define "main" }} + +<div class="container"> + {{ $paginator := .Paginate ( where .Site.RegularPages.ByPublishDate.Reverse "Type" "!=" "page") }} + {{ if .Site.Params.startPageColumns }} + <div class="row"> + {{ range $paginator.Pages }} + <div class="col s4 m4"> + {{- partial "content_index.html" . -}} + </div> + {{ end }} + </div> + {{ else }} + {{ range $paginator.Pages }} + <div class="row"> + <div class="col s12 m12"> + {{- partial "content_index.html" . -}} + </div> + </div> + {{ end }} + {{ end }} + + {{ template "_internal/pagination.html" . }} +</div> + +{{ end }} diff --git a/layouts/partials/content.html b/layouts/partials/content.html new file mode 100644 index 0000000..78f4845 --- /dev/null +++ b/layouts/partials/content.html @@ -0,0 +1,9 @@ +<div class="card"> + {{ .Scratch.Set "fullsize" true }} + {{- partial "content_card_header.html" . -}} + + {{ .Scratch.Set "showPostSummary" false }} + {{- partial "content_card_body.html" . -}} + + {{- partial "content_card_footer.html" . -}} +</div> diff --git a/layouts/partials/content_card_body.html b/layouts/partials/content_card_body.html new file mode 100644 index 0000000..192b3cc --- /dev/null +++ b/layouts/partials/content_card_body.html @@ -0,0 +1,39 @@ +{{ $customDateFormat := "02.01.2006" }} +{{ with .Site.Params.customDateFormat }}{{ $customDateFormat = . }}{{ end }} + +<div class="card-content"> + <h1 class="card-title"><a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a></h1> + <h6 class="grey-text"> + <i class="tiny material-icons">calendar_today</i> {{ .PublishDate.Format $customDateFormat }}{{ if gt .Lastmod .PublishDate }}, last updated {{ .Lastmod.Format $customDateFormat }}{{ end }} - + <i class="tiny material-icons">person</i> {{ range .Site.Author }}{{ . }}{{ end }} + {{ if ne .Site.Params.hideReadingTime true }} + {{ if and (not (.Scratch.Get "showPostSummary")) (.Scratch.Get "fullsize") }} + - <i class="material-icons">timer</i> ~{{ if le .ReadingTime 1 }}1 Minute{{ else }}{{ .ReadingTime }} Minutes{{ end }} + {{ end }} + {{ end }} + </h6> + + {{ if eq .Type "video" }} + {{ else if eq .Type "audio" }} + {{ else if eq .Type "link" }} + <p class="center-align"><a href="{{ .Params.link }}" target="_blank" class="btn btn-primary btn-lg" tabindex="-1" role="button"><i class="fas fa-link"></i> {{ .Title }}</a></p> + {{ else if eq .Type "quote" }} + <blockquote class="center-align"> + <p><i class="fas fa-quote-left fa-2x"></i> {{ .Params.quote }} <i class="fas fa-quote-right fa-2x"></i></p> + <p class="grey-text"><cite title="{{ .Params.quoteauthor }}">{{ .Params.quoteauthor }}</cite></p> + </blockquote> + {{ end }} + + {{ if .Scratch.Get "showPostSummary" }} + <p>{{ .Summary }}</p> + + <p><br /> + <a href="{{ .RelPermalink }}" class="blue waves-effect waves-light btn"><i class="material-icons right">navigate_next</i>Read more</a> + {{ if ne .Site.Params.hideReadingTime true }} + (<i class="tiny material-icons">timer</i> ~{{ .ReadingTime }} Min.) + {{end}} + </p> + {{ else }} + <p class="card-text">{{ .Content }}</p> + {{ end }} +</div> diff --git a/layouts/partials/content_card_footer.html b/layouts/partials/content_card_footer.html new file mode 100644 index 0000000..44683dd --- /dev/null +++ b/layouts/partials/content_card_footer.html @@ -0,0 +1,16 @@ +<div class="card-action"> + <small> + {{ if ne .Type "page" }} + {{ if gt .Params.categories 0 }} + {{ range .Params.categories }} + <a href="{{ "/categories/" | relURL }}#{{ . | urlize }}">+{{ . }}</a> + {{ end }} + {{ end }} + {{ if gt .Params.tags 0 }} + {{ range .Params.tags }} + <a href="{{ "/tags/" | relURL }}#{{ . | urlize }}">#{{ . }}</a> + {{ end }} + {{ end }} + {{ end }} + </small> +</div> diff --git a/layouts/partials/content_card_header.html b/layouts/partials/content_card_header.html new file mode 100644 index 0000000..4a0d4fd --- /dev/null +++ b/layouts/partials/content_card_header.html @@ -0,0 +1,31 @@ +{{ if eq .Type "video" }} + <div class="video-container"> + {{ if .Scratch.Get "fullsize" }} + <iframe src="https://www.youtube-nocookie.com/embed/{{ .Params.youtube }}?rel=0" width="100%" height="600px" frameborder="0" allowfullscreen></iframe> + {{ else }} + <iframe src="https://www.youtube-nocookie.com/embed/{{ .Params.youtube }}?rel=0" width="100%" height="200px" frameborder="0" allowfullscreen></iframe> + {{ end }} + </div> +{{ else if eq .Type "audio" }} + <div class="video-container"> + <iframe src="https://open.spotify.com/embed?uri={{ .Params.spotify }}" width="100%" height="80" frameborder="0" allowtransparency="true"></iframe> + </div> +{{ else }} + {{- $images := $.Resources.ByType "image" -}} + {{- $featured := $images.GetMatch "*feature*" -}} + {{- $featured := cond (ne $featured nil) $featured ($images.GetMatch "{*cover*,*thumbnail*}") -}} + {{- $featured := cond (ne $.Params.featured_image nil) (.Page.Resources.GetMatch (printf "*%s" $.Params.featured_image)) $featured -}} + {{ $sitetitle := (.Title) }} + {{ $fullsize := .Scratch.Get "fullsize" }} + {{- with $featured -}} + <div class="card-image"> + {{ if $fullsize }} + {{ $thumb := .Resize "1108x" }} + <img src="{{ $thumb.RelPermalink }}" alt="{{ $sitetitle }}" title="{{ $sitetitle }}"> + {{ else }} + {{ $thumb := .Resize "360x" }} + <img src="{{ $thumb.RelPermalink }}" alt="{{ $sitetitle }}" title="{{ $sitetitle }}"> + {{ end }} + </div> + {{ end }} +{{ end }} diff --git a/layouts/partials/content_index.html b/layouts/partials/content_index.html new file mode 100644 index 0000000..3853adf --- /dev/null +++ b/layouts/partials/content_index.html @@ -0,0 +1,10 @@ +<div class="card"> + {{ $startPageColumns := .Site.Params.startPageColumns }} + {{ .Scratch.Set "fullsize" (not $startPageColumns) }} + {{- partial "content_card_header.html" . -}} + + {{ .Scratch.Set "showPostSummary" .Site.Params.showPostSummary }} + {{- partial "content_card_body.html" . -}} + + {{- partial "content_card_footer.html" . -}} +</div> diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..c3457cf --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,38 @@ +<footer class="page-footer orange"> + <div class="container"> + <div class="row"> + <div class="col l4 s12"> + <h5 class="white-text">{{ .Site.Title }}</h5> + <p class="grey-text text-lighten-4">{{ .Site.Params.description }}</p> + </div> + <div class="col l4 s12"> + <h5 class="white-text">Social</h5> + <ul> + {{- partial "social.html" . -}} + </ul> + </div> + <div class="col l4 s12"> + <h5 class="white-text">Connect</h5> + <ul> + {{ range $index, $element := .Site.Menus.footer }} + {{ if .HasChildren }} + <li><a class="white-text" href="{{ .URL }}">{{ .Pre }} {{ .Name }}</a></li> + {{ range .Children }} + <li><a class="white-text" href="{{ .URL }}">{{ .Pre }} {{ .Name }}</a></li> + {{ end }} + {{ else }} + <li><a class="white-text" href="{{ .URL }}">{{ .Pre }} {{ .Name }}</a></li> + {{ end }} + {{ end }} + </ul> + </div> + </div> + </div> + <div class="footer-copyright"> + <div class="container"> + © {{ now.Format "2006" }} {{ range .Site.Author }}{{ . }}{{ end }}. + Theme by <a class="orange-text text-lighten-3" href="https://www.spech.de">Sebastian Pech</a>. + Made by <a class="orange-text text-lighten-3" href="http://materializecss.com">Materialize</a>. + </div> + </div> +</footer> diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..1425370 --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,42 @@ +<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/> +<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ .Site.Params.description }}{{ end }}"> +<meta name="author" content="{{ range .Site.Author }}{{ . }}{{ end }}"> +<link rel="icon" href="/favicon.ico"> +<!--<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"> +<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"> +<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">--> + +{{ template "_internal/schema.html" . }} +{{ template "_internal/opengraph.html" . }} +{{ template "_internal/twitter_cards.html" . }} + +{{ if .Site.RSSLink }}<link rel="alternate" href="{{ .Site.RSSLink }}" type="application/rss+xml" title="{{ .Site.Title }}"/>{{ end }} + +{{ $themeColor := "default" }} +{{ if .Site.Params.themeColor }} + {{ $themeColor = .Site.Params.themeColor }} +{{ end }} + +{{ $cssbootstrap := resources.Get (printf "/css/materialize-%s.min.css" $themeColor) }} +{{ $cssfontawesome := resources.Get "/css/fontawesome-free-5.10.1-web-all.min.css" }} +{{ $cssmain := resources.Get "/css/main.css" }} +{{ $csstheme := resources.Get (printf "/css/main-%s.css" $themeColor) }} +{{ $customcss := resources.Get "/css/custom.css" }} +{{ $allcss := slice $cssbootstrap $cssfontawesome $cssmain $csstheme $customcss | resources.Concat "/css/vendor.css" | minify | fingerprint }} +<link rel="stylesheet" href="{{ $allcss.RelPermalink }}" integrity="{{ $allcss.Data.Integrity }}"> + +<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> + +{{- range .Site.Params.csscdn }} + <link rel="stylesheet" href="{{ . }}"> +{{- end }} + +{{- range .Site.Params.css }} + {{ $pagestyle := resources.Get . | minify | fingerprint }} + <link rel="stylesheet" href="{{ $pagestyle.RelPermalink }}" integrity="{{ $pagestyle.Data.Integrity }}"> +{{- end }} + +{{- range .Params.css }} + {{ $pagestyle := resources.Get . | minify | fingerprint }} + <link rel="stylesheet" href="{{ $pagestyle.RelPermalink }}" integrity="{{ $pagestyle.Data.Integrity }}"> +{{- end }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..edce3f4 --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,32 @@ +<nav class="light-blue lighten-1" role="navigation"> + <div class="nav-wrapper container"> + <a id="logo-container" href="/" class="brand-logo">{{ .Site.Title }}</a> + <a href="#" data-target="nav-mobile" class="sidenav-trigger"><i class="material-icons">menu</i></a> + <ul class="right hide-on-med-and-down"> + {{ $currentPage := . }} + {{ range $index, $element := .Site.Menus.main }} + {{ if .HasChildren }} + <li><a href="{{ .URL }}">{{ .Pre }} {{ .Name }}</a></li> + {{ range .Children }} + <li><a href="{{ .URL }}">{{ .Pre }} {{ .Name }}</a></li> + {{ end }} + {{ else }} + <li><a href="{{ .URL }}">{{ .Pre }} {{ .Name }}</a></li> + {{ end }} + {{ end }} + </ul> + + <ul id="nav-mobile" class="sidenav"> + {{ range $index, $element := .Site.Menus.main }} + {{ if .HasChildren }} + <li><a href="{{ .URL }}">{{ .Pre }} {{ .Name }}</a></li> + {{ range .Children }} + <li><a href="{{ .URL }}">{{ .Pre }} {{ .Name }}</a></li> + {{ end }} + {{ else }} + <li><a href="{{ .URL }}">{{ .Pre }} {{ .Name }}</a></li> + {{ end }} + {{ end }} + </ul> + </div> +</nav> diff --git a/layouts/partials/js.html b/layouts/partials/js.html new file mode 100644 index 0000000..e494f81 --- /dev/null +++ b/layouts/partials/js.html @@ -0,0 +1,18 @@ +{{ $jquery := resources.Get "/js/jquery-3.3.1.slim.min.js" }} +{{ $bootstrap := resources.Get "/js/materialize.min.js" }} +{{ $mainjs := resources.Get "/js/main.js" }} +{{ $customjs := resources.Get "/js/custom.js" }} +{{ $allscript := slice $jquery $bootstrap $mainjs $customjs | resources.Concat "/js/vendor.js" | minify | fingerprint }} +<script src="{{ $allscript.RelPermalink }}" integrity="{{ $allscript.Data.Integrity }}"></script> + +{{- range .Site.Params.js }} + {{ $pagescript := resources.Get . | minify | fingerprint }} + <script src="{{ $pagescript.RelPermalink }}" integrity="{{ $pagescript.Data.Integrity }}"></script> +{{- end }} + +{{- range .Params.js }} + {{ $pagescript := resources.Get . | minify | fingerprint }} + <script src="{{ $pagescript.RelPermalink }}" integrity="{{ $pagescript.Data.Integrity }}"></script> +{{- end }} + +{{ template "_internal/google_analytics_async.html" . }} diff --git a/layouts/partials/seo_schema.html b/layouts/partials/seo_schema.html new file mode 100644 index 0000000..96f0751 --- /dev/null +++ b/layouts/partials/seo_schema.html @@ -0,0 +1,26 @@ +<script type="application/ld+json"> + { + "@context" : "http://schema.org", + "@type" : "BlogPosting", + "mainEntityOfPage": { + "@type": "WebPage", + "@id": "{{ .Site.BaseURL }}" + }, + "articleSection" : "{{ .Section }}", + "name" : "{{ .Title }}", + "headline" : "{{ .Title }}", + "description" : "{{ with .Description }}{{ . }}{{ else }}{{ .Site.Params.description }}{{ end }}", + "inLanguage" : "{{ .Lang }}", + "author" : "{{ range .Site.Author }}{{ . }}{{ end }}", + "creator" : "{{ range .Site.Author }}{{ . }}{{ end }}", + "publisher": "{{ range .Site.Author }}{{ . }}{{ end }}", + "accountablePerson" : "{{ range .Site.Author }}{{ . }}{{ end }}", + "copyrightHolder" : "{{ range .Site.Author }}{{ . }}{{ end }}", + "copyrightYear" : "{{ .Date.Format "2006" }}", + "datePublished": "{{ .Date.UTC.Format "2006-01-02T15:04:05Z" | safeHTML }}", + "dateModified" : "{{ .Date.UTC.Format "2006-01-02T15:04:05Z" | safeHTML }}", + "url" : "{{ .RelPermalink }}", + "wordCount" : "{{ .WordCount }}", + "keywords" : [ {{ if isset .Params "tags" }}{{ range .Params.tags }}"{{ . }}",{{ end }}{{ end }}"Blog" ] + } +</script> diff --git a/layouts/partials/social.html b/layouts/partials/social.html new file mode 100644 index 0000000..2cba9df --- /dev/null +++ b/layouts/partials/social.html @@ -0,0 +1,135 @@ +{{ with .Site.Social.github }} + <li class="list-inline-item"><a href="//github.com/{{.}}" target="_blank" title="GitHub" class="fab fa-github fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.gitlab }} + <li class="list-inline-item"><a href="//gitlab.com/{{.}}" target="_blank" title="GitLab" class="fab fa-gitlab fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.stackoverflow }} + <li class="list-inline-item"><a href="//stackoverflow.com/users/{{.}}" target="_blank" title="Stack Overflow" class="fab fa-stack-overflow fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.bitbucket }} + <li class="list-inline-item"><a href="//bitbucket.com/{{.}}" target="_blank" title="Bitbucket" class="fab fa-bitbucket fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.jsfiddle }} + <li class="list-inline-item"><a href="//jsfiddle.com/{{.}}" target="_blank" title="JSFiddle" class="fab fa-jsfiddle fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.codepen }} + <li class="list-inline-item"><a href="//codepen.io/{{.}}" target="_blank" title="CodePen" class="fab fa-codepen fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.deviantart }} + <li class="list-inline-item"><a href="//{{.}}.deviantart.com/" target="_blank" title="DeviantArt" class="fab fa-deviantart fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.flickr }} + <li class="list-inline-item"><a href="//flickr.com/photos/{{.}}" target="_blank" title="Flickr" class="fab fa-flickr fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.behance }} + <li class="list-inline-item"><a href="//behance.net/{{.}}" target="_blank" title="Behance" class="fab fa-behance fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.dribbble }} + <li class="list-inline-item"><a href="//dribbble.com/{{.}}" target="_blank" title="Dribbble" class="fab fa-dribbble fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.wordpress }} + <li class="list-inline-item"><a href="//{{.}}.wordpress.com" target="_blank" title="WordPress" class="fab fa-wordpress fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.medium}} + <li class="list-inline-item"><a href="//medium.com/@{{.}}" target="_blank" title="Medium" class="fab fa-medium fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.linkedin }} + <li class="list-inline-item"><a href="//linkedin.com/in/{{.}}" target="_blank" title="LinkedIn" class="fab fa-linkedin fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.linkedin_company }} + <li class="list-inline-item"><a href="//linkedin.com/company/{{.}}" target="_blank" title="LinkedIn Company" class="fab fa-linkedin fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.foursquare }} + <li class="list-inline-item"><a href="//foursquare.com/{{.}}" target="_blank" title="Foursquare" class="fab fa-foursquare fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.xing }} + <li class="list-inline-item"><a href="//xing.com/profile/{{.}}" target="_blank" title="Xing" class="fab fa-xing fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.slideshare }} + <li class="list-inline-item"><a href="//slideshare.com/{{.}}" target="_blank" title="SlideShare" class="fab fa-slideshare fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.facebook }} + <li class="list-inline-item"><a href="//facebook.com/{{.}}" target="_blank" title="Facebook" class="fab fa-facebook fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.googleplus }} + <li class="list-inline-item"><a href="//plus.google.com/+{{.}}" target="_blank" title="Google+" class="fab fa-google-plus fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.reddit }} + <li class="list-inline-item"><a href="//reddit.com/user/{{.}}" target="_blank" title="Reddit" class="fab fa-reddit fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.quora }} + <li class="list-inline-item"><a href="//quora.com/profile/{{.}}" target="_blank" title="Quora" class="fab fa-quora fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.youtube }} + <li class="list-inline-item"><a href="//youtube.com/{{.}}" target="_blank" title="YouTube" class="fab fa-youtube fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.youtube2 }} + <li class="list-inline-item"><a href="//youtube.com/{{.}}" target="_blank" title="YouTube" class="fab fa-youtube fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.vimeo }} + <li class="list-inline-item"><a href="//vimeo.com/{{.}}" target="_blank" title="Vimeo" class="fab fa-vimeo fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.whatsapp }} + <li class="list-inline-item"><a href="//api.whatsapp.com/send?phone={{.}}" target="_blank" title="WhatsApp" class="fab fa-whatsapp fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.instagram }} + <li class="list-inline-item"><a href="//instagram.com/{{.}}" target="_blank" title="Instagram" class="fab fa-instagram fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.tumblr }} + <li class="list-inline-item"><a href="//{{.}}.tumblr.com" target="_blank" title="Tumblr" class="fab fa-tumblr fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.twitter }} + <li class="list-inline-item"><a href="//twitter.com/{{.}}" target="_blank" title="Twitter" class="fab fa-twitter fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.skype }} + <li class="list-inline-item"><a href="skype:{{.}}?userinfo" target="_blank" title="Skype" class="fab fa-skype fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.snapchat }} + <li class="list-inline-item"><a href="//snapchat.com/add/{{.}}" target="_blank" title="snapchat" class="fab fa-snapchat fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.pinterest }} + <li class="list-inline-item"><a href="//pinterest.com/{{.}}" target="_blank" title="Pinterest" class="fab fa-pinterest-p fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.telegram }} + <li class="list-inline-item"><a href="//telegram.me/{{.}}" target="_blank" title="telegram" class="fab fa-telegram fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.twitch }} + <li class="list-inline-item"><a href="//twitch.tv/{{.}}" target="_blank" title="twitch" class="fab fa-twitch fa-2x white-text"></a></li> +{{ end }} + +{{ with .Site.Social.email }} + <li class="list-inline-item"><a href="mailto:{{.}}" title="Email" class="fas fa-envelope fa-2x white-text"></a></li> +{{ end }} diff --git a/layouts/shortcodes/optfigure.html b/layouts/shortcodes/optfigure.html new file mode 100644 index 0000000..f4eab20 --- /dev/null +++ b/layouts/shortcodes/optfigure.html @@ -0,0 +1,41 @@ +{{ $original := .Page.Resources.GetMatch (printf "*%s*.{png,jpg}" (.Get "src")) }} +{{ $alt := (.Get "alt") }} +{{ $caption := (.Get "caption") }} + +<figure{{ with .Get "class" }} class="{{ . }}"{{ end }}> + {{- if .Get "link" -}} + <a href="{{ .Get "link" }}"{{ with .Get "target" }} target="{{ . }}"{{ end }}{{ with .Get "rel" }} rel="{{ . }}"{{ end }}> + {{- end }} +{{ with $original }} + {{ if gt $original.Width 600 }} + {{ $image := .Resize "600x" }} + <img src="{{ $image.RelPermalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}" + {{- if or ($alt) ($caption) }} + alt="{{ with $alt }}{{ . }}{{ else }}{{ $caption | markdownify| plainify }}{{ end }}" + {{- end -}} + /> + {{ else }} + <img src="{{ $original.RelPermalink }}" width="{{ $original.Width }}" height="{{ $original.Height }}" + {{- if or ($alt) ($caption) }} + alt="{{ with $alt }}{{ . }}{{ else }}{{ $caption | markdownify| plainify }}{{ end }}" + {{- end -}} + /> + {{ end }} +{{ end }} + {{- if .Get "link" }}</a>{{ end -}} + {{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}} + <figcaption class="figure-caption"> + {{ with (.Get "title") -}} + <h4>{{ . }}</h4> + {{- end -}} + {{- if or (.Get "caption") (.Get "attr") -}}<p> + {{- .Get "caption" | markdownify -}} + {{- with .Get "attrlink" -}} + <a href="{{ . }}"> + {{- end -}} + {{- .Get "attr" | markdownify -}} + {{- if .Get "attrlink" }}</a>{{ end }}</p> + {{- end }} + </figcaption> + {{- end }} +</figure> |