Skip to content

Commit

Permalink
docs: update
Browse files Browse the repository at this point in the history
  • Loading branch information
jaeh committed Oct 5, 2020
1 parent 3ace96c commit 919d137
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/404.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link rel="icon" href="/language-switch/favicon.ico"/><title>404 - not found</title><meta name="description" content="404 - not found."/><script type="application/ld+json">{"@context":"http://schema.org","@type":"website","name":"404 - not found"}</script><link rel="stylesheet" href="/language-switch/magic.css?FCpnCPOaWd" integrity="sha384-FCpnCPOaWdtazDlnwEhl+IMFzJiiPuYWKTfzrxbMwFjHPEq/Z+6O7GgUyXNz055X" crossorigin="anonymous"/></head><body><a class="SkipLink" href="/language-switch/#page">Skip to Content</a><main id="Magic"><div class="Wrapper"><header class="Header"><div><a class="Logo" href="/language-switch/"><svg viewBox="0 0 512 444"><path d="M512 444L256 0 0 444z" fill="#663695"></path><circle cx="256" cy="294" r="130" fill="#fff"></circle><circle cx="256" cy="281" r="40" fill="#663695"></circle><path d="M256 350v44m24-44l1 13c1 27 29 27 29-7m-160-72s46-47 106-47c59 0 106 47 106 47s-47 43-106 43c-60 0-106-43-106-43zm65-75a134 134 0 0189 2" class="stroke"></path><path d="M256 81v53m184 270l-43-29M72 404l43-29" class="stroke white"></path></svg></a><p>LanguageSwitch</p><nav class="Menu"><ul><li><a href="/language-switch/#installation">installation</a></li><li><a href="/language-switch/#usage">usage</a></li><li><a href="/language-switch/#pages">language pages</a></li><li><a href="/language-switch/#state">required state</a></li><li><a href="/language-switch/#source">source</a></li></ul></nav></div></header><div class="Page" id="page"><div>404 - not found.</div></div><footer class="Footer"><div class="Container"><div class="Credits">made with a few bits of <a target="_blank" rel="noopener" href="https://magic.github.io/">magic</a></div></div></footer></div></main><script src="/language-switch/magic.js?lm8RNjME0/" integrity="sha384-lm8RNjME0/g4Xc2FDLLmbMHvXcKJks7e+UoxBp/95CXFlvuoNdj2q/tpskq/Upfm" crossorigin="anonymous"></script></body></html>
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link rel="icon" href="/language-switch/favicon.ico"/><title>404 - not found</title><meta name="description" content="404 - not found."/><script type="application/ld+json">{"@context":"http://schema.org","@type":"website","name":"404 - not found"}</script><link rel="stylesheet" href="/language-switch/magic.css?6TZBTNHLKl" integrity="sha384-6TZBTNHLKlB2V52pESNlAYAXPv/seNzwGVNGlmXnbq4/9PhAFm3r7DPJFRayvFqj" crossorigin="anonymous"/></head><body><a class="SkipLink" href="/language-switch/#page">Skip to Content</a><main id="Magic"><div class="Wrapper"><header class="Header"><div><a class="Logo" href="/language-switch/"><svg viewBox="0 0 512 444"><path d="M512 444L256 0 0 444z" fill="#663695"></path><circle cx="256" cy="294" r="130" fill="#fff"></circle><circle cx="256" cy="281" r="40" fill="#663695"></circle><path d="M256 350v44m24-44l1 13c1 27 29 27 29-7m-160-72s46-47 106-47c59 0 106 47 106 47s-47 43-106 43c-60 0-106-43-106-43zm65-75a134 134 0 0189 2" class="stroke"></path><path d="M256 81v53m184 270l-43-29M72 404l43-29" class="stroke white"></path></svg></a><p>LanguageSwitch</p><nav class="Menu"><ul><li><a href="/language-switch/#installation">installation</a></li><li><a href="/language-switch/#usage">usage</a></li><li><a href="/language-switch/#pages">language pages</a></li><li><a href="/language-switch/#state">required state</a></li><li><a href="/language-switch/#source">source</a></li></ul></nav></div></header><div class="Page" id="page"><div>404 - not found.</div></div><footer class="Footer"><div class="Container"><div class="Credits">made with a few bits of <a target="_blank" rel="noopener" href="https://magic.github.io/">magic</a></div></div></footer></div></main><script src="/language-switch/magic.js?lm8RNjME0/" integrity="sha384-lm8RNjME0/g4Xc2FDLLmbMHvXcKJks7e+UoxBp/95CXFlvuoNdj2q/tpskq/Upfm" crossorigin="anonymous"></script></body></html>
2 changes: 1 addition & 1 deletion docs/de/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html><html lang="de"><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link rel="icon" href="/language-switch/favicon.ico"/><title>@magic-modules/language-switch</title><meta name="description" content="@magic-modules LanguageSwitch. adds an intelligent language switching mechanism to your @magic app."/><script type="application/ld+json">{"@context":"http://schema.org","@type":"website","name":"@magic-modules/language-switch"}</script><link rel="stylesheet" href="/language-switch/magic.css?FCpnCPOaWd" integrity="sha384-FCpnCPOaWdtazDlnwEhl+IMFzJiiPuYWKTfzrxbMwFjHPEq/Z+6O7GgUyXNz055X" crossorigin="anonymous"/></head><body><a class="SkipLink" href="/language-switch/#page">Skip to Content</a><main id="Magic"><div class="Wrapper"><header class="Header"><div><a class="Logo" href="/language-switch/"><svg viewBox="0 0 512 444"><path d="M512 444L256 0 0 444z" fill="#663695"></path><circle cx="256" cy="294" r="130" fill="#fff"></circle><circle cx="256" cy="281" r="40" fill="#663695"></circle><path d="M256 350v44m24-44l1 13c1 27 29 27 29-7m-160-72s46-47 106-47c59 0 106 47 106 47s-47 43-106 43c-60 0-106-43-106-43zm65-75a134 134 0 0189 2" class="stroke"></path><path d="M256 81v53m184 270l-43-29M72 404l43-29" class="stroke white"></path></svg></a><p>LanguageSwitch</p><nav class="Menu"><ul><li><a href="/language-switch/#installation">installation</a></li><li><a href="/language-switch/#usage">usage</a></li><li><a href="/language-switch/#pages">language pages</a></li><li><a href="/language-switch/#state">required state</a></li><li><a href="/language-switch/#source">source</a></li></ul></nav></div></header><div class="Page" id="page"><h1 id="magic-moduleslanguage-switch">@magic-modules/language-switch</h1><p>dies ist das
<!DOCTYPE html><html lang="de"><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link rel="icon" href="/language-switch/favicon.ico"/><title>@magic-modules/language-switch</title><meta name="description" content="@magic-modules LanguageSwitch. adds an intelligent language switching mechanism to your @magic app."/><script type="application/ld+json">{"@context":"http://schema.org","@type":"website","name":"@magic-modules/language-switch"}</script><link rel="stylesheet" href="/language-switch/magic.css?6TZBTNHLKl" integrity="sha384-6TZBTNHLKlB2V52pESNlAYAXPv/seNzwGVNGlmXnbq4/9PhAFm3r7DPJFRayvFqj" crossorigin="anonymous"/></head><body><a class="SkipLink" href="/language-switch/#page">Skip to Content</a><main id="Magic"><div class="Wrapper"><header class="Header"><div><a class="Logo" href="/language-switch/"><svg viewBox="0 0 512 444"><path d="M512 444L256 0 0 444z" fill="#663695"></path><circle cx="256" cy="294" r="130" fill="#fff"></circle><circle cx="256" cy="281" r="40" fill="#663695"></circle><path d="M256 350v44m24-44l1 13c1 27 29 27 29-7m-160-72s46-47 106-47c59 0 106 47 106 47s-47 43-106 43c-60 0-106-43-106-43zm65-75a134 134 0 0189 2" class="stroke"></path><path d="M256 81v53m184 270l-43-29M72 404l43-29" class="stroke white"></path></svg></a><p>LanguageSwitch</p><nav class="Menu"><ul><li><a href="/language-switch/#installation">installation</a></li><li><a href="/language-switch/#usage">usage</a></li><li><a href="/language-switch/#pages">language pages</a></li><li><a href="/language-switch/#state">required state</a></li><li><a href="/language-switch/#source">source</a></li></ul></nav></div></header><div class="Page" id="page"><h1 id="magic-moduleslanguage-switch">@magic-modules/language-switch</h1><p>dies ist das
<a href="https://github.com/magic-modules" target="_blank" rel="noopener">@magic-modules</a>
LanguageSwitch modul. Es rendert ein Menu mit Sprachauswahl.</p><ul class="GitBadges"><li><a href="https://www.npmjs.com/package/@magic-modules/language-switch" target="_blank" rel="noopener"><img src="https://img.shields.io/npm/v/@magic-modules/language-switch?color=blue" height="23" role="presentation" alt="" loading="lazy"/></a></li><li><img src="https://img.shields.io/node/v/@magic-modules/language-switch?color=blue" height="23" role="presentation" alt="" loading="lazy"/></li><li><img src="https://img.shields.io/npm/l/@magic-modules/language-switch?color=blue" height="23" role="presentation" alt="" loading="lazy"/></li><li><a href="https://travis-ci.com/magic-modules/language-switch" target="_blank" rel="noopener"><img src="https://img.shields.io/travis/com/magic-modules/language-switch/master" height="23" role="presentation" alt="" loading="lazy"/></a></li><li><a href="https://ci.appveyor.com/project/magicmodules/language-switch/branch/master" target="_blank" rel="noopener"><img src="https://img.shields.io/appveyor/ci/magicmodules/language-switch/master.svg" height="23" role="presentation" alt="" loading="lazy"/></a></li><li><a href="https://coveralls.io/github/magic-modules/language-switch" target="_blank" rel="noopener"><img src="https://img.shields.io/coveralls/github/magic-modules/language-switch/master.svg" height="23" role="presentation" alt="" loading="lazy"/></a></li><li><a href="https://snyk.io/test/github/magic-modules/language-switch" target="_blank" rel="noopener"><img src="https://img.shields.io/snyk/vulnerabilities/github/magic-modules/language-switch.svg" height="23" role="presentation" alt="" loading="lazy"/></a></li></ul><h2 id="installation">installation</h2><div class="Pre"><div class="menu"><button>copy</button></div><pre><code class="line"><span class="keyword">npm</span> <span class="keyword">install</span> @magic-modules/language-switch</code></pre></div><h2 id="usage">verwendung</h2><p>hoisten in config.mjs:</p><div class="Pre lines"><div class="menu"><button>copy</button></div><pre><code class="line"><span class="comment">// /src/config.mjs</span></code><code class="line"><span class="keyword">export</span> <span class="keyword">default</span> {</code><code class="line"> HOIST: [<span class="string">&#39;LanguageSwitch&#39;</span>],</code><code class="line">}</code></pre></div><h3 id="caveat">caveat</h3><p>bitte beachte, dass dieses modul nicht das menu veraendert.</p><p>ich habe es gebaut, um es auf meiner seite zu verwenden: <a href="https://jaeh.at" target="_blank" rel="noopener">jaeh.at</a>,
und die hat kein menu.</p><h2 id="pages">seiten</h2><p>erstelle deine sprachfiles im pages directory, zum beispiel:</p><div class="Pre lines"><div class="menu"><button>copy</button></div><pre><code class="line">/src/pages/</code><code class="line"> index.mjs <span class="comment">// englische seite</span></code><code class="line"> /de/</code><code class="line"> index.mjs <span class="comment">// deutsche seite</span></code></pre></div><h2 id="state">state</h2><p>LanguageSwitch braucht folgende informationen:</p><div class="Pre lines"><div class="menu"><button>copy</button></div><pre><code class="line"><span class="comment">// /src/app.mjs</span></code><code class="line"><span class="keyword">export</span> <span class="keyword">const</span> <span class="state">state</span> = {</code><code class="line"> <span class="comment">// ... other app <span class="state">state</span></span></code><code class="line"> languages: [</code><code class="line"> <span class="comment">// die erste sprache ist der standard</span></code><code class="line"> { code: <span class="string">&#39;en&#39;</span>, to: <span class="string">&#39;/&#39;</span>, text: <span class="string">&#39;english&#39;</span> },</code><code class="line"> { code: <span class="string">&#39;de&#39;</span>, to: <span class="string">&#39;/de/&#39;</span>, text: <span class="string">&#39;deutsch&#39;</span> },</code><code class="line"> ],</code><code class="line">}</code></pre></div><h2 id="source">source</h2><p>der sourcecode dieser page ist im
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link rel="icon" href="/language-switch/favicon.ico"/><title>@magic-modules/language-switch</title><meta name="description" content="@magic-modules LanguageSwitch. adds an intelligent language switching mechanism to your @magic app."/><script type="application/ld+json">{"@context":"http://schema.org","@type":"website","name":"@magic-modules/language-switch"}</script><link rel="stylesheet" href="/language-switch/magic.css?FCpnCPOaWd" integrity="sha384-FCpnCPOaWdtazDlnwEhl+IMFzJiiPuYWKTfzrxbMwFjHPEq/Z+6O7GgUyXNz055X" crossorigin="anonymous"/></head><body><a class="SkipLink" href="/language-switch/#page">Skip to Content</a><main id="Magic"><div class="Wrapper"><header class="Header"><div><a class="Logo" href="/language-switch/"><svg viewBox="0 0 512 444"><path d="M512 444L256 0 0 444z" fill="#663695"></path><circle cx="256" cy="294" r="130" fill="#fff"></circle><circle cx="256" cy="281" r="40" fill="#663695"></circle><path d="M256 350v44m24-44l1 13c1 27 29 27 29-7m-160-72s46-47 106-47c59 0 106 47 106 47s-47 43-106 43c-60 0-106-43-106-43zm65-75a134 134 0 0189 2" class="stroke"></path><path d="M256 81v53m184 270l-43-29M72 404l43-29" class="stroke white"></path></svg></a><p>LanguageSwitch</p><nav class="Menu"><ul><li><a href="/language-switch/#installation">installation</a></li><li><a href="/language-switch/#usage">usage</a></li><li><a href="/language-switch/#pages">language pages</a></li><li><a href="/language-switch/#state">required state</a></li><li><a href="/language-switch/#source">source</a></li></ul></nav></div></header><div class="Page" id="page"><h1 id="magic-moduleslanguage-switch">@magic-modules/language-switch</h1><p>this is the
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link rel="icon" href="/language-switch/favicon.ico"/><title>@magic-modules/language-switch</title><meta name="description" content="@magic-modules LanguageSwitch. adds an intelligent language switching mechanism to your @magic app."/><script type="application/ld+json">{"@context":"http://schema.org","@type":"website","name":"@magic-modules/language-switch"}</script><link rel="stylesheet" href="/language-switch/magic.css?6TZBTNHLKl" integrity="sha384-6TZBTNHLKlB2V52pESNlAYAXPv/seNzwGVNGlmXnbq4/9PhAFm3r7DPJFRayvFqj" crossorigin="anonymous"/></head><body><a class="SkipLink" href="/language-switch/#page">Skip to Content</a><main id="Magic"><div class="Wrapper"><header class="Header"><div><a class="Logo" href="/language-switch/"><svg viewBox="0 0 512 444"><path d="M512 444L256 0 0 444z" fill="#663695"></path><circle cx="256" cy="294" r="130" fill="#fff"></circle><circle cx="256" cy="281" r="40" fill="#663695"></circle><path d="M256 350v44m24-44l1 13c1 27 29 27 29-7m-160-72s46-47 106-47c59 0 106 47 106 47s-47 43-106 43c-60 0-106-43-106-43zm65-75a134 134 0 0189 2" class="stroke"></path><path d="M256 81v53m184 270l-43-29M72 404l43-29" class="stroke white"></path></svg></a><p>LanguageSwitch</p><nav class="Menu"><ul><li><a href="/language-switch/#installation">installation</a></li><li><a href="/language-switch/#usage">usage</a></li><li><a href="/language-switch/#pages">language pages</a></li><li><a href="/language-switch/#state">required state</a></li><li><a href="/language-switch/#source">source</a></li></ul></nav></div></header><div class="Page" id="page"><h1 id="magic-moduleslanguage-switch">@magic-modules/language-switch</h1><p>this is the
<a href="https://github.com/magic-modules" target="_blank" rel="noopener">@magic-modules</a>
LanguageSwitch component. It provides a language switch menu.</p><ul class="GitBadges"><li><a href="https://www.npmjs.com/package/@magic-modules/language-switch" target="_blank" rel="noopener"><img src="https://img.shields.io/npm/v/@magic-modules/language-switch?color=blue" height="23" role="presentation" alt="" loading="lazy"/></a></li><li><img src="https://img.shields.io/node/v/@magic-modules/language-switch?color=blue" height="23" role="presentation" alt="" loading="lazy"/></li><li><img src="https://img.shields.io/npm/l/@magic-modules/language-switch?color=blue" height="23" role="presentation" alt="" loading="lazy"/></li><li><a href="https://travis-ci.com/magic-modules/language-switch" target="_blank" rel="noopener"><img src="https://img.shields.io/travis/com/magic-modules/language-switch/master" height="23" role="presentation" alt="" loading="lazy"/></a></li><li><a href="https://ci.appveyor.com/project/magicmodules/language-switch/branch/master" target="_blank" rel="noopener"><img src="https://img.shields.io/appveyor/ci/magicmodules/language-switch/master.svg" height="23" role="presentation" alt="" loading="lazy"/></a></li><li><a href="https://coveralls.io/github/magic-modules/language-switch" target="_blank" rel="noopener"><img src="https://img.shields.io/coveralls/github/magic-modules/language-switch/master.svg" height="23" role="presentation" alt="" loading="lazy"/></a></li><li><a href="https://snyk.io/test/github/magic-modules/language-switch" target="_blank" rel="noopener"><img src="https://img.shields.io/snyk/vulnerabilities/github/magic-modules/language-switch.svg" height="23" role="presentation" alt="" loading="lazy"/></a></li></ul><h2 id="installation">installation</h2><div class="Pre"><div class="menu"><button>copy</button></div><pre><code class="line"><span class="keyword">npm</span> <span class="keyword">install</span> @magic-modules/language-switch</code></pre></div><h2 id="usage">usage</h2><p>hoist in config.mjs:</p><div class="Pre lines"><div class="menu"><button>copy</button></div><pre><code class="line"><span class="comment">// /src/config.mjs</span></code><code class="line"><span class="keyword">export</span> <span class="keyword">default</span> {</code><code class="line"> HOIST: [<span class="string">&#39;LanguageSwitch&#39;</span>],</code><code class="line">}</code></pre></div><h3 id="caveat">caveat</h3><p>please note that this module will not change anything about the menu.</p><p>i built it to use it on my page <a href="https://jaeh.at" target="_blank" rel="noopener">jaeh.at</a>, which does not have a menu.</p><h2 id="pages">pages</h2><p>create your languages in the pages directory, for example:</p><div class="Pre lines"><div class="menu"><button>copy</button></div><pre><code class="line">/pages/</code><code class="line"> index.mjs <span class="comment">// english page</span></code><code class="line"> /de/</code><code class="line"> index.mjs <span class="comment">// german page</span></code></pre></div><h2 id="state">state</h2><p>LanguageSwitch needs to know about the languages in your app.</p><div class="Pre lines"><div class="menu"><button>copy</button></div><pre><code class="line"><span class="comment">// /assets/app.mjs</span></code><code class="line"><span class="keyword">export</span> <span class="keyword">const</span> <span class="state">state</span> = {</code><code class="line"> <span class="comment">// ... other app <span class="state">state</span></span></code><code class="line"> languages: [</code><code class="line"> <span class="comment">// the first language is the <span class="keyword">default</span> fallback</span></code><code class="line"> { code: <span class="string">&#39;en&#39;</span>, to: <span class="string">&#39;/&#39;</span>, text: <span class="string">&#39;english&#39;</span> },</code><code class="line"> { code: <span class="string">&#39;de&#39;</span>, to: <span class="string">&#39;/de/&#39;</span>, text: <span class="string">&#39;deutsch&#39;</span> },</code><code class="line"> ],</code><code class="line">}</code></pre></div><p>thats it, your magic app now knows about your languages</p><h2 id="source">source</h2><p>the source for this page is in the
<a href="https://github.com/magic-modules/language-switch/tree/master/example" target="_blank" rel="noopener">example directory</a>
Expand Down

0 comments on commit 919d137

Please sign in to comment.