Add meta description support to pages
Add description meta tag to base template Fix navigation list structure in header Add meta description extraction helper function Update rendering and routing to include meta description
This commit is contained in:
parent
6009cb451e
commit
0b84615bf9
5 changed files with 49 additions and 3 deletions
|
|
@ -57,6 +57,7 @@ function renderFile(Context $ctx, string $filePath): void {
|
|||
$pageDir = dirname($realPath);
|
||||
$pageMetadata = loadMetadata($pageDir, $ctx->currentLang, $ctx->defaultLang);
|
||||
$pageTitle = $pageMetadata['title'] ?? null;
|
||||
$metaDescription = extractMetaDescription($pageDir, $pageMetadata, $ctx->currentLang, $ctx->defaultLang);
|
||||
|
||||
// Wrap content with page template
|
||||
ob_start();
|
||||
|
|
@ -94,6 +95,7 @@ function renderMultipleFiles(Context $ctx, array $filePaths, string $pageDir): v
|
|||
|
||||
$pageMetadata = loadMetadata($pageDir, $ctx->currentLang, $ctx->defaultLang);
|
||||
$pageTitle = $pageMetadata['title'] ?? null;
|
||||
$metaDescription = extractMetaDescription($pageDir, $pageMetadata, $ctx->currentLang, $ctx->defaultLang);
|
||||
|
||||
// Wrap content with page template
|
||||
ob_start();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue