diff --git a/CHANGELOG.md b/CHANGELOG.md index 761adc59..66519b2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ All notable changes to this project will be documented in this file. - :sparkles: Feat(highlight): add full support for Chroma highlighting languages in the [list](https://gohugo.io/content-management/syntax-highlighting/#list-of-chroma-highlighting-languages) - :sparkles: Feat: add optional parameter `noreferrer` for the shortcode `link` - :sparkles: Feat: update echarts theme config +- :sparkles: Feat: add noscript warning banner ([#194](https://github.com/hugo-fixit/FixIt/issues/194)) - :zap: Perf: remove extra spaces in plugin link - :wheelchair: Feat(accessibility): use `aria-hidden=true` on icons that AT should ignore - :recycle: Refactor: image rendering diff --git a/assets/css/_partials/_widgets.scss b/assets/css/_partials/_widgets.scss index f12dda35..758fb06c 100644 --- a/assets/css/_partials/_widgets.scss +++ b/assets/css/_partials/_widgets.scss @@ -1,5 +1,6 @@ @import '_widgets/cookieconsent'; @import '_widgets/fixed-button'; @import '_widgets/github-corner'; +@import '_widgets/noscript-warning'; @import '_widgets/reading-progress'; -@import '_widgets/typeit'; \ No newline at end of file +@import '_widgets/typeit'; diff --git a/assets/css/_partials/_widgets/_noscript-warning.scss b/assets/css/_partials/_widgets/_noscript-warning.scss new file mode 100644 index 00000000..d226f2f8 --- /dev/null +++ b/assets/css/_partials/_widgets/_noscript-warning.scss @@ -0,0 +1,16 @@ +.noscript-warning { + background-color: var(--fi-danger); + color: white; + font-size: 1rem; + font-weight: bold; + position: fixed; + text-align: center; + left: 0; + top: 0; + width: 100%; + z-index: 150; + + [data-theme='dark'] & { + background-color: var(--fi-danger-dark); + } +} diff --git a/i18n/de.toml b/i18n/de.toml index d9f898e7..6088c129 100644 --- a/i18n/de.toml +++ b/i18n/de.toml @@ -25,6 +25,9 @@ other = "Nach oben" [viewComments] other = "Kommentare anzeigen" + +[noscript] +other = "" # waitting for translation # === baseof === # === Post === diff --git a/i18n/en.toml b/i18n/en.toml index d47e8b0e..f1ba5df2 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -24,6 +24,9 @@ other = "Back to Top" [viewComments] other = "View Comments" + +[noscript] +other = "Theme FixIt works best with JavaScript enabled." # === baseof === # === Post === diff --git a/i18n/es.toml b/i18n/es.toml index a336abc2..b3bc6534 100644 --- a/i18n/es.toml +++ b/i18n/es.toml @@ -25,6 +25,9 @@ other = "Volver arriba" [viewComments] other = "Ver comentarios" + +[noscript] +other = "" # waitting for translation # === baseof === # === Post === diff --git a/i18n/fr.toml b/i18n/fr.toml index 61bbe670..dddc3ee1 100644 --- a/i18n/fr.toml +++ b/i18n/fr.toml @@ -25,6 +25,9 @@ other = "Retour en Haut" [viewComments] other = "Afficher les Commentaires" + +[noscript] +other = "" # waitting for translation # === baseof === # === Post === diff --git a/i18n/it.toml b/i18n/it.toml index 2c3b1a65..c36a31bf 100644 --- a/i18n/it.toml +++ b/i18n/it.toml @@ -25,6 +25,9 @@ other = "Torna all'inizio" [viewComments] other = "Vedi commenti" + +[noscript] +other = "" # waitting for translation # === baseof === # === Post === diff --git a/i18n/pl.toml b/i18n/pl.toml index 97194519..85a6deab 100644 --- a/i18n/pl.toml +++ b/i18n/pl.toml @@ -25,6 +25,9 @@ other = "Powrót do góry" [viewComments] other = "Zobacz komentarze" + +[noscript] +other = "" # waitting for translation # === baseof === # === Post === diff --git a/i18n/pt-BR.toml b/i18n/pt-BR.toml index df64a9c2..ed1e8ec3 100644 --- a/i18n/pt-BR.toml +++ b/i18n/pt-BR.toml @@ -25,6 +25,9 @@ other = "Voltar ao topo" [viewComments] other = "Ver comentários" + +[noscript] +other = "" # waitting for translation # === baseof === # === Post === diff --git a/i18n/ro.toml b/i18n/ro.toml index c311959d..a3059251 100644 --- a/i18n/ro.toml +++ b/i18n/ro.toml @@ -25,6 +25,9 @@ other = "Înapoi Sus" [viewComments] other = "Vizualizare Comentarii" + +[noscript] +other = "" # waitting for translation # === baseof === # === Post === diff --git a/i18n/ru.toml b/i18n/ru.toml index 0dcf93ef..7da1d752 100644 --- a/i18n/ru.toml +++ b/i18n/ru.toml @@ -25,6 +25,9 @@ other = "Наверх" [viewComments] other = "Посмотреть комментарии" + +[noscript] +other = "" # waitting for translation # === baseof === # === Post === diff --git a/i18n/sr.toml b/i18n/sr.toml index 38283829..1b8b921f 100644 --- a/i18n/sr.toml +++ b/i18n/sr.toml @@ -25,6 +25,9 @@ other = "Назад на Врх" [viewComments] other = "Погледај Коментаре" + +[noscript] +other = "" # waitting for translation # === baseof === # === Post === diff --git a/i18n/vi.toml b/i18n/vi.toml index ceadfb7b..dec089b7 100644 --- a/i18n/vi.toml +++ b/i18n/vi.toml @@ -24,6 +24,9 @@ other = "Lên trên" [viewComments] other = "Xem bình luận" + +[noscript] +other = "" # waitting for translation # === baseof === # === Post === diff --git a/i18n/zh-CN.toml b/i18n/zh-CN.toml index 21888603..5866c030 100644 --- a/i18n/zh-CN.toml +++ b/i18n/zh-CN.toml @@ -25,6 +25,9 @@ other = "回到顶部" [viewComments] other = "查看评论" + +[noscript] +other = "FixIt 主题在启用 JavaScript 的情况下效果最佳。" # === baseof === # === Post === diff --git a/i18n/zh-TW.toml b/i18n/zh-TW.toml index e943af8f..bf812fdc 100644 --- a/i18n/zh-TW.toml +++ b/i18n/zh-TW.toml @@ -25,6 +25,9 @@ other = "回到頂部" [viewComments] other = "查看評論" + +[noscript] +other = "FixIt 主題在啟用 JavaScript 的情況下效果最佳。" # === baseof === # === Post === diff --git a/layouts/partials/widgets.html b/layouts/partials/widgets.html index 0dadb3b0..44028413 100644 --- a/layouts/partials/widgets.html +++ b/layouts/partials/widgets.html @@ -44,4 +44,8 @@ {{- .Position | default "top" -}}: 0;height: {{ .Height | default "2px" }};"> {{- end -}} {{- end -}} - + + + \ No newline at end of file