diff options
Diffstat (limited to 'layouts')
33 files changed, 713 insertions, 913 deletions
diff --git a/layouts/404.html b/layouts/404.html index 02a2775..a4f98ab 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -1,23 +1,13 @@ -{{ partial "header.html" . }} -<body> - -<div class="section" id="top"><!-- Parent section --> - - <div class="container hero is-medium has-text-centered {{ if .Site.Params.fadeIn }} fade-in one {{ end }}"><!-- Begin Title --> - <h1 class="bold-title is-1">404</h1> - </div><!-- End Title --> - -<!-- Everything below fades in two! --> -<div class="section {{ if .Site.Params.fadeIn }} fade-in two {{ end }}"> - - <div class="container"><!-- Begin Nav bar --> - {{ partial "nav-single.html" . }} - </div><!-- End Nav bar --> - - <div class="container {{ if .Site.Params.fadeIn }} fade-in two {{ end }} top-pad"><!-- Begin blurb --> - Oops! Either you've found a bug (in which case, <a href="mailto:{{ .Site.Params.email }}">please tell me</a>) or you're just making things up. This page doesn't exist! - </div><!-- End blurb --> - -<div class="container top-pad"><hr></div> -{{ partial "footer.html" . }} -</div><!-- End parent section --> +{{ define "title" }} + <h1 class="bold-title is-1">{{ i18n "404_title" . }}</h1> +{{ end }} + +{{ define "main" }} + <div class="container markdown top-pad"> + {{ i18n "404_description" . | markdownify }} + </div> +{{ end }} + +{{ define "footer" }} + {{ partial "footer/text.html" . }} +{{ end }} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..0345ff8 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,42 @@ +<!DOCTYPE html> +<html lang="{{ .Site.LanguageCode }}"> + <head> + {{ block "head" . }} + {{ partial "head/metadata.html" . }} + {{ partial "head/openGraph.html" . }} + {{ partial "head/favicons.html" . }} + {{ partial "head/css.html" . }} + {{ end }} + <!-- Include page specific css --> + {{ block "customCSS" . }} + {{ end }} + </head> + <body> + <section id="top" class="section"> + <!-- Begin Title --> + <div class="container hero {{ if .Site.Params.fadeIn | default true }} fade-in one {{ end }}"> + {{ block "title" . }} + <h1 class="bold-title is-1">{{ .Title }}</h1> + {{ end }} + </div> + <!-- End Title --> + <div class="section {{ if .Site.Params.fadeIn | default true }} fade-in two {{ end }}"> + {{ partial "nav.html" . }} + + {{ block "main" . }} + {{ end }} + + {{ block "footer" . }} + {{ partial "top-icon-with-hr.html" . }} + {{ partial "footer/text.html" . }} + {{ end }} + </div> + </section> + {{ block "js-include" . }} + {{ partial "footer/scripts.html" . }} + {{ end }} + <!-- Include page specific scritps --> + {{ block "customScripts" . }} + {{ end }} + </body> +</html> diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 1c6cf64..d7d6065 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,63 +1,15 @@ -{{ partial "header.html" . }} - -<body> - - <div class="section" id="top"> - <!-- Parent section --> - <div class="container hero {{ if .Site.Params.fadeIn }} fade-in one {{ end }}"> - <!-- Begin Title --> - <h1 class="bold-title is-1">{{ .Title }}</h1> - </div> - <!-- End Title --> - - <!-- Everything below fades in two! --> - <div class="section no-padding {{ if .Site.Params.fadeIn }} fade-in two {{ end }}"> - - <div class="container"> - <!-- Begin Nav bar --> - {{ partial "nav-list.html" . }} - </div> - <!-- End Nav bar --> - - <div class="container markdown {{ if .Site.Params.fadeIn | default true }}fade-in two{{ end }} top-pad"> - <!-- "{{.Content}}" pulls from the markdown content of the corresponding _index.md --> - {{ .Content }} - </div> - <div class="container"> - <ul> - <!-- Ranges through content/*/*.md --> - {{ range .Data.Pages.ByPublishDate }} {{ if not (eq .Section "blog") }} - <li> - <a href="{{.Permalink}}">{{.Date.Format (.Site.Params.dateform | default "Jan 02, 2006") }} | {{.Title}}</a> - </li> - {{ end }} {{ end }} - </ul> - </div> - - <div class="container has-text-centered top-pad"> - <hr> - <a href="#top"> - <i class="fa fa-arrow-up"></i> - </a> - <hr> - </div> - - {{ partial "footer.html" . }} - </div> - <!-- End fade in two --> +{{ define "main" }} + <div class="container markdown top-pad"> + {{ .Content }} </div> - <!-- End parent section --> - - <!-- Bitty scrolling links script --> - <script> - $('a[href^="{{ .Permalink }}#"]').click(function (e) { - e.preventDefault(); - var target = this.hash; - $('html, body').animate({ - scrollTop: $(target).offset().top - }, 500); - return false; - }) - </script> - -</body>
\ No newline at end of file + <div class="container"> + <ul> + {{ range .Pages.ByPublishDate.Reverse }} + <li> + <a href="{{ .Permalink }}">{{ .Date.Format (.Site.Params.dateFormat | default "Jan 02, 2006") }} | {{ .Title }}</a> + </li> + {{ end }} + </ul> + </div> +</body> +{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 55910d6..2b7793f 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,62 +1,9 @@ -{{ partial "header.html" . }} - -<body> - - <div class="section" id="top"> - <!-- Parent section --> - <div class="container hero {{ if .Site.Params.fadeIn }} fade-in one {{ end }}"> - <!-- Begin Title --> - <h1 class="bold-title is-1">{{ .Title }}</h1> - </div> - <!-- End Title --> - - <!-- Everything below fades in two! --> - <div class="section {{ if .Site.Params.fadeIn }} fade-in two {{ end }}"> - - <div class="container"> - <!-- Begin Nav bar --> - {{ partial "nav-single.html" . }} - </div> - <!-- End Nav bar --> - - <div class="container markdown {{ if .Site.Params.fadeIn }} fade-in two {{ end }} top-pad"> - <!-- Begin content --> - {{ if .Params.image }} - <div class="has-text-centered"> - <img src="{{ .Params.image | relURL }}" class="img-responsive"> - </div> - {{ end }} {{ .Content }} - </div> - <!-- End content --> - - <div class="disqus"> - {{ template "_internal/disqus.html" . }} - </div> - - <div class="container has-text-centered top-pad"> - <hr> - <a href="#top"> - <i class="fa fa-arrow-up"></i> - </a> - <hr> - </div> - - {{ partial "footer.html" . }} - </div> - <!-- End fade in two --> +{{ define "main" }} + <div class="container markdown top-pad"> + {{ .Content }} </div> - <!-- End parent section --> - - <!-- Bitty scrolling links script --> - <script> - $('a[href^="{{ .Permalink }}#"]').click(function (e) { - e.preventDefault(); - var target = this.hash; - $('html, body').animate({ - scrollTop: $(target).offset().top - }, 500); - return false; - }) - </script> - -</body> + <!-- End post content --> + <div class="disqus"> + {{ template "_internal/disqus.html" . }} + </div> +{{ end }} diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html index 5f7e1c4..92e1492 100644 --- a/layouts/_default/taxonomy.html +++ b/layouts/_default/taxonomy.html @@ -1,66 +1,15 @@ -{{ partial "header.html" . }} - -<body> - - <div class="section" id="top"> - <!-- Parent section --> - <div class="container hero {{ if .Site.Params.fadeIn }} fade-in one {{ end }}"> - <!-- Begin Title --> - <h1 class="bold-title is-1">Tagged "{{ lower .Title }}"</h1> - </div> - <!-- End Title --> - - <!-- Everything below fades in two! --> - <div class="section no-padding {{ if .Site.Params.fadeIn }} fade-in two {{ end }}"> - - <div class="container"> - <!-- Begin Nav bar --> - {{ partial "nav-list.html" . }} - </div> - <!-- End Nav bar --> - <article> - <!-- "{{.Content}}" pulls from the markdown content of the corresponding _index.md --> - {{ .Content }} - </article> - - - <div class="container"> - <!-- Begin Blog container --> - <ul> - <!-- Ranges through content/post/*.md --> - {{ range .Data.Pages.ByPublishDate }} - <li> - <a href="{{.Permalink}}">{{.Date.Format (.Site.Params.dateform | default "Jan 02, 2006") }} | {{.Title}}</a> - </li> - {{ end }} - </ul> - </div> - <!-- End Blog container --> - - <div class="container has-text-centered top-pad"> - <hr> - <a href="#top"> - <i class="fa fa-arrow-up"></i> - </a> - <hr> - </div> - - {{ partial "footer.html" . }} - </div> - <!-- End fade in two --> +{{ define "title" }} + <h1 class="bold-title is-1">{{ .Data.Singular | humanize }}: {{ lower .Title }}</h1> +{{ end }} + +{{ define "main" }} + <div class="container"> + <ul> + {{ range .Pages.ByPublishDate.Reverse }} + <li> + <a href="{{ .Permalink }}">{{ .Date.Format (.Site.Params.dateFormat | default "Jan 02, 2006") }} | {{ .Title }}</a> + </li> + {{ end }} + </ul> </div> - <!-- End parent section --> - - <!-- Bitty scrolling links script --> - <script> - $('a[href^="{{ .Permalink }}#"]').click(function (e) { - e.preventDefault(); - var target = this.hash; - $('html, body').animate({ - scrollTop: $(target).offset().top - }, 500); - return false; - }) - </script> - -</body>
\ No newline at end of file +{{ end }} diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html index a1cd7f8..c070bfe 100644 --- a/layouts/_default/terms.html +++ b/layouts/_default/terms.html @@ -1,60 +1,9 @@ -{{ partial "header.html" . }} - -<body> - - <div class="section" id="top"> - <!-- Parent section --> - <div class="container hero {{ if .Site.Params.fadeIn }} fade-in one {{ end }}"> - <!-- Begin Title --> - <h1 class="bold-title is-1">{{ .Title }}</h1> +{{ define "main" }} + <div class="container"> + <div class="section tags-list"> + {{- range $key, $value:= .Data.Terms -}} + <a class="tag-cloud" href="{{ "/" | absLangURL }}{{ $.Data.Plural | urlize }}/{{ $key | urlize }}">{{ $key }} ({{ $value.Count }})</a> + {{- end -}} </div> - <!-- End Title --> - - <!-- Everything below fades in two! --> - <div class="section no-padding {{ if .Site.Params.fadeIn }} fade-in two {{ end }}"> - - <div class="container"> - <!-- Begin Nav bar --> - {{ partial "nav-list.html" . }} - </div> - <!-- End Nav bar --> - <article> - <!-- "{{.Content}}" pulls from the markdown content of the corresponding _index.md --> - {{ .Content }} - </article> - - - <div class="container"> - <div class="section tags-list"> - {{ range $name, $taxonomy := .Site.Taxonomies.tags }} - <a class="tag-cloud" href="{{"tags/" | relLangURL }}{{ $name | urlize }}">{{ lower $name }} ({{ len $taxonomy }})</a> - {{ end }} - </div> - - <div class="container has-text-centered top-pad"> - <hr> - <a href="#top"> - <i class="fa fa-arrow-up"></i> - </a> - <hr> - </div> - - {{ partial "footer.html" . }} - </div> - <!-- End fade in two --> - </div> - <!-- End parent section --> - - <!-- Bitty scrolling links script --> - <script> - $('a[href^="{{ .Permalink }}#"]').click(function (e) { - e.preventDefault(); - var target = this.hash; - $('html, body').animate({ - scrollTop: $(target).offset().top - }, 500); - return false; - }) - </script> - -</body>
\ No newline at end of file + </div> +{{ end }} diff --git a/layouts/blog/list.html b/layouts/blog/list.html index 676de26..c2c6583 100644 --- a/layouts/blog/list.html +++ b/layouts/blog/list.html @@ -1,76 +1,28 @@ -{{ partial "header.html" . }} - -<body> - - <div class="section" id="top"> - <!-- Parent section --> - <div class="container hero {{ if .Site.Params.fadeIn | default true }}fade-in one{{ end }}"> - <!-- Begin Title --> - <h1 class="bold-title is-1">{{ .Title | default "Blog" }}</h1> - </div> - <!-- End Title --> - - <!-- Everything below fades in two! --> - <div class="section no-padding {{ if .Site.Params.fadeIn | default true }}fade-in two{{ end }}"> - - <div class="container"> - <!-- Begin Nav bar --> - {{ partial "nav-list.html" . }} - </div> - <!-- End Nav bar --> - - <div class="container markdown {{ if .Site.Params.fadeIn | default true }}fade-in two{{ end }} top-pad"> - <!-- "{{.Content}}" pulls from the markdown content of the corresponding _index.md --> - {{ .Content }} - </div> - <div class="container"> - {{ if .Site.Params.showLatest }} - <h2 class="title is-2 top-pad">Latest Post</h2> - {{ range first 1 (where .Data.Pages.ByPublishDate.Reverse "Section" "blog") }} - <div class="summary">{{ .Date.Format (.Site.Params.dateForm | default "Jan 02, 2006") }} - <h3 class="title is-3 strong-post-title"> - <a href="{{ .RelPermalink }}">{{ .Title }}</a> - </h3> - <div class="markdown"> - {{ .Summary }} {{ if .Truncated }} - <a href="{{ .RelPermalink }}">...Read More</a> - {{ end }} - </div> - </div> - {{ end }} {{ end }} - - <h2 class="title is-2 top-pad">All Posts</h2> - <ul> - {{ range .Data.Pages.ByPublishDate }} {{ if eq .Section "blog" }} {{ partial "li.html" . }} {{ end }} {{ end }} - </ul> - - </div> - <!-- End Blog container --> - - <div class="container has-text-centered top-pad"> - <hr> - <a href="{{ .Permalink }}#top"> - <i class="fa fa-arrow-up"></i> +{{ define "main" }} + <div class="container markdown top-pad"> + {{ .Content }} + </div> + <div class="container"> + {{ if .Site.Params.home.showLatest | default true }} + <h2 class="title is-2 top-pad">{{ i18n "index_blog_latestPosts" . }}</h2> + {{ range first 1 .Pages.ByPublishDate.Reverse }} + <div class="summary">{{ .Date.Format (.Site.Params.dateFormat | default "Jan 02, 2006") }} + <h3 class="title is-3 strong-post-title"> + <a href="{{ .Permalink }}"> + {{ .Title }} </a> - <hr> + </h3> + <div class="markdown"> + {{ .Summary }} + {{ if .Truncated }} + <a href="{{ .Permalink }}">{{ i18n "index_blog_readMore" . }}</a> + {{ end }} </div> - - {{ partial "footer.html" . }} </div> - <!-- End fade in two --> - </div> - <!-- End parent section --> + {{ end }} - <!-- Bitty scrolling links script --> - <script> - $('a[href^="{{ .Permalink }}#"]').click(function (e) { - e.preventDefault(); - var target = this.hash; - $('html, body').animate({ - scrollTop: $(target).offset().top - }, 500); - return false; - }) - </script> - -</body>
\ No newline at end of file + {{ end }} + <h2 class="title is-2 top-pad">{{ i18n "index_blog_allPosts" . }}</h2> + {{ partialCached "blog/li.html" . }} + </div> +{{ end }} diff --git a/layouts/blog/single.html b/layouts/blog/single.html index e0b3650..fcbe513 100644 --- a/layouts/blog/single.html +++ b/layouts/blog/single.html @@ -1,99 +1,62 @@ -{{ partial "header.html" . }} - -<body> - - <div class="section" id="top"> - <!-- Parent section --> - - <div class="container hero {{ if .Site.Params.fadeIn | default true }}fade-in one{{ end }}"> - <!-- Begin Title --> - <h1 class="bold-title is-1">{{ .Site.Params.blogHead | default "Blog" }}</h1> +{{ define "title" }} +{{ with .Site.GetPage "/blog" }} + <h1 class="bold-title is-1">{{ .Title }}</h1> +{{ end }} +{{ end }} + +{{ define "main" }} + <div class="container"> + <h2 class="title is-1 top-pad strong-post-title"> + <a href="{{ .Permalink }}">{{ .Title }}</a> + </h2> + <div class="post-data"> + {{ .Date.Format (.Site.Params.dateFormat | default "Jan 02, 2006") }} | + {{ i18n "blog_readingTime" .ReadingTime }} </div> - <!-- End Title --> - - <!-- Everything below fades in two! --> - <div class="section {{ if .Site.Params.fadeIn | default true }}fade-in two{{ end }}"> - - <div class="container"> - <!-- Begin Nav bar --> - {{ partial "nav-single.html" . }} - </div> - <!-- End Nav bar --> - - <div class="container {{ if .Site.Params.fadeIn | default true }}fade-in two{{ end }}"> - <!-- Begin blog title container --> - <h2 class="title is-1 top-pad strong-post-title"> - <a href="{{ .Permalink }}">{{ .Title }}</a> - </h2> - <div class="post-data"> - {{ .Date.Format (.Site.Params.dateForm | default "Jan 02, 2006") }} | {{ if eq 1 .ReadingTime }}{{ .ReadingTime }} minute - read{{ else }}{{ .ReadingTime }} minutes read{{ end }} - </div> - - {{ if .Site.Params.shareButtons }} - <div class="blog-share"> - Share this: {{ if .Site.Params.shareTwitter }} - <a class="twitter-share-button" href="https://twitter.com/intent/tweet?text=Read%20{{ .Title }}%20{{ .Permalink }}" onclick="window.open(this.href, 'twitter-share', 'width=550,height=235');return false;"> - <i class="fa fa-twitter"></i> - <span class="hidden">Twitter</span> - </a> - {{ end }} {{ if .Site.Params.shareFacebook }} - <a class="icon-facebook" href="https://www.facebook.com/sharer/sharer.php?u={{ .Permalink }}" onclick="window.open(this.href, 'facebook-share','width=580,height=296');return false;"> - <i class="fa fa-facebook"></i> - <span class="hidden">Facebook</span> - </a> - {{ end }} {{ if .Site.Params.sharePinterest }} - <a class="icon-pinterest" href="http://pinterest.com/pin/create/button/?url={{ .Permalink }}{{ if .Params.pinterestMedia }}&media={{ .Site.BaseURL }}{{ .Params.pinterestMedia }}{{ end }}&description={{ .Title | safeHTML}}" - onclick="window.open(this.href, 'pinterest-share','width=580,height=296');return false;"> - <i class="fa fa-pinterest"></i> - <span class="hidden">Pinterest</span> - </a> - {{ end }} {{ if .Site.Params.shareGooglePlus }} - <a class="icon-google-plus" href="https://plus.google.com/share?url={{ .Permalink }}" onclick="window.open(this.href, 'google-plus-share', 'width=490,height=530');return false;"> - <i class="fa fa-google-plus"></i> - <span class="hidden">Google+</span> - </a> - {{ end }} - </div> - {{ end }} - - </div> - <!-- End blog title container --> - - <div class="container markdown {{ if .Site.Params.fadeIn | default true }}fade-in two{{ end }} top-pad"> - <!-- Begin blog post content --> - {{ .Content }} - </div> - <!-- End blog post content --> - - <div class="disqus"> - {{ template "_internal/disqus.html" . }} - </div> - - <div class="container has-text-centered top-pad"> - <hr> - <a href="{{ .Permalink }}#top"> - <i class="fa fa-arrow-up"></i> - </a> - <hr> - </div> - - {{ partial "footer.html" . }} + {{ if or .Site.Params.share.twitter .Site.Params.share.facebook .Site.Params.share.pinterest .Site.Params.share.googlePlus }} + <div class="blog-share"> + {{ i18n "blog_shareThis" . }}: + {{ if .Site.Params.share.twitter }} + <a class="twitter-share-button" href="https://twitter.com/intent/tweet?text=Read%20{{ .Title }}%20{{ .Permalink }}" onclick="window.open(this.href, 'twitter-share', 'width=550,height=235');return false;"> + <i class="fab fa-twitter"></i> + <span class="hidden">Twitter</span> + </a> + {{ end }} + {{ if .Site.Params.share.facebook }} + <a class="icon-facebook" href="https://www.facebook.com/sharer/sharer.php?u={{ .Permalink }}" onclick="window.open(this.href, 'facebook-share','width=580,height=296');return false;"> + <i class="fab fa-facebook-f"></i> + <span class="hidden">Facebook</span> + </a> + {{ end }} + {{ if .Site.Params.share.pinterest }} + <a class="icon-pinterest" href="http://pinterest.com/pin/create/button/?url={{ .Permalink }}{{ if .Params.pinterestMedia }}&media={{ .Site.BaseURL }}{{ .Params.pinterestMedia }}{{ end }}&description={{ .Title | safeHTML}}" onclick="window.open(this.href, 'pinterest-share','width=580,height=296');return false;"> + <i class="fab fa-pinterest-p"></i> + <span class="hidden">Pinterest</span> + </a> + {{ end }} + {{ if .Site.Params.share.googlePlus }} + <a class="icon-google-plus" href="https://plus.google.com/share?url={{ .Permalink }}" onclick="window.open(this.href, 'google-plus-share', 'width=490,height=530');return false;"> + <i class="fab fa-google-plus-g"></i> + <span class="hidden">Google+</span> + </a> + {{ end }} </div> - <!-- End fade in two --> + {{ end }} + {{ if .Params.tags }} + <p> + Tag{{ if gt (len .Params.tags) 1 }}s{{ end }}: + {{ range $index, $tag := .Params.tags }} + {{ if gt $index 0 }}, {{ end }}<a href="{{ "/tags/" | absLangURL }}{{ . | urlize }}">{{ . }}</a> + {{ end }} + </p> + {{ end }} </div> - <!-- End parent section --> - - <!-- Bitty scrolling links script --> - <script> - $('a[href^="{{ .Permalink }}#"]').click(function (e) { - e.preventDefault(); - var target = this.hash; - $('html, body').animate({ - scrollTop: $(target).offset().top - }, 500); - return false; - }) - </script> - -</body>
\ No newline at end of file + <!-- Begin blog post content --> + <div class="container markdown top-pad"> + {{ .Content }} + </div> + <!-- End blog post content --> + <div class="disqus"> + {{ template "_internal/disqus.html" . }} + </div> +{{ end }} diff --git a/layouts/index.html b/layouts/index.html index 5bb5693..6bb259f 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,147 +1,120 @@ -{{ partial "header.html" . }} -<body> - -<div id="top"> <!-- Where all the awesome begins --> - -<div class="hero is-{{ .Site.Params.introHeight | default "fullheight" }}"> -<!-- Possible hero-head not used --> - <!-- Super sweet Hero body title --> - <div class="hero-body"> - <div class="container has-text-centered"> - <!-- Title and tagline --> - <h1 class="bold-title {{ if .Site.Params.fadeIn | default true }}fade-in one{{ end }}"> - Hi, I'm {{ .Site.Params.firstName | default "Introduction" }}. - </h1> - <h3 class="subtitle is-3 {{ if .Site.Params.fadeIn | default true }}fade-in two{{ end }}"> - {{ .Site.Params.tagLine }} - </h3> - <!-- End title and tagline --> - <!-- Some social icons --> - <div class=" {{ if .Site.Params.fadeIn | default true }}fade-in three{{ end }}"> - {{ partial "social.html" . }} - </div> - <!-- End top social icons --> - </div> - </div> <!-- Hero body title end --> - <!-- Hero foot has nav bar --> - <div class="hero-foot {{ if .Site.Params.fadeIn | default true }}fade-in three{{ end }}"> - <hr> - <nav class="nav-center"> - {{ if (.Site.GetPage "page" "about") }} - <a class="nav-item" href="#about">About</a> - {{ end }} - {{ if .Site.Params.showProjects }} - <a class="nav-item" href="#projects">Projects</a> - {{ end }} - {{ if .Site.Params.showBlog }} - <a class="nav-item" href="#blog">Blog</a> - {{ end }} - {{ if (.Site.GetPage "page" "contact") }} - <a class="nav-item" href="#contact">Contact</a> - {{ end }} - </nav> - <hr> - </div><!-- Done with nav bar --> -</div><!-- Done with Hero --> - -<!-- Everything below fades in three! --> -<div class="section no-padding {{ if .Site.Params.fadeIn | default true }}fade-in three{{ end }}"> - -<!-- Tell them all about it! --> -{{ if (.Site.GetPage "page" "about") }} -<div class="section" id="about"> - <div class="container"> - <h2 class="title is-2 has-text-centered">About</h2> - - <div class="columns"><!-- Avatar and about.md side by side except mobile --> - {{ if .Site.Params.avatar }} - <div class="column is-one-third has-text-centered"> - <img class="img-responsive avatar" src="{{ .Site.Params.avatar | relURL }}" alt="My profile picture."> +<!DOCTYPE html> +<html lang="{{ .Site.LanguageCode }}"> + <head> + {{ partial "head/metadata.html" . }} + {{ partial "head/openGraph.html" . }} + {{ partial "head/favicons.html" . }} + {{ partial "head/css.html" . }} + {{ partial "css/owlCarousel.html" . }} + </head> + <body> + <section id="top" class="section"> + {{ with .Site.GetPage "/home" }} + <div class="hero is-{{ .Site.Params.home.introHeight | default "large" }}"> + <!-- Super sweet Hero body title --> + <div class="hero-body"> + <div class="container has-text-centered"> + <!-- Title and tagline --> + <h1 class="bold-title {{ if .Site.Params.fadeIn | default true }}fade-in one{{ end }}"> + {{ .Title }} + </h1> + <div class="subtitle is-3 {{ if .Site.Params.fadeIn | default true }}fade-in two{{ end }}"> + {{ .Content }} + </div> + <!-- End title and tagline --> + <!-- Some social icons --> + <div class=" {{ if .Site.Params.fadeIn | default true }}fade-in three{{ end }}"> + {{ partial "home/social.html" . }} + </div> + <!-- End top social icons --> + </div> + </div> + <!-- Hero body title end --> </div> {{ end }} - <div class="column markdown"> - {{ (.Site.GetPage "page" "about").Content }} - </div> - </div> - </div><!-- End About container--> - -<div class="container has-text-centered top-pad"><a href="#top"><i class="fa fa-arrow-up"></i></a></div> -</div><!-- End About section --> - -<div class="container"><hr></div> -{{ end }} - -<!-- Now for some cool projects --> - {{ if .Site.Params.showProjects }} - <div class="section" id="projects"> - {{ partial "projects.html" . }} - </div><!-- End Projects section --> - - <div class="container"><hr></div> - {{ end }} - -<!-- Let's show some blog posts --> - {{ if .Site.Params.showBlog }} - <div class="section" id="blog"> - {{ partial "blogsection.html" . }} - </div><!-- End Blog section --> - - <div class="container"><hr></div> - {{ end }} - -<!-- Let's chat, shall we? --> -{{ if (.Site.GetPage "page" "contact") }} -<div class="section" id="contact"> - <div class="container has-text-centered"> - <h2 class="title is-2">Contact</h2> - <div class="markdown"> - {{ (.Site.GetPage "page" "contact").Content }} - </div> - - {{ if .Site.Params.localTime }} - <p>My current local time is <span id="time"></span>.</p> - <script type="text/javascript" src="{{ "/js/moment.js" | relURL }}"></script> - <script type="text/javascript" src="{{ "/js/moment-timezone.js" | relURL }}"></script> - <script type="text/javascript" src="{{ "/js/moment-timezone-with-data-2012-2022.js" | relURL }}"></script> - - <script> - $(document).ready(function() { - var time = moment().tz("{{ .Site.Params.timeZone }}").format("h:mm A"); - $('#time').html(time); - }) - </script> - {{ end }} - - {{ if .Site.Params.email }} - <h3 class="subtitle is-3 has-text-centered top-pad"><a href="mailto:{{ .Site.Params.email }}">{{ .Site.Params.email }}</a></h3> + <!-- Done with Hero --> + <div class="{{ if .Site.Params.fadeIn | default true }}fade-in three{{ end }}"> + <!-- Tell them all about it! --> + {{ partial "nav.html" . }} + + {{ with .Site.GetPage "/home" }} + {{ $home := . }} + {{ range sort (.Resources.ByType "page") "Params.weight" }} + {{ if ne .Name "contact.md" }} + <!-- Range through all sections in /home execept contact.md --> + <div class="section" id="{{ .File.TranslationBaseName }}"> + <div class="container"> + <h2 class="title is-2 has-text-centered">{{ .Title }}</h2> + {{ if .Params.Image }} + <div class="columns"> + <div class="column is-one-third has-text-centered"> + {{ with $home.Resources.GetMatch .Params.Image }} + {{ with .Resize "320x" }} + <img class="img-responsive avatar" src="{{ .Permalink }}" alt="{{ .Name }}"> + {{ end }} + {{ end }} + </div> + <div class="markdown column"> + {{ .Content }} + </div> + </div> + {{ else }} + <div class="markdown has-text-centered"> + {{ .Content }} + </div> + {{ end }} + </div> + <!-- End About container--> + {{ partial "top-icon.html" . }} + </div> + <div class="container"><hr></div> + {{ end }} + {{ end }} + <!-- Now for some cool projects --> + {{ partial "home/projects.html" . }} + <!-- Let`s show some blog posts --> + {{ partial "home/blog.html" . }} + <!-- Let`s chat, shall we? --> + {{ with .Resources.GetMatch "contact.md" }} + <div class="section" id="{{ .File.TranslationBaseName }}"> + <div class="container has-text-centered"> + <h2 class="title is-2">{{ .Title }}</h2> + <div class="markdown"> + {{ .Content }} + </div> + {{ if .Site.Params.home.localTime }} + <p>{{ i18n "index_currentTime" . }} <span id="time"></span>.</p> + {{ end }} + {{ with .Site.Params.email }} + <h3 class="subtitle is-3 has-text-centered top-pad"> + <a href="mailto:{{ . }}">{{ . }}</a> + </h3> + {{ end }} + {{ partial "home/social.html" . }} + </div> + <!-- End Contact container --> + {{ partial "top-icon.html" . }} + </div> + <div class="container"><hr></div> + {{ end }} + <!-- End Contact section --> + {{ end }} + + {{ partial "footer/text.html" . }} + </div> + </section> + <!-- End of fade in three section --> + {{ partial "footer/scripts.html" . }} + {{ partial "js/owlCarousel.html" . }} + + {{ if .Site.Params.home.localTime }} + {{ $momentjs := resources.Get "/vendor/momentjs/moment.min.js" }} + {{ $momentTimezone := resources.Get "/vendor/momentjs/moment-timezone.min.js" }} + {{ $momentTimezoneWithData := resources.Get "/vendor/momentjs/moment-timezone-with-data-2012-2022.min.js" }} + {{ $initMomentjs := resources.Get "/js/initMoment.js" | resources.ExecuteAsTemplate "js/initMoment.tmp.js" . }} + {{ $bundleMoment := slice $momentjs $momentTimezone $momentTimezoneWithData $initMomentjs | resources.Concat "/js/bundleMoment.js" | fingerprint }} + <script src="{{ $bundleMoment.Permalink }}" integrity="{{ $bundleMoment.Data.Integrity }}"></script> {{ end }} - - {{ partial "social.html" . }} - </div><!-- End Contact container --> - - <div class="container has-text-centered top-pad"><a href="#top"><i class="fa fa-arrow-up"></i></a></div> -</div><!-- End Contact section --> - -<div class="container"><hr></div> -{{ end }} - -<!-- Nice clean finish --> -{{ partial "footer.html" . }} -<!-- Footer done! --> -</div><!-- End of fade in three section --> -<!-- Where all the awesome ends. Aww. --> - -<!-- Bitty scrolling links script --> -<script> -$('a[href^="#"]').click(function(e) { - e.preventDefault(); - var target = this.hash; - $('html, body').animate({ - scrollTop: $(target).offset().top - }, 500); - return false; -}) -</script> - -</body> + </body> +</html> diff --git a/layouts/partials/blog/li.html b/layouts/partials/blog/li.html new file mode 100644 index 0000000..1f13118 --- /dev/null +++ b/layouts/partials/blog/li.html @@ -0,0 +1,5 @@ +{{ range .Pages.ByPublishDate.Reverse }} + <li class="post-item"> + <span><a href="{{ .Permalink }}">{{ .Title }}</a></span> - <span>{{ .Date.Format (.Site.Params.dateFormat | default "Jan 02, 2006") }}</span> + </li> +{{ end }} diff --git a/layouts/partials/blogsection.html b/layouts/partials/blogsection.html deleted file mode 100644 index bc10f7b..0000000 --- a/layouts/partials/blogsection.html +++ /dev/null @@ -1,33 +0,0 @@ -<div class="container"><!-- Begin Blog container --> - -{{ if .Site.Params.showLatest }} -<h2 class="title is-2 has-text-centered">Latest Post</h2> - {{ range first 1 (where .Data.Pages.ByPublishDate.Reverse "Section" "blog") }} - <div class="summary">{{ .Date.Format (.Site.Params.dateForm | default "Jan 02, 2006") }} - <h3 class="title is-3 latest-post-title"><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3> - <div class="markdown"> - {{ .Summary }} - {{ if .Truncated }} - <a href="{{ .RelPermalink }}">...Read More</a> - {{ end }} - </div> - </div> - {{ end }} -{{ end }} - -{{ if .Site.Params.showAllPosts }} -<h2 class="title is-2 has-text-centered top-pad">All Posts</h2> - <ul> - {{ range .Data.Pages.ByPublishDate }} - {{ if eq .Section "blog" }} - {{ partial "li.html" . }} - {{ end }} - {{ end }} - </ul> -{{ else }} -<div class="container has-text-centered top-pad"><a href="{{ "/blog" | relURL }}">ALL BLOG POSTS</a></div> -{{ end }} - -</div><!-- End Blog container --> - -<div class="container has-text-centered top-pad"><a href="#top"><i class="fa fa-arrow-up"></i></a></div> diff --git a/layouts/partials/css/owlCarousel.html b/layouts/partials/css/owlCarousel.html new file mode 100644 index 0000000..d42e685 --- /dev/null +++ b/layouts/partials/css/owlCarousel.html @@ -0,0 +1,4 @@ +{{ $owlCarousel := resources.Get "vendor/owlCarousel/owl.carousel.min.css" }} +{{ $owlCarouselTheme := resources.Get "vendor/owlCarousel/owl.theme.default.min.css" }} +{{ $owlCarouselBundle := slice $owlCarousel $owlCarouselTheme | resources.Concat "/styles/owlCarousel.min.css" | fingerprint }} +<link rel="stylesheet" href="{{ $owlCarouselBundle.Permalink }}" integrity="{{ $owlCarouselBundle.Data.Integrity }}" media="screen"> diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 39e2446..0aed20f 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,7 +1,7 @@ <div class="section" id="footer"><!-- Begin Footer section --> <div class="container has-text-centered"><!-- Begin Footer container --> {{ if .Site.Params.footerText }} - {{ .Site.Params.footerText | markdownify }} + <span class="footer-text">{{ .Site.Params.footerText | markdownify }}</span> {{ else }} <span class="footer-text"><a href="https://github.com/vickylai/hugo-theme-introduction" target="_blank" rel="noopener">Introduction</a> theme for <a href="http://gohugo.io/" target="_blank" rel="noopener">Hugo</a>. Made with <a href="https://vickylai.com" target="_blank" rel="noopener"><i class="fa fa-heart"></i> and <i class="fa fa-coffee"></i></a> by open source contributors.</span> {{ end }} diff --git a/layouts/partials/footer/scripts.html b/layouts/partials/footer/scripts.html new file mode 100644 index 0000000..77fa926 --- /dev/null +++ b/layouts/partials/footer/scripts.html @@ -0,0 +1,6 @@ +{{ $jQuery := resources.Get "/vendor/jquery/jquery-3.3.1.min.js" }} +{{ $index := resources.Get "/js/index.js" | minify }} +{{ $scripts := slice $jQuery $index | resources.Concat "/js/bundle.js" | fingerprint }} +<script src="{{ $scripts.Permalink }}" integrity="{{ $scripts.Data.Integrity }}"></script> + +{{ template "_internal/google_analytics_async.html" . }} diff --git a/layouts/partials/footer/text.html b/layouts/partials/footer/text.html new file mode 100644 index 0000000..c356329 --- /dev/null +++ b/layouts/partials/footer/text.html @@ -0,0 +1,11 @@ +<div class="section" id="footer"> + <div class="container has-text-centered"> + {{ with .Site.Params.footerText }} + {{ . | markdownify }} + {{ else }} + <span class="footer-text"> + {{ i18n "footer_text" . | markdownify }} + </span> + {{ end }} + </div> +</div> diff --git a/layouts/partials/head/css.html b/layouts/partials/head/css.html new file mode 100644 index 0000000..0b3f461 --- /dev/null +++ b/layouts/partials/head/css.html @@ -0,0 +1,18 @@ +{{ $bundleRaw := resources.Get "/sass/style.sass" | resources.ExecuteAsTemplate "/css/main.tmp.css" . }} + +{{ if .Site.IsServer }} +{{ $cssOpts := (dict "targetPath" "/css/main.css" "enableSourceMap" true ) }} +{{ $bundle := $bundleRaw | toCSS $cssOpts }} +<link rel="stylesheet" href="{{ $bundle.Permalink }}" media="screen"> +{{ else }} +{{ $cssOpts := (dict "targetPath" "/css/main.css" ) }} +{{ $postCSSOpts := (dict "use" "autoprefixer" ) }} +{{ $bundle := $bundleRaw | toCSS $cssOpts | postCSS $postCSSOpts | minify | fingerprint }} +<link rel="stylesheet" href="{{ $bundle.Permalink }}" integrity="{{ $bundle.Data.Integrity }}" media="screen"> +{{ end }} + +<!-- Custom css --> +{{ range .Site.Params.customCSS -}} + {{ $style := resources.Get . }} + <link rel="stylesheet" href="{{ $style.Permalink }}" integrity="{{ $style.Data.Integrity }}" media="screen"> +{{- end }} diff --git a/layouts/partials/head/favicons.html b/layouts/partials/head/favicons.html new file mode 100644 index 0000000..2e77ade --- /dev/null +++ b/layouts/partials/head/favicons.html @@ -0,0 +1,3 @@ +{{ with .Site.Params.favicon }} +<link rel="shortcut icon" href="{{ . | absURL }}"> +{{ end }} diff --git a/layouts/partials/head/metadata.html b/layouts/partials/head/metadata.html new file mode 100644 index 0000000..7e8c3a0 --- /dev/null +++ b/layouts/partials/head/metadata.html @@ -0,0 +1,14 @@ +<meta charset="utf-8"> +<meta http-equiv="X-UA-Compatible" content="chrome=1"> +<meta name="HandheldFriendly" content="True"> +<meta name="MobileOptimized" content="320"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> +<meta name="referrer" content="no-referrer"> +{{ if .Site.Params.description }}<meta name="description" content="{{ .Site.Params.description }}">{{ end }} +<title> +{{ .Title }}{{ if ne .Title .Site.Title }} - {{ .Site.Title }}{{ end }} +</title> +<!-- RSS --> +{{ if .RSSLink }} + <link href="{{ .RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" /> +{{ end }} diff --git a/layouts/partials/head/openGraph.html b/layouts/partials/head/openGraph.html new file mode 100644 index 0000000..d613451 --- /dev/null +++ b/layouts/partials/head/openGraph.html @@ -0,0 +1,17 @@ +<meta property="og:title" content="{{ .Title }}{{ if ne .Title .Site.Title }} - {{ .Site.Title }}{{ end }}" /> +<meta property="og:type" content="website" /> +<meta property="og:description" content="{{ if .Description }}{{ .Description }}{{ else }}{{ .Site.Params.description }}{{ end }}"/> +<meta property="og:url" content="{{ .Permalink }}"/> +<meta property="og:site_name" content="{{ .Site.Title }}"/> + +{{ with .Resources.ByType "image" }} +{{ range first 5 (sort . "Params.weight") }} +<meta property="og:image" content="{{ .Permalink }}"/> +{{ end }} +{{ else }} +{{ with .Site.GetPage "page" "/home" }} +{{ range first 5 (.Resources.ByType "image") }} +<meta property="og:image" content="{{ .Permalink }}"/> +{{ end }} +{{ end }} +{{ end }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html deleted file mode 100644 index 82ff72b..0000000 --- a/layouts/partials/header.html +++ /dev/null @@ -1,64 +0,0 @@ -<!DOCTYPE html> -<html lang="{{ .Site.LanguageCode }}"> - -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="chrome=1"> -<meta name="HandheldFriendly" content="True"> -<meta name="MobileOptimized" content="320"> -<meta name="viewport" content="width=device-width, initial-scale=1.0"> -<meta name="referrer" content="no-referrer"> -{{ if .Site.Params.description }}<meta name="description" content="{{ .Site.Params.description }}">{{ end }} - -<title> -{{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }} -{{ if eq $url "/" }} - {{ .Site.Title }} -{{ else }} - {{ if .Params.heading }} {{ .Params.heading }} {{ else }} {{ .Title }} {{ end }} -{{ end }} -</title> -<link rel="canonical" href="{{ .Permalink }}"> - -<!-- HTTPS --> - -{{ if .Site.Params.enforce_ssl }} -<script type="text/javascript"> - var baseURL = '{{ .Site.BaseURL }}'; - var host = baseURL.substring(0, baseURL.length - 1).replace(/\//g, ''); - if ((host === window.location.host) && (window.location.protocol !== 'https:')) { - window.location.protocol = 'https:'; - } -</script> -{{ end }} - -<!-- jQuery --> -<script type="text/javascript" src="{{ "/js/jquery-3.3.1.min.js" | relURL }}"></script> - -<!-- Fonts and icon CSS --> -<link rel="stylesheet" href="{{ "/css/font-awesome.min.css" | relURL }}"> -<link rel="stylesheet" href="{{ "/css/nunito_sans.css" | relURL }}"> - -{{ if .Site.Params.cacheBuster }} - <link rel="stylesheet" href="{{ (printf "css/%s-style.css?t=%d" (.Site.Params.themeStyle | default "dark") now.Unix) |relURL }}"> -{{ else }} - <link rel="stylesheet" href="{{ (printf "css/%s-style.css" .Site.Params.themeStyle | default "dark") | relURL }}"> -{{ end }} - -<!-- Custom css --> -{{ range .Site.Params.customCSS -}} - <link rel="stylesheet" href="{{ . | relURL }}"> -{{- end }} - -<!-- Icon --> -<link rel="shortcut icon" href="{{ .Site.Params.faviconFile | default "img/favicon.ico" | relURL }}"> - -<!-- Google Analytics --> -{{ template "_internal/google_analytics_async.html" . }} - -<!-- RSS --> -{{ if .RSSLink }} - <link href="{{ .RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" /> -{{ end }} - -</head> diff --git a/layouts/partials/home/blog.html b/layouts/partials/home/blog.html new file mode 100644 index 0000000..d79eab9 --- /dev/null +++ b/layouts/partials/home/blog.html @@ -0,0 +1,37 @@ +{{ with .Site.GetPage "/blog" }} +<div class="section" id="{{ .Title | urlize }}"> + <!-- Begin Blog container --> + <div class="container"> + {{ if .Site.Params.home.showLatest | default true }} + <h2 class="title is-2 has-text-centered">{{ i18n "index_blog_latestPosts" . }}</h2> + {{ range first 1 .Pages.ByPublishDate.Reverse }} + <div class="summary">{{ .Date.Format (.Site.Params.dateFormat | default "Jan 02, 2006") }} + <h3 class="title is-3 latest-post-title"><a href="{{ .Permalink }}">{{ .Title }}</a></h3> + <div class="markdown"> + {{ .Summary }} + {{ if .Truncated }} + <a href="{{ .Permalink }}">{{ i18n "index_blog_readMore" . }}</a> + {{ end }} + </div> + </div> + {{ end }} + {{ end }} + {{ if .Site.Params.home.showAllPosts }} + </div> +</div> +<div class="section" id="all-posts"> + <div class="container"> + <h2 class="title is-2 has-text-centered top-pad">{{ i18n "index_blog_allPosts" . }}</h2> + {{ partialCached "blog/li.html" . }} + {{ else }} + <div class="container has-text-centered top-pad"> + <a href="{{ .Permalink }}">{{ i18n "index_blog_allPosts" . }}</a> + </div> + {{ end }} + </div> + <!-- End Blog container --> + {{ partial "top-icon.html" . }} +</div> +<!-- End Blog section --> +<div class="container"><hr></div> +{{ end }} diff --git a/layouts/partials/home/projects.html b/layouts/partials/home/projects.html new file mode 100644 index 0000000..324573f --- /dev/null +++ b/layouts/partials/home/projects.html @@ -0,0 +1,98 @@ +{{ with .Site.GetPage "/projects" }} +<div class="section" id="{{ .Title | urlize }}"> + <!-- Begin Projects container --> + <div class="container"> + <h2 class="title is-2 has-text-centered"> + {{ .Title }} + </h2> + <div class="section"> + <div class="columns is-multiline"> + {{ $totalProjects := (len .Pages) }} + {{ $numberOfProjectsToShow := .Site.Params.home.numberOfProjectsToShow | default $totalProjects }} + {{ range $index, $element := .Pages.ByWeight | first $numberOfProjectsToShow }} + {{ if .Site.Params.projects.useTwoColumns }} + {{ .Scratch.Set "width" "490x" }} + <div class="column is-half"> + {{ else }} + {{ .Scratch.Set "width" "302x" }} + <div class="column is-one-third"> + {{ end }} + <div class="card" data-target="#project-{{ $index }}"> + <div class="card-image"> + <figure class="image is-3by2"> + <a {{ if .Params.external_link }} href="{{ .Params.external_link }}" {{ end }}> + {{ $width := ( .Scratch.Get "width" ) }} + {{ with .Resources.ByType "image" }} + {{ range first 1 (sort . "Params.weight") }} + {{ $image := .Resize $width }} + <img src="{{ $image.Permalink }}" alt ="{{ $image.Name }}"> + {{ end }} + {{ end }} + </a> + </figure> + </div> + <div class="card-content has-text-centered top-pad"> + <a {{ if .Params.external_link }} href="{{ .Params.external_link }}" {{ end }}> + {{ .Params.external_link }} + {{ .Title }} + </a> + </div> + </div> + </div> + {{ end }} + </div> + </div> + {{ if lt $numberOfProjectsToShow $totalProjects }} + <div class="container has-text-centered top-pad"> + <a href="{{ .Permalink }}">{{ i18n "index_projects_allProjects" . }}</a> + </div> + {{ end }} + </div> + <!-- End Projects container --> + <!-- Projects modals --> + {{ range $index, $element := .Pages.ByWeight | first $numberOfProjectsToShow }} + {{ if not .Params.external_link }} + <div class="modal" id="project-{{ $index }}"> + <div class="modal-background"></div> + <div class="modal-card"> + {{ with .Title }} + <header class="modal-card-header bottom-pad"> + <p class="modal-card-title has-text-centered">{{ . }}</p> + </header> + {{ end }} + + {{ with .Resources.ByType "image" }} + {{ $moreThenOneImage := gt (len .) 1 }} + {{ if $moreThenOneImage }} + <div class="owl-carousel owl-theme"> + {{ end }} + {{ range sort . "Params.weight" }} + {{ $image := .Resize "640x" }} + {{ if $moreThenOneImage }} + <div class="item owl-height"> + {{ end }} + <img src="{{ $image.Permalink }}" class="img-responsive" alt="{{ $image.Name }}"> + {{ if $moreThenOneImage }} + </div> + {{ end }} + {{ end }} + {{ if $moreThenOneImage }} + </div> + {{ end }} + {{ end }} + + {{ with .Content }} + <section class="modal-card-body markdown"> + {{ . }} + </section> + {{ end }} + </div> + <button class="modal-close is-large" aria-label="close" data-target="#project-{{ $index }}"></button> + </div> + {{ end }} + {{ end }} + {{ partial "top-icon.html" . }} +</div> +<!-- End Projects section --> +<div class="container"><hr></div> +{{ end }} diff --git a/layouts/partials/social.html b/layouts/partials/home/social.html index 6092ab1..54a846c 100644 --- a/layouts/partials/social.html +++ b/layouts/partials/home/social.html @@ -1,7 +1,7 @@ <div class="social-icons"> {{ range .Site.Params.social }} <a href="{{ .url }}"> - <i class="fa fa-{{ .icon}}"></i> + <i class="fab fa-{{ .icon}}"></i> </a> {{ end }} -</div>
\ No newline at end of file +</div> diff --git a/layouts/partials/js/owlCarousel.html b/layouts/partials/js/owlCarousel.html new file mode 100644 index 0000000..5ffb506 --- /dev/null +++ b/layouts/partials/js/owlCarousel.html @@ -0,0 +1,4 @@ +{{ $owlCarousel := resources.Get "/vendor/owlCarousel/owl.carousel.min.js" }} +{{ $initOwlCarousel := resources.Get "/js/initOwlCarousel.js" | minify }} +{{ $bundleOwlCarousel := slice $owlCarousel $initOwlCarousel | resources.Concat "/js/bundleOwlCarousel.js" | fingerprint }} +<script src="{{ $bundleOwlCarousel.Permalink }}" integrity="{{ $bundleOwlCarousel.Data.Integrity }}"></script> diff --git a/layouts/partials/li.html b/layouts/partials/li.html deleted file mode 100644 index 1e26736..0000000 --- a/layouts/partials/li.html +++ /dev/null @@ -1,3 +0,0 @@ -<li class="post-item"> - <span><a href="{{ .Permalink }}">{{ .Title }}</a></span> - <span>{{ .Date.Format (.Site.Params.dateform | default "Jan 02, 2006") }}</span> -</li> diff --git a/layouts/partials/nav-list.html b/layouts/partials/nav-list.html deleted file mode 100644 index dc00b6c..0000000 --- a/layouts/partials/nav-list.html +++ /dev/null @@ -1,39 +0,0 @@ -<hr> -<nav class="nav nav-center"> - <span id="nav-toggle" class="nav-toggle" onclick="document.getElementById('nav-menu').classList.toggle('is-active');"> - <span></span> - <span></span> - <span></span> - </span> - <div id="nav-menu" class="nav-left nav-menu"> - <span class="nav-item"> - <a href="{{ "/" | relURL }}">Main</a> - </span> - {{ if (.Site.GetPage "page" "about") }} - <span class="nav-item"> - <a href="{{ "/about" | relURL }}">About</a> - </span> - {{ end }} - {{ if and (.Site.Params.showProjects) (ne .Page.Section "projects") }} - <span class="nav-item"> - <a href="{{ "/projects" | relURL }}">Projects</a> - </span> - {{ end }} - {{ if and (.Site.Params.showBlog) (ne .Page.Section "blog") }} - <span class="nav-item"> - <a href="{{ "/blog" | relURL }}">Blog</a> - </span> - {{ end }} - {{ if (.Site.GetPage "page" "contact") }} - <span class="nav-item"> - <a href="{{ "/contact" | relURL }}">Contact</a> - </span> - {{ end }} - {{ if .Site.RSSLink }} - <span class="nav-item"> - <a href="{{ .Site.RSSLink }}"><i class="fa fa-rss"></i></a> - </span> - {{ end }} - </div> -</nav> -<hr> diff --git a/layouts/partials/nav-single.html b/layouts/partials/nav-single.html deleted file mode 100644 index 9775c03..0000000 --- a/layouts/partials/nav-single.html +++ /dev/null @@ -1,47 +0,0 @@ -<hr> -<nav class="nav nav-center"> - <span id="nav-toggle" class="nav-toggle" onclick="document.getElementById('nav-menu').classList.toggle('is-active');"> - <span></span> - <span></span> - <span></span> - </span> - <div id="nav-menu" class="nav-left nav-menu"> - <span class="nav-item"> - <a href="{{ "/" | relURL }}">Main</a> - </span> - {{ if (.Site.GetPage "page" "about") }} - <span class="nav-item"> - <a href="{{ "/about" | relURL }}">About</a> - </span> - {{ end }} - {{ if .Site.Params.showProjects }} - <span class="nav-item"> - {{ if ne .Section "projects" }} - <a href="{{ "/projects" | relURL }}">Projects</a> - {{ else }} - <a href="{{ "/projects" | relURL }}">Back to Projects</a> - {{ end }} - </span> - {{ end }} - {{ if .Site.Params.showBlog }} - <span class="nav-item"> - {{ if ne .Section "blog" }} - <a href="{{ "/blog" | relURL }}">Blog</a> - {{ else }} - <a href="{{ "/blog" | relURL }}">Back to Blog</a> - {{ end }} - </span> - {{ end }} - {{ if (.Site.GetPage "page" "contact") }} - <span class="nav-item"> - <a href="{{ "/contact" | relURL }}">Contact</a> - </span> - {{ end }} - {{ if .Site.RSSLink }} - <span class="nav-item"> - <a href="{{ .Site.RSSLink }}"><i class="fa fa-rss"></i></a> - </span> - {{ end }} - </div> -</nav> -<hr> diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html new file mode 100644 index 0000000..e726190 --- /dev/null +++ b/layouts/partials/nav.html @@ -0,0 +1,109 @@ +<!-- Begin Nav bar --> +<div class="container"> + <hr> + <nav class="navbar" role="navigation" aria-label="main navigation"> + {{ $isHome := .Page.IsHome }} + <a role="button" class="navbar-burger" data-target="navMenu" aria-label="menu" aria-expanded="false" > + <span aria-hidden="true"></span> + <span aria-hidden="true"></span> + <span aria-hidden="true"></span> + </a> + <div class="navbar-menu" id="navMenu"> + <!-- look for custom menu and include it --> + {{ if .Site.Menus.main }} + {{ range .Site.Menus.main }} + {{ if .HasChildren }} + <a class="navbar-item" href="{{ .URL }}"> + {{ .Pre }} + {{ .Name }} + {{ .Post }} + </a> + {{ range .Children }} + <!-- TODO: style children diffrent then parents--> + <a class="navbar-item" href="{{ .URL }}"> + {{ .Pre }} + {{ .Name }} + {{ .Post }} + </a> + {{ end }} + {{ else }} + <a class="navbar-item" href="{{ .URL }}"> + {{ .Pre }} + {{ .Name }} + {{ .Post }} + </a> + {{ end }} + {{ end }} + {{ else }} + <!-- use default menu --> + {{ if not $isHome }} + <a class="navbar-item" href="{{ "/" | absLangURL }}">{{ i18n "nav_main" . }}</a> + {{ end }} + + {{ with .Site.GetPage "/home" }} + {{ range sort (.Resources.ByType "page") "Params.weight" }} + {{ if ne .Name "contact.md" }} + <a class="navbar-item" href="{{ if $isHome }}#{{ .File.TranslationBaseName }}{{ else }}{{ printf "/#%s" (.File.TranslationBaseName | urlize) | relLangURL }}{{ end }}">{{ .Title }}</a> + {{ end }} + {{ end }} + {{ end }} + + {{ $pageIsInProjects := eq .Page.Section "projects"}} + {{ if not (and $pageIsInProjects (eq .Page.Kind "section")) }} + {{ with .Site.GetPage "/projects" }} + {{ $totalProjects := (len .Pages) }} + {{ $numberOfProjectsToShow := .Site.Params.home.numberOfProjectsToShow | default $totalProjects }} + {{ if $isHome }} + <a class="navbar-item" href="{{ printf "#%s" (.Title | urlize) }}">{{ .Title }}</a> + {{ else if le $totalProjects $numberOfProjectsToShow }} + <a class="navbar-item" href="{{ printf "/#%s" (.Title | urlize) | relLangURL }}">{{ .Title }}</a> + {{ else }} + <a class="navbar-item" href="{{ .Permalink }}"> + {{ if $pageIsInProjects }} + {{ i18n "nav_backToSection" . }} + {{ else }} + {{ .Title }} + {{ end }} + </a> + {{ end }} + {{ end }} + {{ end }} + + {{ $pageIsInBlog := eq .Page.Section "blog"}} + {{ if not (and $pageIsInBlog (eq .Page.Kind "section")) }} + {{ with .Site.GetPage "/blog" }} + {{ if $isHome }} + <a class="navbar-item" href="{{ printf "#%s" (.Title | urlize) }}">{{ .Title }}</a> + {{ else }} + <a class="navbar-item" href="{{ .Permalink }}"> + {{ if $pageIsInBlog }} + Back to {{ .Title | singularize}} + {{ else }} + {{ .Title | singularize}} + {{ end }} + </a> + {{ end }} + {{ end }} + {{ end }} + + {{ with .Site.GetPage "/home" }} + {{ with .Resources.GetMatch "contact.md" }} + <a class="navbar-item" href="{{ if $isHome }}#{{ .File.TranslationBaseName }}{{ else }}{{ printf "/#%s" (.File.TranslationBaseName | urlize) | relLangURL }}{{ end }}">{{ .Title }}</a> + {{ end }} + {{ end }} + + {{ range $.Site.Home.AllTranslations.ByWeight }} + {{ if ne .Language.LanguageName $.Language.LanguageName }} + <a class="navbar-item" href="{{ .Permalink }}">{{ .Language.LanguageName }}</a> + {{ end }} + {{ end }} + + {{ if and .Site.Params.showRSSButton .Site.RSSLink }} + <a class="navbar-item" href="{{ .Site.RSSLink }}"><i class="fas fa-rss"></i></a> + {{ end }} + {{ end }} + </div> + </nav> + <hr> +</div> +<!-- End Nav bar --> diff --git a/layouts/partials/projects.html b/layouts/partials/projects.html deleted file mode 100644 index 4688f83..0000000 --- a/layouts/partials/projects.html +++ /dev/null @@ -1,75 +0,0 @@ -<div class="container"> - <!-- Begin Projects container --> - <h2 class="title is-2 has-text-centered">Projects</h2> - - <div class="section is-small"> - <div class="columns is-multiline"> - {{ $totalProjects := (len (.Site.GetPage "section" "projects").Pages) }} - {{ $numberOfProjectsToShow := .Site.Params.numberOfProjectsToShow | default $totalProjects }} - {{ range (.Site.GetPage "section" "projects").Pages | first $numberOfProjectsToShow }} - {{ if eq (mod $numberOfProjectsToShow 2) 0 }} - <div class="column is-half"> - {{ else }} - <div class="column is-one-third"> - {{ end }} - <div {{ if not .Params.external_link }} id="project{{ $card := .Title | urlize }}{{ replace $card "%" " "}}" {{ end }} - class="card"> - <div class="card-image"> - <figure class="image is-3by2"> - <a {{ if .Params.external_link }} href="{{ .Params.external_link }}" {{ end }}> - <img src="{{ if .Params.image }}{{ .Params.image | relURL }}{{ else }}{{ (.Site.Params.placeHolderimg | default "/img/workday.jpg") | relURL }}{{ end }}"> - </a> - </figure> - </div> - <div class="card-content has-text-centered top-pad"> - <a {{ if .Params.external_link }} href="{{ .Params.external_link }}" {{ end }}> - {{ .Title }} - </a> - </div> - </div> - </div> - {{ end }} - </div> - </div> - </div> - {{ if lt $numberOfProjectsToShow $totalProjects }} - <div class="container has-text-centered top-pad"> - <a href="{{ "/projects" | relURL }}">ALL PROJECTS</a> - </div> - {{ end }} - <!-- End Projects container --> - - <!-- Projects modals --> - {{ range (.Site.GetPage "section" "projects").Pages | first $numberOfProjectsToShow }} {{ if not .Params.external_link }} - <div class="modal" id="modal{{ $card := .Title | urlize }}{{ replace $card "%" " "}}"> - <div class="modal-background"></div> - <div class="modal-card"> - {{ with .Title }} - <header class="modal-card-header bottom-pad"> - <p class="modal-card-title has-text-centered">{{ . }}</p> - </header> - {{ end }} {{ if .Params.image }} - <img src="{{ .Params.image | relURL }}" class="img-responsive img-centered"> {{ end }} {{ if .Content }} - <section class="modal-card-body markdown"> - {{ .Content }} - </section> - {{ end }} - </div> - <button class="modal-close is-large" aria-label="close" id="close{{ $card := .Title | urlize }}{{ replace $card "%" ""}}"></button> - </div> - <script> - $('#project{{ $card := .Title | urlize }}{{ replace $card "%" ""}}').click(function () { - $('#modal{{ $card := .Title | urlize }}{{ replace $card "%" ""}}').addClass('is-active'); - }); - $('#close{{ $card := .Title | urlize }}{{ replace $card "%" ""}}').click(function () { - $('#modal{{ $card := .Title | urlize }}{{ replace $card "%" ""}}').removeClass('is-active'); - }); - </script> - {{ end }} {{ end }} - - - <div class="container has-text-centered top-pad"> - <a href="#top"> - <i class="fa fa-arrow-up"></i> - </a> - </div>
\ No newline at end of file diff --git a/layouts/partials/top-icon-with-hr.html b/layouts/partials/top-icon-with-hr.html new file mode 100644 index 0000000..4595a80 --- /dev/null +++ b/layouts/partials/top-icon-with-hr.html @@ -0,0 +1,7 @@ +<div class="container"> + <hr> +</div> +{{ partial "top-icon.html" . }} +<div class="container"> + <hr> +</div> diff --git a/layouts/partials/top-icon.html b/layouts/partials/top-icon.html new file mode 100644 index 0000000..015516f --- /dev/null +++ b/layouts/partials/top-icon.html @@ -0,0 +1,5 @@ +<div class="container has-text-centered top-pad"> + <a href="#top"> + <i class="fa fa-arrow-up"></i> + </a> +</div> diff --git a/layouts/projects/list.html b/layouts/projects/list.html index 6ab59a6..a4f6e1a 100644 --- a/layouts/projects/list.html +++ b/layouts/projects/list.html @@ -1,74 +1,42 @@ -{{ partial "header.html" . }} -<body> - -<div class="section" id="top"><!-- Parent section --> - <div class="container hero {{ if .Site.Params.fadeIn }} fade-in one {{ end }}"><!-- Begin Title --> - <h1 class="bold-title is-1">{{ .Title }}</h1> - </div><!-- End Title --> - - <!-- Everything below fades in two! --> - <div class="section no-padding {{ if .Site.Params.fadeIn }} fade-in two {{ end }}"> - - <div class="container"><!-- Begin Nav bar --> - {{ partial "nav-list.html" . }} - </div><!-- End Nav bar --> - - <div class="container markdown {{ if .Site.Params.fadeIn | default true }}fade-in two{{ end }} top-pad"> - <!-- "{{.Content}}" pulls from the markdown content of the corresponding _index.md --> - {{ .Content }} - </div> - <div class="container"> - <div class="section is-small"> - <div class="columns is-multiline"> - <!-- Ranges through content/projects/*.md --> - {{ range .Data.Pages }} - {{ if eq (mod (len (.Site.GetPage "section" "projects").Pages) 2) 0 }} - <div class="column is-half"> - {{ else }} - <div class="column is-one-third"> - {{ end }} - <div class="card"> - <div class="card-image"> - <figure class="image is-3by2"> - <a href="{{ if .Params.external_link }}{{ .Params.external_link }}{{ else }}{{.Permalink}}{{ end }}"> - <img src="{{ if .Params.image }}{{ .Params.image | relURL }}{{ else }}{{ (.Site.Params.placeHolderimg | default "/img/workday.jpg") | relURL }}{{ end }}"> - </a> - </figure> - </div> - <div class="card-content has-text-centered top-pad"> - <a href="{{ if .Params.external_link }}{{ .Params.external_link }}{{ else }}{{.Permalink}}{{ end }}"> - {{ .Title }} +{{ define "main" }} + <div class="container markdown top-pad"> + {{ .Content }} + </div> + <div class="container"> + <div class="section"> + <div class="columns is-multiline"> + {{ $numberOfPages := len .Pages}} + {{ range .Pages.ByWeight }} + {{ if .Site.Params.projects.useTwoColumns }} + {{ .Scratch.Set "width" "490x" }} + <div class="column is-half"> + {{ else }} + {{ .Scratch.Set "width" "302x" }} + <div class="column is-one-third"> + {{ end }} + <div class="card"> + <div class="card-image"> + <figure class="image is-3by2"> + <a href="{{ if .Params.external_link }}{{ .Params.external_link }}{{ else }}{{ .Permalink }}{{ end }}"> + {{ $width := ( .Scratch.Get "width" ) }} + {{ with .Resources.ByType "image" }} + {{ range first 1 (sort . "Params.weight") }} + {{ $image := .Resize $width }} + <img src="{{ $image.Permalink }}" alt ="{{ $image.Name }}"> + {{ end }} + {{ end }} </a> - </div> + </figure> + </div> + <div class="card-content has-text-centered top-pad"> + <a href="{{ if .Params.external_link }}{{ .Params.external_link }}{{ else }}{{ .Permalink }}{{ end }}"> + {{ .Title }} + </a> </div> </div> - {{ end }} </div> + {{ end }} </div> </div> - - <div class="container has-text-centered top-pad"> - <hr> - <a href="#top"> - <i class="fa fa-arrow-up"></i> - </a> - <hr> - </div> - - {{ partial "footer.html" . }} - </div><!-- End fade in two --> -</div><!-- End parent section --> - -<!-- Bitty scrolling links script --> -<script> - $('a[href^="{{ .Permalink }}#"]').click(function (e) { - e.preventDefault(); - var target = this.hash; - $('html, body').animate({ - scrollTop: $(target).offset().top - }, 500); - return false; - }) -</script> - -</body>
\ No newline at end of file + </div> +{{ end }} diff --git a/layouts/projects/single.html b/layouts/projects/single.html new file mode 100644 index 0000000..98176e8 --- /dev/null +++ b/layouts/projects/single.html @@ -0,0 +1,38 @@ +{{ define "main" }} + <div class="container markdown top-pad"> + {{ with .Resources.ByType "image" }} + <div class="has-text-centered"> + {{ $moreThanOneImage := gt (len .) 1 }} + {{ if $moreThanOneImage }} + <div class="owl-carousel owl-theme"> + {{ end }} + {{ range sort . "Params.weight" }} + {{ $image := .Resize "1000x" }} + {{ if $moreThanOneImage }} + <div class="item owl-height"> + {{ end }} + <img src="{{ $image.RelPermalink }}" class="img-responsive" alt="{{ $image.Name }}"> + {{ if $moreThanOneImage }} + </div> + {{ end }} + {{ end }} + {{ if $moreThanOneImage }} + </div> + {{ end }} + </div> + {{ end }} + {{ .Content }} + </div> + <!-- End post content --> + <div class="disqus"> + {{ template "_internal/disqus.html" . }} + </div> +{{ end }} + +{{ define "customCSS" }} +{{ partial "css/owlCarousel.html" . }} +{{ end }} + +{{ define "customScripts" }} +{{ partial "js/owlCarousel.html" . }} +{{ end }} |