Hugo-theme-zzo: Search broke after updating from latest master

Created on 29 Oct 2020  路  4Comments  路  Source: zzossig/hugo-theme-zzo

Not sure what happened, but the search broke. I did test it first on local. Maybe I had cached results on local. Once deployed the search shows undefined.

Peek 2020-10-29 01-23

On clicking the result goes to url like this : https://crushingcode.nisrulz.com/posts/undefined

Can also try live here

I believe it comes from this commit: https://github.com/zzossig/hugo-theme-zzo/commit/ed920bdd6d7bd0e5e45e7a2f9f32db3452c0a06c

Most helpful comment

I see the below issue now

200be8c310fad13c57af7cb4b7515e21b128542d commit fix the issue

In this sass document - https://sass-lang.com/documentation/variables#shadowing

Older Sass versions allowed !global to be used for a variable that doesn鈥檛 exist yet. This behavior was deprecated to make sure each stylesheet declares the same variables no matter how it鈥檚 executed.

So, I declared the global variable at the top of the scss file

$theme-map: null;
@mixin themify($themes) {
...

And it breaks nothing

All 4 comments

I updated the search library to the newest one.
https://github.com/zzossig/hugo-theme-zzo/blob/e09bbc6d4e7cd88ca327b74bd855794c246ebc36/assets/js/fuse.min.js#L2
And in the version, some data structures have been changed. So made some changes in ed920bd.
Can you check your fuse.js version?
Or set enableSearchHighlight to true in params.toml and see if it solves the problem

enableSearchHighlight = true

I have the same Fuse version.
Adding enableSearchHighlight fixed the issue.

However when I serve my site on local, using hugo serve I see the below issue now:

DEPRECATION WARNING on line 4 of PATH_TO_MY_SITE/source/themes/zzo/assets/sass/abstracts/_mixins.scss:
!global assignments won't be able to declare new variables in future versions.
Consider adding `$theme-map: null` at the top level.

Should I open a new issue for this?

I see the below issue now

200be8c310fad13c57af7cb4b7515e21b128542d commit fix the issue

In this sass document - https://sass-lang.com/documentation/variables#shadowing

Older Sass versions allowed !global to be used for a variable that doesn鈥檛 exist yet. This behavior was deprecated to make sure each stylesheet declares the same variables no matter how it鈥檚 executed.

So, I declared the global variable at the top of the scss file

$theme-map: null;
@mixin themify($themes) {
...

And it breaks nothing

Thank you 馃樅

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Gictorbit picture Gictorbit  路  4Comments

nisrulz picture nisrulz  路  8Comments

szpak picture szpak  路  7Comments

simicn picture simicn  路  3Comments

Gictorbit picture Gictorbit  路  4Comments