1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-09-01 20:33:34 +02:00

base url resolution

This commit is contained in:
Pomax
2020-08-05 21:57:16 -07:00
parent a995918351
commit d41d02404c
5 changed files with 37 additions and 24 deletions

View File

@@ -7,6 +7,12 @@
<title>A Primer on Bézier Curves</title> <title>A Primer on Bézier Curves</title>
<link rel="shortcut icon" href="favicon.png" type="image/png" /> <link rel="shortcut icon" href="favicon.png" type="image/png" />
<!-- And a slew of SEO related meta elements, because being discoverable is important -->
<meta
name="description"
content="A detailed explanation of Bézier curves, and how to do the many things that we commonly want to do with them."
/>
<!-- opengraph information --> <!-- opengraph information -->
<meta property="og:title" content="A Primer on Bézier Curves" /> <meta property="og:title" content="A Primer on Bézier Curves" />
<meta <meta
@@ -40,7 +46,7 @@
content="A detailed explanation of Bézier curves, and how to do the many things that we commonly want to do with them." content="A detailed explanation of Bézier curves, and how to do the many things that we commonly want to do with them."
/> />
<!-- my own referral/page hit tracker --> <!-- my own referral/page hit tracker, because Google knows enough -->
<script src="./lib/site/referrer.js" type="module" async></script> <script src="./lib/site/referrer.js" type="module" async></script>
<!-- the part that makes interactive graphics work: an HTML5 <graphics-element> custom element --> <!-- the part that makes interactive graphics work: an HTML5 <graphics-element> custom element -->
@@ -66,8 +72,8 @@
<span>Read this in your own language:</span> <span>Read this in your own language:</span>
<ul> <ul>
<li><a href="./index.html">English</a></li> <li><a href="./index.html">English</a></li>
<li><a href="ja-JP/index.html">日本語</a></li> <li><a href="./ja-JP/index.html">日本語</a></li>
<li><a href="zh-CN/index.html">中文</a></li> <li><a href="./zh-CN/index.html">中文</a></li>
</ul> </ul>
<span <span
>Don't see your language listed? >Don't see your language listed?

View File

@@ -10,6 +10,9 @@
{{ base }} {{ base }}
<!-- And a slew of SEO related meta elements, because being discoverable is important -->
<meta name="description" content="{{ description }}">
<!-- opengraph information --> <!-- opengraph information -->
<meta property="og:title" content="{{ title }}"> <meta property="og:title" content="{{ title }}">
<meta property="og:image" content="https://pomax.github.io/bezierinfo/images/og-image.png"> <meta property="og:image" content="https://pomax.github.io/bezierinfo/images/og-image.png">
@@ -25,13 +28,13 @@
<!-- twitter card information --> <!-- twitter card information -->
<meta name="twitter:card" content="summary"> <meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@TheRealPomax" /> <meta name="twitter:site" content="@TheRealPomax">
<meta name="twitter:creator" content="@TheRealPomax"> <meta name="twitter:creator" content="@TheRealPomax">
<meta name="twitter:image" content="https://pomax.github.io/bezierinfo/images/og-image.png"> <meta name="twitter:image" content="https://pomax.github.io/bezierinfo/images/og-image.png">
<meta name="twitter:url" content="https://pomax.github.io/bezierinfo"> <meta name="twitter:url" content="https://pomax.github.io/bezierinfo">
<meta name="twitter:description" content="{{ description }}"> <meta name="twitter:description" content="{{ description }}">
<!-- my own referral/page hit tracker --> <!-- my own referral/page hit tracker, because Google knows enough -->
<script src="./lib/site/referrer.js" type="module" async></script> <script src="./lib/site/referrer.js" type="module" async></script>
<!-- the part that makes interactive graphics work: an HTML5 <graphics-element> custom element --> <!-- the part that makes interactive graphics work: an HTML5 <graphics-element> custom element -->

View File

@@ -9,6 +9,12 @@
<base href=".." /> <base href=".." />
<!-- And a slew of SEO related meta elements, because being discoverable is important -->
<meta
name="description"
content="A detailed explanation of Bézier curves, and how to do the many things that we commonly want to do with them."
/>
<!-- opengraph information --> <!-- opengraph information -->
<meta property="og:title" content="A Primer on Bézier Curves" /> <meta property="og:title" content="A Primer on Bézier Curves" />
<meta <meta
@@ -42,7 +48,7 @@
content="A detailed explanation of Bézier curves, and how to do the many things that we commonly want to do with them." content="A detailed explanation of Bézier curves, and how to do the many things that we commonly want to do with them."
/> />
<!-- my own referral/page hit tracker --> <!-- my own referral/page hit tracker, because Google knows enough -->
<script src="./lib/site/referrer.js" type="module" async></script> <script src="./lib/site/referrer.js" type="module" async></script>
<!-- the part that makes interactive graphics work: an HTML5 <graphics-element> custom element --> <!-- the part that makes interactive graphics work: an HTML5 <graphics-element> custom element -->
@@ -67,9 +73,9 @@
</h2> </h2>
<span>Read this in your own language:</span> <span>Read this in your own language:</span>
<ul> <ul>
<li><a href="../index.html">English</a></li> <li><a href="./index.html">English</a></li>
<li><a href="../ja-JP/index.html">日本語</a></li> <li><a href="./ja-JP/index.html">日本語</a></li>
<li><a href="../zh-CN/index.html">中文</a></li> <li><a href="./zh-CN/index.html">中文</a></li>
</ul> </ul>
<span <span
>Don't see your language listed? >Don't see your language listed?

View File

@@ -6,18 +6,10 @@ export default function generateLangSwitcher(currentLocale, allLocales) {
return allLocales return allLocales
.map((locale) => { .map((locale) => {
let link; let link;
if (currentLocale === defaultLocale) { if (locale === defaultLocale) {
if (locale === defaultLocale) { link = `./index.html`;
link = `./index.html`;
} else {
link = `${locale}/index.html`;
}
} else { } else {
if (locale === defaultLocale) { link = `./${locale}/index.html`;
link = `../index.html`;
} else {
link = `../${locale}/index.html`;
}
} }
return `<li><a href="${link}">${localeStrings.localeName[locale]}</a></li>`; return `<li><a href="${link}">${localeStrings.localeName[locale]}</a></li>`;
}) })

View File

@@ -9,6 +9,12 @@
<base href=".." /> <base href=".." />
<!-- And a slew of SEO related meta elements, because being discoverable is important -->
<meta
name="description"
content="A detailed explanation of Bézier curves, and how to do the many things that we commonly want to do with them."
/>
<!-- opengraph information --> <!-- opengraph information -->
<meta property="og:title" content="A Primer on Bézier Curves" /> <meta property="og:title" content="A Primer on Bézier Curves" />
<meta <meta
@@ -42,7 +48,7 @@
content="A detailed explanation of Bézier curves, and how to do the many things that we commonly want to do with them." content="A detailed explanation of Bézier curves, and how to do the many things that we commonly want to do with them."
/> />
<!-- my own referral/page hit tracker --> <!-- my own referral/page hit tracker, because Google knows enough -->
<script src="./lib/site/referrer.js" type="module" async></script> <script src="./lib/site/referrer.js" type="module" async></script>
<!-- the part that makes interactive graphics work: an HTML5 <graphics-element> custom element --> <!-- the part that makes interactive graphics work: an HTML5 <graphics-element> custom element -->
@@ -67,9 +73,9 @@
</h2> </h2>
<span>Read this in your own language:</span> <span>Read this in your own language:</span>
<ul> <ul>
<li><a href="../index.html">English</a></li> <li><a href="./index.html">English</a></li>
<li><a href="../ja-JP/index.html">日本語</a></li> <li><a href="./ja-JP/index.html">日本語</a></li>
<li><a href="../zh-CN/index.html">中文</a></li> <li><a href="./zh-CN/index.html">中文</a></li>
</ul> </ul>
<span <span
>Don't see your language listed? >Don't see your language listed?