docs refactor
All checks were successful
All checks were successful
This commit is contained in:
96
docs/templates/__file.document.html
vendored
Normal file
96
docs/templates/__file.document.html
vendored
Normal file
@ -0,0 +1,96 @@
|
||||
<div class="document-layout">
|
||||
<article class="document">
|
||||
<header class="document-header">
|
||||
<hr>
|
||||
<div class="document-header-holder">
|
||||
{% if metadata and metadata.date %}
|
||||
<div class="document-metadata">
|
||||
{{ metadata.date }}
|
||||
{% if metadata.author %} — {{ metadata.author }}{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div>
|
||||
<div class="document-file-nav-holder">
|
||||
{% set siblings = get_sibling_content_files(currentPath) %}
|
||||
{% if siblings and siblings|length > 1 %}
|
||||
{% set current_index = namespace(value=-1) %}
|
||||
{% for sibling in siblings %}
|
||||
{% if sibling[1] == currentPath %}
|
||||
<a href="/{{ sibling[1] }}" class="document-nav-link">
|
||||
<span class="document-nav-label-selected">🖹 {{ sibling[0] }}</span>
|
||||
</a>
|
||||
{% else %}
|
||||
<a href="/{{ sibling[1] }}" class="document-nav-link">
|
||||
<span class="document-nav-label">🖹 {{ sibling[0] }}</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="document-folder-nav-holder">
|
||||
{% set siblingsfolders = get_sibling_content_folders(currentPath) %}
|
||||
{% if siblingsfolders and siblingsfolders|length > 1 %}
|
||||
{% set current_index = namespace(value=-1) %}
|
||||
{% for siblingf in siblingsfolders %}
|
||||
{% if siblingf.path == currentPath %}
|
||||
{% set current_index.value = loop.index0 %}
|
||||
{% endif %}
|
||||
<a href="/{{ siblingf[1] }}" class="document-nav-link">
|
||||
<span class="document-nav-label">🗀 {{ siblingf[0] }}</span>
|
||||
</a>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</header>
|
||||
|
||||
<div class="document-content-wrapper">
|
||||
<div class="document-content">
|
||||
<hr>
|
||||
{{ content|safe }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% if metadata and metadata.tags %}
|
||||
<footer class="document-footer">
|
||||
<div class="document-tags">
|
||||
<span class="mono small secondary">Tagged: </span>
|
||||
{% for tag in metadata.tags %}
|
||||
<a href="/tags/{{ tag|lower }}" class="mono small">{{ tag }}</a>{% if not loop.last %}, {% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</footer>
|
||||
{% endif %}
|
||||
|
||||
<div class="document-footer">
|
||||
<hr>
|
||||
<div class="document-footer-holder">
|
||||
{% if metadata and metadata.summary %}
|
||||
<p class="document-subtitle">{{ metadata.summary }}</p>
|
||||
{% endif %}
|
||||
|
||||
{% if metadata and metadata.quick_tips %}
|
||||
<div class="document-quick-tips">
|
||||
<h4>Quick Tips:</h4>
|
||||
<hr>
|
||||
<ul>
|
||||
{% for tip in metadata.quick_tips %}
|
||||
<li>{{ tip }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</article>
|
||||
|
||||
|
||||
</div>
|
7
docs/templates/__file.md.html
vendored
7
docs/templates/__file.md.html
vendored
@ -1,7 +0,0 @@
|
||||
<article>
|
||||
{{ content|safe }}
|
||||
</article>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/dark.min.css">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/dockerfile.min.js"></script>
|
||||
<script>hljs.highlightAll();</script>
|
120
docs/templates/__folder.html
vendored
Normal file
120
docs/templates/__folder.html
vendored
Normal file
@ -0,0 +1,120 @@
|
||||
<div class="document-layout">
|
||||
{% set index_path = (currentPath + '/index.md') if currentPath else 'index.md' %}
|
||||
{% set index = get_rendered_markdown(index_path) %}
|
||||
<article class="document">
|
||||
<header class="document-header">
|
||||
<hr>
|
||||
<div class="document-header-holder">
|
||||
{% if index.exists %}
|
||||
{% if index.metadata and index.metadata.date %}
|
||||
<div class="document-metadata">
|
||||
{{ index.metadata.date }}
|
||||
{% if index.metadata.author %} — {{ index.metadata.author }}{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
<div>
|
||||
<div class="document-file-nav-holder">
|
||||
{% set siblings = get_sibling_content_files(currentPath) %}
|
||||
{% if siblings and siblings|length > 1 %}
|
||||
{% set current_index = namespace(value=-1) %}
|
||||
{% for sibling in siblings %}
|
||||
{% if sibling[1] == currentPath %}
|
||||
<a href="/{{ sibling[1] }}" class="document-nav-link">
|
||||
<span class="document-nav-label-selected">🖹 {{ sibling[0] }}</span>
|
||||
</a>
|
||||
{% else %}
|
||||
<a href="/{{ sibling[1] }}" class="document-nav-link">
|
||||
<span class="document-nav-label">🖹 {{ sibling[0] }}</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="document-folder-nav-holder">
|
||||
{% set siblingsfolders = get_sibling_content_folders(currentPath) %}
|
||||
{% if siblingsfolders and siblingsfolders|length > 1 %}
|
||||
{% for siblingf in siblingsfolders %}
|
||||
{% if siblingf[1] == currentPath %}
|
||||
<a href="/{{ siblingf[1] }}" class="document-nav-link">
|
||||
<span class="document-nav-label-selected">🗀 {{ siblingf[0] }}</span>
|
||||
</a>
|
||||
{% for child in get_folder_contents(siblingf[1]) %}
|
||||
{% if child.name == "index.md" %}
|
||||
<a href="/{{ child.path }}" class="document-nav-link">
|
||||
<span class="document-nav-label-selected">∟ 🖹 {{ child.name }}</span>
|
||||
</a>
|
||||
{% else %}
|
||||
<a href="/{{ child.path }}" class="document-nav-link">
|
||||
<span class="document-nav-label">∟ 🖹 {{ child.name }}</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<a href="/{{ siblingf[1] }}" class="document-nav-link">
|
||||
<span class="document-nav-label">🗀 {{ siblingf[0] }}</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</header>
|
||||
|
||||
<div class="document-content-wrapper">
|
||||
<div class="document-content">
|
||||
<hr>
|
||||
{% if index.exists %}
|
||||
<section class="folder-index">
|
||||
{{ index.html | safe }}
|
||||
<hr>
|
||||
</section>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% if metadata and metadata.tags %}
|
||||
<footer class="document-footer">
|
||||
<div class="document-tags">
|
||||
<span class="mono small secondary">Tagged: </span>
|
||||
{% for tag in metadata.tags %}
|
||||
<a href="/tags/{{ tag|lower }}" class="mono small">{{ tag }}</a>{% if not loop.last %}, {% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</footer>
|
||||
{% endif %}
|
||||
|
||||
<!-- Navigation to sibling documents -->
|
||||
<div class="document-footer">
|
||||
<hr>
|
||||
{% if index.exists %}
|
||||
<div class="document-footer-holder">
|
||||
{% if index.metadata and index.metadata.summary %}
|
||||
<p class="document-subtitle">{{ index.metadata.summary }}</p>
|
||||
{% endif %}
|
||||
|
||||
{% if index.metadata and index.metadata.quick_tips %}
|
||||
<div class="document-quick-tips">
|
||||
<h4>Quick Tips:</h4>
|
||||
<hr>
|
||||
<ul>
|
||||
{% for tip in index.metadata.quick_tips %}
|
||||
<li>{{ tip }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</article>
|
||||
|
||||
|
||||
</div>
|
65
docs/templates/base.html
vendored
65
docs/templates/base.html
vendored
@ -1,43 +1,44 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{ title }}</title>
|
||||
{% if metadata and metadata.title %}
|
||||
<title>{{ metadata.title }} — Foldsite</title>
|
||||
<meta name="description" content="{{ metadata.description or 'A thoughtful static site generator' }}">
|
||||
{% if metadata.tags %}
|
||||
<meta name="keywords" content="{{ metadata.tags | join(', ') }}">
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<title>Foldsite — Documentation</title>
|
||||
<meta name="description" content="A thoughtful static site generator built with Python">
|
||||
{% endif %}
|
||||
|
||||
<!-- Open Graph / Social Media -->
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:title" content="{{ metadata.title if metadata and metadata.title else 'Foldsite' }}">
|
||||
<meta property="og:description" content="{{ metadata.description if metadata and metadata.description else 'A thoughtful static site generator' }}">
|
||||
|
||||
<!-- Load layout-specific styles -->
|
||||
{% for style in styles %}
|
||||
<link rel="stylesheet" href="/styles{{ style }}">
|
||||
{% endfor %}
|
||||
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Outfit:wght@100..900&display=swap" rel="stylesheet">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Doto:wght@100..900&family=Lekton:ital,wght@0,400;0,700;1,400&display=swap" rel="stylesheet">
|
||||
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='base.css') }}">
|
||||
{% for style in styles %}
|
||||
<link rel="stylesheet" href="/styles{{ style }}" type="text/css">
|
||||
{% endfor %}
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/default.min.css">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/highlight.min.js"></script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/languages/django.min.js"></script>
|
||||
|
||||
|
||||
{% block extra_styles %}{% endblock %}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="holder">
|
||||
<div class="sidebar"> <!-- Changed <sidebar> to <div> -->
|
||||
<ul>
|
||||
<li><a href="/">⌂ Home</a></li>
|
||||
<hr>
|
||||
{% for f in get_folder_contents() %}
|
||||
{% if not f.is_dir %}
|
||||
{% if f.proper_name == "index" %}
|
||||
{% else %}
|
||||
<li><a href="/{{ f.path }}">{{ f.proper_name }}</a></li>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="content"> <!-- <main> tag remains the same -->
|
||||
{{ content|safe }}
|
||||
<div class="footer">
|
||||
<p>© DWS</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
{{ content|safe }}
|
||||
|
||||
</html>
|
||||
<script>hljs.highlightAll();</script>
|
||||
</body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user