Skip to content

Commit

Permalink
Revert "Updated hugo version. Partially solves #144 (#576)"
Browse files Browse the repository at this point in the history
This reverts commit b94f820.
  • Loading branch information
appieschot authored Sep 26, 2022
1 parent 9e11eae commit 64ddce9
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 61 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// Update VERSION to pick a specific hugo version.
// Example versions: latest, 0.73.0, 0,71.1
// Rebuild the container if it already exists to update.
"VERSION": "latest",
"VERSION": "0.100.2",
// Update NODE_VERSION to pick the Node.js version: 12, 14
"NODE_VERSION": "14"
}
Expand All @@ -22,7 +22,7 @@
"settings": {
"html.format.templating": true,
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"bungcip.better-toml",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 'latest'
hugo-version: '0.100.2' # temporary set to fixed version as 0.101.0 seems to cause problems
extended: true

- name: Build
Expand Down
7 changes: 5 additions & 2 deletions config/_default/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ enableEmoji = true

# Image Processing Config
[imaging]
quality = 75
quality = 100




############################# Outputs ##############################
[outputs]
Expand Down Expand Up @@ -56,4 +59,4 @@ suffixes = [""]
[outputFormats]
[outputFormats.WebAppManifest]
mediaType = "application/manifest+json"
rel = "manifest"
rel = "manifest"
11 changes: 7 additions & 4 deletions layouts/_default/_markup/render-image.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,31 @@
{{ $image_ext := path.Ext $image.RelPermalink }}
{{ $image_width := $image.Width }}
{{ if (ne $image_ext ".gif") }}
{{ $tinyImage := $image.Resize "500x webp" }}
{{ $smallImage := $image.Resize "800x webp" }}
{{ $mediumImage := $image.Resize "1200x webp" }}
{{ $largeImage := $image.Resize "1500x webp" }}

{{ if .Title }}
<figure>
<picture>
<source media="(min-width:500px)" srcset={{ $smallImage.RelPermalink | safeURL }}>
<source media="(min-width:800px)" srcset={{ $mediumImage.RelPermalink | safeURL }}>
<source media="(min-width:1200px)" srcset={{ $largeImage.RelPermalink | safeURL }}>
<source media="(min-width:1500px)" srcset={{ .Destination | safeURL }}>
<img src="{{ $smallImage.RelPermalink | safeURL }}" {{ with .Text }} alt="{{ . }}" {{ end }} {{ with .Title }}
<img src="{{ $tinyImage.RelPermalink | safeURL }}" {{ with .Text }} alt="{{ . }}" {{ end }} {{ with .Title }}
title="{{ . }}" {{ end }} style="width:auto;">
</picture>

{{ with .Title}} <figcaption>{{ . | markdownify }}</figcaption> {{ end }}
</figure>
{{ else }}
<picture>
<source media="(min-width:500px)" srcset={{ $smallImage.RelPermalink | safeURL }}>
<source media="(min-width:800px)" srcset={{ $mediumImage.RelPermalink | safeURL }}>
<source media="(min-width:1200px)" srcset={{ $largeImage.RelPermalink | safeURL }}>
<source media="(min-width:1500px)" srcset={{ .Destination | safeURL }}>
<img src="{{ $smallImage.RelPermalink | safeURL }}" {{ with .Text }} alt="{{ . }}" {{ end }} style="width:auto;">
<img src="{{ $tinyImage.RelPermalink | safeURL }}" {{ with .Text }} alt="{{ . }}" {{ end }} style="width:auto;">
</picture>
{{ end }}
{{ else }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<!-- cache partial only in production -->
{{ if hugo.IsProduction }}
{{ partialCached "script.html" . }}
{{ partialCached "footer.html" . }}
{{ partial "footer.html" . }}
{{ else }}
{{ partial "script.html" . }}
{{ partial "footer.html" . }}
Expand Down
26 changes: 6 additions & 20 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -1,26 +1,12 @@
{{ define "main" }}

<!-- checking blog -->
{{ if or
(eq .Section "adaptive-cards-community-call")
(eq .Section "categories") (eq .Section "tags")
(eq .Section "cli-for-microsoft-365")
(eq .Section "m365-dev-podcast")
(eq .Section "m365-pnp-weekly")
(eq .Section "microsoft-365-developer-community-call")
(eq .Section "microsoft-365-platform-community-call")
(eq .Section "microsoft-365-platform-community-update")
(eq .Section "microsoft-365-pnp-community")
(eq .Section "microsoft-365-pnp-weekly")
(eq .Section "microsoft-graph-community-call")
(eq .Section "microsoft-identity-platform-community-call")
(eq .Section "microsoft-teams-community-call")
(eq .Section "microsoft-viva-and-spfx-community-call")
(eq .Section "office-add-ins-community-call")
(eq .Section "pnp-powershell")
(eq .Section "post")
(eq .Section "power-platform-community-call")
}}
{{ if or (eq .Section "post") (eq .Section "microsoft-viva-and-spfx-community-call") (eq .Section
"cli-for-microsoft-365") (eq .Section "cli-for-microsoft-365") (eq .Section "m365-dev-podcast") (eq .Section
"microsoft-365-developer-community-call")
(eq .Section "categories") (eq .Section "tags") (eq .Section "adaptive-card-community-call") (eq .Section
"power-platform-community-call") (eq .Section "microsoft-365-platform-community-update") (eq .Section
"microsoft-365-pnp-weekly") (eq .Section "m365-pnp-weekly") (eq .Section "adaptive-cards-community-call") (eq .Section "microsoft-365-pnp-community") (eq .Section "office-add-ins-community-call") (eq .Section "microsoft-graph-community-call") (eq .Section "microsoft-identity-platform-community-call") (eq .Section "microsoft-teams-community-call") }}

<section class="section">
<div class="py-4"></div>
Expand Down
32 changes: 9 additions & 23 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -1,30 +1,12 @@
{{ define "main" }}

<!-- checking blog -->
{{ if or
(eq .Section "adaptive-cards-community-call")
(eq .Section "categories") (eq .Section "tags")
(eq .Section "cli-for-microsoft-365")
(eq .Section "m365-dev-podcast")
(eq .Section "m365-pnp-weekly")
(eq .Section "microsoft-365-developer-community-call")
(eq .Section "microsoft-365-platform-community-call")
(eq .Section "microsoft-365-platform-community-update")
(eq .Section "microsoft-365-pnp-community")
(eq .Section "microsoft-365-pnp-weekly")
(eq .Section "microsoft-graph-community-call")
(eq .Section "microsoft-identity-platform-community-call")
(eq .Section "microsoft-teams-community-call")
(eq .Section "microsoft-viva-and-spfx-community-call")
(eq .Section "office-add-ins-community-call")
(eq .Section "pnp-powershell")
(eq .Section "post")
(eq .Section "power-platform-community-call")
}}
{{ if or (eq .Section "post") (eq .Section "microsoft-viva-and-spfx-community-call") (eq .Section "cli-for-microsoft-365") (eq .Section "cli-for-microsoft-365") (eq .Section "m365-dev-podcast") (eq .Section "microsoft-365-developer-community-call")
(eq .Section "categories") (eq .Section "tags") (eq .Section "adaptive-card-community-call") (eq .Section "power-platform-community-call") (eq .Section "microsoft-teams-community-call") (eq .Section "microsoft-365-platform-community-update") (eq .Section "microsoft-365-pnp-weekly") (eq .Section "m365-pnp-weekly") (eq .Section "adaptive-cards-community-call") (eq .Section "microsoft-365-pnp-community") (eq .Section "office-add-ins-community-call") (eq .Section "microsoft-graph-community-call") (eq .Section "microsoft-identity-platform-community-call") (eq .Section "microsoft-365-platform-community-call") (eq .Section "pnp-powershell")}}

{{ $sidebar:= site.Params.sidebar }}
{{ $hasbar:= or (eq $sidebar `left`) (eq $sidebar `right`)}}

{{ $layout:= site.Params.post_layout}}
{{ $widget:= site.Params.widgets.sidebar }}


Expand All @@ -37,7 +19,7 @@
<!-- left sidebar -->
{{ if eq $sidebar "left" }}
<aside class="col-lg-4 order-2 order-lg-1">
{{- partialCached "widgets/widget-wrapper" ( dict "Widgets" $widget "Scope" . ) -}}
{{- partial "widgets/widget-wrapper" ( dict "Widgets" $widget "Scope" . ) -}}
</aside>
{{ end }}
<!-- /left sidebar -->
Expand All @@ -57,7 +39,9 @@
{{ $image:= resources.Get $imgPath }}
{{ $imageMD:= $image.Fill "700x330 webp" }}
{{ $imageLG:= $image.Fill "510x240 webp" }}
{{ $imageSM:= $image.Fill "380x180 webp" }}
<picture>
<source srcset="{{ $imageSM.Permalink }}" media="(max-width: 575px)">
<source srcset="{{ $imageMD.Permalink }}" media="(max-width: 767px)">
<source srcset="{{ $imageLG.Permalink }}" media="(max-width: 991px)">
<source srcset="{{$imageMD.Permalink}}">
Expand All @@ -69,7 +53,9 @@
{{ $image:= . }}
{{ $imageMD:= $image.Fill "700x330 webp" }}
{{ $imageLG:= $image.Fill "510x240 webp" }}
{{ $imageSM:= $image.Fill "380x180 webp" }}
<picture>
<source srcset="{{ $imageSM.Permalink }}" media="(max-width: 575px)">
<source srcset="{{ $imageMD.Permalink }}" media="(max-width: 767px)">
<source srcset="{{ $imageLG.Permalink }}" media="(max-width: 991px)">
<source srcset="{{$imageMD.Permalink}}">
Expand Down Expand Up @@ -147,7 +133,7 @@ <h1 class="h2">{{ .Title }}</h1>
<!-- right sidebar -->
{{ if eq $sidebar "right" }}
<aside class="col-lg-4">
{{- partialCached "widgets/widget-wrapper" ( dict "Widgets" $widget "Scope" . ) -}}
{{- partial "widgets/widget-wrapper" ( dict "Widgets" $widget "Scope" . ) -}}
</aside>
{{ end }}
<!-- /right sidebar -->
Expand Down
6 changes: 3 additions & 3 deletions layouts/homepage/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ <h3 class="h4 mb-3"><a class="post-title" href="{{ .Permalink }}">{{ .Title }}</
<!-- left sidebar -->
{{ if eq $sidebar "left" }}
<aside class="col-lg-4 sidebar-home order-2 order-lg-1">
{{- partialCached "widgets/widget-wrapper" ( dict "Widgets" $widget "Scope" . ) -}}
{{- partial "widgets/widget-wrapper" ( dict "Widgets" $widget "Scope" . ) -}}
</aside>
{{ end }}
<!-- /left sidebar -->
Expand All @@ -367,7 +367,7 @@ <h2 class="h5 section-title">{{ i18n "recent_post" }}</h2>
{{ if .Params.images }}
<div class="post-slider slider-sm">
<a href="{{ .Permalink }}">
{{ range .Params.images }}
{{ range .Params.images }}
{{ $imgPath:= . }}
{{ if fileExists (add `assets/` $imgPath) }}
{{ $img:= resources.Get $imgPath }}
Expand Down Expand Up @@ -609,7 +609,7 @@ <h3 class="mb-3"><a class="post-title" href="{{ .Permalink }}">{{ .Title }}</a><
<!-- right sidebar -->
{{ if eq $sidebar "right" }}
<aside class="col-lg-4 sidebar-home">
{{- partialCached "widgets/widget-wrapper" ( dict "Widgets" $widget "Scope" . ) -}}
{{- partial "widgets/widget-wrapper" ( dict "Widgets" $widget "Scope" . ) -}}
</aside>
{{ end }}
<!-- /right sidebar -->
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<!-- left sidebar -->
{{ if eq $sidebar "left" }}
<aside class="col-lg-4 order-2 order-lg-1 {{.Scratch.Get `sidebar-margin`}}">
{{- partialCached "widgets/widget-wrapper" ( dict "Widgets" $widget "Scope" . ) -}}
{{- partial "widgets/widget-wrapper" ( dict "Widgets" $widget "Scope" . ) -}}
</aside>
{{ end }}
<!-- /left sidebar -->
Expand Down Expand Up @@ -388,7 +388,7 @@ <h3 class="mb-3"><a class="post-title" href="{{ .Permalink }}">{{ .Title }}</a><
<!-- right sidebar -->
{{ if eq $sidebar "right" }}
<aside class="col-lg-4 {{.Scratch.Get `sidebar-margin`}}">
{{- partialCached "widgets/widget-wrapper" ( dict "Widgets" $widget "Scope" . ) -}}
{{- partial "widgets/widget-wrapper" ( dict "Widgets" $widget "Scope" . ) -}}
</aside>
{{ end }}
<!-- /right sidebar -->
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ <h2 class="h3 mb-5">{{ i18n "instagram_post" | upper }}</h2>
</div>
<div class="col-md-2 text-center mb-4">
<a href="{{ site.BaseURL | relLangURL }}">
{{ partialCached "logo.html" . }}
{{ partial "logo.html" . }}
</a>
</div>
<div class="col-md-5 text-md-right text-center mb-4">
Expand Down
6 changes: 5 additions & 1 deletion layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
<title>{{.Title | default site.Title}}</title>

<!-- base url -->
{{ if or (eq site.BaseURL "/") (eq site.BaseURL "http://localhost:1313/") }}{{else}}
{{ if or (eq site.BaseURL "/") (eq site.BaseURL "http://localhost:1313/") (eq site.BaseURL "http://examplesite.org/")
(eq site.BaseURL "https://examplesite.org/") (eq site.BaseURL "http://examplesite.com/") (eq site.BaseURL
"https://examplesite.com/")}}{{else}}
<base href="{{ .Permalink }}">
{{ end }}

Expand All @@ -24,6 +26,7 @@

<!-- favicon -->
{{ $favicon:= site.Params.favicon }}
{{ if $favicon }}
{{ if fileExists (add `assets/` $favicon) }}
{{ $favicon:= resources.Get $favicon }}
{{ $favicon_16:= $favicon.Resize "16x png"}}
Expand All @@ -35,6 +38,7 @@
<link rel="icon" type="image/png" sizes="32x32" href="{{$favicon_32.RelPermalink}}">
<link rel="apple-touch-icon" sizes="180x180" href="{{$favicon_180.RelPermalink}}">
{{ end }}
{{ end }}
<link rel="manifest" href="{{`manifest.webmanifest` | relURL }}">
<meta name="msapplication-TileColor" content="{{site.Params.variables.color_primary | default `#da532c`}}">
<meta name="theme-color" content="{{site.Params.variables.body_color | default `#ffffff` }}">
Expand Down
2 changes: 1 addition & 1 deletion themes/reader-hugo/layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
placeholder="{{ i18n `search_placeholder`}}">
</form>
{{ end }}
{{ partialCached "pnp-main-page-link.html" . }}
{{ partial "pnp-main-page-link.html" . }}
{{ partial "gh-link.html" . }}
</div>
</nav>
Expand Down

0 comments on commit 64ddce9

Please sign in to comment.