vweb: @js and @css template fns

pull/5351/head
Alexander Medvednikov 2020-06-11 20:34:59 +02:00
parent 72fdb09e46
commit c9cfe9d40b
1 changed files with 15 additions and 1 deletions

View File

@ -67,8 +67,8 @@ _ = header
else if line == '</script>' {
state = .html
}
// TODO
if line.contains('@include ') && false {
// TODO
pos := line.index('@include ') or {
continue
}
@ -84,6 +84,20 @@ _ = header
}
continue
//s.writeln(file_content)
} else if line.contains('@js ') {
pos := line.index('@js') or {
continue
}
s.write('<script src=') // " is inserted in the template
s.write(line[pos + 4..])
s.writeln('></script>')
} else if line.contains('@css ') {
pos := line.index('@css') or {
continue
}
s.write('<link href=')
s.write(line[pos + 4..])
s.writeln(' rel="stylesheet" type="text/css">')
} else if line.contains('@if ') {
s.writeln(str_end)
pos := line.index('@if') or {