Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add course links #24

Merged
merged 1 commit into from
Oct 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions docs/trails/prague.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ sidebar_label: "Prague Trails"

| Name | Route | Distance | Start | End |
| --- | --- | --- | --- | --- |
| [Barre](prague/barre) | [GPX](/gpx/prague-trails-barre.gpx) | 24 km | Velká Chuchle | Velká Chuchle |
| [Hokun](prague/hokun) | [GPX](/gpx/prague-trails-hokun.gpx) | 25 km | Uhříněves | Braník |
| [Kokomo](prague/kokomo) | [GPX](/gpx/prague-trails-kokomo.gpx) | 24 km | Zbraslav | Braník |
| [Laadchee](prague/laadchee) | [GPX](/gpx/prague-trails-laadchee.gpx) | 28 km | Satalice | Podbaba |
| [Rockyt](prague/rockyt) | [GPX](/gpx/prague-trails-rockyt.gpx) | 23 km | Klánovice | Bulhar |
| [Semmering](prague/semmering) | [GPX](/gpx/prague-trails-semmering.gpx) | 25 km | Ruzyně | Braník |
| [Shark-A](prague/shark-a) | [GPX](/gpx/prague-trails-shark-a.gpx) | 21 km | Ruzyně | Podbaba |
| [Shuss](prague/shuss) | [GPX](/gpx/prague-trails-shuss.gpx) | 26 km | Ruzyně | Sedlec |
| [Barre](prague/barre) | [GPX](/gpx/prague-trails-barre.gpx) &nbsp; <TrailRouteLink id="barre"></TrailRouteLink> | 24 km | Velká Chuchle | Velká Chuchle |
| [Hokun](prague/hokun) | [GPX](/gpx/prague-trails-hokun.gpx) &nbsp; <TrailRouteLink id="hokun"></TrailRouteLink> | 25 km | Uhříněves | Braník |
| [Kokomo](prague/kokomo) | [GPX](/gpx/prague-trails-kokomo.gpx) &nbsp; <TrailRouteLink id="kokomo"></TrailRouteLink> | 24 km | Zbraslav | Braník |
| [Laadchee](prague/laadchee) | [GPX](/gpx/prague-trails-laadchee.gpx) &nbsp; <TrailRouteLink id="laadchee"></TrailRouteLink> | 28 km | Satalice | Podbaba |
| [Rockyt](prague/rockyt) | [GPX](/gpx/prague-trails-rockyt.gpx) &nbsp; <TrailRouteLink id="rockyt"></TrailRouteLink> | 23 km | Klánovice | Bulhar |
| [Semmering](prague/semmering) | [GPX](/gpx/prague-trails-semmering.gpx) &nbsp; <TrailRouteLink id="semmering"></TrailRouteLink> | 25 km | Ruzyně | Braník |
| [Shark-A](prague/shark-a) | [GPX](/gpx/prague-trails-shark-a.gpx) &nbsp; <TrailRouteLink id="shark-a"></TrailRouteLink> | 21 km | Ruzyně | Podbaba |
| [Shuss](prague/shuss) | [GPX](/gpx/prague-trails-shuss.gpx) &nbsp; <TrailRouteLink id="shuss"></TrailRouteLink> | 26 km | Ruzyně | Sedlec |

## Map

Expand Down
2 changes: 1 addition & 1 deletion docs/trails/prague/barre.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: "Barre"

| Property | Value |
| --- | --- |
| Route | [GPX](/gpx/prague-trails-barre.gpx) |
| Route | [GPX](/gpx/prague-trails-barre.gpx) &nbsp; <TrailRouteLink id="barre"></TrailRouteLink> |
| Distance | 24 km |
| Start | Velká Chuchle train station <br /> Poliklinika Barrandov tram stop |
| End | Velká Chuchle train station |
Expand Down
2 changes: 1 addition & 1 deletion docs/trails/prague/hokun.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: "Hokun"

| Property | Value |
| --- | --- |
| Route | [GPX](/gpx/prague-trails-hokun.gpx) |
| Route | [GPX](/gpx/prague-trails-hokun.gpx) &nbsp; <TrailRouteLink id="hokun"></TrailRouteLink> |
| Distance | 25 km |
| Start | Uhříněves train station |
| End | Braník |
Expand Down
2 changes: 1 addition & 1 deletion docs/trails/prague/kokomo.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: "Kokomo"

| Property | Value |
| --- | --- |
| Route | [GPX](/gpx/prague-trails-kokomo.gpx) |
| Route | [GPX](/gpx/prague-trails-kokomo.gpx) &nbsp; <TrailRouteLink id="kokomo"></TrailRouteLink> |
| Distance | 24 km |
| Start | Zbraslav train station |
| End | Braník |
Expand Down
2 changes: 1 addition & 1 deletion docs/trails/prague/laadchee.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: "Laadchee"

| Property | Value |
| --- | --- |
| Route | [GPX](/gpx/prague-trails-laadchee.gpx) |
| Route | [GPX](/gpx/prague-trails-laadchee.gpx) &nbsp; <TrailRouteLink id="laadchee"></TrailRouteLink> |
| Distance | 28 km |
| Start | Satalice train station |
| End | Podbaba |
Expand Down
2 changes: 1 addition & 1 deletion docs/trails/prague/rockyt.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: "Rockyt"

| Property | Value |
| --- | --- |
| Route | [GPX](/gpx/prague-trails-rockyt.gpx) |
| Route | [GPX](/gpx/prague-trails-rockyt.gpx) &nbsp; <TrailRouteLink id="rockyt"></TrailRouteLink> |
| Distance | 23 km |
| Start | Klánovice train station |
| End | Bulhar junction (near Masaryk/Central train station) |
Expand Down
2 changes: 1 addition & 1 deletion docs/trails/prague/semmering.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: "Semmering"

| Property | Value |
| --- | --- |
| Route | [GPX](/gpx/prague-trails-semmering.gpx) |
| Route | [GPX](/gpx/prague-trails-semmering.gpx) &nbsp; <TrailRouteLink id="semmering"></TrailRouteLink> |
| Distance | 25 km |
| Start | Ruzyně train station <br /> Bílá hora tram station |
| End | Braník |
Expand Down
2 changes: 1 addition & 1 deletion docs/trails/prague/shark-a.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: "Shark-A"

| Property | Value |
| --- | --- |
| Route | [GPX](/gpx/prague-trails-shark-a.gpx) |
| Route | [GPX](/gpx/prague-trails-shark-a.gpx) &nbsp; <TrailRouteLink id="shark-a"></TrailRouteLink> |
| Distance | 21 km |
| Start | Ruzyně train station |
| End | Podbaba |
Expand Down
2 changes: 1 addition & 1 deletion docs/trails/prague/shuss.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: "Shuss"

| Property | Value |
| --- | --- |
| Route | [GPX](/gpx/prague-trails-shuss.gpx) |
| Route | [GPX](/gpx/prague-trails-shuss.gpx) &nbsp; <TrailRouteLink id="shuss"></TrailRouteLink> |
| Distance | 26 km |
| Start | Ruzyně train station |
| End | Sedlec train station |
Expand Down
17 changes: 0 additions & 17 deletions src/components/MapyCzPathLink/index.tsx

This file was deleted.

74 changes: 74 additions & 0 deletions src/components/TrailRouteLink/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import React, {type ReactNode} from 'react';
import Link from '@docusaurus/Link';

export interface Props {
id: string;
}

function GetGarminId(id: string) {
switch (id)
{
case "barre":
return "211837509";
case "hokun":
return "224619876";
case "kokomo":
return "211777074";
case "laadchee":
return "211106575";
case "rockyt":
return "215783112";
case "semmering":
return "211858322";
case "shark-a":
return "211895409";
case "shuss":
return "211914796";
default:
throw new Error();
}
}

function GetMapyCzId(id: string) {
switch (id)
{
case "barre":
return "652fd038acaa705928cd5a80";
case "hokun":
return "651f065a36a6efcb000cbf3b";
case "kokomo":
return "6515f72525e33d94be29277f";
case "laadchee":
return "6515f72525e33d94be29277e";
case "rockyt":
return "651877615a91d7ce7e1692f6";
case "semmering":
return "652d80293a4984d1a065acef";
case "shark-a":
return "6515f72525e33d94be29277b";
case "shuss":
return "6515f72525e33d94be29277a";
default:
throw new Error();
}
}

export default function TrailRouteLink({
id,
}: Props): JSX.Element {
const gpxUrl = `/gpx/prague-trails-${id}.gpx`;
const garminUrl = `https://connect.garmin.com/modern/course/${GetGarminId(id)}`;
const mapyczUrl = `https://en.mapy.cz/turisticka?dim=${GetMapyCzId(id)}&z=13`;
return (
<>
<Link to={garminUrl}>
Garmin
</Link>
&nbsp;
&nbsp;
<Link to={mapyczUrl}>
Mapy.cz
</Link>
</>
);
}
4 changes: 2 additions & 2 deletions src/theme/MDXComponents.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import MDXComponents from '@theme-original/MDXComponents';
import MapyCzEmbeddedPath from '@site/src/components/MapyCzEmbeddedPath';
import MapyCzPathLink from '@site/src/components/MapyCzPathLink';
import GarminEmbeddedCourse from '@site/src/components/GarminEmbeddedCourse';
import TrailRouteLink from '@site/src/components/TrailRouteLink';

export default {
...MDXComponents,
MapyCzEmbeddedPath,
MapyCzPathLink,
GarminEmbeddedCourse,
TrailRouteLink,
};