Cleanup code

This commit is contained in:
Hanzei 2018-06-25 15:03:18 +02:00
parent 8afcd8365c
commit 8269d33fa2
No known key found for this signature in database
GPG key ID: 69A2DEFD98937BA0
18 changed files with 357 additions and 470 deletions

View file

@ -27,8 +27,6 @@ enforce_ssl = false
fadeIn = true # Turn on/off the fade-in effect
customCSS = [] # Include custom css files e.g. ["css/foo.css", "css/bar.css"]
showBlog = true # Show Blog section on home page
showProjects = true # Show Projects section on home page
projectColumns = "3" # Choose "2" or "3" columns for projects section
placeHolderimg = "/img/workday.jpg" # For Projects without image
showAllPosts = false # Set 'true' to list all posts on home page, or set 'false' to link to separate blog list page

View file

@ -0,0 +1,6 @@
---
title: "Blog"
date: 2017-03-09T13:19:25+08:00
---
Here is some introduction text for my blog

View file

@ -0,0 +1,6 @@
---
title: "Projects"
date: 2017-03-09T13:19:25+08:00
---
Here is some introduction text for my projects

View file

@ -1,21 +1,24 @@
{{ 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 }}">
{{ partial "nav.html" . }}
<!-- Begin blurb -->
<div class="container {{ if .Site.Params.fadeIn }} fade-in two {{ end }} top-pad">
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!
<!-- Parent section -->
<div class="section" id="top">
<!-- Begin Title -->
<div class="container hero is-medium has-text-centered {{ if .Site.Params.fadeIn }} fade-in one {{ end }}">
<h1 class="bold-title is-1">404</h1>
</div>
<!-- End blurb -->
<div class="container top-pad"><hr></div>
{{ partial "footer.html" . }}
</div><!-- End parent section -->
<!-- End Title -->
<!-- Everything below fades in two! -->
<div class="section {{ if .Site.Params.fadeIn }} fade-in two {{ end }}">
{{ partial "nav.html" . }}
<!-- Begin blurb -->
<div class="container {{ if .Site.Params.fadeIn }} fade-in two {{ end }} top-pad">
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>
</div>
{{ partial "footer.html" . }}
</div>
<!-- End parent section -->

View file

@ -1,29 +1,23 @@
{{ partial "header.html" . }}
<body>
<!-- Parent section -->
<div class="section" id="top">
<!-- Parent section -->
<!-- Begin Title -->
<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 }}">
{{ partial "nav.html" . }}
<article>
<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 }}
</article>
</div>
<!-- Begin Blog container -->
<div class="container">
<!-- Begin Blog container -->
<ul>
<!-- Ranges through content/post/*.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>
@ -32,31 +26,10 @@
</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 "top-icon-with-hr.html" . }}
{{ 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>

View file

@ -1,22 +1,17 @@
{{ partial "header.html" . }}
<body>
<!-- Parent section -->
<div class="section" id="top">
<!-- Parent section -->
<!-- Begin Title -->
<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 }}">
{{ partial "nav.html" . }}
<!-- Begin blog post content -->
<div class="container markdown {{ if .Site.Params.fadeIn }} fade-in two {{ end }} top-pad">
<!-- Begin blog post content -->
{{ if .Params.image }}
<div class="has-text-centered">
<img src="{{ .Params.image }}" class="img-responsive">
@ -25,35 +20,14 @@
{{ .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="#top">
<i class="fa fa-arrow-up"></i>
</a>
<hr>
</div>
{{ partial "top-icon-with-hr.html" . }}
{{ 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>

View file

@ -1,29 +1,22 @@
{{ partial "header.html" . }}
<body>
<!-- Parent section -->
<div class="section" id="top">
<!-- Parent section -->
<!-- Begin Title -->
<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 }}">
{{ partial "nav.html" . }}
<article>
<!-- "{{.Content}}" pulls from the markdown content of the corresponding _index.md -->
{{ .Content }}
</article>
<!-- Begin Blog container -->
<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>
@ -32,31 +25,10 @@
</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 "top-icon-with-hr.html" . }}
{{ 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>

View file

@ -1,57 +1,31 @@
{{ partial "header.html" . }}
<body>
<!-- Parent section -->
<div class="section" id="top">
<!-- Begin Title -->
<div class="container hero {{ if .Site.Params.fadeIn }} fade-in one {{ end }}">
<h1 class="bold-title is-1">{{ .Title }}</h1>
</div>
<!-- End Title -->
<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 }}">
{{ partial "nav.html" . }}
<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" . }}
<!-- Everything below fades in two! -->
<div class="section no-padding {{ if .Site.Params.fadeIn }} fade-in two {{ end }}">
{{ partial "nav.html" . }}
<article>
{{ .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>
<!-- 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>
{{ partial "top-icon-with-hr.html" . }}
{{ partial "footer.html" . }}
</div>
<!-- End fade in two -->
</div>
<!-- End parent section -->
</body>

View file

@ -1,65 +1,49 @@
{{ 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>
</div><!-- End Title -->
<!-- Parent section -->
<div class="section" id="top">
<!-- Begin Title -->
<div class="container hero {{ if .Site.Params.fadeIn | default true }}fade-in one{{ end }}">
<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 | default true }}fade-in two{{ end }}">
{{ partial "nav.html" . }}
<div class="container"><!-- Begin Blog 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>
{{ partial "nav.html" . }}
<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>
{{ end }}
{{ end }}
<h2 class="title is-2 top-pad">All Posts</h2>
<ul>
{{ range .Data.Pages.ByPublishDate }}
{{ if eq .Section "blog" }}
{{ partial "li.html" . }}
<!-- Begin Blog container -->
<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 }}
{{ 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></a>
<hr>
<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 -->
{{ partial "top-icon-with-hr.html" . }}
{{ partial "footer.html" . }}
</div>
<!-- End fade in two -->
</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>
<!-- End parent section -->
</body>

View file

@ -1,88 +1,69 @@
{{ 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>
</div><!-- End Title -->
<!-- Parent section -->
<div class="section" id="top">
<!-- Begin Title -->
<div class="container hero {{ if .Site.Params.fadeIn | default true }}fade-in one{{ end }}">
<h1 class="bold-title is-1">{{ .Site.Params.blogHead | default "Blog" }}</h1>
</div>
<!-- End Title -->
<!-- Everything below fades in two! -->
<div class="section {{ if .Site.Params.fadeIn | default true }}fade-in two{{ end }}">
{{ partial "nav.html" . }}
<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 }}&amp;media={{ .Site.BaseURL }}{{ .Params.pinterestMedia }}{{ end }}&amp;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 }}
{{ partial "nav.html" . }}
<!-- Begin blog title container -->
<div class="container {{ if .Site.Params.fadeIn | default true }}fade-in two{{ end }}">
<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>
{{ 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" . }}
{{ 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 }}&amp;media={{ .Site.BaseURL }}{{ .Params.pinterestMedia }}{{ end }}&amp;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 -->
<!-- Begin blog post content -->
<div class="container markdown {{ if .Site.Params.fadeIn | default true }}fade-in two{{ end }} top-pad">
{{ .Content }}
</div>
<!-- End blog post content -->
<div class="disqus">
{{ template "_internal/disqus.html" . }}
</div>
{{ partial "top-icon-with-hr.html" . }}
{{ partial "footer.html" . }}
</div>
<div class="container has-text-centered top-pad">
<hr>
<a href="{{ .Permalink }}#top"><i class="fa fa-arrow-up"></i></a>
<hr>
<!-- End fade in two -->
</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>
<!-- End parent section -->
</body>

View file

@ -35,61 +35,43 @@
<div class="section no-padding {{ if .Site.Params.fadeIn | default true }}fade-in three{{ end }}">
<!-- Tell them all about it! -->
{{ with .Site.GetPage "page" "about" }}
<div class="section" id="about">
<div class="container">
<h2 class="title is-2 has-text-centered">About</h2>
<h2 class="title is-2 has-text-centered">{{ .Title }}</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.">
<img class="img-responsive avatar" src="{{ .Site.Params.avatar | relURL }}" alt="My profile picture">
</div>
{{ end }}
<div class="column markdown">
{{ range .Data.Pages }}
{{if eq .Title "About" }}
{{.Content}}
{{end}}
{{ end }}
{{.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>
<!-- End About container-->
{{ partial "top-icon.html" . }}
</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 }}
{{ partial "projects.html" . }}
<!-- 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 }}
{{ partial "blogsection.html" . }}
<!-- Let's chat, shall we? -->
{{ with .Site.GetPage "page" "contact" }}
<div class="section" id="contact">
<div class="container has-text-centered">
<h2 class="title is-2">Contact</h2>
<h2 class="title is-2">{{ .Title }}</h2>
<div class="markdown">
{{ range .Data.Pages }}
{{if eq .Title "Contact" }}
{{.Content}}
{{end}}
{{ end }}
{{.Content}}
</div>
{{ if .Site.Params.localTime }}
@ -111,30 +93,20 @@
{{ 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>
<!-- End Contact container -->
{{ partial "top-icon.html" . }}
</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 -->
</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>

View file

@ -1,33 +1,37 @@
<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 }}
{{ with .Site.GetPage "section" "blog" }}
<div class="section" id="blog">
<!-- Begin Blog container -->
<div class="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>
</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 }}
{{ end }}
</ul>
{{ else }}
<div class="container has-text-centered top-pad"><a href="/blog">ALL BLOG POSTS</a></div>
{{ if .Site.Params.showAllPosts }}
<h2 class="title is-2 has-text-centered top-pad">All Posts</h2>
<ul>
{{ range .Pages }}
{{ partial "li.html" . }}
{{ 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 -->
{{ partial "top-icon.html" . }}
</div>
<!-- End Blog section -->
<div class="container"><hr></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>

View file

@ -1,9 +1,25 @@
<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 }}
<!-- Begin Footer section -->
<div class="section" id="footer">
<!-- Begin Footer container -->
<div class="container has-text-centered">
{{ with .Site.Params.footerText }}
{{ . | markdownify }}
{{ 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 <i class="fa fa-heart"></i> and <i class="fa fa-coffee"></i> by <a href="https://vickylai.com" target="_blank" rel="noopener">Vicky Lai</a>.</span>
{{ end }}
</div><!-- End Footer container -->
</div><!-- End Footer section -->
</div>
<!-- End Footer container -->
</div>
<!-- End Footer section -->
<!-- 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>

View file

@ -10,7 +10,7 @@
<meta name="referrer" content="no-referrer">
{{ if .Site.Params.description }}<meta name="description" content="{{ .Site.Params.description }}">{{ end }}
<base href="{{ .Site.BaseURL }}">
<!--<base href="{{ .Site.BaseURL }}">-->
<title>
{{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }}
{{ if eq $url "/" }}

View file

@ -2,7 +2,8 @@
<div class="container">
<hr>
<nav class="nav nav-center">
{{ if not .Page.IsHome }}
{{ $isHome := .Page.IsHome }}
{{ if not $isHome }}
<span id="nav-toggle" class="nav-toggle" onclick="document.getElementById('nav-menu').classList.toggle('is-active');">
<span></span>
<span></span>
@ -10,41 +11,51 @@
</span>
<div id="nav-menu" class="nav-left nav-menu">
{{ end }}
{{ if not .Page.IsHome }}
{{ if not $isHome }}
<a class="nav-item" href="{{ "/" | relURL }}">Main</a>
{{ end }}
<a class="nav-item" href="#about">About</a>
{{ with .Site.GetPage "page" "about" }}
<a class="nav-item" href="{{ if $isHome }}#about{{ else }}{{ "/#about" | relURL }}{{ end }}">{{ .Title }}</a>
{{ end }}
{{ if and (.Site.Params.showProjects) (not (and (eq .Page.Section "projects") (eq .Page.Kind "section") )) }}
{{ if .IsHome }}
<a class="nav-item" href="#projects">Projects</a>
{{ $pageIsInProjects := eq .Page.Section "projects"}}
{{ if not (and $pageIsInProjects (eq .Page.Kind "section")) }}
{{ with .Site.GetPage "section" "projects" }}
{{ if $isHome }}
<a class="nav-item" href="#projects">{{ .Title }}</a>
{{ else }}
<a class="nav-item" href="{{ "/projects" | relURL }}">
{{ if eq .Section "projects" }}
Back to Projects
{{ if $pageIsInProjects }}
Back to {{ .Title }}
{{ else }}
Projects
{{ .Title }}
{{ end }}
</a>
{{ end }}
{{ end }}
{{ end }}
{{ if and (.Site.Params.showBlog) (not (and (eq .Page.Section "blog") (eq .Page.Kind "section") )) }}
{{ if .IsHome }}
<a class="nav-item" href="#blog">Blog</a>
{{ $pageIsInBlog := eq .Page.Section "blog"}}
{{ if not (and $pageIsInBlog (eq .Page.Kind "section")) }}
{{ with .Site.GetPage "section" "blog" }}
{{ if $isHome }}
<a class="nav-item" href="#blog">{{ .Title }}</a>
{{ else }}
<a class="nav-item" href="{{ "/blog" | relURL }}">
{{ if eq .Section "blog" }}
Back to Blog
{{ if $pageIsInBlog }}
Back to {{ .Title | singularize}}
{{ else }}
Blog
{{ .Title | singularize}}
{{ end }}
</a>
{{ end }}
{{ end }}
{{ end }}
<a class="nav-item" href="#contact">Contact</a>
{{ with .Site.GetPage "page" "contact" }}
<a class="nav-item" href="{{ if $isHome }}#contact{{ else }}{{ "/#contact" | relURL }}{{ end }}">{{ .Title }}</a>
{{ end }}
{{ if and .Site.Params.showRSSButton .Site.RSSLink }}
<a class="nav-item" href="{{ .Site.RSSLink }}"><i class="fa fa-rss"></i></a>

View file

@ -1,70 +1,71 @@
<div class="container">
{{ with .Site.GetPage "section" "projects" }}
<div class="section" id="projects">
<!-- Begin Projects container -->
<h2 class="title is-2 has-text-centered">Projects</h2>
<div class="section is-small">
<div class="columns is-multiline">
{{ range sort .Pages }} {{ if eq .Section "projects" }}
{{ if eq .Site.Params.projectColumns "2" }}
<div class="column is-half"> {{ else if eq .Site.Params.projectColumns "3" }}
<div class="column is-one-third"> {{ else }}
<div class="column is-one-third"> {{ end }}
<!-- Hey Vicky, show half column if number is even. -->
<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 class="container">
<h2 class="title is-2 has-text-centered">{{ .Title }}</h2>
<div class="section is-small">
<div class="columns is-multiline">
{{ range sort .Pages }}
{{ if eq .Site.Params.projectColumns "2" }}
<div class="column is-half"> {{ else if eq .Site.Params.projectColumns "3" }}
<div class="column is-one-third"> {{ else }}
<div class="column is-one-third"> {{ end }}
<!-- Hey Vicky, show half column if number is even. -->
<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>
</div>
{{ end }} {{ end }}
{{ end }}
</div>
</div>
</div>
</div>
<!-- End Projects container -->
<!-- Projects modals -->
{{ range sort .Pages }} {{ if eq .Section "projects" }} {{ 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 }} {{ end }}
<!-- End Projects container -->
<div class="container has-text-centered top-pad">
<a href="#top">
<i class="fa fa-arrow-up"></i>
</a>
<!-- Projects modals -->
{{ range sort .Pages }}
{{ 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 }}
{{ partial "top-icon.html" . }}
</div>
<!-- End Projects section -->
<div class="container"><hr></div>
{{ end }}

View file

@ -0,0 +1,7 @@
<div class="container top-pad">
<hr>
</div>
{{ partial "top-icon.html" . }}
<div class="container top-pad">
<hr>
</div>

View file

@ -0,0 +1,5 @@
<div class="container has-text-centered top-pad">
<a href="#top">
<i class="fa fa-arrow-up"></i>
</a>
</div>