Closed jskeet closed 7 years ago
Ooh, it looks like I can put a _ViewStart.md in each view directory, and that will be picked up. That will be a fine solution for me...
Nope, that doesn't work - I've tried a few things, and although a single _ViewStart.md with @layout _Layout
looks like it might work, I don't see any way of specifying a layout relative to the page itself.
I think I can make do with two controllers, although it's a bit ugly...
@jskeet I change the directives little bit last week but I didn't push the updates yet, hope I will do it soon.
Regarding _ViewStart
it is limited now so the engine only able to pick it from the shared folder
Uploading the latest change will fix the issue. Also I will look to support multiple _ViewStart
so you will be able to add one in each folder
RIghto - will use different controllers just for now, but fix it later - thanks :)
No need for multiple _ViewStart in this particular case, so long as there's a way of making a single @layout
directive work relative to the rendered Markdown page - I can just call the layout _Layout.md
in every directory.
Yes you can, but it's tedious 😄, we can support _ViewStart
per folder such as Razor Engine
After looking to the latest code the @page
directive introduces a property called Layout instead of the @Layout
directive, so this absolutely will solve your issue
@jskeet after this commit https://github.com/hishamco/MarkdownViewEngine/commit/ac6800b4b1df8d6a9d0ed30efb6efc03193c5bb2 this should be fixed. You can have a look to this https://github.com/hishamco/MarkdownViewEngine/blob/master/samples/MarkdownViewEngineSample/Views/Home/Index.md and https://github.com/hishamco/MarkdownViewEngine/blob/master/samples/MarkdownViewEngineSample/Views/Home/About.md which there are using different layouts
I have two different layouts I need to support: one for the user guide, and one for a developer guide.
Ideally, I could default to the user guide but have a file in the developer directory that changes the layout. However, failing that, it wouldn't be awful to have:
in each developer guide page. But at the moment, I think only a single directive is supported per file. Perhaps it should read a line at a time until it finds something which isn't a directive (and processing the directives as it goes), and then concatenate the rest of the file with that...