✨ layout/_index.html を 外部から読み込めるように変更
parent
b432961097
commit
315baaf552
@ -1,15 +1,12 @@
|
||||
/*
|
||||
何も作ってない
|
||||
*/
|
||||
|
||||
module template
|
||||
|
||||
struct Template {
|
||||
template string
|
||||
}
|
||||
|
||||
fn parse(template string, target map[string]any) string {
|
||||
pub fn parse(template string, target map[string]string) string {
|
||||
mut content := template
|
||||
for key in target.keys() {
|
||||
at_key := '@' + key
|
||||
value := target[key]
|
||||
// assign to content
|
||||
content = content.replace(at_key, value)
|
||||
}
|
||||
return content
|
||||
}
|
||||
|
||||
|
||||
fn execute() {}
|
Loading…
Reference in New Issue