fix: deprecations warnings Language.LanguageDirection and .site#199
fix: deprecations warnings Language.LanguageDirection and .site#199saurabhraghuvanshii wants to merge 1 commit into
Conversation
Signed-off-by: saurabhraghuvanshii <saurabhsraghuvanshi@gmail.com>
There was a problem hiding this comment.
Code Review
This pull request aims to address deprecation warnings and improve the offline search functionality. In offline-search.js, robust payload normalization and error handling were added. In hugo.yaml, minor formatting and configuration changes were made. However, two issues were identified in the review: the newly added head-css.html template still uses the deprecated .Site.Language.Direction instead of .Language.LanguageDirection, and changing languageName to label in hugo.yaml is non-standard and will break language-related templates.
| makes it snappier to develop in Chrome, but it may look sub-optimal in other | ||
| browsers. */ -}} | ||
|
|
||
| {{ if eq .Site.Language.Direction "rtl" -}} |
There was a problem hiding this comment.
The PR objective is to fix deprecation warnings for Language.LanguageDirection and .site. However, this newly added file still uses the deprecated .Site.Language.Direction. Update it to use .Language.LanguageDirection to resolve the deprecation warning.
| {{ if eq .Site.Language.Direction "rtl" -}} | |
| {{ if eq .Language.LanguageDirection "rtl" -}} |
| languages: | ||
| en: | ||
| languageName: English | ||
| label: English |
There was a problem hiding this comment.
In Hugo, languageName is the standard configuration option used to define the language's display name (accessed via .Language.LanguageName). Changing this to label is not standard in Hugo and will cause .Language.LanguageName to return the language code (e.g., en) or be empty, which breaks language switchers or templates relying on it. Revert this change to keep languageName.
languageName: English|
🚀 Preview deployment: https://layer5io.github.io/academy-theme/pr-preview/pr-199/ |
Notes for Reviewers
This PR fixes #
Signed commits