feat: change log output and template structure

- new global variable debugMode
- demo templates are now based on hippie defaults joined with template inheritance
- add log macros
- new function logAdd()
- log uses global state
This commit is contained in:
sthag 2024-08-10 15:25:41 +02:00
parent c55c1c9b66
commit be425e8be5
20 changed files with 206 additions and 155 deletions

View file

@ -0,0 +1,50 @@
<!-- main.template -->
{% import "hippie/macros/_log.njk" as log %}
<!DOCTYPE html>
<html lang="de" class="{{ pageClass }}" id="{{ pageId }}">
<head>
<meta charset="utf-8">
{% block head %}
<title>
{{ hippie.titlePrefix }}
{% block title %}{% endblock %}{{ hippie.titlePostfix }}</title>
{% block meta %}
{% include "hippie/partials/_head_meta.njk" %}
{% endblock %}
{% include "hippie/partials/_head_script.njk" %}
{{ log.debug(hippie.debugMode, true) }}
{{ log.start() }}
{% block links %}
{% include "hippie/partials/_head_links.njk" %}
<link rel="stylesheet" type="text/css" media="all" href="{{ pageBase }}css/demo.css"/>
{% endblock %}
{{ log.log('HEAD end :: Links parsed, starting to load.') }}
{% endblock %}
</head>
<body class="{{ bodyClass }}">
{{ log.log('BODY start') }}
{% include "hippie/partials/_body_hover.njk" %}
<div id="root">
{% include "hippie/partials/_header.njk" %}
<main class="main_site">
{% block main %}{% endblock %}
</main>
{% include "hippie/partials/_footer.njk" %}
</div>
{% block script %}
{{ log.log('BODY :: Loading script assets...') }}
{% endblock %}
{{ log.log('BODY end :: Page script might still be loading.') }}
</body>
</html>