- 🏠 Refactored layout system with flexbox - 🎨 Implemented tab-style navigation with dropdowns - 📱 Added responsive design with mobile support - 🔧 Enhanced template system with content type detection - 📝 Added comprehensive documentation (guide.md, README.md) - ⚙️ Improved security with proper file access control - 🎨 Added meta tags for SEO and author attribution - 📁 Fixed breadcrumb navigation and duplicate links - 🗂️ Removed unused files and cleaned up project structure - ⚙️ Added JSON configuration system with homepage detection - 📱 Enhanced search functionality with snippet display - 🔗 Implemented auto-linking between pages - 📊 Added file metadata display in footer Features: - Multi-format content support (Markdown, PHP, HTML) - Dynamic navigation with collapsible folders - Full-text search across all content - Responsive Bootstrap 5 design - JSON-based configuration - SEO-optimized meta tags - Security-focused file management - Mobile-first responsive design - Auto-linking between pages - File metadata tracking - Breadcrumb navigation - Custom CSS styling - Progressive enhancement Technical improvements: - Replaced fixed positioning with flexbox layout - Implemented proper template inheritance - Added content type detection - Enhanced security with .htaccess - Optimized for performance - Added proper error handling - Implemented caching mechanisms - Enhanced accessibility features
41 lines
1.5 KiB
PHP
41 lines
1.5 KiB
PHP
<?php
|
|
|
|
// Default configuration
|
|
$defaultConfig = [
|
|
'site_title' => 'CodePress',
|
|
'content_dir' => __DIR__ . '/../../content',
|
|
'templates_dir' => __DIR__ . '/../templates',
|
|
'default_page' => 'auto',
|
|
'homepage' => 'auto'
|
|
];
|
|
|
|
// Check for config.json in project root
|
|
$projectRoot = __DIR__ . '/../../';
|
|
$configJsonPath = $projectRoot . 'config.json';
|
|
|
|
if (file_exists($configJsonPath)) {
|
|
$jsonContent = file_get_contents($configJsonPath);
|
|
$jsonConfig = json_decode($jsonContent, true);
|
|
|
|
if (json_last_error() === JSON_ERROR_NONE && is_array($jsonConfig)) {
|
|
// Merge JSON config with defaults, converting relative paths to absolute
|
|
$mergedConfig = array_merge($defaultConfig, $jsonConfig);
|
|
|
|
// Convert relative paths to absolute paths (inline function to avoid redeclaration)
|
|
$isAbsolutePath = function($path) {
|
|
return (strpos($path, '/') === 0) || (preg_match('/^[A-Za-z]:/', $path));
|
|
};
|
|
|
|
if (isset($mergedConfig['content_dir']) && !$isAbsolutePath($mergedConfig['content_dir'])) {
|
|
$mergedConfig['content_dir'] = $projectRoot . $mergedConfig['content_dir'];
|
|
}
|
|
if (isset($mergedConfig['templates_dir']) && !$isAbsolutePath($mergedConfig['templates_dir'])) {
|
|
$mergedConfig['templates_dir'] = $projectRoot . $mergedConfig['templates_dir'];
|
|
}
|
|
|
|
return $mergedConfig;
|
|
}
|
|
}
|
|
|
|
// Fallback to default config
|
|
return $defaultConfig; |