Skip to content

Commit

Permalink
Merge pull request #70 from pyotek/master
Browse files Browse the repository at this point in the history
Fixed theme + migrated to newer Hugo features
  • Loading branch information
tomanistor committed Dec 9, 2019
2 parents f8b42ce + 52255bf commit 06b3f49
Show file tree
Hide file tree
Showing 28 changed files with 19 additions and 25 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
{{ partial "about.html" . }}

<!-- Gallery -->
{{ if not (eq (len (where .Data.Pages "Section" "gallery")) 0) }}
{{ if not (eq (len (where .Site.RegularPages "Section" "gallery")) 0) }}
{{ partial "gallery.html" . }}
{{ end }}

<!-- Blog -->
{{ if not (eq (len (where .Data.Pages "Section" "blog")) 0) }}
{{ if not (eq (len (where .Site.RegularPages "Section" "blog")) 0) }}
{{ partial "blog.html" . }}
{{ end }}

Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/blog.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</div>
<div class="row">
<div class="col-xs-12 posts-list">
{{ range first 5 (where .Data.Pages "Section" "blog") }}
{{ range first 5 (where .Site.RegularPages "Section" "blog") }}
<article>
<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
<div class=sub-header>
Expand Down
10 changes: 5 additions & 5 deletions layouts/partials/body-bottom.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ if not (eq (len (where .Data.Pages "Section" "gallery")) 0) }}
{{ if not (eq (len (where .Site.RegularPages "Section" "gallery")) 0) }}
{{ partial "modals.html" . }}
<script src="/scripts/{{ if .Site.Params.cacheBustJS }}{{ index .Site.Data.cachedAssets "modal.js" }}{{ else }}modal.min.js{{ end }}" type="text/javascript"></script>
<script src="{{ (resources.Get "js/src/modal.js" | minify | fingerprint).Permalink }}" type="text/javascript"></script>
{{ end }}

{{ if .Site.Params.highlightJS }}
Expand All @@ -13,10 +13,10 @@
{{ end }}

{{ if .IsHome }}
<script src="/scripts/{{ if .Site.Params.cacheBustJS }}{{ index .Site.Data.cachedAssets "index.js" }}{{ else }}index.min.js{{ end }}" type="text/javascript"></script>
<script src="{{ (resources.Get "js/src/index.js" | minify | fingerprint).Permalink }}" type="text/javascript"></script>
{{ if or (and (.Site.Params.ajaxFormspree) (.Site.Params.ajaxFormspreeGold)) (.Site.Params.ajaxBasin) }}
<script>{{ partial "scripts/contact.min.js" . | safeJS }}</script>
<script>{{ (resources.Get "js/src/contact.js" | resources.ExecuteAsTemplate "js/src/contact.js" . | minify | fingerprint).Content | safeJS }}</script>
{{ end }}
{{ else }}
<script src="/scripts/{{ if .Site.Params.cacheBustJS }}{{ index .Site.Data.cachedAssets "main.js" }}{{ else }}main.min.js{{ end }}" type="text/javascript"></script>
<script src="{{ (resources.Get "js/src/main.js" | minify | fingerprint).Permalink }}" type="text/javascript"></script>
{{ end }}
2 changes: 1 addition & 1 deletion layouts/partials/gallery.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- First 4 characters of each gallery page's unique ID -->
{{ range where .Site.RegularPages "Section" "gallery" }}
<!-- Scratch is used to set page-scoped variable outside of this loop-->
{{ .Scratch.Set "$modalID" (slicestr .UniqueID 0 4) }}
{{ .Scratch.Set "$modalID" (slicestr .File.UniqueID 0 4) }}
{{ end }}

{{ $galleryTotal := len (where .Site.RegularPages "Section" "gallery") }}
Expand Down
15 changes: 7 additions & 8 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@

<title>
{{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }}
{{- if .IsHome -}}
{{ if .IsHome -}}
{{ .Site.Title }}
{{- else if .Params.heading -}}
{{ .Params.heading }}
{{- else -}}
{{ .Title }} | {{ .Site.Title }}
{{- end -}}
{{- end }}
</title>

<meta name="title" content="{{ if .IsHome }}{{ .Site.Title }}{{ else if .Params.heading }}{{ .Params.heading }}{{ else }}{{ .Title }} | {{ .Site.Title }}{{ end}}">
Expand All @@ -32,7 +32,6 @@
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="referrer" content="no-referrer-when-downgrade">
<meta name="generator" content="{{ .Hugo.Generator }}">
<base href="{{ .Site.BaseURL }}">

{{ if .Description }}
Expand Down Expand Up @@ -75,20 +74,20 @@
{{ end }}

<link rel="canonical" href="{{ .Permalink }}">

{{ if .RSSLink }}
<link href="{{ .RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}">
{{ with .OutputFormats.Get "RSS" }}
<link href="{{ .Permalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}">
{{ end }}

<link rel="stylesheet" href="{{ .Site.BaseURL }}/styles/{{ if .Site.Params.cacheBustCSS }}{{ index .Site.Data.cachedAssets "main.css" }}{{ else }}main.css{{ end }}" type="text/css">
<link rel="stylesheet" href="{{ (resources.Get "sass/main.scss" | resources.ToCSS (dict "targetPath" "style.css" "outputStyle" "compressed") | resources.Fingerprint).Permalink }}" type="text/css">

{{ if .Site.Params.customCSS }}
{{ partial "css.html" . }}
{{ end }}

{{ if .Site.Params.lazyLoading }}
<style>.lazyload{opacity:.0001;}.logo .lazyload{min-width:10em;}</style>
<script src="/scripts/vendor/lazysizes.min.js" async></script>
<script src="{{ (resources.Get "js/vendor/lazysizes.min.js").Permalink }}" async></script>
{{ end }}

{{ if .Site.Params.highlightJS }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/modals.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ range where .Site.RegularPages "Section" "gallery" }}

<!-- First 4 characters of each gallery page's unique ID -->
{{ $modalID := (slicestr .UniqueID 0 4) }}
{{ $modalID := (slicestr .File.UniqueID 0 4) }}

<div id="modal-{{ $modalID }}" class="modal">

Expand Down
2 changes: 1 addition & 1 deletion layouts/sitemap.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<urlset xmlns="http:https://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http:https://www.w3.org/1999/xhtml">
{{ range (where .Data.Pages "Section" "!=" "gallery") }}
{{ range (where .Site.RegularPages "Section" "!=" "gallery") }}
<url>
<loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
Expand Down
1 change: 0 additions & 1 deletion static/scripts/contact.min.js

This file was deleted.

1 change: 0 additions & 1 deletion static/scripts/index.min.js

This file was deleted.

1 change: 0 additions & 1 deletion static/scripts/main.min.js

This file was deleted.

1 change: 0 additions & 1 deletion static/scripts/modal.min.js

This file was deleted.

1 change: 0 additions & 1 deletion static/styles/main.min.css

This file was deleted.

2 changes: 1 addition & 1 deletion theme.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description = "Clean, responsive one-page portfolio accompanied by a minimalist
homepage = "https://github.com/tomanistor/osprey"
tags = ["blog", "portfolio", "gallery", "minimalist", "responsive", "flexbox"]
features = ["blog", "portfolio", "google analytics"]
min_version = 0.24.1
min_version = "0.5"

[author]
name = "Toma Nistor"
Expand Down

0 comments on commit 06b3f49

Please sign in to comment.