updates
This commit is contained in:
@@ -160,7 +160,7 @@ class Site:
|
|||||||
content_item.render_content(categories = self.categories)
|
content_item.render_content(categories = self.categories)
|
||||||
|
|
||||||
# Render the about file
|
# Render the about file
|
||||||
about_content = ContentItem(Path(f'themes/{Config.THEME}/static/about.md'))
|
about_content = ContentItem(Path(f'themes/{Config.THEME}/content/about.md'))
|
||||||
about_content.parse_content()
|
about_content.parse_content()
|
||||||
about_content.render_content(categories = self.categories, target_file='public/static/about.html')
|
about_content.render_content(categories = self.categories, target_file='public/static/about.html')
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
9
themes/default/content/about.md
Normal file
9
themes/default/content/about.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
title: "About"
|
||||||
|
omit_second_title: True
|
||||||
|
---
|
||||||
|
|
||||||
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
||||||
|
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
||||||
|
|
||||||
|
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
title: "About"
|
|
||||||
omit_second_title: True
|
|
||||||
---
|
|
||||||
|
|
||||||
20
themes/default/static/js/theme.js
Normal file
20
themes/default/static/js/theme.js
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
console.log('Default theme loaded.')
|
||||||
|
|
||||||
|
const saved_color_theme = localStorage.getItem('saved_color_theme');
|
||||||
|
|
||||||
|
if (saved_color_theme) {
|
||||||
|
document.documentElement.setAttribute('data-bs-theme', saved_color_theme);
|
||||||
|
}
|
||||||
|
|
||||||
|
document.getElementById("categories_toggle").onclick = function() {
|
||||||
|
categories_menu_item = document.getElementById("categories_menu");
|
||||||
|
categories_menu_item.style.display = categories_menu_item.style.display === "none" ? "block" : "none"
|
||||||
|
}
|
||||||
|
|
||||||
|
document.getElementById("dark_theme_toggle").onclick = function() {
|
||||||
|
html = document.documentElement;
|
||||||
|
current_color_theme = html.getAttribute('data-bs-theme');
|
||||||
|
new_color_theme = current_color_theme === 'dark' ? 'light' : 'dark';
|
||||||
|
html.setAttribute('data-bs-theme', new_color_theme);
|
||||||
|
localStorage.setItem('saved_color_theme', new_color_theme);
|
||||||
|
}
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="container mt-4 mb-5">
|
<div class="container mt-4 mb-5">
|
||||||
{% if content_item.image_file %}<img src="{{ parent_path }}static/images/{{ content_item.image_file }}" class="img-fluid mb-5 rounded w-100 h-auto">{% endif %}
|
<img src="{{ parent_path }}static/images/{{ content_item.image_file }}" class="img-fluid mb-5 rounded w-100 h-auto">
|
||||||
{% if not content_item.omit_second_title %}
|
{% if not content_item.omit_second_title %}
|
||||||
<h1>{{ content_item.title }}</h1>
|
<h1>{{ content_item.title }}</h1>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -93,22 +93,5 @@
|
|||||||
</div>
|
</div>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.8/dist/umd/popper.min.js" integrity="sha384-I7E8VVD/ismYTF4hNIPjVp/Zjvgyol6VFvRkX/vR+Vc4jQkC+hVqc2pM8ODewa9r" crossorigin="anonymous"></script>
|
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.8/dist/umd/popper.min.js" integrity="sha384-I7E8VVD/ismYTF4hNIPjVp/Zjvgyol6VFvRkX/vR+Vc4jQkC+hVqc2pM8ODewa9r" crossorigin="anonymous"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.6/dist/js/bootstrap.min.js" integrity="sha384-RuyvpeZCxMJCqVUGFI0Do1mQrods/hhxYlcVfGPOfQtPJh0JCw12tUAZ/Mv10S7D" crossorigin="anonymous"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.6/dist/js/bootstrap.min.js" integrity="sha384-RuyvpeZCxMJCqVUGFI0Do1mQrods/hhxYlcVfGPOfQtPJh0JCw12tUAZ/Mv10S7D" crossorigin="anonymous"></script>
|
||||||
<script defer>
|
<script defer src="{{ parent_path }}static/js/theme.js"></script>
|
||||||
const saved_color_theme = localStorage.getItem('saved_color_theme');
|
|
||||||
if (saved_color_theme) {
|
|
||||||
document.documentElement.setAttribute('data-bs-theme', saved_color_theme);
|
|
||||||
}
|
|
||||||
|
|
||||||
document.getElementById("categories_toggle").onclick = function() {
|
|
||||||
categories_menu_item = document.getElementById("categories_menu");
|
|
||||||
categories_menu_item.style.display = categories_menu_item.style.display === "none" ? "block" : "none"
|
|
||||||
};
|
|
||||||
document.getElementById("dark_theme_toggle").onclick = function() {
|
|
||||||
html = document.documentElement;
|
|
||||||
current_color_theme = html.getAttribute('data-bs-theme');
|
|
||||||
new_color_theme = current_color_theme === 'dark' ? 'light' : 'dark';
|
|
||||||
html.setAttribute('data-bs-theme', new_color_theme);
|
|
||||||
localStorage.setItem('saved_color_theme', new_color_theme);
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user