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:
@@ -6,6 +6,8 @@ backend:
|
|||||||
base_url: https://git.beardedtek.com
|
base_url: https://git.beardedtek.com
|
||||||
api_root: https://git.beardedtek.com/api/v1
|
api_root: https://git.beardedtek.com/api/v1
|
||||||
auth_endpoint: https://git.beardedtek.com/login/oauth/authorize
|
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:
|
commit_messages:
|
||||||
create: 'content: create {{collection}} "{{slug}}"'
|
create: 'content: create {{collection}} "{{slug}}"'
|
||||||
update: 'content: update {{collection}} "{{slug}}"'
|
update: 'content: update {{collection}} "{{slug}}"'
|
||||||
|
|||||||
@@ -10,7 +10,21 @@
|
|||||||
<!-- Include the script that builds the page and powers Decap CMS -->
|
<!-- 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 src="https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
// Wait for the script to load before initializing
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
if (typeof DecapCMS !== 'undefined') {
|
||||||
DecapCMS.init({ config: '/admin/config.yml' });
|
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>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user