mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-10-17 08:42:28 +00:00
user guide structure draft
This commit is contained in:
1 parent
2bcfba0fa4
commit
ad7ff5ddba
36 files changed
+171
-46
No files matched your search
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -44,10 +44,10 @@
|
||||
<Button
|
||||
variant="link"
|
||||
class="h-6 px-0 text-muted-foreground"
|
||||
href={getURLForLanguage('/[...language]/documentation', $locale)}
|
||||
href={getURLForLanguage('/[...language]/help', $locale)}
|
||||
>
|
||||
<BookOpenText size="16" class="mr-1" />
|
||||
{$_('homepage.documentation')}
|
||||
{$_('menu.help')}
|
||||
</Button>
|
||||
</div>
|
||||
<div class="flex flex-col items-start gap-1" id="contact">
|
||||
|
||||
@@ -417,7 +417,7 @@
|
||||
<div class="h-fit flex flex-row items-center ml-1 gap-1">
|
||||
<Button
|
||||
variant="ghost"
|
||||
href={getURLForLanguage('/[...language]/documentation', $locale)}
|
||||
href={getURLForLanguage('/[...language]/help', $locale)}
|
||||
target="_blank"
|
||||
class="cursor-default h-fit rounded-sm px-3 py-0.5"
|
||||
>
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
<nav class="w-full sticky top-0 bg-background z-10">
|
||||
<div class="mx-6 py-2 flex flex-row items-center border-b gap-4 md:gap-8">
|
||||
<a href={getURLForLanguage('/[...language]', $locale)} class="shrink-0">
|
||||
<a href={getURLForLanguage('/[...language]', $locale)} class="shrink-0 translate-y-0.5">
|
||||
<Logo class="h-8 sm:hidden" iconOnly={true} />
|
||||
<Logo class="h-7 hidden sm:block" />
|
||||
<Logo class="h-8 hidden sm:block" />
|
||||
</a>
|
||||
<Button
|
||||
variant="link"
|
||||
@@ -32,10 +32,10 @@
|
||||
<Button
|
||||
variant="link"
|
||||
class="text-base px-0"
|
||||
href={getURLForLanguage('/[...language]/documentation', $locale)}
|
||||
href={getURLForLanguage('/[...language]/help', $locale)}
|
||||
>
|
||||
<BookOpenText size="18" class="mr-1.5" />
|
||||
{$_('homepage.documentation')}
|
||||
{$_('menu.help')}
|
||||
</Button>
|
||||
<ModeSwitch class="ml-auto" />
|
||||
</div>
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
<script>
|
||||
import Test, { metadata } from '$lib/docs/en/introduction/test.md';
|
||||
|
||||
const toc = {
|
||||
introduction: ['test']
|
||||
};
|
||||
</script>
|
||||
|
||||
{metadata.title}
|
||||
|
||||
<Test />
|
||||
@@ -2,22 +2,33 @@
|
||||
import { _, locale } from 'svelte-i18n';
|
||||
|
||||
export let path: string;
|
||||
export let titleOnly: boolean = false;
|
||||
|
||||
let module = undefined;
|
||||
let metadata: Record<string, any> = {};
|
||||
|
||||
const modules = import.meta.glob('/src/lib/docs/**/*.{md,svx}');
|
||||
|
||||
$: if ($locale) {
|
||||
modules[`/src/lib/docs/${$locale}/${path}`]().then((mod) => {
|
||||
function loadModule(path: string) {
|
||||
modules[path]().then((mod) => {
|
||||
module = mod.default;
|
||||
metadata = mod.metadata;
|
||||
});
|
||||
}
|
||||
|
||||
$: if ($locale) {
|
||||
loadModule(`/src/lib/docs/${$locale}/${path}`);
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if module !== undefined}
|
||||
<div class="markdown space-y-3">
|
||||
<svelte:component this={module} />
|
||||
</div>
|
||||
{#if titleOnly}
|
||||
{metadata.title}
|
||||
{:else}
|
||||
<div class="markdown space-y-3">
|
||||
<svelte:component this={module} />
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
<style lang="postcss">
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
title: Getting started
|
||||
---
|
||||
|
||||
# { title }
|
||||
|
||||
Welcome message.
|
||||
|
||||
- screenshot of the interface
|
||||
|
||||
explain main components of the interface and link to the corresponding sections
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
title: Test
|
||||
---
|
||||
|
||||
test
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
title: Map controls
|
||||
---
|
||||
|
||||
# { title }
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
title: Menu
|
||||
---
|
||||
|
||||
# { title }
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
title: Edit
|
||||
---
|
||||
|
||||
# { title }
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
title: File
|
||||
---
|
||||
|
||||
# { title }
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
title: Settings
|
||||
---
|
||||
|
||||
# { title }
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
title: View
|
||||
---
|
||||
|
||||
# { title }
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
title: Toolbar
|
||||
---
|
||||
|
||||
# { title }
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
title: Clean
|
||||
---
|
||||
|
||||
# { title }
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
title: Extract
|
||||
---
|
||||
|
||||
# { title }
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
title: Merge
|
||||
---
|
||||
|
||||
# { title }
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
title: Points of interest
|
||||
---
|
||||
|
||||
# { title }
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
title: Reduce
|
||||
---
|
||||
|
||||
# { title }
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
title: Route planning and editing
|
||||
---
|
||||
|
||||
# { title }
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
title: Scissors
|
||||
---
|
||||
|
||||
# { title }
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
title: Time
|
||||
---
|
||||
|
||||
# { title }
|
||||
@@ -3,7 +3,7 @@ import { glob } from 'glob';
|
||||
import { languages } from '$lib/languages';
|
||||
|
||||
function generateSitemap() {
|
||||
const pages = glob.sync('*.html', { cwd: 'build' });
|
||||
const pages = glob.sync('**/*.html', { cwd: 'build' });
|
||||
|
||||
let sitemap = '<?xml version="1.0" encoding="UTF-8"?>\n';
|
||||
sitemap += '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">\n';
|
||||
@@ -11,7 +11,8 @@ function generateSitemap() {
|
||||
pages.forEach((page) => {
|
||||
const url = page.replace('.html', '').replace('index', '');
|
||||
|
||||
if (languages[url]) {
|
||||
const rootDir = url.split('/')[0];
|
||||
if (languages[url] || languages[rootDir]) {
|
||||
// Skip localized pages
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"metadata": {
|
||||
"home_title": "home",
|
||||
"app_title": "the online GPX file editor",
|
||||
"documentation_title": "documentation",
|
||||
"help_title": "help",
|
||||
"description": "View, edit and create GPX files online with advanced route planning capabilities and file processing tools, beautiful maps and detailed data visualizations."
|
||||
},
|
||||
"menu": {
|
||||
@@ -349,7 +349,6 @@
|
||||
"website": "Website",
|
||||
"home": "Home",
|
||||
"app": "App",
|
||||
"documentation": "Documentation",
|
||||
"contact": "Contact",
|
||||
"x": "X",
|
||||
"facebook": "Facebook",
|
||||
|
||||
@@ -14,13 +14,13 @@
|
||||
import { currentTool, Tool } from '$lib/stores';
|
||||
import { onDestroy, onMount } from 'svelte';
|
||||
import { getURLForLanguage } from '$lib/utils';
|
||||
import routingScreenshot from '$lib/assets/img/routing.png?enhanced';
|
||||
import mapboxOutdoorsMap from '$lib/assets/img/mapbox-outdoors.png?enhanced';
|
||||
import mapboxSatelliteMap from '$lib/assets/img/mapbox-satellite.png?enhanced';
|
||||
import ignMap from '$lib/assets/img/ign.png?enhanced';
|
||||
import cyclosmMap from '$lib/assets/img/cyclosm.png?enhanced';
|
||||
import waymarkedMap from '$lib/assets/img/waymarked.png?enhanced';
|
||||
import mapScreenshot from '$lib/assets/img/map.png?enhanced';
|
||||
import routingScreenshot from '$lib/assets/img/home/routing.png?enhanced';
|
||||
import mapboxOutdoorsMap from '$lib/assets/img/home/mapbox-outdoors.png?enhanced';
|
||||
import mapboxSatelliteMap from '$lib/assets/img/home/mapbox-satellite.png?enhanced';
|
||||
import ignMap from '$lib/assets/img/home/ign.png?enhanced';
|
||||
import cyclosmMap from '$lib/assets/img/home/cyclosm.png?enhanced';
|
||||
import waymarkedMap from '$lib/assets/img/home/waymarked.png?enhanced';
|
||||
import mapScreenshot from '$lib/assets/img/home/map.png?enhanced';
|
||||
|
||||
let gpxStatistics = writable(exampleGPXFile.getStatistics());
|
||||
let slicedGPXStatistics = writable(undefined);
|
||||
@@ -52,11 +52,11 @@
|
||||
</Button>
|
||||
<Button
|
||||
variant="secondary"
|
||||
href={getURLForLanguage('/[...language]/documentation', $locale)}
|
||||
href={getURLForLanguage('/[...language]/help', $locale)}
|
||||
class="w-1/3 min-w-fit"
|
||||
>
|
||||
<BookOpenText size="18" class="mr-1.5" />
|
||||
<span>{$_('homepage.documentation')}</span>
|
||||
<span>{$_('homepage.help')}</span>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
<script>
|
||||
import Docs from '$lib/components/docs/Docs.svelte';
|
||||
</script>
|
||||
|
||||
<Docs />
|
||||
@@ -0,0 +1,37 @@
|
||||
<script lang="ts">
|
||||
import { Button } from '$lib/components/ui/button';
|
||||
import { getURLForLanguage } from '$lib/utils';
|
||||
import { locale } from 'svelte-i18n';
|
||||
import DocsLoader from '$lib/components/docs/DocsLoader.svelte';
|
||||
|
||||
let guides: Record<string, string[]> = {
|
||||
'getting-started': [],
|
||||
menu: ['file', 'edit', 'view', 'settings'],
|
||||
toolbar: ['routing', 'poi', 'scissors', 'time', 'merge', 'extract', 'reduce', 'clean'],
|
||||
'map-controls': []
|
||||
};
|
||||
</script>
|
||||
|
||||
<div class="p-12 flex flex-row gap-24">
|
||||
<div class="hidden md:flex flex-col gap-1 w-40">
|
||||
{#each Object.keys(guides) as guide}
|
||||
<Button
|
||||
variant="link"
|
||||
href={getURLForLanguage(`/[...language]/help/${guide}`, $locale)}
|
||||
class="h-6 p-0 w-fit text-muted-foreground hover:text-foreground hover:no-underline font-normal hover:font-semibold items-start"
|
||||
>
|
||||
<DocsLoader path={`${guide}.svx`} titleOnly={true} />
|
||||
</Button>
|
||||
{#each guides[guide] as subGuide}
|
||||
<Button
|
||||
variant="link"
|
||||
href={getURLForLanguage(`/[...language]/help/${guide}/${subGuide}`, $locale)}
|
||||
class="h-6 p-0 w-fit text-muted-foreground hover:text-foreground hover:no-underline font-normal hover:font-semibold items-start ml-3"
|
||||
>
|
||||
<DocsLoader path={`${guide}/${subGuide}.svx`} titleOnly={true} />
|
||||
</Button>
|
||||
{/each}
|
||||
{/each}
|
||||
</div>
|
||||
<slot />
|
||||
</div>
|
||||
@@ -0,0 +1,4 @@
|
||||
<script>
|
||||
</script>
|
||||
|
||||
<div></div>
|
||||
@@ -0,0 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import DocsLoader from '$lib/components/docs/DocsLoader.svelte';
|
||||
</script>
|
||||
|
||||
<DocsLoader path="{$page.params.guide}.svx" />
|
||||
Reference in new issue
Block a user