fix: resolve Decap CMS media 404s and add Turkish translations
- Fix Decap CMS configuration with proper media folder paths - Add Turkish translations for sharing interface elements - Implement smart background handling for transparent logos - Update image path conversion system for CMS compatibility - Add comprehensive image optimization with Astro assets - Update all blog post image paths for consistency 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -6,8 +6,8 @@ backend:
|
||||
- editor
|
||||
squash_merges: true
|
||||
|
||||
media_folder: 'src/assets/images'
|
||||
public_folder: '~/assets/images'
|
||||
media_folder: 'public/images'
|
||||
public_folder: '/images'
|
||||
|
||||
locale: 'tr'
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="robots" content="noindex" />
|
||||
<title>ARC İçerik Yöneticisi</title>
|
||||
<script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 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>
|
||||
// Initialize Netlify Identity widget with role checking
|
||||
if (window.netlifyIdentity) {
|
||||
window.netlifyIdentity.on('init', (user) => {
|
||||
if (!user) {
|
||||
window.netlifyIdentity.on('login', () => {
|
||||
document.location.href = '/admin/';
|
||||
});
|
||||
} else {
|
||||
// Check if user has required roles
|
||||
checkUserRole(user);
|
||||
}
|
||||
});
|
||||
|
||||
window.netlifyIdentity.on('login', (user) => {
|
||||
checkUserRole(user);
|
||||
});
|
||||
}
|
||||
|
||||
function checkUserRole(user) {
|
||||
const allowedRoles = ['admin', 'editor'];
|
||||
const userRoles = user.app_metadata?.roles || [];
|
||||
|
||||
// Check if user has any of the allowed roles
|
||||
const hasAccess = allowedRoles.some(role => userRoles.includes(role));
|
||||
|
||||
if (!hasAccess) {
|
||||
// User doesn't have required roles
|
||||
alert('Erişim reddedildi. Bu alanı kullanmak için yönetici izni gereklidir.');
|
||||
window.netlifyIdentity.logout();
|
||||
window.location.href = '/';
|
||||
return;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user