Last active
August 11, 2021 00:09
-
-
Save jdf-id-au/2cda1521ae477ac324697cdf07d62353 to your computer and use it in GitHub Desktop.
Debugging nimWebTemplates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "parent.html" %} | |
{% block head %} | |
head! | |
{{key1}} {{key2}} | |
{% endblock %} | |
{% block content %} | |
content! | |
{{key1}} {{key2}} | |
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nwt | |
import json | |
var templates = newNwt("templates/*.html") | |
var context = %* {"key1": "one", "key2": "two"} | |
echo templates.renderTemplate("child.html", context) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Title</title> | |
head! | |
one | |
content! | |
one two | |
</head> | |
<body> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Title</title> | |
{% block head %} | |
{% endblock %} | |
</head> | |
<body> | |
{% block content %} | |
{% endblock %} | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the new incarnation of nwt does not have this issue: nimja