feat: Add subdirectory hosting support and fix asset path resolution

- Update README with comprehensive subdirectory hosting instructions and BASE_URL configuration guide
- Convert absolute asset paths to relative paths in index.html for proper subdirectory deployment
- Update all worker script imports to use relative paths instead of absolute paths
- Fix favicon and image references to work correctly when hosted in nested directories
- Normalize whitespace and formatting across worker files for consistency
- Update vite.config.ts to properly handle BASE_URL configuration for subdirectory deployments
- Ensure all tool pages and logic files maintain compatibility with subdirectory hosting
- Enable BentoPDF to be deployed at any URL path (e.g., example.com/tools/bentopdf/) without breaking asset loading
This commit is contained in:
abdullahalam123
2025-12-04 23:53:00 +05:30
parent 19425d98f9
commit b279c05281
39 changed files with 206 additions and 181 deletions

View File

@@ -16,18 +16,18 @@
<div class="container mx-auto px-4">
<div class="flex justify-between items-center h-16">
<div class="flex-shrink-0 flex items-center cursor-pointer" id="home-logo">
<img src="../../public/images/favicon.svg" alt="Bento PDF Logo" class="h-8 w-8" />
<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>
<a href="../../index.html">BentoPDF</a>
</span>
</div>
<!-- Desktop Navigation -->
<div class="hidden md:flex items-center space-x-8 text-white">
<a href="/" class="nav-link">Home</a>
<a href="./about.html" class="nav-link">About</a>
<a href="./contact.html" class="nav-link">Contact</a>
<a href="/" class="nav-link">All Tools</a>
<a href="../../index.html" class="nav-link">Home</a>
<a href="../../about.html" class="nav-link">About</a>
<a href="../../contact.html" class="nav-link">Contact</a>
<a href="../../index.html" class="nav-link">All Tools</a>
</div>
<!-- Mobile Hamburger Button -->
@@ -54,10 +54,10 @@
<!-- Mobile Menu Dropdown -->
<div id="mobile-menu" class="hidden md:hidden bg-gray-800 border-t border-gray-700">
<div class="px-2 pt-2 pb-3 space-y-1 text-center">
<a href="/" class="mobile-nav-link">Home</a>
<a href="./about.html" class="mobile-nav-link">About</a>
<a href="./contact.html" class="mobile-nav-link">Contact</a>
<a href="/" class="mobile-nav-link">All Tools</a>
<a href="../../index.html" class="mobile-nav-link">Home</a>
<a href="../../about.html" class="mobile-nav-link">About</a>
<a href="../../contact.html" class="mobile-nav-link">Contact</a>
<a href="../../index.html" class="mobile-nav-link">All Tools</a>
</div>
</div>
</nav>
@@ -170,7 +170,7 @@
<div class="grid grid-cols-1 md:grid-cols-4 gap-8 text-center md:text-left">
<div class="mb-8 md:mb-0">
<div class="flex items-center justify-center md:justify-start mb-4">
<img src="../../public/images/favicon.svg" alt="Bento PDF Logo" class="h-10 w-10 mr-3" />
<img src="../../images/favicon.svg" alt="Bento PDF Logo" class="h-10 w-10 mr-3" />
<span class="text-xl font-bold text-white">BentoPDF</span>
</div>
<p class="text-gray-400 text-sm">