Add token endpoint to config.yml for compatibility and enhance Decap CMS initialization in index.html with load checks.

This commit is contained in:
2025-07-29 13:56:21 -08:00
parent df2325adb6
commit 03e3c5aef9
2 changed files with 17 additions and 1 deletions

View File

@@ -6,6 +6,8 @@ backend:
base_url: https://git.beardedtek.com
api_root: https://git.beardedtek.com/api/v1
auth_endpoint: https://git.beardedtek.com/login/oauth/authorize
# Add explicit token endpoint for better compatibility
token_endpoint: https://git.beardedtek.com/login/oauth/access_token
commit_messages:
create: 'content: create {{collection}} "{{slug}}"'
update: 'content: update {{collection}} "{{slug}}"'

View File

@@ -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>
// 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>