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:
parent
c55c1c9b66
commit
be425e8be5
20 changed files with 206 additions and 155 deletions
24
source/templates/hippie/macros/_log.njk
Normal file
24
source/templates/hippie/macros/_log.njk
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{% macro start() %}
|
||||
<script>
|
||||
logAdd('EVENT :: Document \'%s\' event fired.', 'DOMContentLoaded');
|
||||
logPerf('HEAD start :: Debugging performance...', debugOn);
|
||||
</script>
|
||||
{% endmacro %}
|
||||
{% macro log(msg, arg = '') %}
|
||||
<script>
|
||||
logPerf('{{ msg }}', {{ arg }});
|
||||
</script>
|
||||
{% endmacro %}
|
||||
{% macro debug(state = false, display = false, assets = false) %}
|
||||
{# {{ set hippie.debugMode = state }} #}
|
||||
<script>
|
||||
debugOn = {{ state }};
|
||||
debugOnScreen = {{ display }};
|
||||
assetsLoaded = {{ assets }};
|
||||
</script>
|
||||
{% endmacro %}
|
||||
{% macro asset(state = false) %}
|
||||
<script>
|
||||
assetsLoaded = {{ state }};
|
||||
</script>
|
||||
{% endmacro %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue