feat: Simple Mode language routing and translation improvements
## Simple Mode Enhancements - Add `simple-index.html` as dedicated homepage for Simple Mode - Hide marketing sections (FAQ, How It Works, Related Tools) on tool pages - Add simplified navbar and footer for tool pages in Simple Mode - Configure vite preview server to handle language-prefixed URLs ## Language Routing - Add middleware to rewrite language-prefixed URLs (e.g., /de/merge-pdf.html) - Support all languages: en, de, es, fr, id, it, pt, tr, vi, zh, zh-TW - Create .htaccess with internal rewrites for Apache/Hostinger hosting ## Translation Updates - Add missing translations for digitalSignPdf, validateSignaturePdf, emailToPdf, fontToOutline, deskewPdf to es, pt, tr, zh-TW - Add Digital Signature and Validate Signature to homepage translation keys - Fix language regex patterns to include all supported languages - Fix typo in encrypt-pdf.html
This commit is contained in:
@@ -44,4 +44,44 @@ if (__SIMPLE_MODE__) {
|
||||
langContainer.appendChild(switcher);
|
||||
}
|
||||
}
|
||||
|
||||
const sectionsToHide = [
|
||||
'How It Works',
|
||||
'Related PDF Tools',
|
||||
'Related Tools',
|
||||
'Frequently Asked Questions',
|
||||
];
|
||||
|
||||
document.querySelectorAll('section').forEach((section) => {
|
||||
const h2 = section.querySelector('h2');
|
||||
if (h2) {
|
||||
const heading = h2.textContent?.trim() || '';
|
||||
if (sectionsToHide.some((text) => heading.includes(text))) {
|
||||
(section as HTMLElement).style.display = 'none';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const nav = document.querySelector('nav');
|
||||
if (nav && !document.querySelector('[data-simple-nav]')) {
|
||||
nav.style.display = 'none';
|
||||
|
||||
const simpleNav = document.createElement('nav');
|
||||
simpleNav.className =
|
||||
'bg-gray-800 border-b border-gray-700 sticky top-0 z-30';
|
||||
simpleNav.setAttribute('data-simple-nav', 'true');
|
||||
simpleNav.innerHTML = `
|
||||
<div class="container mx-auto px-4">
|
||||
<div class="flex justify-start items-center h-16">
|
||||
<div class="flex-shrink-0 flex items-center cursor-pointer">
|
||||
<img src="/images/favicon.svg" alt="Bento PDF Logo" class="h-8 w-8">
|
||||
<span class="text-white font-bold text-xl ml-2">
|
||||
<a href="/">BentoPDF</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
document.body.insertBefore(simpleNav, document.body.firstChild);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user