Complete CodePress CMS refactoring

- 🏠 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
This commit is contained in:
2025-11-21 16:58:37 +01:00
parent a86809c243
commit dfe2df141b
28 changed files with 837 additions and 1800 deletions

View File

@@ -16,173 +16,157 @@ body {
min-height: 100vh;
}
.main-wrapper {
flex: 1;
display: flex;
position: relative;
}
.content-wrapper {
flex: 1;
display: flex;
overflow: hidden;
}
.sidebar {
width: 250px;
background-color: #f8f9fa;
border-right: 1px solid #dee2e6;
overflow-y: auto; /* Only sidebar scrolls when needed */
/* Header */
header.navbar {
flex-shrink: 0;
transition: transform 0.3s ease;
position: relative;
height: 100%;
z-index: 999;
transform: translateX(0);
height: 66px;
}
.sidebar.collapsed {
transform: translateX(-250px);
/* Navigation section */
.navigation-section {
background-color: #ffffff;
border-bottom: 1px solid #dee2e6;
padding: 0.5rem 0;
flex-shrink: 0;
}
.sidebar-toggle {
position: absolute;
top: 15px;
right: 15px;
z-index: 1001;
background: none;
border: none;
cursor: pointer;
transition: all 0.3s ease;
font-size: 20px;
/* Tab styling */
.nav-tabs {
border-bottom: none;
}
.nav-tabs .nav-link {
border: 1px solid transparent;
border-bottom: none;
border-radius: 0.375rem 0.375rem 0 0;
color: #6c757d;
width: 30px;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 4px;
}
.sidebar-toggle:hover {
color: #0d6efd;
background-color: #f8f9fa;
margin-right: 0.25rem;
transition: all 0.2s ease;
}
.sidebar-toggle-outer {
position: relative;
z-index: 1001;
background-color: rgba(255, 255, 255, 0.2);
border: 1px solid rgba(255, 255, 255, 0.3);
margin-right: 10px;
color: white !important;
display: none; /* Hidden by default */
}
.sidebar-toggle-outer:hover {
background-color: rgba(255, 255, 255, 0.3);
color: white !important;
.nav-tabs .nav-link:hover {
color: #495057;
background-color: #e9ecef;
border-color: #dee2e6 #dee2e6 transparent;
}
.sidebar.collapsed .sidebar-toggle-inner {
right: auto;
left: 15px;
.nav-tabs .nav-link.active {
color: #495057;
background-color: #ffffff;
border-color: #dee2e6 #dee2e6 transparent;
font-weight: 500;
}
.sidebar.collapsed ~ .main-content {
margin-left: 0;
/* Dropdown in tabs */
.nav-tabs .nav-item.dropdown .nav-link {
background-color: #f8f9fa;
border: 1px solid transparent;
}
body.sidebar-collapsed .sidebar-toggle-outer {
display: block !important;
.nav-tabs .nav-item.dropdown .nav-link:hover {
background-color: #e9ecef;
border-color: #dee2e6 #dee2e6 transparent;
}
body:not(.sidebar-collapsed) .sidebar-toggle-outer {
display: none !important;
/* Dropdown menu styling */
.nav-tabs .dropdown-menu {
margin-top: 0.25rem;
border-radius: 0.375rem;
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
min-width: 200px;
max-width: 300px;
width: auto;
}
/* Override inline styles */
.sidebar-toggle-outer[style*="display: none"] {
display: none !important;
/* Dropdown items styling */
.nav-tabs .dropdown-menu .dropdown-item {
white-space: normal;
padding: 0.5rem 1rem;
line-height: 1.4;
}
body.sidebar-collapsed .sidebar-toggle-outer[style*="display: none"] {
display: block !important;
/* Long text truncation for very long titles */
.nav-tabs .dropdown-menu .dropdown-item {
overflow: hidden;
text-overflow: ellipsis;
max-width: 280px;
}
/* Breadcrumb section */
.breadcrumb-section {
background-color: #f8f9fa;
border-bottom: 1px solid #dee2e6;
flex-shrink: 0;
}
/* Breadcrumb styling consistency */
.breadcrumb-section .breadcrumb {
margin-bottom: 0;
}
.breadcrumb-section .breadcrumb-item {
color: #6c757d !important;
}
.breadcrumb-section .breadcrumb-item a {
color: #0d6efd !important;
text-decoration: none;
}
.breadcrumb-section .breadcrumb-item a:hover {
color: #0a58ca !important;
text-decoration: underline;
}
.breadcrumb-section .breadcrumb-item.active {
color: #6c757d !important;
}
/* Main content area */
.main-content {
flex: 1;
overflow: hidden; /* Main content container doesn't scroll */
transition: margin-left 0.3s ease;
margin-left: 250px;
height: 100%;
display: flex;
flex-direction: column;
overflow-y: auto;
padding: 1rem 0;
}
.content-inner {
flex: 1;
overflow-y: auto; /* Only content-inner scrolls when needed */
padding: 20px;
/* Footer */
footer {
flex-shrink: 0;
}
.folder-toggle {
font-weight: bold;
color: #212529 !important;
cursor: pointer;
display: flex;
align-items: center;
padding: 0.5rem 0.75rem;
background-color: #f8f9fa !important;
margin: 0.125rem 0;
transition: background-color 0.2s ease;
}
.folder-toggle:hover {
background-color: #e9ecef !important;
}
.folder-toggle[aria-expanded=true] {
background-color: #dee2e6 !important;
color: #212529 !important;
font-weight: 600;
}
.folder-toggle .arrow {
margin-right: 8px;
transition: transform 0.2s;
font-size: 0.8em;
}
.folder-toggle[aria-expanded=true] .arrow {
transform: rotate(90deg);
}
.page-link {
color: #495057 !important;
/* Navigation dropdown styling */
.navigation-section .btn {
font-weight: 500;
padding: 0.5rem 0.75rem;
padding-left: 2rem;
background-color: #ffffff !important;
margin: 0.125rem 0;
transition: background-color 0.2s ease;
}
.page-link:hover {
color: #212529 !important;
background-color: #f8f9fa !important;
}
.page-link.active {
background-color: rgba(13, 110, 253, 0.1) !important;
color: #0d6efd !important;
font-weight: 600;
}
.navigation-section .collapse .nav-link {
color: #495057;
padding: 0.375rem 0.75rem;
border-radius: 0.25rem;
transition: all 0.2s ease;
}
.navigation-section .collapse .nav-link:hover {
background-color: #e9ecef;
color: #212529;
}
.navigation-section .collapse .nav-link.active {
background-color: #0d6efd;
color: white;
}
.navigation-section .collapse .nav-link i {
margin-right: 0.5rem;
}
/* File info styling */
.file-info {
font-size: 0.9rem;
color: #6c757d;
flex: 1;
min-width: 0; /* Important for text truncation in flexbox */
}
.file-info {
font-size: 0.9rem;
color: #6c757d;
flex: 1;
min-width: 0; /* Important for text truncation in flexbox */
min-width: 0;
}
.file-info i {
@@ -191,11 +175,11 @@ body.sidebar-collapsed .sidebar-toggle-outer[style*="display: none"] {
.page-title {
color: #6c757d;
max-width: 250px !important;
display: inline-block !important;
white-space: nowrap !important;
overflow: hidden !important;
text-overflow: ellipsis !important;
max-width: 250px;
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: middle;
margin-right: 10px;
}
@@ -213,48 +197,30 @@ body.sidebar-collapsed .sidebar-toggle-outer[style*="display: none"] {
.site-info a {
color: #0d6efd;
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
.site-info a:hover {
text-decoration: underline;
}
.guide-link {
color: white !important;
color: #6c757d !important;
text-decoration: none;
font-size: 0.9rem;
&:hover {
color: rgba(255, 255, 255, 0.8) !important;
text-decoration: none;
}
i {
font-size: 1rem;
}
}
.site-title-link {
color: white !important;
.guide-link:hover {
color: #0d6efd !important;
text-decoration: none;
&:hover {
color: rgba(255, 255, 255, 0.8) !important;
text-decoration: none;
}
h1 {
margin: 0;
transition: color 0.2s ease;
}
}
footer {
margin-top: auto; /* Push footer to bottom */
flex-shrink: 0;
.guide-link i {
font-size: 1rem;
color: #6c757d !important;
}
.site-info a:hover {
text-decoration: underline;
.guide-link:hover i {
color: #0d6efd !important;
}
.auto-link {
@@ -264,6 +230,7 @@ footer {
font-weight: 500;
transition: all 0.2s ease;
}
.auto-link:hover {
color: #0a58ca;
text-decoration: none;
@@ -271,46 +238,75 @@ footer {
border-bottom-color: #0a58ca;
}
/* Search form */
.search-form {
max-width: 300px;
}
/* Card styling */
.card-title a {
text-decoration: none;
color: inherit;
}
.card-title a:hover {
text-decoration: underline;
}
.folder-disabled {
font-weight: 500;
color: #6c757d !important;
cursor: not-allowed;
display: flex;
align-items: center;
padding: 0.5rem 0.75rem;
background-color: #f8f9fa !important;
margin: 0.125rem 0;
opacity: 0.7;
}
.folder-disabled .arrow {
margin-right: 8px;
font-size: 0.8em;
opacity: 0.6;
/* Dropdown submenu styling */
.dropdown-menu .dropdown-menu {
top: 0;
left: 100%;
margin-top: -1px;
margin-left: -1px;
}
@media (max-width: 768px) {
.sidebar {
width: 250px;
background-color: #f8f9fa;
border-right: 1px solid #dee2e6;
overflow-y: auto; /* Only sidebar scrolls when needed */
flex-shrink: 0;
transition: transform 0.3s ease;
/* Show nested dropdowns on hover */
.dropdown-submenu {
position: relative;
height: 100%;
z-index: 999;
transform: translateX(0);
}
.dropdown-submenu .dropdown-menu {
top: 0;
left: 100%;
margin-top: -1px;
}
.dropdown-submenu:hover > .dropdown-menu {
display: block;
}
/* For touch devices - click to open */
.dropdown-submenu > .dropdown-toggle:active::after {
transform: rotate(90deg);
}
/* Responsive adjustments */
@media (max-width: 768px) {
.main-content {
padding-top: 120px; /* More space for mobile */
}
.nav-tabs .dropdown-menu {
min-width: 180px;
max-width: 250px;
}
.nav-tabs .dropdown-menu .dropdown-item {
max-width: 230px;
font-size: 0.9rem;
}
}
@media (max-width: 576px) {
.nav-tabs .dropdown-menu {
min-width: 160px;
max-width: 200px;
}
.nav-tabs .dropdown-menu .dropdown-item {
max-width: 180px;
font-size: 0.85rem;
padding: 0.4rem 0.8rem;
}
}