-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
158 additions
and
16 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import fs from 'fs'; | ||
import { languages } from "./languages"; | ||
|
||
function getURL(lang: string, path: string = '/') { | ||
return 'https://gpx.studio' + (lang === 'en' ? '' : ('/' + lang)) + path; | ||
} | ||
|
||
function generateSitemap() { | ||
const sitemap = `<?xml version="1.0" encoding="UTF-8"?> | ||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">` + | ||
|
||
Object.keys(languages).map((lang) => ` | ||
<url> | ||
<loc>${getURL(lang)}</loc>${Object.keys(languages).map((lang2) => ` | ||
<xhtml:link rel="alternate" hreflang="${lang2}" href="${getURL(lang2)}"/>`).join('')} | ||
</url>`).join('') + | ||
|
||
Object.keys(languages).map((lang) => ` | ||
<url> | ||
<loc>${getURL(lang, '/about')}</loc>${Object.keys(languages).map((lang2) => ` | ||
<xhtml:link rel="alternate" hreflang="${lang2}" href="${getURL(lang2, '/about')}"/>`).join('')} | ||
</url>`).join('') + | ||
|
||
` | ||
</urlset> | ||
`; | ||
|
||
return sitemap; | ||
} | ||
|
||
fs.writeFileSync('build/sitemap.xml', generateSitemap()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,5 @@ | ||
<script> | ||
<script lang="ts"> | ||
import '../app.pcss'; | ||
import { ModeWatcher } from 'mode-watcher'; | ||
import { isLoading } from 'svelte-i18n'; | ||
</script> | ||
|
||
<ModeWatcher /> | ||
|
||
{#if !$isLoading} | ||
<slot /> | ||
{/if} | ||
<slot /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<script lang="ts"> | ||
import { ModeWatcher } from 'mode-watcher'; | ||
import { isLoading, locale, _ } from 'svelte-i18n'; | ||
import { page } from '$app/stores'; | ||
if ($page.params.language) { | ||
locale.set($page.params.language); | ||
} | ||
</script> | ||
|
||
<ModeWatcher /> | ||
|
||
{#if !$isLoading} | ||
<slot /> | ||
{/if} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,35 @@ | ||
<script lang="ts"> | ||
import App from '$lib/components/App.svelte'; | ||
import { base } from '$app/paths'; | ||
import { languages } from '$lib/languages'; | ||
import { _ } from 'svelte-i18n'; | ||
</script> | ||
|
||
import { locale } from 'svelte-i18n'; | ||
import { page } from '$app/stores'; | ||
<svelte:head> | ||
<title>gpx.studio — {$_('metadata.app_title')}</title> | ||
<meta name="description" content={$_('metadata.description')} /> | ||
<meta property="og:title" content="gpx.studio — {$_('metadata.app_title')}" /> | ||
<meta property="og:description" content={$_('metadata.description')} /> | ||
<meta property="og:image" content="{base}/og_logo.png" /> | ||
<meta property="og:url" content="{base}/" /> | ||
<meta property="og:type" content="website" /> | ||
<meta property="og:site_name" content="gpx.studio" /> | ||
<meta name="twitter:card" content="summary_large_image" /> | ||
<meta name="twitter:title" content="gpx.studio — {$_('metadata.app_title')}" /> | ||
<meta name="twitter:description" content={$_('metadata.description')} /> | ||
<meta name="twitter:image" content="{base}/og_logo.png" /> | ||
<meta name="twitter:url" content="{base}/" /> | ||
<meta name="twitter:site" content="@gpxstudio" /> | ||
<meta name="twitter:creator" content="@gpxstudio" /> | ||
|
||
if ($page.params.language) { | ||
locale.set($page.params.language); | ||
} | ||
</script> | ||
<link rel="alternate" hreflang="x-default" href="{base}/" /> | ||
{#each Object.keys(languages) as lang} | ||
{#if lang === 'en'} | ||
<link rel="alternate" hreflang="en" href="{base}/" /> | ||
{:else} | ||
<link rel="alternate" hreflang={lang} href="{base}/{lang}/" /> | ||
{/if} | ||
{/each} | ||
</svelte:head> | ||
|
||
<App /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<script lang="ts"> | ||
import { base } from '$app/paths'; | ||
import { languages } from '$lib/languages'; | ||
import { _ } from 'svelte-i18n'; | ||
</script> | ||
|
||
<svelte:head> | ||
<title>gpx.studio — {$_('metadata.about_title')}</title> | ||
<meta name="description" content={$_('metadata.description')} /> | ||
<meta property="og:title" content="gpx.studio — {$_('metadata.about_title')}" /> | ||
<meta property="og:description" content={$_('metadata.description')} /> | ||
<meta property="og:image" content="{base}/og_logo.png" /> | ||
<meta property="og:url" content="{base}/" /> | ||
<meta property="og:type" content="website" /> | ||
<meta property="og:site_name" content="gpx.studio" /> | ||
<meta name="twitter:card" content="summary_large_image" /> | ||
<meta name="twitter:title" content="gpx.studio — {$_('metadata.about_title')}" /> | ||
<meta name="twitter:description" content={$_('metadata.description')} /> | ||
<meta name="twitter:image" content="{base}/og_logo.png" /> | ||
<meta name="twitter:url" content="{base}/" /> | ||
<meta name="twitter:site" content="@gpxstudio" /> | ||
<meta name="twitter:creator" content="@gpxstudio" /> | ||
|
||
<link rel="alternate" hreflang="x-default" href="{base}/" /> | ||
{#each Object.keys(languages) as lang} | ||
{#if lang === 'en'} | ||
<link rel="alternate" hreflang="en" href="{base}/" /> | ||
{:else} | ||
<link rel="alternate" hreflang={lang} href="{base}/{lang}/" /> | ||
{/if} | ||
{/each} | ||
</svelte:head> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.