Alleviating warnings

As mentioned in the site acknowledgements, this site’s structure is generated using Hugo, which conveniently allows me to write articles in the Markdown syntax and compile them to html pages.

Upon running the hugo server command recently, it failed citing a few clues. The primary error first being that the head.html partial within the theme failed to evaluate the Author field. So I updated the theme submodule, in case this was rectified since last I pulled, which it had. This left me with a few warnings.


WARN  deprecated: project config key languageCode was deprecated in Hugo v0.158.0 and will be removed in a future release. Use locale instead.

WARN  deprecated: css.Sass: libsass was deprecated in Hugo v0.153.0 and will be removed in a future release. Use dartsass instead. See https://gohugo.io/functions/css/sass/#dart-sass

WARN  deprecated: .Site.LanguageCode was deprecated in Hugo v0.158.0 and will be removed in a future release. Use .Site.Language.Locale instead.

For the deprecation of languageCode and LanguageCode, a mere replacement eased those messages. To replace the transpiler libsass with dartsass, I had to find the CSS options. In this theme, they are inherited from head.html, a partial layout, and look like this.

<!-- CSS -->
{{ $opts := dict 
    "transpiler" "dartsass" 
    "targetPath" "main.css" 
    "outputStyle" "compressed" 
    "enableSourceMap" true 
    }}

For rectifying this warning, I was gifted around 18 warnings on the same matter.


WARN  Dart Sass: DEPRECATED [import]: site/assets/scss/main.scss:1:8: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.

The @import calls in the *.scss files are deprecated. But conveniently, Sass provides sass-migrator, an executable automating the conversion to modern etiquette. The only nuance being some reserved names. The hugo server command was now entirely free of warnings and errors.


Improvements

As of writing this, the styling of my site derives from the hello-friend-ng theme, which uses Normalize version 8.0.1. My crude modifications included the use of an instance of Bootstrap inline with the hugo-cards theme. This instance was derived from that of hugo-cards, and thus has tags for bootswatch v3.3.6, bootstrap v3.3.6 and normalize.css v3.0.3. Clearly, there are two versions of Normalize and an antique Bootstrap onboard, so we move to solve this.

Having looked into each of these, Bootswatch is a library of open source themes for Bootstrap, which included normalize.css in its contemporary form. Modern bootstrap (v5.3.8) includes Reboot, which serves as an improved Normalize, so the combination used before is replaced by a fresh bootstrap.css v5.3.8.