1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vweb: look for html templates in templates/

This commit is contained in:
Alexander Medvednikov
2020-06-10 18:00:06 +02:00
parent 972f60d785
commit a2d7bc6e6f
2 changed files with 13 additions and 12 deletions

View File

@@ -30,9 +30,9 @@ pub fn compile_template(content, fn_name string) string {
// lines := os.read_lines(path)
mut html := content
mut header := ''
if os.exists('header.html') && html.contains('@header') {
h := os.read_file('header.html') or {
panic('reading file header.html failed')
if os.exists('templates/header.html') && html.contains('@header') {
h := os.read_file('templates/header.html') or {
panic('reading file templates/header.html failed')
}
header = h.replace("\'", '"')
html = header + html