No description
| content | ||
| custom | ||
| .gitignore | ||
| AGENT.md | ||
| apache.conf | ||
| compose.yaml | ||
| Dockerfile | ||
| README.md | ||
Stopplidelsen.no - Content Repository
This repository contains the content and custom styling for stopplidelsen.no, a Norwegian organization focused on medical cannabis awareness and information.
Project Structure
stopplidelsen-innhold/
├── app/ # Core framework (router, templates, vendor libraries)
├── content/ # All public content (document root)
│ ├── artikler/ # Articles
│ ├── brosjyrer/ # Brochures
│ ├── nyheter/ # News
│ ├── faq/ # Frequently asked questions
│ └── kontakt/ # Contact information
└── custom/ # Site-specific customizations
├── templates/ # Custom template overrides
├── styles/ # Custom CSS
├── languages/ # Translation files (no.ini, en.ini)
├── fonts/ # Web fonts
└── assets/ # Images and other assets
Technology Stack
- Backend: PHP 8.3+ (Apache module)
- Content Format: Markdown (via Parsedown library)
- Frontend: Modern HTML5/CSS3
- Infrastructure: podman (Apache container)
- Languages: Norwegian (default) and English
Architecture Overview
/app/ - Core Framework
A minimal, file-based CMS framework providing:
- Request routing (
router.php) - Static asset serving (
static.php) - Default templates and configuration
- Markdown parser (Parsedown vendor library)
See app/README.md for framework documentation.
/content/ - Public Content
The document root containing all public-facing content. Each section is organized hierarchically with:
metadata.ini- Configuration and metadataarticle.mdorpage.md- Content in Markdown- Images, PDFs, and other media files
/custom/ - Site Customizations
Site-specific overrides including:
- Templates: Custom PHP templates that override defaults from
/app/default/ - Styles: Custom CSS styling
- Translations: Language files for Norwegian and English
- Fonts & Assets: Web fonts and images
Local Development
Using podman (Recommended)
# Start the development server
podman compose up
# Access the site at http://localhost:4040
Manual Setup
Requirements:
- PHP 8.3+
- Apache with mod_rewrite enabled
- Configure document root to
content/
Server Deployment Structure
The production server uses symlinks to separate the app code from content, allowing two independent git repositories:
/home/rubensol/dev.stopplidelsen.no/
├── folderweb/ # App repository
│ ├── app/
└── innhold/ # Content repository
├── content/ # Document root
├── custom/
└── app/ # Symlink → ../folderweb/app/
Required Symlinks
In /innhold/ directory:
cd /home/rubensol/dev.stopplidelsen.no/innhold/
ln -s ../folderweb/app app
In /folderweb/ directory:
cd /home/rubensol/dev.stopplidelsen.no/folderweb/
ln -s ../innhold/custom custom
Web Server Configuration
- Document Root:
content/ - The
.htaccessfile incontent/routes all requests throughindex.php - Static
/app/requests are handled byapp/static.php
Content Management
Creating New Content
- Create a new directory in the appropriate section (e.g.,
content/artikler/my-article/) - Add a
metadata.inifile with title, slug, and other metadata - Create content in
article.md(orarticle.no.mdandarticle.en.mdfor translations) - Optionally add
cover.jpgfor thumbnail images
Multilingual Content
The site supports Norwegian and English:
- URLs use language prefixes:
/no/artikler/...or/en/articles/... - Content files can be language-specific:
article.no.md,article.en.md - Slugs are translated via
metadata.iniconfiguration - Translations stored in
custom/languages/no.inianden.ini
Key Features
- File-based CMS: No database required
- Markdown support: Write content in Markdown with automatic HTML conversion
- Multilingual: Norwegian and English with URL-based language switching
- SEO-friendly URLs: Clean, translatable slugs
- Multiple template layouts: List, grid, card grid, FAQ views
- Media support: Cover images, PDFs, downloadable resources
- Performance tracking: Page generation timing displayed