Update README with content repository structure and documentation
This commit is contained in:
parent
9fbfc1d466
commit
e00e8e790f
1 changed files with 105 additions and 14 deletions
119
README.md
119
README.md
|
|
@ -1,14 +1,79 @@
|
|||
# Stopplidelsen.no - Deployment Setup
|
||||
# Stopplidelsen.no - Content Repository
|
||||
|
||||
## Local Development Structure
|
||||
This repository contains the content and custom styling for [stopplidelsen.no](https://stopplidelsen.no), a Norwegian organization focused on medical cannabis awareness and information.
|
||||
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
stopplidelsen.no/
|
||||
├── app/ # Application router and logic
|
||||
├── content/ # Content files (from innhold repo)
|
||||
└── custom/ # Custom templates and styles (from innhold repo)
|
||||
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](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
|
||||
|
||||
### Using podman (Recommended)
|
||||
|
||||
```bash
|
||||
# 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:
|
||||
|
|
@ -17,29 +82,55 @@ The production server uses symlinks to separate the app code from content, allow
|
|||
/home/rubensol/dev.stopplidelsen.no/
|
||||
├── folderweb/ # App repository
|
||||
│ ├── app/
|
||||
│ └── custom/ # Symlink → ../innhold/custom/
|
||||
└── innhold/ # Content repository (document root: innhold/content)
|
||||
├── content/
|
||||
└── innhold/ # Content repository
|
||||
├── content/ # Document root
|
||||
├── custom/
|
||||
└── app/ # Symlink → ../folderweb/app/
|
||||
```
|
||||
|
||||
## Required Symlinks
|
||||
### Required Symlinks
|
||||
|
||||
### In `/innhold/` directory:
|
||||
**In `/innhold/` directory:**
|
||||
```bash
|
||||
cd /home/rubensol/dev.stopplidelsen.no/innhold/
|
||||
ln -s ../folderweb/app app
|
||||
```
|
||||
|
||||
### In `/folderweb/` directory:
|
||||
**In `/folderweb/` directory:**
|
||||
```bash
|
||||
cd /home/rubensol/dev.stopplidelsen.no/folderweb/
|
||||
ln -s ../innhold/custom custom
|
||||
```
|
||||
|
||||
## Web Server Configuration
|
||||
### Web Server Configuration
|
||||
|
||||
- **Document Root:** `/home/rubensol/dev.stopplidelsen.no/innhold/content`
|
||||
- **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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue