mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-18 03:15:11 +00:00
feat(documentation): svelte app as document generator (#566)
* check in full site application * rm unused assets components * change base css * i18n * new doc workflow * fix crosslink to doc in github * nav, console link, assets, console brand * edit configjs server * rm go struct references * cleanup input output bindings * working dir * export path * always trigger * rel paths * cname * rev workdir * fix fallbacklanguage, home on large screens * remove mit from site
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
export function getCookie(name, cookies) {
|
||||
if (cookies == null) {
|
||||
if (typeof window === 'undefined') {
|
||||
return undefined;
|
||||
}
|
||||
cookies = document.cookie;
|
||||
}
|
||||
|
||||
const kv = cookies.split(';').find((part) => part.trim().startsWith(name));
|
||||
|
||||
if (!kv) return undefined;
|
||||
|
||||
const cookieValue = kv.split('=')[1];
|
||||
if (!cookieValue) return undefined;
|
||||
|
||||
return decodeURIComponent(cookieValue.trim());
|
||||
}
|
||||
|
||||
export function setCookie(name, value, options = {}) {
|
||||
if (options.expires instanceof Date) {
|
||||
options.expires = options.expires.toUTCString();
|
||||
}
|
||||
|
||||
let updatedCookie = {
|
||||
[encodeURIComponent(name)]: encodeURIComponent(value),
|
||||
sameSite: 'strict',
|
||||
...options,
|
||||
};
|
||||
|
||||
document.cookie = Object.entries(updatedCookie)
|
||||
.map((kv) => kv.join('='))
|
||||
.join(';');
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import { writable } from 'svelte/store';
|
||||
|
||||
export const docLanguages = writable(['de', 'en']);
|
||||
|
||||
export function storeValue(lngs) {
|
||||
console.log('lngs: ' + lngs);
|
||||
docLanguages.set(lngs);
|
||||
}
|
||||
Reference in New Issue
Block a user