catalog
catalog copied to clipboard
External script is included twice
I have this minimal setup with standalone build:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>My Catalog</title>
</head>
<body>
<div id="catalog" />
<script src="catalog-standalone.min.js"></script>
<script>
Catalog.render({
title: 'Test',
scripts: ['jquery-3.3.1.min.js'],
pages: [
{
path: '/',
title: 'Introduction',
src: 'intro.md'
}
]
}, document.getElementById('catalog'));
</script>
</body>
</html>
but when I inspect generated code with dev tools jquery script is included twice. This is generated head section from dev tools:
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Test – Introduction</title>
<style type="text/css" data-emotion="catalog"></style>
<script type="text/javascript" src="jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="jquery-3.3.1.min.js"></script>
</head>
Thanks, loading and executing scripts/styles something that needs an overhaul.
As a workaround, you can include <script type="text/javascript" src="jquery-3.3.1.min.js"></script> in the index.html template.
Related: #340 #350