Code cleanup

This commit is contained in:
Hanzei 2018-06-27 02:33:38 +02:00
parent 389a69a6e7
commit ada1932097
No known key found for this signature in database
GPG key ID: 69A2DEFD98937BA0
6 changed files with 21 additions and 36 deletions

View file

@ -11,21 +11,19 @@
<div class="section no-padding {{ if .Site.Params.fadeIn }} fade-in two {{ end }}"> <div class="section no-padding {{ if .Site.Params.fadeIn }} fade-in two {{ end }}">
{{ partial "nav.html" . }} {{ partial "nav.html" . }}
<div class="container markdown {{ if .Site.Params.fadeIn | default true }}fade-in two{{ end }} top-pad"> <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 }} {{ .Content }}
</div> </div>
<!-- Begin Blog container --> <!-- Begin container -->
<div class="container"> <div class="container">
<ul> <ul>
<!-- Ranges through content/*/*.md --> {{ range .Pages.ByPublishDate }}
{{ range .Data.Pages.ByPublishDate }} {{ if not (eq .Section "blog") }}
<li> <li>
<a href="{{.Permalink}}">{{.Date.Format (.Site.Params.dateform | default "Jan 02, 2006") }} | {{.Title}}</a> <a href="{{.Permalink}}">{{.Date.Format (.Site.Params.dateform | default "Jan 02, 2006") }} | {{.Title}}</a>
</li> </li>
{{ end }} {{ end }} {{ end }}
</ul> </ul>
</div> </div>
<!-- End Blog container --> <!-- End container -->
{{ partial "top-icon-with-hr.html" . }} {{ partial "top-icon-with-hr.html" . }}
{{ partial "footer.html" . }} {{ partial "footer.html" . }}
</div> </div>

View file

@ -16,7 +16,7 @@
<!-- Begin Blog container --> <!-- Begin Blog container -->
<div class="container"> <div class="container">
<ul> <ul>
{{ range .Data.Pages.ByPublishDate }} {{ range .Pages.ByPublishDate }}
<li> <li>
<a href="{{.Permalink}}">{{.Date.Format (.Site.Params.dateform | default "Jan 02, 2006") }} | {{.Title}}</a> <a href="{{.Permalink}}">{{.Date.Format (.Site.Params.dateform | default "Jan 02, 2006") }} | {{.Title}}</a>
</li> </li>

View file

@ -11,14 +11,13 @@
<div class="section no-padding {{ if .Site.Params.fadeIn | default true }}fade-in two{{ end }}"> <div class="section no-padding {{ if .Site.Params.fadeIn | default true }}fade-in two{{ end }}">
{{ partial "nav.html" . }} {{ partial "nav.html" . }}
<div class="container markdown {{ if .Site.Params.fadeIn | default true }}fade-in two{{ end }} top-pad"> <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 }} {{ .Content }}
</div> </div>
<!-- Begin Blog container --> <!-- Begin Blog container -->
<div class="container"> <div class="container">
{{ if .Site.Params.showLatest }} {{ if .Site.Params.showLatest }}
<h2 class="title is-2 top-pad">{{ i18n "index_blog_latestPosts" . }}</h2> <h2 class="title is-2 top-pad">{{ i18n "index_blog_latestPosts" . }}</h2>
{{ range first 1 (where .Data.Pages.ByPublishDate.Reverse "Section" "blog") }} {{ range first 1 .Pages.ByPublishDate.Reverse }}
<div class="summary">{{ .Date.Format (.Site.Params.dateForm | default "Jan 02, 2006") }} <div class="summary">{{ .Date.Format (.Site.Params.dateForm | default "Jan 02, 2006") }}
<h3 class="title is-3 strong-post-title"> <h3 class="title is-3 strong-post-title">
<a href="{{ .RelPermalink }}"> <a href="{{ .RelPermalink }}">
@ -36,10 +35,8 @@
{{ end }} {{ end }}
<h2 class="title is-2 top-pad">{{ i18n "index_blog_allPosts" . }}</h2> <h2 class="title is-2 top-pad">{{ i18n "index_blog_allPosts" . }}</h2>
<ul> <ul>
{{ range .Data.Pages.ByPublishDate }} {{ range .Pages.ByPublishDate.Reverse }}
{{ if eq .Section "blog" }} {{ partial "li.html" . }}
{{ partial "li.html" . }}
{{ end }}
{{ end }} {{ end }}
</ul> </ul>
</div> </div>

View file

@ -4,7 +4,7 @@
<div class="container"> <div class="container">
{{ if .Site.Params.showLatest }} {{ if .Site.Params.showLatest }}
<h2 class="title is-2 has-text-centered">{{ i18n "index_blog_latestPosts" . }}</h2> <h2 class="title is-2 has-text-centered">{{ i18n "index_blog_latestPosts" . }}</h2>
{{ range first 1 (where .Data.Pages.ByPublishDate.Reverse "Section" "blog") }} {{ range first 1 .Pages.ByPublishDate.Reverse }}
<div class="summary">{{ .Date.Format (.Site.Params.dateForm | default "Jan 02, 2006") }} <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> <h3 class="title is-3 latest-post-title"><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3>
<div class="markdown"> <div class="markdown">

View file

@ -5,12 +5,11 @@
<h2 class="title is-2 has-text-centered"> <h2 class="title is-2 has-text-centered">
{{ .Title }} {{ .Title }}
</h2> </h2>
<div class="section is-small"> <div class="section is-small">
<div class="columns is-multiline"> <div class="columns is-multiline">
{{ $totalProjects := (len (.Site.GetPage "section" "projects").Pages) }} {{ $totalProjects := (len .Pages) }}
{{ $numberOfProjectsToShow := .Site.Params.numberOfProjectsToShow | default $totalProjects }} {{ $numberOfProjectsToShow := .Site.Params.numberOfProjectsToShow | default $totalProjects }}
{{ range (.Site.GetPage "section" "projects").Pages | first $numberOfProjectsToShow }} {{ range .Pages | first $numberOfProjectsToShow }}
{{ if eq (mod $numberOfProjectsToShow 2) 0 }} {{ if eq (mod $numberOfProjectsToShow 2) 0 }}
<div class="column is-half"> <div class="column is-half">
{{ else }} {{ else }}
@ -43,9 +42,8 @@
{{ end }} {{ end }}
</div> </div>
<!-- End Projects container --> <!-- End Projects container -->
<!-- Projects modals --> <!-- Projects modals -->
{{ range (.Site.GetPage "section" "projects").Pages | first $numberOfProjectsToShow }} {{ if not .Params.external_link }} {{ range .Pages | first $numberOfProjectsToShow }} {{ if not .Params.external_link }}
<div class="modal" id="modal{{ $card := .Title | urlize }}{{ replace $card "%" " "}}"> <div class="modal" id="modal{{ $card := .Title | urlize }}{{ replace $card "%" " "}}">
<div class="modal-background"></div> <div class="modal-background"></div>
<div class="modal-card"> <div class="modal-card">
@ -77,6 +75,5 @@
{{ partial "top-icon.html" . }} {{ partial "top-icon.html" . }}
</div> </div>
<!-- End Projects section --> <!-- End Projects section -->
<div class="container"><hr></div> <div class="container"><hr></div>
{{ end }} {{ end }}

View file

@ -16,13 +16,13 @@
<div class="container"> <div class="container">
<div class="section is-small"> <div class="section is-small">
<div class="columns is-multiline"> <div class="columns is-multiline">
<!-- Ranges through content/projects/*.md --> {{ $numberOfPages := len .Pages}}
{{ range .Data.Pages }} {{ range .Pages }}
{{ if eq (mod (len (.Site.GetPage "section" "projects").Pages) 2) 0 }} {{ if eq (mod $numberOfPages 2) 0 }}
<div class="column is-half"> <div class="column is-half">
{{ else }} {{ else }}
<div class="column is-one-third"> <div class="column is-one-third">
{{ end }} {{ end }}
<div class="card"> <div class="card">
<div class="card-image"> <div class="card-image">
<figure class="image is-3by2"> <figure class="image is-3by2">
@ -42,17 +42,10 @@
</div> </div>
</div> </div>
</div> </div>
{{ partial "top-icon-with-hr.html" . }}
<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" . }} {{ partial "footer.html" . }}
</div><!-- End fade in two --> </div>
</div><!-- End parent section --> <!-- End fade in two -->
</div>
<!-- End parent section -->
</body> </body>