Upgrade "minVersion" of theme to 84 (#543)

* Upgrade "minVersion" of theme to 84

Check hugo.IsExtended before trying to process scss files

Fixes #541
This commit is contained in:
Regis Philibert 2022-04-21 11:48:54 -04:00 committed by GitHub
parent e91f77c5be
commit 751ac93c1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 4 deletions

View file

@ -239,6 +239,7 @@ For example, if your css files are `assets/ananke/css/custom.css` and `assets/an
[params] [params]
custom_css = ["custom.css","special.css"] custom_css = ["custom.css","special.css"]
``` ```
__IMPORTANT__: Files registered through the `custom_css` array, while unlimited in number, must be of the same type (Ex: all `scss` or all `css`)
__Note on retrocompatibiliy for custom css__: If the files registered through the `custom_css` setting are not found in `assets/ananke/css` the theme will expect them to live at the given path relative to the static directory and load them as <link> requests. __Note on retrocompatibiliy for custom css__: If the files registered through the `custom_css` setting are not found in `assets/ananke/css` the theme will expect them to live at the given path relative to the static directory and load them as <link> requests.

View file

@ -1,3 +1,3 @@
module: module:
hugoVersion: hugoVersion:
min: "0.64.0" min: "0.84.0"

View file

@ -2,6 +2,8 @@
title: "Ananke: a Hugo Theme" title: "Ananke: a Hugo Theme"
description: "The last theme you'll ever need. Maybe." description: "The last theme you'll ever need. Maybe."
# 1. To ensure Netlify triggers a build on our exampleSite instrance, we need to change a file in the exampleSite directory.
theme_version: '2.8.2'
cascade: cascade:
featured_image: '/images/gohugo-default-sample-hero-image.jpg' featured_image: '/images/gohugo-default-sample-hero-image.jpg'
--- ---

View file

@ -42,13 +42,22 @@
{{ end }} {{ end }}
{{/* We look for any custom css files registered by the user under `site.params.custom_css and if found in the theme's {{/* We look for any custom css files registered by the user under `site.params.custom_css and if found in the theme's
css asset directory we add to aforementioned slice */}} css asset directory we (unless condition below) add to aforementioned slice */}}
{{ with site.Params.custom_css }} {{ with site.Params.custom_css }}
{{ range . }} {{ range . }}
{{ with partialCached "func/style/GetResource" . . }} {{ with partialCached "func/style/GetResource" . . }}
{{ if eq .MediaType.SubType "x-scss" "x-sass" "scss" "sass" }}
{{ if hugo.IsExtended }}
{{/* as we cannot concatenate styles of different types, we sass/scss to be transformed to css beforehand */}}
{{ $assets_to_concat = $assets_to_concat | append (. | resources.ToCSS) }}
{{ else }}
{{ partial "func/warn" (printf "Processing of stylesheet %s of type %s has been skipped. You need Hugo Extended to process such files." .Name .MediaType.SubType) }}
{{ end }}
{{ else }}
{{ $assets_to_concat = $assets_to_concat | append . }} {{ $assets_to_concat = $assets_to_concat | append . }}
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ end }}
{{ end }} {{ end }}
{{ with $assets_to_concat }} {{ with $assets_to_concat }}

View file

@ -8,7 +8,7 @@ description = "A Base theme for building full featured Hugo sites"
homepage = "https://github.com/theNewDynamic/gohugo-theme-ananke" homepage = "https://github.com/theNewDynamic/gohugo-theme-ananke"
tags = ["website", "starter", "responsive", "Disqus", "blog", "Tachyons", "Multilingual", "Stackbit"] tags = ["website", "starter", "responsive", "Disqus", "blog", "Tachyons", "Multilingual", "Stackbit"]
features = ["posts", "shortcodes", "related content", "comments"] features = ["posts", "shortcodes", "related content", "comments"]
min_version = "0.64.0" min_version = "0.84.0"
[author] [author]
name = "theNewDynamic" name = "theNewDynamic"