2018-07-12 17:21:42 +02:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-07-13 23:58:24 +02:00
|
|
|
// P A C K A G E S
|
2018-07-12 17:21:42 +02:00
|
|
|
|
2018-08-29 01:57:18 +02:00
|
|
|
import html from "choo/html";
|
|
|
|
import { require as local } from "app-root-path";
|
2018-07-12 17:21:42 +02:00
|
|
|
|
|
|
|
// V A R I A B L E
|
|
|
|
|
|
|
|
const config = local("/config");
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-07-13 23:58:24 +02:00
|
|
|
// E X P O R T
|
2018-07-12 17:21:42 +02:00
|
|
|
|
2018-08-29 01:57:18 +02:00
|
|
|
export default function (pagePath) {
|
2018-07-13 20:22:46 +02:00
|
|
|
let githubUrl = `https://github.com/${config.github.repo}/edit/${config.github.branch}`;
|
2018-07-12 17:21:42 +02:00
|
|
|
|
2018-07-13 20:22:46 +02:00
|
|
|
switch(pagePath) {
|
|
|
|
case "":
|
2018-09-24 20:46:01 +02:00
|
|
|
githubUrl = `${githubUrl}/app/views/home.js`;
|
2018-07-13 20:22:46 +02:00
|
|
|
break;
|
|
|
|
|
2018-07-26 00:04:21 +02:00
|
|
|
case "/resources":
|
2018-07-13 20:22:46 +02:00
|
|
|
githubUrl = `${githubUrl}/views/pages/resources.js`;
|
|
|
|
break;
|
|
|
|
|
2018-07-26 00:04:21 +02:00
|
|
|
case "/tour":
|
2018-09-24 20:46:01 +02:00
|
|
|
githubUrl = `${githubUrl}/app/components/tour.js`;
|
2018-07-26 00:04:21 +02:00
|
|
|
break;
|
|
|
|
|
2018-07-13 20:22:46 +02:00
|
|
|
default:
|
|
|
|
githubUrl = `${githubUrl}/documents${pagePath}.md`;
|
|
|
|
break;
|
|
|
|
}
|
2018-07-12 17:21:42 +02:00
|
|
|
|
|
|
|
return html`
|
2018-08-29 01:57:18 +02:00
|
|
|
<a
|
|
|
|
href="${githubUrl}"
|
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
title="${config.github.linkText}"
|
|
|
|
>${config.github.linkText}</a>
|
2018-07-12 17:21:42 +02:00
|
|
|
`;
|
2018-08-29 01:57:18 +02:00
|
|
|
}
|