2.0 KiB
2.0 KiB
Data Model for Blog Feature
Entity: Article
Represents a single blog post.
Fields:
title(String): The title of the article.- Source: Extracted from the
titlefield within the JSON metadata block at the top of the article's HTML file.
- Source: Extracted from the
date(String): The publication date of the article inYYYY-MM-DDformat.- Source: Extracted from the
datefield within the JSON metadata block. This also serves as the prefix for the article's filename.
- Source: Extracted from the
image(String): The relative path to the main image associated with the article.- Source: Extracted from the
imagefield within the JSON metadata block.
- Source: Extracted from the
summary(String): A brief summary or excerpt of the article (1-2 sentences).- Source: Extracted from the
summaryfield within the JSON metadata block.
- Source: Extracted from the
content(String): The full HTML content of the article.- Source: The body of the article's HTML file, following the JSON metadata block.
Relationships:
- Implicit Relationship with Blog Page: Multiple
Articleentities are displayed on the mainBlog Page(/blog/index.html), which dynamically aggregates and presents them.
Validation Rules:
- Filename Format: Each article HTML file in
blog/clanki/MUST be named with aYYYY-MM-DD-prefix (e.g.,2025-11-15-medkulturnost-prostor-za-rast.html). Files not adhering to this convention will be ignored with a warning. - JSON Metadata: Each article HTML file MUST contain a valid JSON block within an HTML comment at its very beginning. Malformed JSON will cause the article to be skipped with a warning.
- Required Metadata Fields: The JSON metadata block MUST include
title,date,image, andsummaryfields. jqDependency: Theposodobi_blog.shscript requiresjqto parse JSON metadata. The script will check forjq's presence and exit with an error if it's not found.
State Transitions:
- Not applicable, as articles are static content files.