%# --------------------------------------------------------------- # docmd : the zero-config documentation engine. # Cookie consent dialog. # # Rendered only when `config.cookie` is set (opt-in). The companion # CSS lives in `docmd-main.css`; the persistence + UI logic lives in # `docmd-main.js`. Both are overridable by templates via the standard # CSS / JS asset priority system, but never by customCss (which always # wins). # # Configuration: # { # "cookie": { # "enabled": true, // default: true # "message": "...", // default: translation key `cookieMessage` # "acceptText": "Accept", // default: translation key `cookieAccept` # "declineText": "Decline", // default: translation key `cookieDecline` # "policyUrl": "/privacy", // optional # "position": "bottom", // "bottom" | "bottom-left" | "bottom-right" | "center" # "dismissible": true, // show a close (X) button # "expiryDays": 180 // localStorage TTL # } # } # --------------------------------------------------------------- %> <% const cookie = (typeof config !== 'undefined' && config.cookie) || null; %> <% if (cookie && cookie.enabled !== false) { %> <% const _cMsg = cookie.message || (typeof t === 'function' ? t('cookieMessage') : 'This site uses cookies to ensure you get the best experience.'); const _cAccept = cookie.acceptText || (typeof t === 'function' ? t('cookieAccept') : 'Accept'); const _cDecline = cookie.declineText || (typeof t === 'function' ? t('cookieDecline') : 'Decline'); const _cPos = cookie.position || 'bottom'; const _cDismissible = cookie.dismissible !== false; const _cPolicy = cookie.policyUrl || null; const _cExpiry = cookie.expiryDays || 180; %>
<% } %>