diff --git a/commands/build.v b/commands/build.v index 1f52839..cfa0052 100644 --- a/commands/build.v +++ b/commands/build.v @@ -166,7 +166,7 @@ fn build(config config.Config, mut logger log.Log) ! { logger.info('start md to html') for path in mds { if b.is_ignore(path) { - logger.info('$path is included in ignore_files, skip build') + logger.info('${path} is included in ignore_files, skip build') continue } b.md2html(path)! diff --git a/commands/serve.v b/commands/serve.v index 8816348..6c3655f 100644 --- a/commands/serve.v +++ b/commands/serve.v @@ -96,7 +96,7 @@ fn watch(path string, config config.Config, mut logger log.Log) { } now := os.file_last_mod_unix(w.path) if now > w.time_stamp { - println('modified file: $w.path') + println('modified file: ${w.path}') w.time_stamp = now build(config, mut logger) or { @@ -117,7 +117,7 @@ fn serve(mut logger log.Log) ! { port: commands.cport } - local_base_url := 'http://localhost:$commands.cport/' + local_base_url := 'http://localhost:${commands.cport}/' mut config := load_config(default_config)! config.base_url = local_base_url println(local_base_url) @@ -128,7 +128,7 @@ fn serve(mut logger log.Log) ! { println('Build failed') } - w := go watch('.', config, mut logger) + w := spawn watch('.', config, mut logger) server.listen_and_serve() w.wait() diff --git a/internal/config/config.v b/internal/config/config.v index a8b0be0..d68349c 100644 --- a/internal/config/config.v +++ b/internal/config/config.v @@ -24,8 +24,8 @@ pub mut: pub fn load(toml_text string) !Config { doc := toml.parse_text(toml_text)! - mut config := doc.reflect() - config.build = doc.value('build').reflect() + mut config := doc.reflect[Config]() + config.build = doc.value('build').reflect[Build]() return config }