feat: added date to values
This commit is contained in:
parent
ae5ba0d044
commit
ddd536c958
@ -84,6 +84,7 @@ class ArticleTranslation:
|
|||||||
"article_overview_url": self.article_overview.url,
|
"article_overview_url": self.article_overview.url,
|
||||||
"article_slug": self.article_overview.slug,
|
"article_slug": self.article_overview.slug,
|
||||||
"article_title": self.title,
|
"article_title": self.title,
|
||||||
|
"article_datetime": self.article_overview.article_written.strftime(config.formatting.datetime_format),
|
||||||
"article_language_name": self.language_name,
|
"article_language_name": self.language_name,
|
||||||
"article_language_code": self.language_code,
|
"article_language_code": self.language_code,
|
||||||
"article_language_flag": self.language_flag,
|
"article_language_flag": self.language_flag,
|
||||||
@ -111,7 +112,7 @@ class ArticleTranslation:
|
|||||||
|
|
||||||
|
|
||||||
class ArticleOverview:
|
class ArticleOverview:
|
||||||
def __init__(self, directory: Path, location_in_tree: Optional[List[str]] = None):
|
def __init__(self, directory: Path, location_in_tree: Optional[List[str]] = None, is_root: bool = False):
|
||||||
self.directory = directory
|
self.directory = directory
|
||||||
|
|
||||||
article_config = {}
|
article_config = {}
|
||||||
@ -173,6 +174,7 @@ class ArticleOverview:
|
|||||||
"article_url": self.url,
|
"article_url": self.url,
|
||||||
"article_title": self.slug,
|
"article_title": self.slug,
|
||||||
"article_slug": self.slug,
|
"article_slug": self.slug,
|
||||||
|
"article_datetime": self.article_written.strftime(config.formatting.datetime_format),
|
||||||
"article_overview_url": self.url,
|
"article_overview_url": self.url,
|
||||||
"article_overview_cards": self.overview_cards,
|
"article_overview_cards": self.overview_cards,
|
||||||
}
|
}
|
||||||
@ -207,7 +209,7 @@ def build():
|
|||||||
shutil.copytree(Path(config.setup.source_directory, "static"), Path(config.setup.dist_directory, "static"), dirs_exist_ok=True)
|
shutil.copytree(Path(config.setup.source_directory, "static"), Path(config.setup.dist_directory, "static"), dirs_exist_ok=True)
|
||||||
|
|
||||||
logger.info("reading page tree...")
|
logger.info("reading page tree...")
|
||||||
tree = ArticleOverview(directory=Path(config.setup.source_directory, "articles"))
|
tree = ArticleOverview(directory=Path(config.setup.source_directory, "articles"), is_root=True)
|
||||||
|
|
||||||
# build article reverence values
|
# build article reverence values
|
||||||
for article_overview in ARTICLE_LAKE.values():
|
for article_overview in ARTICLE_LAKE.values():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user