Three content areas: Tips, News, Modules
This commit is contained in:
1 parent
e577e52a08
commit
309cd7a381
5 files changed
+50
-79
No files matched your search
@@ -49,9 +49,13 @@ CATEGORY_KEYS = ("category", "area", "tags", "tag", "section", "type")
|
||||
DATE_KEYS = ("scheduled", "date", "published", "pubDate", "created", "timestamp")
|
||||
ID_KEYS = ("id", "slug", "uuid", "_id")
|
||||
|
||||
# The three categories are the three areas of the homepage. Nothing else exists:
|
||||
# tips -> /#tips news -> /#news modules -> /#modules
|
||||
KNOWN_CATEGORIES = {"tips": "tips", "tip": "tips", "tricks": "tips",
|
||||
"news": "news", "community": "news", "oca": "news",
|
||||
"blog": "blog", "article": "blog", "post": "blog"}
|
||||
"news": "news", "community": "news", "blog": "news",
|
||||
"article": "news", "post": "news", "release": "news",
|
||||
"modules": "modules", "module": "modules", "oca": "modules",
|
||||
"featured": "modules", "integration": "modules"}
|
||||
|
||||
|
||||
def log(msg: str) -> None:
|
||||
@@ -127,7 +131,7 @@ def normalise_category(value: object) -> str:
|
||||
for tag in raw:
|
||||
if tag in KNOWN_CATEGORIES:
|
||||
return KNOWN_CATEGORIES[tag]
|
||||
return "blog"
|
||||
return "news"
|
||||
|
||||
|
||||
def image_urls(value: object) -> list[str]:
|
||||
@@ -221,8 +225,8 @@ POST_PAGE = """<!DOCTYPE html>
|
||||
<a class="wordmark" href="../index.html">The OC Guy</a>
|
||||
<nav class="nav" aria-label="Sections">
|
||||
<a href="../index.html#tips">Tips</a>
|
||||
<a href="../index.html#blog">Blog</a>
|
||||
<a href="../index.html#featured">Modules</a>
|
||||
<a href="../index.html#news">News</a>
|
||||
<a href="../index.html#modules">Modules</a>
|
||||
<a href="../index.html#ask">About</a>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
Reference in new issue
Block a user