kirbysayshi/vash

Filling a block only shows VASHMARK

Closed this issue · 3 comments

When I try to fill a block from a nested layout, I only see this in the code:

[VASHMARK-8113110:block-details]

Since this is really hard to explain, I ask you too look into this repository - it's super easy to get started:

git clone https://github.com/yannik-b/AbiFinanzen-17 && cd AbiFinanzen-17
npm i
node index.js

Then run xdg-open http://localhost:5000/detail or open localhost:5000/detail in your browser.

Same issue. Works fine if I dont use block. (Note:

require('http');
require('url');
require('fs');
var port = process.env.port || 1337
require('mime');
var vash = require('vash');
fs.readFile('./Views/Home/Index.vash', 'utf8', function (err, data) {
            var tpl = vash.compile(data.toString());
            var out = tpl({ X: 'a' })

            response.write(out);
            response.end();
        });   
@html.extend('./Views/Layout.vash', function(model){

    @html.block('body', function(model){

    });

});
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Bootstrap 101 Template</title>

    <!-- Bootstrap -->
    <link href="/Content/Packages/BootStrap/css/bootstrap.min.css" rel="stylesheet">

</head>
<body>
    @html.block('body') 
    <script src="/Content/JS/jquery-1.11.3.js"></script>
    <script src="/Content/Packages/BootStrap/js/bootstrap.js"></script>
</body>
</html>

Output: (all layout code) + [VASHMARK-5606127:block-body] ;

Nm This fixed it.

fs.readFile('./Views/Home/Index.vash', 'utf8', function (err, data) {
            var tpl = vash.compile(data.toString());
            var rendered = tpl({ X: 'a' }, function sealLayout(err, ctx) {
                response.write(ctx.finishLayout());
                response.end();
            });
        });   

Request you to close this issue as this is fixed. It shows a lot of open bugs and I am confused as to whether I use this or not