1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-08-09 15:35:25 +02:00

remove iframe

resolves #194
This commit is contained in:
Taly 2022-06-01 18:16:32 +03:00
parent dd7537a6a0
commit 05aa862ad7
3 changed files with 12 additions and 36 deletions

View file

@ -7,7 +7,6 @@
"Plugins",
{"title": "Support Project", "uri": "/support"}
],
"landingFrameSrc": "https://codex.so/editor?frame=1",
"startPage": "",
"misprintsChatId": "12344564",
"yandexMetrikaId": "",

View file

@ -7,9 +7,13 @@ const router = express.Router();
router.get('/', verifyToken, async (req: Request, res: Response) => {
const config = req.app.locals.config;
/**
* If start page is defined, redirect to it
*/
if (config.startPage) {
return res.redirect(config.startPage);
}
res.render('pages/index', { isAuthorized: res.locals.isAuthorized });
});

View file

@ -1,36 +1,9 @@
<!DOCTYPE html>
<html style="height: 100%">
<head>
<title>{{ config.title }}</title>
<link rel="stylesheet" href="/dist/main.css" />
<link rel="preload" href="{{ config.landingFrameSrc }}" as="document">
<link rel="icon" type="image/png" href="/favicon.png?v=2">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta property="og:title" content="{{ config.title }}" />
<meta property="og:site_name" content="{{ config.title }}" />
<meta name="description" property="og:description" content="{{ config.description }}">
</head>
<body class="landing-body">
{% include "components/header.twig" %}
<div class="landing-loader" id="frame-loader">
{{ svg('loader') }}
{% extends 'layout.twig' %}
{% block body %}
<div class="page">
<h1>Index page</h1>
<p>Start page is not defined in <code class="inline-code">.codexdocsrc</code> file.</p>
</div>
<iframe class="landing-frame" src="{{ config.landingFrameSrc }}" seamless frameborder="0" onload="this.style.opacity = 1; setTimeout(document.getElementById('frame-loader').remove(), 500)"></iframe>
{% if config.yandexMetrikaId is not empty %}
<script type="text/javascript" >
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
m[i].l=1*new Date();k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
ym({{ config.yandexMetrikaId }}, "init", {
clickmap:true,
trackLinks:true,
accurateTrackBounce:true
});
</script>
<noscript><div><img src="https://mc.yandex.ru/watch/{{ config.yandexMetrikaId }}" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
{% endif %}
</body>
</html>
{% endblock %}