madskristensen / MiniBlog

A minimal blog engine using Razor Web Pages
Other
917 stars 376 forks source link

Interest in CMS features? #192

Open rickparrish opened 9 years ago

rickparrish commented 9 years ago

I modified MiniBlog to add simple CMS features (ability to add/edit/delete pages in the same way that blog posts are added/edited/deleted), and I'm wondering if there is enough interest in something like that to have the changes included in the main repository.

The reason I ask is because my proof-of-concept was a quick hack, so my next step will be to try to implement things a little more cleanly. And I have two different ways to go about it:

If my changes may get pulled into the main repository, it makes sense to integrate wherever it makes sense. If my changes will only ever exist in my own fork, then keeping my changes as separate as possible will make it easier for me to pull in changes from the main repository in the future.

A quick example of what I'm talking about would be Storage.cs. I can either add methods for adding/editing/deleting pages to the existing Storage.cs file, or I can create a separate CmsStorage.cs file to handle the adding/editing/deleting of pages.

I guess I could always keep my changes as separate as possible whether they get pulled into the main repository or not, but using the Storage.cs example again that would mean some helper functions get duplicated (ie ReadValue and ReadAttribute would exist in both files).

It sounds like some people are using MiniBlog as a virtual application inside an existing project, in which case the CMS features wouldn't be useful, so I'm leaning towards keeping my changes in a separate fork, but just wanted to get some feedback before I go ahead with that plan.

madskristensen commented 9 years ago

I think pages is beyond the scope of the main repo. @razorant has been playing around with the concept too and might have additional feedback

RazorAnt commented 9 years ago

I've been working with a fork of MiniBlog that has pages but I completely re-wrote storage as I want my data in a different format. Before I did that though, I started with a pages hack like you mentioned and keep things as separate as possible.

This post shows what I'm working on: http://nyveldt.com/blog/post/blogging-with-markdown

I've not published it as life got really busy, but hope to soon. Just opened it again yesterday.

rickparrish commented 9 years ago

Looks very interesting, I'll have to watch for it.

One question I meant to ask above is related to the defaultDocument setting. To keep my POC changes separate I created a Cms.cshtml to handle page requests, and I set it as the defaultDocument in the web.config file. It didn't seem to have any effect though. I tried using so Cms.cshtml should be the only document used, but that still didn't work. The only way I was able to get Cms.cshtml to be used was to rename Index.cshtml to Blog.cshtml.

Is that normal/expected behaviour? Does Index.cshtml somehow take priority over everything else if it exists? Is there anything else I should have tried? Renaming one of your files isn't ideal since I assume it'll complicate future pulls to update my fork.

RazorAnt commented 9 years ago

Rick, I finally published my fork this weekend. You can take a look at the code or see it in action here. There is a short walkthrough video near the end of that post.