From 8ebd45e208ed7acbcd16a4cf4a21e1a9b6ce2e57 Mon Sep 17 00:00:00 2001 From: jascha Date: Sun, 17 Jan 2021 02:45:23 +0100 Subject: [PATCH] docs: update --- docs/404.html | 2 +- docs/de/index.html | 2 +- docs/index.html | 2 +- docs/magic.js | 2 +- docs/sitemap.xml | 6 +++--- docs/sri-hashes.json | 10 +++++----- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/404.html b/docs/404.html index eedc320..b6b4b99 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1 +1 @@ -404 - not found

LanguageSwitch

404 - not found.
made with a few bits of magic
\ No newline at end of file +404 - not found

LanguageSwitch

404 - not found.
made with a few bits of magic
\ No newline at end of file diff --git a/docs/de/index.html b/docs/de/index.html index 199bd28..2fc4128 100644 --- a/docs/de/index.html +++ b/docs/de/index.html @@ -5,4 +5,4 @@ example directory und wird mit @magic/core -gebaut und zu github publiziert.

\ No newline at end of file +gebaut und zu github publiziert.

\ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 1ef0808..14f70e5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -3,4 +3,4 @@ LanguageSwitch component. It provides a language switch menu.

installation

npm install @magic-modules/language-switch

usage

hoist in config.mjs:

// /src/config.mjsexport default {  HOIST: ['LanguageSwitch'],}

caveat

please note that this module will not change anything about the menu.

i built it to use it on my page jaeh.at, which does not have a menu.

pages

create your languages in the pages directory, for example:

/pages/  index.mjs // english page  /de/    index.mjs // german page

state

LanguageSwitch needs to know about the languages in your app.

// /assets/app.mjsexport const state = {  // ... other app state  languages: [    // the first language is the default fallback    { code: 'en', to: '/', text: 'english' },    { code: 'de', to: '/de/', text: 'deutsch' },  ],}

thats it, your magic app now knows about your languages

source

the source for this page is in the example directory and gets built and published to github using -@magic/core

\ No newline at end of file +@magic/core

\ No newline at end of file diff --git a/docs/magic.js b/docs/magic.js index 127ecb5..de9e488 100644 --- a/docs/magic.js +++ b/docs/magic.js @@ -1 +1 @@ -"use strict";function b(a){return s(a)||c(a)||n(a)||m()}function c(a){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(a))return Array.from(a)}function d(a,b){if(null==a)return{};var c,d,f=e(a,b);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(a);for(d=0;da.length)&&(b=a.length);for(var c=0,d=Array(b);cy)for(;x<=z;)c.insertBefore(p(u[x]=v(u[x++]),f,g),(k=t[w])&&k.node);else if(x>z)for(;w<=y;)c.removeChild(t[w++].node);else{for(var A=w,B={},C={};A<=y;A++)null!=(l=t[A].key)&&(B[l]=t[A]);for(;x<=z;){if(l=q(k=t[w]),m=q(u[x]=v(u[x],k)),C[l]||null!=m&&m===q(t[w+1])){null==l&&c.removeChild(k.node),w++;continue}null==m||1===d.type?(null==l&&(r(c,k&&k.node,k,u[x],f,g),x++),w++):(l===m?(r(c,k.node,k,u[x],f,g),C[m]=!0,w++):null==(h=B[m])?r(c,k&&k.node,null,u[x],f,g):(r(c,c.insertBefore(h.node,k&&k.node),h,u[x],f,g),C[m]=!0),x++)}for(;w<=y;)null==q(k=t[w++])&&c.removeChild(k.node);for(var A in B)null==C[A]&&c.removeChild(B[A].node)}}return e.node=c},s=function(c,a){for(var b in c)if(c[b]!==a[b])return!0;for(var b in a)if(c[b]!==a[b])return!0},u=function(a){return"object"===t(a)?a:x(a)},v=function(b,c){return b.type===a?((!c||!c.lazy||s(c.lazy,b.lazy))&&((c=u(b.lazy.view(b.lazy))).lazy=b.lazy),c):b},w=function(a,b,c,d,e,f){return{name:a,props:b,children:c,node:d,type:f,key:e}},x=function(a,e){return w(a,c,d,e,void 0,b)},y=function(a){return a.nodeType===b?x(a.nodeValue,a):w(a.nodeName.toLowerCase(),c,e.call(a.childNodes,y),a,void 0,1)};return{h:function h(a,b){for(var d,e=[],g=[],h=arguments.length;2"],stringRegex:/("|')(.*?)\1/gim,wordRegex:/( )/gim},preventDefault:function preventDefault(a){return a.preventDefault(),a}},na={changeLanguage:function changeLanguage(a,b){return j(j({},a),{},{language:b})},changeTheme:function changeTheme(a){return j(j({},a),{},{pageClass:j(j({},a.pageClass),{},{light:"dark"===a.theme}),theme:"dark"===a.theme?"light":"dark"})},go:function go(a,b){var c=b.currentTarget.href.replace(window.location.origin,""),d=c.split("#"),e=l(d,2),f=e[0],g=e[1],h=void 0===g?"":g;if(f===a.url&&h===a.hash)return h&&(window.location.hash=h),a;var i=window,k=i.scrollY,m=a.pages&&a.pages[f]&&a.pages[f].title;if(m&&(document.title=a.title=m),f===a.url)window.location.hash=h;else if(!h){var n=document.getElementsByTagName("html"),o=l(n,1),p=o[0],q=p.style.scrollBehavior;p.style.scrollBehavior="auto",window.scrollTo({top:0,behavior:"smooth"}),p.style.scrollBehavior=q}return window.history.pushState({url:f,hash:h,scrollY:k},a.title,c),j(j({},a),{},{url:f,hash:h,prev:a.url})},nospy:{toggle:function toggle(a){return a.nospy.show=!a.nospy.show,j({},a)}},pop:function pop(a,b){var c=window.location,d=c.pathname,e=c.hash;e=e.substring(1);var f=0;return b.state&&(d=b.state.url,e=b.state.hash,f=b.state.scrollY||0),e?window.location.hash=e:window.scroll({top:f,behavior:"smooth"}),j(j({},a),{},{url:d,hash:e})},pre:{clip:function clip(a,b){var c=b.content;if("undefined"!=typeof document&&"function"==typeof document.execCommand){var d=document.createElement("textarea");d.id="copy",d.innerHTML=c,document.body.appendChild(d);var e=document.getElementById("copy");e.select(),document.execCommand("copy"),document.body.removeChild(e)}return a}}},oa={"/language-switch/":function languageSwitch(){return[g({id:"magic-moduleslanguage-switch"},"@magic-modules/language-switch"),M(["this is the\n",ea({to:"https://github.com/magic-modules",text:"@magic-modules"}),"\nLanguageSwitch component. It provides a language switch menu."]),_("@magic-modules/language-switch"),B({id:"installation"},"installation"),la({lines:"false"},"npm install @magic-modules/language-switch"),B({id:"usage"},"usage"),M("hoist in config.mjs:"),la("// /src/config.mjs\nexport default {\n HOIST: ['LanguageSwitch'],\n}"),C({id:"caveat"},"caveat"),M("please note that this module will not change anything about the menu."),M(["i built it to use it on my page ",ea({to:"https://jaeh.at",text:"jaeh.at"}),", which does not have a menu."]),B({id:"pages"},"pages"),M("create your languages in the pages directory, for example:"),la("/pages/\n index.mjs // english page\n /de/\n index.mjs // german page"),B({id:"state"},"state"),M("LanguageSwitch needs to know about the languages in your app."),la("// /assets/app.mjs\nexport const state = {\n // ... other app state\n languages: [\n // the first language is the default fallback\n { code: 'en', to: '/', text: 'english' },\n { code: 'de', to: '/de/', text: 'deutsch' },\n ],\n}"),M("thats it, your magic app now knows about your languages"),B({id:"source"},"source"),M(["the source for this page is in the\n",ea({to:"https://github.com/magic-modules/language-switch/tree/master/example",text:"example directory"}),"\nand gets built and published to github using\n",ea({to:"https://github.com/magic/core",text:"@magic/core"})])]},"/language-switch/404/":function languageSwitch404(){return y("404 - not found.")},"/language-switch/de/":function languageSwitchDe(){return[g({id:"magic-moduleslanguage-switch"},"@magic-modules/language-switch"),M(["dies ist das\n",ea({to:"https://github.com/magic-modules",text:"@magic-modules"}),"\nLanguageSwitch modul. Es rendert ein Menu mit Sprachauswahl."]),_("@magic-modules/language-switch"),B({id:"installation"},"installation"),la({lines:"false"},"npm install @magic-modules/language-switch"),B({id:"usage"},"verwendung"),M("hoisten in config.mjs:"),la("// /src/config.mjs\nexport default {\n HOIST: ['LanguageSwitch'],\n}"),C({id:"caveat"},"caveat"),M("bitte beachte, dass dieses modul nicht das menu veraendert."),M(["ich habe es gebaut, um es auf meiner seite zu verwenden: ",ea({to:"https://jaeh.at",text:"jaeh.at"}),",\nund die hat kein menu."]),B({id:"pages"},"seiten"),M("erstelle deine sprachfiles im pages directory, zum beispiel:"),la("/src/pages/\n index.mjs // englische seite\n /de/\n index.mjs // deutsche seite"),B({id:"state"},"state"),M("LanguageSwitch braucht folgende informationen:"),la("// /src/app.mjs\nexport const state = {\n // ... other app state\n languages: [\n // die erste sprache ist der standard\n { code: 'en', to: '/', text: 'english' },\n { code: 'de', to: '/de/', text: 'deutsch' },\n ],\n}"),B({id:"source"},"source"),M(["der sourcecode dieser page ist im\n",ea({to:"https://github.com/magic-modules/language-switch/tree/master/example",text:"example directory"}),"\nund wird mit\n",ea({to:"https://github.com/magic/core",text:"@magic/core"}),"\ngebaut und zu github publiziert."])]}};h({init:j(j({},U),{},{url:window.location.pathname,hash:window.location.hash.substr(1)}),subscriptions:function subscriptions(){return[[V.listenPopState,na.pop]]},view:function(a){var b=oa[a.url]?a.url:"/404/",c=oa[b],d=a.pages&&a.pages[b];return d&&Object.keys(d).forEach(function(b){a[b]=d[b]}),a.url=b,ka({page:c,state:a},[da(a),ja(a),ca(a)])},node:document.getElementById("Magic")}); \ No newline at end of file +"use strict";function b(a){return s(a)||c(a)||n(a)||m()}function c(a){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(a))return Array.from(a)}function d(a,b){if(null==a)return{};var c,d,f=e(a,b);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(a);for(d=0;da.length)&&(b=a.length);for(var c=0,d=Array(b);cy)for(;x<=z;)c.insertBefore(p(u[x]=v(u[x++]),f,g),(k=t[w])&&k.node);else if(x>z)for(;w<=y;)c.removeChild(t[w++].node);else{for(var A=w,B={},C={};A<=y;A++)null!=(l=t[A].key)&&(B[l]=t[A]);for(;x<=z;){if(l=q(k=t[w]),m=q(u[x]=v(u[x],k)),C[l]||null!=m&&m===q(t[w+1])){null==l&&c.removeChild(k.node),w++;continue}null==m||1===d.type?(null==l&&(r(c,k&&k.node,k,u[x],f,g),x++),w++):(l===m?(r(c,k.node,k,u[x],f,g),C[m]=!0,w++):null==(h=B[m])?r(c,k&&k.node,null,u[x],f,g):(r(c,c.insertBefore(h.node,k&&k.node),h,u[x],f,g),C[m]=!0),x++)}for(;w<=y;)null==q(k=t[w++])&&c.removeChild(k.node);for(var A in B)null==C[A]&&c.removeChild(B[A].node)}}return e.node=c},s=function(c,a){for(var b in c)if(c[b]!==a[b])return!0;for(var b in a)if(c[b]!==a[b])return!0},u=function(a){return"object"===t(a)?a:x(a)},v=function(b,c){return b.type===a?((!c||!c.lazy||s(c.lazy,b.lazy))&&((c=u(b.lazy.view(b.lazy))).lazy=b.lazy),c):b},w=function(a,b,c,d,e,f){return{name:a,props:b,children:c,node:d,type:f,key:e}},x=function(a,e){return w(a,c,d,e,void 0,b)},y=function(a){return a.nodeType===b?x(a.nodeValue,a):w(a.nodeName.toLowerCase(),c,e.call(a.childNodes,y),a,void 0,1)};return{h:function h(a,b){for(var d,e=[],g=[],h=arguments.length;2"],stringRegex:/("|')(.*?)\1/gim,wordRegex:/( )/gim},preventDefault:function preventDefault(a){return a.preventDefault(),a}},na={changeLanguage:function changeLanguage(a,b){return j(j({},a),{},{language:b})},changeTheme:function changeTheme(a){return j(j({},a),{},{pageClass:j(j({},a.pageClass),{},{light:"dark"===a.theme}),theme:"dark"===a.theme?"light":"dark"})},go:function go(a,b){var c=b.currentTarget.href.replace(window.location.origin,""),d=c.split("#"),e=l(d,2),f=e[0],g=e[1],h=void 0===g?"":g;if(f===a.url&&h===a.hash)return h&&(window.location.hash=h),a;var i=window,k=i.scrollY,m=a.pages&&a.pages[f]&&a.pages[f].title;if(m&&(document.title=a.title=m),f===a.url)window.location.hash=h;else if(!h){var n=document.getElementsByTagName("html"),o=l(n,1),p=o[0],q=p.style.scrollBehavior;p.style.scrollBehavior="auto",window.scrollTo({top:0,behavior:"smooth"}),p.style.scrollBehavior=q}return window.history.pushState({url:f,hash:h,scrollY:k},a.title,c),j(j({},a),{},{url:f,hash:h,prev:a.url})},nospy:{toggle:function toggle(a){return a.nospy.show=!a.nospy.show,j({},a)}},pop:function pop(a,b){var c=window.location,d=c.pathname,e=c.hash;e=e.substring(1);var f=0;return b.state&&(d=b.state.url,e=b.state.hash,f=b.state.scrollY||0),e?window.location.hash=e:window.scroll({top:f,behavior:"smooth"}),j(j({},a),{},{url:d,hash:e})},pre:{clip:function clip(a,b){var c=b.content;if("undefined"!=typeof document&&"function"==typeof document.execCommand){var d=document.createElement("textarea");d.id="copy",d.innerHTML=c,document.body.appendChild(d);var e=document.getElementById("copy");e.select(),document.execCommand("copy"),document.body.removeChild(e)}return a}}},oa={"/language-switch/":function languageSwitch(){return[g({id:"magic-moduleslanguage-switch"},"@magic-modules/language-switch"),M(["this is the\n",ea({to:"https://github.com/magic-modules",text:"@magic-modules"}),"\nLanguageSwitch component. It provides a language switch menu."]),_("@magic-modules/language-switch"),B({id:"installation"},"installation"),la({lines:"false"},"npm install @magic-modules/language-switch"),B({id:"usage"},"usage"),M("hoist in config.mjs:"),la("// /src/config.mjs\nexport default {\n HOIST: ['LanguageSwitch'],\n}"),C({id:"caveat"},"caveat"),M("please note that this module will not change anything about the menu."),M(["i built it to use it on my page ",ea({to:"https://jaeh.at",text:"jaeh.at"}),", which does not have a menu."]),B({id:"pages"},"pages"),M("create your languages in the pages directory, for example:"),la("/pages/\n index.mjs // english page\n /de/\n index.mjs // german page"),B({id:"state"},"state"),M("LanguageSwitch needs to know about the languages in your app."),la("// /assets/app.mjs\nexport const state = {\n // ... other app state\n languages: [\n // the first language is the default fallback\n { code: 'en', to: '/', text: 'english' },\n { code: 'de', to: '/de/', text: 'deutsch' },\n ],\n}"),M("thats it, your magic app now knows about your languages"),B({id:"source"},"source"),M(["the source for this page is in the\n",ea({to:"https://github.com/magic-modules/language-switch/tree/master/example",text:"example directory"}),"\nand gets built and published to github using\n",ea({to:"https://github.com/magic/core",text:"@magic/core"})])]},"/language-switch/404/":function languageSwitch404(){return y("404 - not found.")},"/language-switch/de/":function languageSwitchDe(){return[g({id:"magic-moduleslanguage-switch"},"@magic-modules/language-switch"),M(["dies ist das\n",ea({to:"https://github.com/magic-modules",text:"@magic-modules"}),"\nLanguageSwitch modul. Es rendert ein Menu mit Sprachauswahl."]),_("@magic-modules/language-switch"),B({id:"installation"},"installation"),la({lines:"false"},"npm install @magic-modules/language-switch"),B({id:"usage"},"verwendung"),M("hoisten in config.mjs:"),la("// /src/config.mjs\nexport default {\n HOIST: ['LanguageSwitch'],\n}"),C({id:"caveat"},"caveat"),M("bitte beachte, dass dieses modul nicht das menu veraendert."),M(["ich habe es gebaut, um es auf meiner seite zu verwenden: ",ea({to:"https://jaeh.at",text:"jaeh.at"}),",\nund die hat kein menu."]),B({id:"pages"},"seiten"),M("erstelle deine sprachfiles im pages directory, zum beispiel:"),la("/src/pages/\n index.mjs // englische seite\n /de/\n index.mjs // deutsche seite"),B({id:"state"},"state"),M("LanguageSwitch braucht folgende informationen:"),la("// /src/app.mjs\nexport const state = {\n // ... other app state\n languages: [\n // die erste sprache ist der standard\n { code: 'en', to: '/', text: 'english' },\n { code: 'de', to: '/de/', text: 'deutsch' },\n ],\n}"),B({id:"source"},"source"),M(["der sourcecode dieser page ist im\n",ea({to:"https://github.com/magic-modules/language-switch/tree/master/example",text:"example directory"}),"\nund wird mit\n",ea({to:"https://github.com/magic/core",text:"@magic/core"}),"\ngebaut und zu github publiziert."])]}};h({init:j(j({},U),{},{url:window.location.pathname,hash:window.location.hash.substr(1)}),subscriptions:function subscriptions(){return[[V.listenPopState,na.pop]]},view:function(a){var b=oa[a.url]?a.url:"/404/",c=oa[b],d=a.pages&&a.pages[b];return d&&Object.keys(d).forEach(function(b){a[b]=d[b]}),a.url=b,ka({page:c,state:a},[da(a),ja(a),ca(a)])},node:document.getElementById("Magic")}); \ No newline at end of file diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 3281187..dc84546 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -7,21 +7,21 @@ https://magic-modules.github.io/language-switch/ - 2021-01-05 + 2021-01-17 weekly 0.5 https://magic-modules.github.io/language-switch/de/ - 2021-01-05 + 2021-01-17 weekly 0.5 https://magic-modules.github.io/language-switch/404/ - 2021-01-05 + 2021-01-17 weekly 0.5 diff --git a/docs/sri-hashes.json b/docs/sri-hashes.json index 350c14e..1510295 100644 --- a/docs/sri-hashes.json +++ b/docs/sri-hashes.json @@ -1,9 +1,9 @@ { "/magic.css": "sha384-6TZBTNHLKlB2V52pESNlAYAXPv/seNzwGVNGlmXnbq4/9PhAFm3r7DPJFRayvFqj", - "/magic.js": "sha384-ABUAQZFAzbkJk/CHxcj+FijlbwBDqXwaFeljqRUgcfIpDAAhwkHcuXCyVGxQI5px", - "/language-switch/": "sha384-NMEjATCzfQY5tY8Ga6VeDvid9WTsbykS2tRx9Vd9Bh6tAznJvcpLhP60O4IjhyDB", - "/language-switch/404/": "sha384-sEK/FcHHZ+JUipk1a7g2JFS7/OVRzx8qpbN+LLlUaAdXYeIp84Y4fas1uCgFHP0+", - "/language-switch/de/": "sha384-0Ubx8ka0N5xM6SvZ69FTgdiFFaqPYGgO6neWScMgCBb2RzvSJgDgvNCjYveu5kHe", + "/magic.js": "sha384-xS786N3JYQL4L1RMYXBJgW28Kr45Bk1dd4dG+rC6U1ceIV8kgwohQlIrKSEg+GPt", + "/language-switch/": "sha384-VnNVRUBz1f0p0YCvBx+yEna3CP40M8lV/MwGSWBK+a2kwBiyWRhbx3Cjt6uT89zw", + "/language-switch/404/": "sha384-yDLKKliatwC1rdlWAP4UNzvrW5NMJ3s0PNnkda5lY525/dRbARKwKqc10ekLh3pD", + "/language-switch/de/": "sha384-2qKlOFXjuUGudi/WeI5lScH6dMvxGCvr0kSZzRivvSymj4TG8Z7QS6DCsZEdsJBC", "/robots.txt": "sha384-EvHv8YVb32aNnvUUecOCU8MRA2ptLVqBusyQVK1ByNv9WOpKmKihoQthL7cADdoO", - "/sitemap.xml": "sha384-lIU2bzka7NaZriv0Wpkyc43dmUct2ByZQq5/Y/ay6ExX3iM4BthJ7R8mSLZbROLw" + "/sitemap.xml": "sha384-faGk4Rdx7HdCt75hJ2Jxlo1b4ZqUbWI1C/Zv7kblKtd2Fjauj/FG4273EvEwjclW" } \ No newline at end of file