Closed OoLunar closed 1 year ago
The issue is due to the leading slashes (/
). If you change to .Add("readme" ...)
the pages are served.
Besides that, it seems that you would like to serve a website, so I would take this approach instead:
var textFiles = Layout.Create()
.Add("readme", ModMarkdown.Page(Resource.FromAssembly(typeof(Program).Assembly, "Readme.md")).Title("Readme"));
var website = Website.Create()
.Theme(Theme.Create())
.Content(textFiles);
//.Favicon(Resource.FromAssembly(...))
Host.Create()
.Handler(website)
.Bind(IPAddress.Parse("127.0.0.1"), 8080)
.Run();
With the NoTheme
package, if the pages should be served without a menu. Otherwise you can try something like AdminLTE
,
Sample project: sample.zip
Thank you for your response and I apologize for the delay.
As you had mentioned, the issue was indeed the leading slash. I hadn't seen this documented anywhere and I expected the leading slash to be treated as the root of the website, not as a segment.
With the
NoTheme
package, if the pages should be served without a menu. Otherwise you can try something likeAdminLTE
,
While I appreciate the offer, the latest Nuget packages don't seem to work as intended with the latest commit of this project. Instead, it throws upon registering due to a lack of implementation on the Build
method, I think? Regardless, that's out of scope for this issue.
Thank you again, I appreciate your assistance.
This was my final result:
When passing a LayoutBuilder I'm expecting to be served the page. Instead I am receiving 404's and am unable to serve any content.
Example
Additional Information Running on the latest commit, using https://genhttp.org/documentation/content/layouting as a reference.