Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
agahkarakuzu committed Sep 8, 2024
1 parent 9936e8b commit e2f4c20
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions api/myst_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,12 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ frontend_data.content.title if frontend_data.content and frontend_data.content.title else 'MyST Page' }}</title>
<script type="module" src="{{ url_for('serve_theme', filename='index.js') }}"></script>
</head>
<body>
<div id="myst-article-root"></div>
<script type="module">
import { renderMystContent } from "{{ url_for('serve_theme', filename='index.js') }}";
const frontendData = {{ frontend_data | tojson | safe }};
window.addEventListener('DOMContentLoaded', (event) => {
if (renderMystContent) {
renderMystContent(document.getElementById('myst-article-root'), frontendData);
} else {
console.error('renderMystContent function not found. Make sure the theme JS is loaded correctly.');
}
});
<script>
window.frontendData = {{ frontend_data | tojson | safe }};
</script>
<script src="{{ url_for('serve_theme', filename='index.js') }}"></script>
</body>
</html>

0 comments on commit e2f4c20

Please sign in to comment.