vweb: @js and @css template fns
parent
72fdb09e46
commit
c9cfe9d40b
|
@ -67,8 +67,8 @@ _ = header
|
||||||
else if line == '</script>' {
|
else if line == '</script>' {
|
||||||
state = .html
|
state = .html
|
||||||
}
|
}
|
||||||
// TODO
|
|
||||||
if line.contains('@include ') && false {
|
if line.contains('@include ') && false {
|
||||||
|
// TODO
|
||||||
pos := line.index('@include ') or {
|
pos := line.index('@include ') or {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -84,6 +84,20 @@ _ = header
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
//s.writeln(file_content)
|
//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 ') {
|
} else if line.contains('@if ') {
|
||||||
s.writeln(str_end)
|
s.writeln(str_end)
|
||||||
pos := line.index('@if') or {
|
pos := line.index('@if') or {
|
||||||
|
|
Loading…
Reference in New Issue