No description
Find a file
Ruben 3c69f613c9 Update survey results and add press release link
Add detailed survey findings and link to full press release
Include comparison with European countries and implications
Highlight key statistics and actionable insights
2026-03-06 20:52:27 +01:00
content Update survey results and add press release link 2026-03-06 20:52:27 +01:00
custom Move petition map documentation to docs directory 2026-02-26 23:05:05 +01:00
docs Move petition map documentation to docs directory 2026-02-26 23:05:05 +01:00
.gitignore Add petition map data files to gitignore 2026-02-25 23:11:21 +01:00
AGENT.md Add margin-top only CSS reset to code style guidelines 2026-02-07 17:15:23 +01:00
apache.conf Add security hardening for shared hosting environments 2026-02-10 23:02:57 +01:00
compose.yaml Update compose.yaml to include assets directory in chown command 2026-02-25 23:11:26 +01:00
Containerfile Add security hardening for shared hosting environments 2026-02-10 23:02:57 +01:00
README.md Update README with content repository structure and documentation 2025-11-01 20:18:10 +01:00

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 metadata
  • article.md or page.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

# 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/

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 .htaccess file in content/ routes all requests through index.php
  • Static /app/ requests are handled by app/static.php

Content Management

Creating New Content

  1. Create a new directory in the appropriate section (e.g., content/artikler/my-article/)
  2. Add a metadata.ini file with title, slug, and other metadata
  3. Create content in article.md (or article.no.md and article.en.md for translations)
  4. Optionally add cover.jpg for 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.ini configuration
  • Translations stored in custom/languages/no.ini and en.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