diff --git a/README.md b/README.md index 2a74d5b..cbd4a5a 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,16 @@ A modern, responsive admin dashboard template built with Bootstrap 5, featuring a clean design and comprehensive functionality for web applications. +![Concept Bootstrap 5 Admin Dashboard](concept-bootstrap-5-admin-dashboard.png) + +## 🌟 Live Demo + +Experience the full power of Concept dashboard: + +**[View Live Demo →](https://colorlib.com/polygon/concept/index.html)** + +Explore all features, pages, and components in action. Perfect for evaluating the template before implementation. + ## Overview Concept is a modern admin template built from the ground up with Bootstrap 5.3.7, Vite, and ES6 modules. This jQuery-free dashboard provides a solid foundation for building admin panels, analytics dashboards, and management systems. @@ -218,6 +228,25 @@ See the [Complete Deployment Guide](docs/deployment/complete-guide.md) for detai This project is licensed under the MIT License - see the LICENSE file for details. +## 🔗 Related Resources + +### Premium Dashboard Collections + +**[DashboardPack.com](https://dashboardpack.com/)** - Premium dashboard templates and UI kits marketplace featuring Bootstrap, React, Vue, and Angular admin templates with live demos and multiple licensing options. + +### Colorlib Admin Dashboard Articles + +**[Colorlib.com](https://colorlib.com/)** - Free web design resources and template collections: + +- **[42 Free Bootstrap Admin Dashboard Templates 2025](https://colorlib.com/wp/free-bootstrap-admin-dashboard-templates/)** - Comprehensive collection including AdminLTE, Adminator, ArchitectUI, and more +- **[42 Free HTML5 Admin Dashboard Templates 2025](https://colorlib.com/wp/free-html5-admin-dashboard-templates/)** - HTML5-based admin templates with responsive designs and Bootstrap framework + +### Popular Template Categories +- **Finance & Analytics Dashboards** - Templates for financial data and reporting +- **E-commerce Admin Panels** - Store management and inventory solutions +- **CRM & Sales Dashboards** - Customer relationship management interfaces +- **Project Management** - Team collaboration and task tracking templates + ## Support For support, please open an issue in the GitHub repository or contact support@yourcompany.com. diff --git a/package.json b/package.json index 1138b5f..3799c7c 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "type": "module", "scripts": { "dev": "vite", - "build": "vite build", + "build": "vite build && node scripts/fix-paths-universal.js", "preview": "vite preview", "clean": "rm -rf dist" }, diff --git a/scripts/fix-paths-universal.js b/scripts/fix-paths-universal.js new file mode 100644 index 0000000..568a0e5 --- /dev/null +++ b/scripts/fix-paths-universal.js @@ -0,0 +1,121 @@ +import fs from 'fs'; +import path from 'path'; +import { fileURLToPath } from 'url'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +// Mapping of sidebar links to actual file locations +const linkMappings = { + 'dashboard-finance.html': 'pages/dashboards/finance.html', + 'dashboard-sales.html': 'pages/dashboards/sales.html', + 'dashboard-influencer.html': 'pages/dashboards/influencer.html', + 'ui-cards.html': 'pages/ui-elements/cards.html', + 'ui-general.html': 'pages/ui-elements/general.html', + 'ui-typography.html': 'pages/ui-elements/typography.html', + 'general-tables.html': 'pages/tables/general-tables.html', + 'data-tables.html': 'pages/tables/data-tables.html', + 'products.html': 'pages/ecommerce/products.html', + 'product-single.html': 'pages/ecommerce/product-single.html', + 'checkout.html': 'pages/ecommerce/checkout.html', + 'blank-page.html': 'pages/misc/blank-page.html', + 'login.html': 'pages/auth/login.html', + 'signup.html': 'pages/auth/signup.html', + 'forgot-password.html': 'pages/auth/forgot-password.html', + '404.html': 'pages/misc/404.html', + 'calendar.html': 'pages/calendar.html', + 'chat.html': 'pages/chat.html', + 'inbox.html': 'pages/email/inbox.html', + 'influencer-finder.html': 'pages/apps/influencer-finder.html', + 'influencer-profile.html': 'pages/apps/influencer-profile.html', + 'users.html': 'pages/users.html', + 'timeline.html': 'pages/timeline.html', + 'settings.html': 'pages/settings.html', + 'form-elements.html': 'pages/form-elements.html', + 'form-validation.html': 'pages/form-validation.html', + 'multiselect.html': 'pages/multiselect.html', + 'charts.html': 'pages/charts/index.html' +}; + +// Function to update paths in a file +function updatePathsInFile(filePath, rootDir) { + const content = fs.readFileSync(filePath, 'utf8'); + const fileRelativeToRoot = path.relative(rootDir, filePath); + const fileDepth = fileRelativeToRoot.split(path.sep).length - 1; + + let updatedContent = content; + + // Update all .html links + updatedContent = updatedContent.replace(/href="([^"]+\.html)"/g, (match, p1) => { + // Skip if already has ../ or is an absolute URL or anchor + if (p1.startsWith('../') || p1.startsWith('http') || p1.startsWith('#') || p1.startsWith('/')) { + return match; + } + + // Check if this link needs mapping + const mappedPath = linkMappings[p1] || p1; + + // For nested files, calculate the correct relative path + if (fileDepth > 0) { + const fromDir = path.dirname(fileRelativeToRoot); + const toPath = mappedPath === 'index.html' ? 'index.html' : mappedPath; + const relativePath = path.relative(fromDir, toPath).replace(/\\/g, '/'); + return `href="${relativePath}"`; + } + + // For root files, use the mapped path directly + return `href="${mappedPath}"`; + }); + + // Update asset paths + updatedContent = updatedContent.replace(/(?:href|src)="(assets\/[^"]+)"/g, (match, p1) => { + if (p1.startsWith('../') || p1.startsWith('http')) { + return match; + } + const prefix = fileDepth > 0 ? '../'.repeat(fileDepth) : ''; + return match.replace(p1, prefix + p1); + }); + + // Update special paths like /pages/email/compose.html + updatedContent = updatedContent.replace(/href="\/pages\/([^"]+)"/g, (match, p1) => { + const prefix = fileDepth > 0 ? '../'.repeat(fileDepth) : ''; + return `href="${prefix}pages/${p1}"`; + }); + + // Only write if content changed + if (content !== updatedContent) { + fs.writeFileSync(filePath, updatedContent); + console.log(`Updated paths in: ${path.relative(rootDir, filePath)}`); + } +} + +// Function to recursively find all HTML files +function findHtmlFiles(dir, files = []) { + const items = fs.readdirSync(dir); + + for (const item of items) { + const fullPath = path.join(dir, item); + const stat = fs.statSync(fullPath); + + if (stat.isDirectory()) { + findHtmlFiles(fullPath, files); + } else if (item.endsWith('.html')) { + files.push(fullPath); + } + } + + return files; +} + +// Main execution +const distDir = path.resolve(__dirname, '../dist'); +console.log('Fixing paths for universal deployment...\n'); + +const htmlFiles = findHtmlFiles(distDir); +console.log(`Found ${htmlFiles.length} HTML files to process\n`); + +htmlFiles.forEach(file => { + updatePathsInFile(file, distDir); +}); + +console.log('\nPath fixing complete! The project can now be deployed to any subfolder.'); \ No newline at end of file diff --git a/test-deployment.html b/test-deployment.html new file mode 100644 index 0000000..d5441db --- /dev/null +++ b/test-deployment.html @@ -0,0 +1,143 @@ + + + + + + Concept Dashboard - Deployment Test + + + +

🚀 Concept Dashboard - Universal Deployment

+ +
+

✅ Build Successful!

+

The project has been built with universal path support. All navigation links will work correctly regardless of where you deploy.

+ +

Deployment Instructions:

+
    +
  1. Upload the entire contents of the dist folder to your server
  2. +
  3. The dashboard will work in any location: +
      +
    • Root domain: https://example.com/
    • +
    • Subfolder: https://colorlib.com/polygon/concept/
    • +
    • Any other subfolder location
    • +
    +
  4. +
+
+ +
+

Path Structure

+

The build system automatically handles path resolution:

+ +
+ +
+

Test Links

+

Open these pages in your browser to test navigation:

+ + +
+ +
+

How It Works

+

The build process includes two steps:

+
npm run build
+
    +
  1. Vite Build: Compiles all assets and generates HTML files
  2. +
  3. Path Fixing Script: Automatically adjusts all navigation links based on file depth
  4. +
+

This ensures that navigation works correctly regardless of deployment location.

+
+ + \ No newline at end of file diff --git a/vite.config.js b/vite.config.js index d0f2ae4..9fe9f77 100644 --- a/vite.config.js +++ b/vite.config.js @@ -5,7 +5,7 @@ import legacy from '@vitejs/plugin-legacy'; export default defineConfig({ root: 'src', - base: process.env.BASE_URL || './', + base: './', publicDir: '../public', plugins: [ @@ -18,7 +18,7 @@ export default defineConfig({ lt: (a, b) => a < b, gt: (a, b) => a > b, lte: (a, b) => a <= b, - gte: (a, b) => a >= b, + gte: (a, b) => a >= b }, context: (pagePath) => { // Add global context data