From 919d1371d639d8f7a100ab2caceebba0861c52a8 Mon Sep 17 00:00:00 2001 From: jascha Date: Mon, 5 Oct 2020 20:43:40 +0200 Subject: [PATCH] docs: update --- docs/404.html | 2 +- docs/de/index.html | 2 +- docs/index.html | 2 +- docs/magic.css | 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 5093eba..679fb1c 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 50f70ae..4788833 100644 --- a/docs/de/index.html +++ b/docs/de/index.html @@ -1,4 +1,4 @@ -@magic-modules/language-switch

LanguageSwitch

@magic-modules/language-switch

dies ist das +@magic-modules/language-switch

@magic-modules/language-switch

dies ist das @magic-modules LanguageSwitch modul. Es rendert ein Menu mit Sprachauswahl.

installation

npm install @magic-modules/language-switch

verwendung

hoisten in config.mjs:

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

caveat

bitte beachte, dass dieses modul nicht das menu veraendert.

ich habe es gebaut, um es auf meiner seite zu verwenden: jaeh.at, und die hat kein menu.

seiten

erstelle deine sprachfiles im pages directory, zum beispiel:

/src/pages/  index.mjs // englische seite  /de/    index.mjs // deutsche seite

state

LanguageSwitch braucht folgende informationen:

// /src/app.mjsexport const state = {  // ... other app state  languages: [    // die erste sprache ist der standard    { code: 'en', to: '/', text: 'english' },    { code: 'de', to: '/de/', text: 'deutsch' },  ],}

source

der sourcecode dieser page ist im diff --git a/docs/index.html b/docs/index.html index 23db182..b85dbb6 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,4 +1,4 @@ -@magic-modules/language-switch

@magic-modules/language-switch

this is the +@magic-modules/language-switch

@magic-modules/language-switch

this is the @magic-modules 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 diff --git a/docs/magic.css b/docs/magic.css index 1f76d86..e30c1b9 100644 --- a/docs/magic.css +++ b/docs/magic.css @@ -1 +1 @@ -html{scroll-behavior:smooth;overflow-y:scroll}h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,img,picture,source,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video,div,body{border:0;box-sizing:border-box;font:inherit;font-size:100%;margin:0;padding:0;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1.5;margin:0;max-width:100vw;overflow-x:hidden;padding:0;font-family:"Ubuntu Narrow",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,sans-serif}ul{display:inline-block;list-style:none}ol{display:inline-block;list-style:inside decimal}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}table{border-collapse:collapse;border-spacing:0}a{cursor:pointer;outline:none;white-space:nowrap;color:#eeeeee;text-decoration:underline;transition:color 500ms}b,strong{font-weight:700}i,em{font-style:italic}button,.button,input[type="reset"],input[type="button"],input[type="submit"],input[type="file"] > input[type="button"]{background-color:#9E9E9E;color:#212121;cursor:pointer;padding:0.5em}button:hover,.button:hover,input[type="reset"]:hover,input[type="button"]:hover,input[type="submit"]:hover,input[type="file"] > input[type="button"]:hover{background-color:#616161;color:#F5F5F5}button::-moz-focus-inner,.button::-moz-focus-inner,input[type="reset"]::-moz-focus-inner,input[type="button"]::-moz-focus-inner,input[type="submit"]::-moz-focus-inner,input[type="file"] > input[type="button"]::-moz-focus-inner{border:0 none;padding:0}#Magic{height:100%;min-height:100vh;width:100%;background-color:#232323;color:#cccccc;transition:color 300ms,background-color 300ms;font-weight:400}#Magic .icon{width:1.5em;height:auto;-webkit-animation:showHoisted 500ms 0s forwards;animation:showHoisted 500ms 0s forwards;opacity:0}.Wrapper{margin:0 auto;max-width:1300px;width:90%}.Header{display:inline-block;width:100%;padding:.5em 0 0}.Header .Logo{display:inline-block}.Header .Logo img{float:left}.Header .Logo span{float:left;font-size:1.5em;margin:.7em .2em}.Page h1{padding:1em 0 .2em}.Footer{width:100%;padding:2em 0 .5em;position:relative}h1,h2,h3,h4,h5{padding:1em 0 .2em}h1{font-size:1.4em}h2{font-size:1.3em}h3{font-size:1.2em}@-webkit-keyframes showHoisted{0%{opacity:0}100%{opacity:1}}@keyframes showHoisted{0%{opacity:0}100%{opacity:1}}.Credits{clear:both;display:block;margin:2em 0 1em}.Credits a{color:#cccccc;text-decoration:underline}.Credits a:hover{color:#c4c4c4}.Footer .Container{text-align:center}.GitBadges{display:inline-block;margin:15px 0}.GitBadges img{height:23px}.GitBadges li{margin:0 .5em 0 0;display:inline-block;float:left}.Header .Menu{display:inline-block;width:100%}.Header p{font-size:1.5em}.LanguageSwitch{position:fixed;top:0.5em;right:1.5em;left:auto;font-size:0.8em}.LightSwitch{bottom:0.5em;cursor:pointer;fill:#9E9E9E;left:0.5em;padding:0;position:fixed;top:auto}.LightSwitch:hover{fill:#616161}.Logo{float:left;height:2.4em}.Logo .stroke{fill:none;stroke:#663695;stroke-width:15;stroke-linecap:round;stroke-linejoin:round}.Logo .stroke.white{stroke:#ffffff}.Logo svg{display:inline-block;width:3em;height:auto}.Menu{float:none;margin:1.5em 0 0;position:relative;display:block;clear:both}.Menu li{float:none;margin:0 .5em 0 0;display:block}.Menu li.active > a{text-decoration:underline;color:#fefefe}.Menu li a{display:block;text-decoration:none}.Menu ul ul{position:relative;left:0;border-left:1px dotted;display:block;margin:0 0 0 0.2em;padding:0 0 0 0.3em}.NoSpy{bottom:0.5em;left:0.5em;position:fixed}.NoSpy .Container{background-color:#212121;border:1px solid;border-radius:.5em;color:#F5F5F5;display:inline-block;padding:1em;position:absolute;text-align:left;left:0;bottom:0;min-width:20em}.light .NoSpy .Container{background-color:#F5F5F5;color:#212121}.NoSpy .icon{position:absolute;left:0;bottom:0;cursor:pointer;color:#9E9E9E;stroke:#9E9E9E;fill:#9E9E9E}.NoSpy .icon:hover{color:#616161;stroke:#616161;fill:#616161}.NoSpy h3{padding:0;margin:0}.NoSpy input[type=button]{display:inline-block;margin:0.5em 0;width:100%}.Pre{background-color:#121212;border:1px solid #666;border-radius:5px;color:#eee;counter-reset:line;display:block;font-family:monospace;line-height:1.3;margin:1em 0;padding:1em .5em 0 .2em;position:relative;text-align:left;transition:color 300ms,background-color 300ms;white-space:pre}.Pre.lines pre > code{counter-increment:line;padding:0}.Pre.lines pre > code:last-child{padding:0 0 1em}.Pre.lines pre > code:before{content:counter(line);display:inline-block;padding:0 .5em 0 0;text-align:right;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:3ch}.Pre .actions{color:blueviolet}.Pre .boolean{color:#7979e4}.Pre .builtin{color:cadetblue}.Pre .colon{color:#8eef8e}.Pre .comment{opacity:0.7;font-style:italic}.Pre .html{color:#008800}.Pre .keyword{color:violet}.light .Pre{background-color:#ddd;color:#111}.light .Pre > code:before{color:#666}.light .Pre .html{color:#008800}.light .Pre .keyword{color:purple}.light .Pre .builtin{color:cadetblue}.light .Pre .string{color:#d15100}.light .Pre .colon{color:#016301}.light .Pre .boolean{color:blue}.light .Pre .actions{color:blueviolet}.light .Pre .state{color:cornflowerblue}.light .Pre .comment{color:#555;opacity:0.8;font-style:italic}.light .Pre .object{color:#016301}.light .Pre .property{color:#2a952a}.light .Pre a{color:#d15100}.light .Pre a:hover{color:turquoise}.Pre .menu{position:absolute;margin-top:-2em;right:0}.Pre .object{color:#00ff00}.Pre .property{color:#8eef8e}.Pre .state{color:cornflowerblue}.Pre .string{color:#dd8f00}.Pre > code:before{color:#666}.Pre a{color:turquoise}.Pre a:hover{color:#d15100}.Pre button{background-color:#666;border-radius:3px;color:#fefefe;margin:0 .2em;padding:1px 3px;border:0 none}.Pre pre{overflow-x:auto}.Pre pre > code{display:block;padding:0 1em 0}.Pre pre > code:last-child{padding:0 1em 1em}.SkipLink{height:1px;left:0;overflow:hidden;position:absolute;top:0;width:1px}#Magic.light{background-color:#eeeeee;color:#232323}h1:target,h2:target,h3:target,h4:target,h5:target{text-decoration:underline}:target > h1:first-child,:target > h2:first-child,:target > h3:first-child,:target > h4:first-child,:target > h5:first-child{text-decoration:underline}a:hover{color:#fefefe}.light a{color:#232323}.light a:hover{color:#232323}.Page{margin-bottom:3em}h4{font-size:1.1em}p{line-height:1.8}.light .Menu li.active > a{color:#232323}.Menu li.active li a{text-decoration:none}@media screen and (min-width:1024px){.Header{width:210px;position:fixed;float:left;max-height:100vh;height:100vh;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;box-sizing:border-box}.Header p{font-size:1em}.Header .Menu{max-width:210px;padding:0 0 2em}.Logo{float:none}.Menu{max-width:210px;padding:0 0 2em}.Page{float:right;width:calc(100% - 220px);min-height:83vh}.Footer{clear:both}}@media screen and (min-width:500px{.Header .Menu{width:auto;float:left}}@media screen and (min-width:900px){.NoSpy input[type=button]{margin:1em 3% 0 0;max-width:30%;width:auto}} \ No newline at end of file +html{scroll-behavior:smooth;overflow-y:scroll}h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,img,picture,source,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video,div,body{border:0;box-sizing:border-box;font:inherit;font-size:100%;margin:0;padding:0;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1.5;margin:0;max-width:100vw;overflow-x:hidden;padding:0;font-family:"Ubuntu Narrow",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,sans-serif}ul{display:inline-block;list-style:none}ol{display:inline-block;list-style:inside decimal}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}table{border-collapse:collapse;border-spacing:0}a{cursor:pointer;outline:none;white-space:nowrap;color:#eeeeee;text-decoration:underline;transition:color 500ms}b,strong{font-weight:700}i,em{font-style:italic}button,.button,input[type="reset"],input[type="button"],input[type="submit"],input[type="file"] > input[type="button"]{background-color:#9E9E9E;color:#212121;cursor:pointer;padding:0.5em}button:hover,.button:hover,input[type="reset"]:hover,input[type="button"]:hover,input[type="submit"]:hover,input[type="file"] > input[type="button"]:hover{background-color:#616161;color:#F5F5F5}button::-moz-focus-inner,.button::-moz-focus-inner,input[type="reset"]::-moz-focus-inner,input[type="button"]::-moz-focus-inner,input[type="submit"]::-moz-focus-inner,input[type="file"] > input[type="button"]::-moz-focus-inner{border:0 none;padding:0}#Magic{height:100%;min-height:100vh;width:100%;background-color:#232323;color:#cccccc;transition:color 300ms,background-color 300ms;font-weight:400}#Magic .icon{width:1.5em;height:auto;-webkit-animation:showHoisted 500ms 0s forwards;animation:showHoisted 500ms 0s forwards;opacity:0}.Wrapper{margin:0 auto;max-width:1300px;width:90%}.Header{display:inline-block;width:100%;padding:.5em 0 0}.Header .Logo{display:inline-block}.Header .Logo img{float:left}.Header .Logo span{float:left;font-size:1.5em;margin:.7em .2em}.Page h1{padding:1em 0 .2em}.Footer{width:100%;padding:2em 0 .5em;position:relative}h1,h2,h3,h4,h5{padding:1em 0 .2em}h1{font-size:1.4em}h2{font-size:1.3em}h3{font-size:1.2em}@-webkit-keyframes showHoisted{0%{opacity:0}100%{opacity:1}}@keyframes showHoisted{0%{opacity:0}100%{opacity:1}}.Credits{clear:both;display:block;margin:2em 0 1em}.Credits a{color:#cccccc;text-decoration:underline}.Credits a:hover{color:#c4c4c4}.Footer .Container{text-align:center}.GitBadges{display:inline-block;margin:15px 0}.GitBadges img{height:23px}.GitBadges li{margin:0 .5em 0 0;display:inline-block;float:left}.Header .Menu{display:inline-block;width:100%}.Header p{font-size:1.5em}.LanguageSwitch{position:fixed;top:0.5em;right:1.5em;left:auto;font-size:0.8em}.LightSwitch{bottom:0.5em;cursor:pointer;fill:#9E9E9E;left:0.5em;padding:0;position:fixed;top:auto}.LightSwitch:hover{fill:#616161}.Logo{float:left;height:2.4em}.Logo .stroke{fill:none;stroke:#663695;stroke-width:15;stroke-linecap:round;stroke-linejoin:round}.Logo .stroke.white{stroke:#ffffff}.Logo svg{display:inline-block;width:3em;height:auto}.Menu{float:none;margin:1.5em 0 0;position:relative;display:block;clear:both}.Menu li{float:none;margin:0 .5em 0 0;display:block}.Menu li.active > a{text-decoration:underline;color:#fefefe}.Menu li a{display:block;text-decoration:none}.Menu ul ul{position:relative;left:0;border-left:1px dotted;display:block;margin:0 0 0 0.2em;padding:0 0 0 0.3em}.NoSpy{bottom:0.5em;left:0.5em;position:fixed}.NoSpy .Container{background-color:#212121;border:1px solid;border-radius:.5em;color:#F5F5F5;display:inline-block;padding:1em;position:absolute;text-align:left;left:0;bottom:0;min-width:20em}.light .NoSpy .Container{background-color:#F5F5F5;color:#212121}.NoSpy .icon{position:absolute;left:0;bottom:0;cursor:pointer;color:#9E9E9E;stroke:#9E9E9E;fill:#9E9E9E}.NoSpy .icon:hover{color:#616161;stroke:#616161;fill:#616161}.NoSpy h3{padding:0;margin:0}.NoSpy input[type=button]{display:inline-block;margin:0.5em 0;width:100%}.Pre{background-color:#121212;border:1px solid #666;border-radius:5px;color:#eee;counter-reset:line;display:block;font-family:monospace;line-height:1.3;margin:1em 0;padding:1em .5em 0 .2em;position:relative;text-align:left;transition:color 300ms,background-color 300ms;white-space:pre}.Pre.lines pre > code{counter-increment:line;padding:0}.Pre.lines pre > code:last-child{padding:0 0 1em}.Pre.lines pre > code:before{content:counter(line);display:inline-block;padding:0 .5em 0 0;text-align:right;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:3ch}.Pre .actions{color:blueviolet}.Pre .boolean{color:#7979e4}.Pre .builtin{color:cadetblue}.Pre .colon{color:#8eef8e}.Pre .comment{opacity:0.7;font-style:italic}.Pre .html{color:#008800}.Pre .keyword{color:violet}.light .Pre{background-color:#ddd;color:#111}.light .Pre > code:before{color:#666}.light .Pre .html{color:#008800}.light .Pre .keyword{color:purple}.light .Pre .builtin{color:cadetblue}.light .Pre .string{color:#d15100}.light .Pre .colon{color:#016301}.light .Pre .boolean{color:blue}.light .Pre .actions{color:blueviolet}.light .Pre .state{color:cornflowerblue}.light .Pre .comment{color:#555;opacity:0.8;font-style:italic}.light .Pre .object{color:#016301}.light .Pre .property{color:#2a952a}.light .Pre a{color:#d15100}.light .Pre a:hover{color:turquoise}.Pre .menu{position:absolute;margin-top:-2em;right:0}.Pre .object{color:#00ff00}.Pre .property{color:#8eef8e}.Pre .state{color:cornflowerblue}.Pre .string{color:#dd8f00}.Pre > code:before{color:#666}.Pre a{color:turquoise}.Pre a:hover{color:#d15100}.Pre button{background-color:#666;border-radius:3px;color:#fefefe;margin:0 .2em;padding:1px 3px;border:0 none}.Pre pre{overflow-x:auto}.Pre pre > code{display:block;padding:0 1em 0}.Pre pre > code:last-child{padding:0 1em 1em}.SkipLink{height:1px;left:0;overflow:hidden;position:absolute;top:0;width:1px}#Magic.light{background-color:#eeeeee;color:#232323}h1:target,h2:target,h3:target,h4:target,h5:target{text-decoration:underline}:target > h1:first-child,:target > h2:first-child,:target > h3:first-child,:target > h4:first-child,:target > h5:first-child{text-decoration:underline}a:hover{color:#fefefe}.light a{color:#232323}.light a:hover{color:#232323}.Page{margin-bottom:3em}h4{font-size:1.1em}p{line-height:1.8}.light .Menu li.active > a{color:#232323}.Menu li.active li a{text-decoration:none}@media screen and (min-width:1024px){.Header{width:210px;position:fixed;float:left;max-height:100vh;height:100vh;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;box-sizing:border-box}.Header p{font-size:1em}.Header .Menu{max-width:210px;padding:0 0 2em}.Logo{float:none}.Menu{max-width:210px;padding:0 0 2em}.Page{float:right;width:calc(100% - 220px);min-height:83vh}.Footer{clear:both}}@media screen and (min-width:500px){.Header .Menu{width:auto;float:left}}@media screen and (min-width:900px){.NoSpy input[type=button]{margin:1em 3% 0 0;max-width:30%;width:auto}} \ No newline at end of file diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 974dfbd..ee0ac31 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -7,21 +7,21 @@ https://magic-modules.github.io/language-switch/ - 2020-08-28 + 2020-10-05 weekly 0.5 https://magic-modules.github.io/language-switch/de/ - 2020-08-28 + 2020-10-05 weekly 0.5 https://magic-modules.github.io/language-switch/404/ - 2020-08-28 + 2020-10-05 weekly 0.5 diff --git a/docs/sri-hashes.json b/docs/sri-hashes.json index ba34d83..17ae3aa 100644 --- a/docs/sri-hashes.json +++ b/docs/sri-hashes.json @@ -1,9 +1,9 @@ { - "/magic.css": "sha384-FCpnCPOaWdtazDlnwEhl+IMFzJiiPuYWKTfzrxbMwFjHPEq/Z+6O7GgUyXNz055X", + "/magic.css": "sha384-6TZBTNHLKlB2V52pESNlAYAXPv/seNzwGVNGlmXnbq4/9PhAFm3r7DPJFRayvFqj", "/magic.js": "sha384-lm8RNjME0/g4Xc2FDLLmbMHvXcKJks7e+UoxBp/95CXFlvuoNdj2q/tpskq/Upfm", - "/language-switch/": "sha384-70xZNCNhLYs3zRi2ynw/cMlorQhKIcZSDpvc7B+6uT/57MSzKMpKnmLmQpEZYUgG", - "/language-switch/404/": "sha384-ZAQfKkVw+3FH6yZv9mygG6SR3anrtLqDbcwh64x4dnogFoa92dJRu22hc4eo3NtY", - "/language-switch/de/": "sha384-7FBq/HTd/562RE896Ib/cdOCNj/lKah8pbbxTP0i/9JyNZJTV/CihQ1ttXwHHsmD", + "/language-switch/": "sha384-QEMW+ejQ80UoF6SDCYrfEYQtF6TpBu5HMrsO14+qQmf4N+4U9REfHbuAYKVC6m/c", + "/language-switch/404/": "sha384-5Ljxm1+m2siHCdilSsrrVm3eJmShWMWIcLgKTQRuh6Nr9vf5mCsAUCnGO2isB+6D", + "/language-switch/de/": "sha384-RnA2gO2ufIN+kyDbxnpQmzGm0lOoYDa2wsAYfbnaN3Imr0YD38eSlPj+Y4XLFiZk", "/robots.txt": "sha384-EvHv8YVb32aNnvUUecOCU8MRA2ptLVqBusyQVK1ByNv9WOpKmKihoQthL7cADdoO", - "/sitemap.xml": "sha384-XgveKKXqi7beZdfqexhA4luGydA3aPmJL8/lTFIAWTJ8tFUCwzyeYrUL/SPIu64r" + "/sitemap.xml": "sha384-x8kzvAGpl753iesTDM6Ln0R3AdEaFz9LlAtgNClIGRSmMpb9fVPftgkQaVcQt20o" } \ No newline at end of file