mirror of
https://github.com/BeardedTek/flowbite-beardedtek.com.git
synced 2025-12-06 05:31:52 +00:00
Add token endpoint to config.yml for compatibility and enhance Decap CMS initialization in index.html with load checks.
This commit is contained in:
@@ -10,7 +10,21 @@
|
||||
<!-- Include the script that builds the page and powers Decap CMS -->
|
||||
<script src="https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js"></script>
|
||||
<script>
|
||||
DecapCMS.init({ config: '/admin/config.yml' });
|
||||
// Wait for the script to load before initializing
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
if (typeof DecapCMS !== 'undefined') {
|
||||
DecapCMS.init({ config: '/admin/config.yml' });
|
||||
} else {
|
||||
// Fallback: wait a bit more for the script to load
|
||||
setTimeout(function() {
|
||||
if (typeof DecapCMS !== 'undefined') {
|
||||
DecapCMS.init({ config: '/admin/config.yml' });
|
||||
} else {
|
||||
console.error('DecapCMS failed to load');
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user