Trying to deploy veb app with templates and static embed #22956
-
I have a veb app with templates From veb documentation:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
For <!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<title>@title</title>
@css 'static/style.css'
</head>
<body>
<header>@title</header> into this: <!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<title>@title</title>
<style>
@include 'static/style.css'
</style>
</head>
<body>
<header>@title</header> Now the But... for javascript the thing is complicated, since I am using an autogenerated js with |
Beta Was this translation helpful? Give feedback.
-
I found embed_file module! import v.embed_file
pub struct App {
css embed_file.EmbedFileData
}
mut app := &App{
css: $embed_file('static/style.css')
}
@['/style.css']
pub fn (mut app App) style(mut ctx Context) veb.Result {
return ctx.send_response_to_client('text/css', app.css.to_string())
} ...still testing |
Beta Was this translation helpful? Give feedback.
Worked
js
too and small deployed-prod
small executable 1.4M worked in another linux.