Inhoudsopgave toegevoegd aan handleidingen met HeadingPermalinkExtension
- Nederlandse en Engelse handleiding hebben nu een inhoudsopgave met anchors naar alle hoofdstukken op dezelfde pagina - HeadingPermalinkExtension toegevoegd aan CommonMark configuratie voor zowel frontend als admin markdown parsers - Heading IDs gegenereerd voor elk kopje (## en lager)
This commit is contained in:
@@ -21,4 +21,9 @@
|
|||||||
.guide-content table { width: 100%; margin-bottom: 1rem; }
|
.guide-content table { width: 100%; margin-bottom: 1rem; }
|
||||||
.guide-content table th, .guide-content table td { padding: 0.5rem; border: 1px solid #dee2e6; }
|
.guide-content table th, .guide-content table td { padding: 0.5rem; border: 1px solid #dee2e6; }
|
||||||
.guide-content blockquote { border-left: 3px solid #ccc; padding-left: 1rem; color: #666; margin-left: 0; }
|
.guide-content blockquote { border-left: 3px solid #ccc; padding-left: 1rem; color: #666; margin-left: 0; }
|
||||||
|
.guide-content .heading-permalink { display: none; }
|
||||||
|
.guide-content ul:first-of-type { list-style: none; padding-left: 0; }
|
||||||
|
.guide-content ul:first-of-type li { padding: 0.15rem 0; }
|
||||||
|
.guide-content ul:first-of-type li a { text-decoration: none; color: #0d6efd; }
|
||||||
|
.guide-content ul:first-of-type li a:hover { text-decoration: underline; }
|
||||||
</style>
|
</style>
|
||||||
@@ -559,6 +559,16 @@ class CodePressCMS {
|
|||||||
'html_input' => 'strip',
|
'html_input' => 'strip',
|
||||||
'allow_unsafe_links' => false,
|
'allow_unsafe_links' => false,
|
||||||
'max_nesting_level' => 100,
|
'max_nesting_level' => 100,
|
||||||
|
'heading_permalink' => [
|
||||||
|
'html_class' => 'heading-permalink',
|
||||||
|
'id_prefix' => '',
|
||||||
|
'insert' => 'after',
|
||||||
|
'min_heading_level' => 1,
|
||||||
|
'max_heading_level' => 6,
|
||||||
|
'title' => 'Permalink',
|
||||||
|
'symbol' => '',
|
||||||
|
'aria_hidden' => true,
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
// Create environment with extensions
|
// Create environment with extensions
|
||||||
@@ -568,6 +578,7 @@ class CodePressCMS {
|
|||||||
$environment->addExtension(new \League\CommonMark\Extension\Strikethrough\StrikethroughExtension());
|
$environment->addExtension(new \League\CommonMark\Extension\Strikethrough\StrikethroughExtension());
|
||||||
$environment->addExtension(new \League\CommonMark\Extension\Table\TableExtension());
|
$environment->addExtension(new \League\CommonMark\Extension\Table\TableExtension());
|
||||||
$environment->addExtension(new \League\CommonMark\Extension\TaskList\TaskListExtension());
|
$environment->addExtension(new \League\CommonMark\Extension\TaskList\TaskListExtension());
|
||||||
|
$environment->addExtension(new \League\CommonMark\Extension\HeadingPermalink\HeadingPermalinkExtension());
|
||||||
|
|
||||||
// Handle custom image size syntax: {:width="300" height="200"}
|
// Handle custom image size syntax: {:width="300" height="200"}
|
||||||
$imagePlaceholders = [];
|
$imagePlaceholders = [];
|
||||||
|
|||||||
@@ -1,5 +1,27 @@
|
|||||||
# CodePress CMS Guide
|
# CodePress CMS Guide
|
||||||
|
|
||||||
|
## Table of Contents
|
||||||
|
|
||||||
|
- [Overview](#overview)
|
||||||
|
- [Features](#features)
|
||||||
|
- [Installation](#installation)
|
||||||
|
- [Project Structure](#project-structure)
|
||||||
|
- [Configuration](#configuration)
|
||||||
|
- [Content Structure](#content-structure)
|
||||||
|
- [Admin Console](#admin-console)
|
||||||
|
- [Templates](#templates)
|
||||||
|
- [URL Structure](#url-structure)
|
||||||
|
- [SEO Optimization](#seo-optimization)
|
||||||
|
- [Plugin System](#plugin-system)
|
||||||
|
- [Content API](#content-api-for-php-content-files)
|
||||||
|
- [Analytics & Tracking](#analytics--tracking)
|
||||||
|
- [Frequently Asked Questions](#frequently-asked-questions)
|
||||||
|
- [Troubleshooting](#troubleshooting)
|
||||||
|
- [Security](#security)
|
||||||
|
- [Version](#version)
|
||||||
|
- [Support](#support)
|
||||||
|
- [License](#license)
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
CodePress CMS is a lightweight, file-based content management system built with PHP (>=8.0). Works without a database.
|
CodePress CMS is a lightweight, file-based content management system built with PHP (>=8.0). Works without a database.
|
||||||
|
|||||||
@@ -1,5 +1,27 @@
|
|||||||
# CodePress CMS Handleiding
|
# CodePress CMS Handleiding
|
||||||
|
|
||||||
|
## Inhoudsopgave
|
||||||
|
|
||||||
|
- [Overzicht](#overzicht)
|
||||||
|
- [Functies](#functies)
|
||||||
|
- [Installatie](#installatie)
|
||||||
|
- [Projectstructuur](#projectstructuur)
|
||||||
|
- [Configuratie](#configuratie)
|
||||||
|
- [Content Structuur](#content-structuur)
|
||||||
|
- [Admin Console](#admin-console)
|
||||||
|
- [Templates](#templates)
|
||||||
|
- [URL Structuur](#url-structuur)
|
||||||
|
- [SEO Optimalisatie](#seo-optimalisatie)
|
||||||
|
- [Plugin Systeem](#plugin-systeem)
|
||||||
|
- [Content API](#content-api-voor-php-content-bestanden)
|
||||||
|
- [Analytics & Tracking](#analytics--tracking)
|
||||||
|
- [Veelgestelde Vragen](#veelgestelde-vragen)
|
||||||
|
- [Troubleshooting](#troubleshooting)
|
||||||
|
- [Beveiliging](#beveiliging)
|
||||||
|
- [Versie](#versie)
|
||||||
|
- [Ondersteuning](#ondersteuning)
|
||||||
|
- [Licentie](#licentie)
|
||||||
|
|
||||||
## Overzicht
|
## Overzicht
|
||||||
|
|
||||||
CodePress CMS is een lichtgewicht, file-based content management systeem gebouwd met PHP (>=8.0). Werkt zonder database.
|
CodePress CMS is een lichtgewicht, file-based content management systeem gebouwd met PHP (>=8.0). Werkt zonder database.
|
||||||
|
|||||||
@@ -1398,12 +1398,23 @@ function handleGuide(AdminAuth $auth, array $config): void
|
|||||||
'html_input' => 'allow',
|
'html_input' => 'allow',
|
||||||
'allow_unsafe_links' => false,
|
'allow_unsafe_links' => false,
|
||||||
'max_nesting_level' => 100,
|
'max_nesting_level' => 100,
|
||||||
|
'heading_permalink' => [
|
||||||
|
'html_class' => 'heading-permalink',
|
||||||
|
'id_prefix' => '',
|
||||||
|
'insert' => 'after',
|
||||||
|
'min_heading_level' => 1,
|
||||||
|
'max_heading_level' => 6,
|
||||||
|
'title' => 'Permalink',
|
||||||
|
'symbol' => '',
|
||||||
|
'aria_hidden' => true,
|
||||||
|
],
|
||||||
];
|
];
|
||||||
$environment = new \League\CommonMark\Environment\Environment($config);
|
$environment = new \League\CommonMark\Environment\Environment($config);
|
||||||
$environment->addExtension(new \League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension());
|
$environment->addExtension(new \League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension());
|
||||||
$environment->addExtension(new \League\CommonMark\Extension\Table\TableExtension());
|
$environment->addExtension(new \League\CommonMark\Extension\Table\TableExtension());
|
||||||
$environment->addExtension(new \League\CommonMark\Extension\Strikethrough\StrikethroughExtension());
|
$environment->addExtension(new \League\CommonMark\Extension\Strikethrough\StrikethroughExtension());
|
||||||
$environment->addExtension(new \League\CommonMark\Extension\TaskList\TaskListExtension());
|
$environment->addExtension(new \League\CommonMark\Extension\TaskList\TaskListExtension());
|
||||||
|
$environment->addExtension(new \League\CommonMark\Extension\HeadingPermalink\HeadingPermalinkExtension());
|
||||||
$converter = new \League\CommonMark\MarkdownConverter($environment);
|
$converter = new \League\CommonMark\MarkdownConverter($environment);
|
||||||
$content = $converter->convert($rawContent)->getContent();
|
$content = $converter->convert($rawContent)->getContent();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user