This commit is contained in:
SG
2025-06-16 22:11:24 +03:00
parent 7d81226d83
commit 0583eb07ee
3 changed files with 36 additions and 42 deletions

View File

@@ -47,7 +47,7 @@ class ContentItem:
logger.debug(f"Copying {self.js_file} to {js_targetfile}")
shutil.copyfile(self.js_file, js_targetfile)
with self.target_file.open("w", encoding="utf-8") as f:
f.write(content_item_template.render(content_item = self, page_title = self.title, parent_path = '../', categories = categories))
f.write(content_item_template.render(content_item = self, page_title = f"{Config.MAIN_PAGE_TITLE}: {self.title}", parent_path = '../', categories = categories))
except Exception as e:
logger.error(f"Renderer: {e}")
@@ -175,7 +175,7 @@ class Site:
category_index = Path(f"{self.output_dir}/categories/{category}.html")
category_items = [i for i in visible_content_items if category in i.data.get("categories")]
with (category_index).open(mode="w", encoding="utf-8") as f:
f.write(index_template.render(page_title=category, content_items=category_items, categories = self.categories, parent_path = '../'))
f.write(index_template.render(page_title=f"{Config.MAIN_PAGE_TITLE}: {category}", content_items=category_items, categories = self.categories, parent_path = '../'))
logger.info(f"Created {len(self.content_items)} content items.")

View File

@@ -3,38 +3,29 @@ body {
"Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif,
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}
.top_header {
position: relative;
height: 200px;
height: 150px;
background: rgb(70, 70, 124);
background-image: url("{{ parent_path }}static/images/header.jpg");
background-size: cover;
background-position: center;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
overflow: hidden;
object-fit: cover;
}
.top_header_text {
position: absolute;
bottom: 10px;
left: 10px;
color: white;
bottom: 0;
left: 0;
color: rgba(255,255,255,0.75);
font-weight: bold;
font-size: 2.5rem;
background: rgba(0, 0, 0, 0.05);
border-radius: 5px;
padding: 10px 20px;
border-radius: 10px;
font-size: 1em;
line-height: 2em;
background: rgba(0, 0, 0, 0.85);
width: 100%;
text-decoration: none;
}
/*
@media (min-width: 768px) {
.top_header_text {
font-size: 4rem;
}
}
*/
article {
font-size: 1.1rem;
line-height: 1.6;

View File

@@ -13,26 +13,29 @@
</head>
<body>
<div class="top_header">
<div class="col-auto">
<h1 class="top_header_text"><a style="border-radius: 5px; padding: 10px; opacity: 0.7; background: black">{{ page_title }}</a></h1>
<div id="content">
<div id= "top_header" class="row top_header">
<img id="top_header_image" src="{{ parent_path }}static/images/header.jpg" class="img-fluid">
<div id="top_title" class="row">
<a class="top_header_text">{{ page_title }}</a>
</div>
</div>
<div id="menu_container" class="row justify-content-end pe-2 py-2" >
<div id="menu_wrapper" class="col-auto fw-bold">
<a class="link-body-emphasis mx-2 text-decoration-none" href="{{ parent_path }}index.html">Home</a>
<a class="link-body-emphasis mx-2 text-decoration-none" id="categories_toggle" href="#none">Categories</a>
<a class="link-body-emphasis mx-2 text-decoration-none" href="{{ parent_path }}static/about.html">About</a>
<a class="link-body-emphasis mx-2 text-decoration-none" id="dark_theme_toggle" href="#none">🌓︎</a>
</div>
</div>
<div class="row justify-content-end pe-2 py-2" >
<div class="col-auto fw-bold">
<a class="link-body-emphasis mx-2 text-decoration-none" href="{{ parent_path }}index.html">Home</a>
<a class="link-body-emphasis mx-2 text-decoration-none" id="categories_toggle" href="#none">Categories</a>
<a class="link-body-emphasis mx-2 text-decoration-none" href="{{ parent_path }}static/about.html">About</a>
<a class="link-body-emphasis mx-2 text-decoration-none" id="dark_theme_toggle" href="#none">🌓︎</a>
</div>
<div id="categories_container" class="container">
<div id="categories_menu" class="row justify-content-center mx-auto mb-2" style="display: none">
{% for category in categories %}
<a href="{{ parent_path }}categories/{{ category }}.html" class="mx-1 text-decoration-none">{{ category }}</a>
{% endfor %}
</div>
</div>
</div>
<div id="categories_container" class="container">
<div id="categories_menu" class="row justify-content-center mx-auto mb-2" style="display: none">
{% for category in categories %}
<a href="{{ parent_path }}categories/{{ category }}.html" class="mx-1 text-decoration-none">{{ category }}</a>
{% endfor %}
</div>
</div>
<div id="content" class="container-fluid mb-2">
{% block content %}