@@ -10,6 +10,7 @@ This guide explains how to add new pages to the Open Elements website, using the
1010## Overview
1111
1212The Open Elements website uses a hybrid architecture:
13+
1314- ** Next.js** for page rendering and routing (` src/app/[locale]/ ` )
1415- ** Markdown files** for content (` content/ ` )
1516- ** i18n support** for English (EN) and German (DE) versions
@@ -31,11 +32,11 @@ content/
3132
3233``` markdown
3334---
34- title: " Your Page Title"
35- description: " Brief description for SEO and meta tags"
36- layout: " article"
37- url: " /your-page-name"
38- keywords: [ " keyword1", " keyword2", " keyword3" ]
35+ title: ' Your Page Title'
36+ description: ' Brief description for SEO and meta tags'
37+ layout: ' article'
38+ url: ' /your-page-name'
39+ keywords: [ ' keyword1', ' keyword2', ' keyword3' ]
3940---
4041
4142Your page content here in Markdown format...
@@ -53,11 +54,11 @@ More content...
5354
5455``` markdown
5556---
56- title: " Ihr Seitentitel"
57- description: " Kurze Beschreibung für SEO und Meta-Tags"
58- layout: " article"
59- url: " /de/your-page-name"
60- keywords: [ " Schlüsselwort1", " Schlüsselwort2" ]
57+ title: ' Ihr Seitentitel'
58+ description: ' Kurze Beschreibung für SEO und Meta-Tags'
59+ layout: ' article'
60+ url: ' /de/your-page-name'
61+ keywords: [ ' Schlüsselwort1', ' Schlüsselwort2' ]
6162---
6263
6364Ihr Seiteninhalt hier im Markdown-Format...
@@ -69,15 +70,15 @@ Inhalt für diesen Abschnitt...
6970
7071### 2. Frontmatter Fields Explained
7172
72- | Field | Required | Description | Example Values |
73- | -------| ----------| -------------| ----------------|
74- | ` title ` | Yes | Page title (appears in browser tab and meta tags) | "DLT & Digital Trust Lecture" |
75- | ` description ` | Yes | Page description for SEO and social sharing | "Since 2023 Hendrik Ebbers has been offering..." |
76- | ` layout ` | Yes | Layout template to use | ` "article" ` , ` "single" ` , ` "contact" ` , ` "about-us" ` |
77- | ` url ` | Yes | URL path for the page (EN: ` /page-name ` , DE: ` /de/page-name ` ) | ` /dlt-lecture ` or ` /de/dlt-lecture ` |
78- | ` keywords ` | No | SEO keywords | ` ["Java", "Open Source", "Support"] ` |
79- | ` aliases ` | No | Alternative URLs that redirect to this page | ` ['/old-url', '/another-old-url'] ` |
80- | ` newsletterPopup ` | No | Whether to show newsletter popup | ` true ` or ` false ` |
73+ | Field | Required | Description | Example Values |
74+ | ----------------- | -------- | ------------------------------------------------------------- | -------------------------------------------------- |
75+ | ` title ` | Yes | Page title (appears in browser tab and meta tags) | "DLT & Digital Trust Lecture" |
76+ | ` description ` | Yes | Page description for SEO and social sharing | "Since 2023 Hendrik Ebbers has been offering..." |
77+ | ` layout ` | Yes | Layout template to use | ` "article" ` , ` "single" ` , ` "contact" ` , ` "about-us" ` |
78+ | ` url ` | Yes | URL path for the page (EN: ` /page-name ` , DE: ` /de/page-name ` ) | ` /dlt-lecture ` or ` /de/dlt-lecture ` |
79+ | ` keywords ` | No | SEO keywords | ` ["Java", "Open Source", "Support"] ` |
80+ | ` aliases ` | No | Alternative URLs that redirect to this page | ` ['/old-url', '/another-old-url'] ` |
81+ | ` newsletterPopup ` | No | Whether to show newsletter popup | ` true ` or ` false ` |
8182
8283### 3. Available Layout Types
8384
@@ -88,7 +89,7 @@ Choose the appropriate layout for your page:
8889 - Best for: Text-heavy content pages, documentation
8990
9091- ** ` single ` ** - Simple single-column layout
91- - Used by: support-care-landingpage , support-care-temurin
92+ - Used by: support-care-maven , support-care-temurin
9293 - Best for: Landing pages, promotional content
9394
9495- ** ` contact ` ** - Contact form layout
@@ -106,7 +107,7 @@ Choose the appropriate layout for your page:
106107 - Used by: newsletter page
107108
108109- ** ` index ` ** - Homepage layout
109- - Used by: _ index.md (homepage only)
110+ - Used by: \ _ index.md (homepage only)
110111
111112### 4. Create Next.js Page Component
112113
@@ -121,25 +122,27 @@ src/app/[locale]/
121122#### Minimal Page Component Template
122123
123124``` tsx
124- import { notFound } from ' next/navigation'
125- import type { Metadata } from ' next'
125+ import { notFound } from ' next/navigation' ;
126+ import type { Metadata } from ' next' ;
126127
127128interface YourPageProps {
128129 params: Promise <{
129- locale: string
130- }>
130+ locale: string ;
131+ }>;
131132}
132133
133- export async function generateMetadata({ params }: YourPageProps ): Promise <Metadata > {
134- const { locale } = await params
134+ export async function generateMetadata({
135+ params ,
136+ }: YourPageProps ): Promise <Metadata > {
137+ const { locale } = await params ;
138+
139+ const title =
140+ locale === ' de'
141+ ? ' Ihr Seitentitel - Open Elements'
142+ : ' Your Page Title - Open Elements' ;
135143
136- const title = locale === ' de'
137- ? ' Ihr Seitentitel - Open Elements'
138- : ' Your Page Title - Open Elements'
139-
140- const description = locale === ' de'
141- ? ' Beschreibung auf Deutsch'
142- : ' Description in English'
144+ const description =
145+ locale === ' de' ? ' Beschreibung auf Deutsch' : ' Description in English' ;
143146
144147 return {
145148 title ,
@@ -151,11 +154,11 @@ export async function generateMetadata({ params }: YourPageProps): Promise<Metad
151154 siteName: ' Open Elements' ,
152155 locale: locale === ' de' ? ' de_DE' : ' en_US' ,
153156 },
154- }
157+ };
155158}
156159
157160export default async function YourPage({ params }: YourPageProps ) {
158- const { locale } = await params
161+ const { locale } = await params ;
159162
160163 return (
161164 <div >
@@ -169,17 +172,16 @@ export default async function YourPage({ params }: YourPageProps) {
169172 <h1 className = " text-4xl font-bold mb-6" >
170173 { locale === ' de' ? ' Ihr Seitentitel' : ' Your Page Title' }
171174 </h1 >
172-
173- <div className = " prose max-w-none" >
174- { /* Page content */ }
175- </div >
175+
176+ <div className = " prose max-w-none" >{ /* Page content */ } </div >
176177 </div >
177178 </div >
178- )
179+ );
179180}
180181```
181182
182183#### Notes on Page Components:
184+
183185- Use the ` locale ` parameter to render different content for EN/DE
184186- Use ` notFound() ` if a locale isn't supported: ` if (locale !== 'de') { notFound() } `
185187- Import and use shared components from ` src/components/ `
@@ -226,17 +228,19 @@ public/
226228##### Next.js Image Component (in page.tsx):
227229
228230``` tsx
229- import Image from ' next/image'
231+ import Image from ' next/image' ;
230232
231233<Image
232234 src = " /images/logo.svg"
233235 alt = " Company logo"
234236 width = { 200 }
235237 height = { 100 }
236238 className = " ..."
237- />
239+ />;
238240
239- {/* For full-width background images */ }
241+ {
242+ /* For full-width background images */
243+ }
240244<div className = " relative w-full h-64" >
241245 <Image
242246 src = " /illustrations/hero-bg.svg"
@@ -245,13 +249,13 @@ import Image from 'next/image'
245249 className = " object-cover"
246250 priority
247251 />
248- </div >
252+ </div >;
249253```
250254
251255#### Image Best Practices
252256
2532571 . ** Naming** : Use lowercase, hyphenated names: ` team-photo.jpg ` , ` process-diagram.svg `
254- 2 . ** Formats** :
258+ 2 . ** Formats** :
255259 - Use ` .svg ` for logos and simple graphics
256260 - Use ` .webp ` or ` .jpg ` for photos
257261 - Use ` .png ` for images requiring transparency
@@ -298,6 +302,7 @@ See existing content files for more shortcode examples.
298302### 8. Testing Your New Page
299303
3003041 . ** Start the development server:**
305+
301306 ``` bash
302307 pnpm run dev
303308 ```
@@ -332,23 +337,25 @@ See existing content files for more shortcode examples.
332337### Example 1: Simple Article Page
333338
334339** Content structure:**
340+
335341```
336342content/my-article/
337343 index.md
338344 index.de.md
339-
345+
340346public/my-article/
341347 hero.jpg
342348 diagram.svg
343349```
344350
345351** Markdown frontmatter:**
352+
346353``` yaml
347354---
348- title : " My Article Title"
349- description : " Article description"
350- layout : " article"
351- url : " /my-article"
355+ title : ' My Article Title'
356+ description : ' Article description'
357+ layout : ' article'
358+ url : ' /my-article'
352359---
353360```
354361
@@ -358,10 +365,10 @@ url: "/my-article"
358365content/support-program/
359366 index.md # English version
360367 index.de.md # German version
361-
368+
362369src/app/[locale]/support-program/
363370 page.tsx # Handles both locales
364-
371+
365372public/support-program/
366373 logo.svg
367374 screenshot.png
@@ -371,10 +378,10 @@ public/support-program/
371378
372379``` markdown
373380---
374- title: " Complex Page"
375- description: " A page with multiple sections"
376- layout: " single"
377- url: " /complex-page"
381+ title: ' Complex Page'
382+ description: ' A page with multiple sections'
383+ layout: ' single'
384+ url: ' /complex-page'
378385---
379386
380387## Section 1
@@ -395,21 +402,25 @@ More detailed content...
395402## Troubleshooting
396403
397404### Page not found (404)
405+
398406- Check that the URL in frontmatter matches the folder structure
399407- Verify the Next.js component is in the correct location
400408- Ensure the locale routing is set up correctly
401409
402410### Images not displaying
411+
403412- Verify the image path is relative to ` public/ ` without including "public" in the path
404413- Check that the image file exists in the correct location
405414- Verify file name capitalization matches exactly
406415
407416### Content not updating
417+
408418- Restart the development server: ` pnpm run dev `
409419- Clear Next.js cache: ` rm -rf .next ` then restart
410420- Check for typos in frontmatter YAML
411421
412422### Layout not working as expected
423+
413424- Verify the layout value matches one of the available layouts
414425- Check if the layout requires specific frontmatter fields
415426- Look at similar pages for reference
@@ -424,6 +435,7 @@ More detailed content...
424435## Need Help?
425436
426437If you encounter issues not covered in this guide:
438+
4274391 . Check existing pages in ` content/ ` and ` src/app/[locale]/ ` for reference
4284402 . Review the project [ README.md] ( README.md )
4294413 . Ask the development team for guidance
0 commit comments