Files
hugo-theme-stack/i18n/el.toml
T
4ad88a327e feat: add GDPR cookie consent banner (#1216)
* feat: add GDPR cookie consent banner

Add a GDPR-compliant cookie consent banner that gates analytics (Google
Analytics) and functional cookies (comments) until user consent is given.

Features:
- Theme-consistent styling using CSS variables (light/dark mode)
- Settings panel with category toggles (necessary, analytics, functional)
- Consent stored in cookie for 365 days
- Google Analytics only loads after analytics consent
- Comments only load after functional consent
- Translations for all 32 supported languages
- Accessible with proper ARIA attributes and focus management

Configuration in hugo.yaml:
  params:
    cookies:
      enabled: true
      categories:
        analytics: true
        functional: true

When cookies.enabled is false, scripts load normally without consent gating.

Closes #412

* refactor: move consent-gated GA to cookies/analytics.html

Move Google Analytics consent logic to avoid shadowing Hugo's internal
`_internal/google_analytics.html` template.

Changes:
- Rename google_analytics.html → cookies/analytics.html
- Update head.html to conditionally load:
  - cookies.enabled=true: cookies/analytics.html (consent-gated)
  - cookies.enabled=false: Hugo's _internal/google_analytics.html
- Align cookies/analytics.html with Hugo's internal template:
  - Support Privacy.GoogleAnalytics.Disable setting
  - Support Privacy.GoogleAnalytics.RespectDoNotTrack setting
  - Add UA- prefix deprecation warning

Note: Custom JS is required for consent-gated GA because Hugo templates
render at build time, but consent happens at runtime. We cannot call
Hugo's internal template after the user grants consent - we must
dynamically inject the GA script via JavaScript.

* style: indent cookies/analytics.html

* refactor: don't use default, put default configurations in params.toml

* fix: don't use `description` as translation key because it's reserved and will throw error

* fix: remove footer/components/custom-font.html call

* fix: banner showSettings key

* style: indent comments/include

* Add missing article.alert translation back

* style: format i18n toml files

* style: indent head/head.html

* style adjustment

* style: add missing -

* style: format demo/config/params.toml

* style: remove redundant comments from cookies.scss

* style: update box-shadow for cookie banner content

---------

Co-authored-by: delize <4028612+delize@users.noreply.github.com>
Co-authored-by: Jimmy Cai <jimmy@cai.im>
2026-02-19 17:21:25 +01:00

76 lines
3.1 KiB
TOML

toggleMenu = "Εναλλαγή Μενού"
darkMode = "Σκοτεινό θέμα"
[list]
section = "Ενότητα"
[list.page]
one = "{{ .Count }} σελιδα"
other = "{{ .Count }} σελιδες"
[list.subsection]
one = "Υποενότητα"
other = "Υποενότητες"
[article]
back = "Πισω"
tableOfContents = "Πινακας περιεχομενων"
relatedContent = "Σχετικο περιεχομενο"
lastUpdatedOn = "Τελευταια τροποποιηση στις"
[article.readingTime]
one = "{{ .Count }} λεπτό ανάγνωσης"
other = "{{ .Count }} λεπτά ανάγνωσης"
[article.alert]
note = "Σημείωση"
tip = "Συμβουλή"
important = "Σημαντικό"
warning = "Προειδοποίηση"
caution = "Προσοχή"
[notFound]
title = "Δε βρέθηκε"
subtitle = "Η σελίδα δε βρέθηκε."
[widget]
[widget.archives]
title = "Αρχειο"
more = "Περισσότερα"
[widget.tagCloud]
title = "Tags"
[search]
title = "Αναζήτηση"
placeholder = "Πληκτρολογήστε κάτι..."
resultTitle = "#PAGES_COUNT σελιδες (#TIME_SECONDS δευτερολεπτα)"
[footer]
builtWith = "Δημιουργήθηκε με τη χρήση {{ .Generator }}"
designedBy = "Το θέμα {{ .Theme }} σχεδιάστηκε από το {{ .DesignedBy }}"
[cookies]
title = "Συγκατάθεση για cookies"
text = "Χρησιμοποιούμε cookies για να βελτιώσουμε την εμπειρία περιήγησής σας και να αναλύσουμε την επισκεψιμότητα του ιστότοπου."
acceptAll = "Αποδοχή όλων"
deny = "Άρνηση"
managePreferences = "Διαχείριση προτιμήσεων"
settingsTitle = "Προτιμήσεις cookies"
savePreferences = "Αποθήκευση προτιμήσεων"
cancel = "Ακύρωση"
footerLink = "Ρυθμίσεις cookies"
commentsDisabled = "Τα σχόλια είναι απενεργοποιημένα μέχρι να αποδεχτείτε τα λειτουργικά cookies."
[cookies.necessary]
title = "Απαραίτητα"
text = "Αυτά τα cookies είναι απαραίτητα για τη λειτουργία του ιστότοπου και δεν μπορούν να απενεργοποιηθούν."
[cookies.analytics]
title = "Αναλυτικά"
text = "Αυτά τα cookies μας βοηθούν να κατανοήσουμε πώς οι επισκέπτες αλληλεπιδρούν με τον ιστότοπό μας."
[cookies.functional]
title = "Λειτουργικά"
text = "Αυτά τα cookies ενεργοποιούν λειτουργίες όπως σχόλια και ενσωματωμένο περιεχόμενο."