Thoughts from the Wet Coast
The musings of an ASP.NET Developer from Canada's We(s)t Coast
In an earlier post in this series I blogged about creating themes for my blogs. In my most recent updates I have added support for pages to my blog. All the pages on the site are rendered with the same View Page view, so would therefore use the same layout or “template”. Even in a fairly simple site this quite restrictive, and in the post I will show how you can support multiple different layout pages or page templates.
I have been updating my Naif.Blog application to ASP.NET Core 2.1, and I noticed that when the site is published all the Razor cshtml files are “pre-compiled” into an assembly. This made me think - this could allow me to break the application into separate projects and I could deploy assemblies with embedded UI, thus allowing me to modularize the application. So I took a deeper look and realized that the ASP.NET Razor team have already thought about this and included a new Razor Class Library (RCL) feature into the 2.1 release.
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.