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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user