poppastring / dasblog-core

The original DasBlog reimagined with ASP.NET Core
MIT License
473 stars 195 forks source link

First implementation of static pages as per #686. #688

Closed thousandtyone closed 1 year ago

thousandtyone commented 1 year ago

Simple Implementation (v1):

This is the basic implementation as discussed in #686.

Once the merge is done testing is really simple.

  1. In your content folder, create a folder called "static" inside your content folder (wherever that is configured). e.g. image

  2. Inside the static folder keep a ".html" file with simple HTML: image

  3. It can hold any static HTML: image

  4. Save the File, run the blog, and now replace ".html" either with ".aspx" or nothing (depending on your blog's routing scheme): image

  5. Of course if you are using aspx based URL scheme (older migrations of historic blogs with URLs retained) you can also retain the URL of your static page and use ".aspx" in the end: image

Next Steps:

Once this PR is approved I will be working on:

  1. Test Cases.
  2. Caching (this would be better than reading from the file) - in the long run, we should do file-dependency caching so that files are not read till changes are made.
  3. Maybe even a front end for creating and managing these pages? (if there is a real demand/need for that).
  4. For now I've not removed the about-us implementation that already exists. I can remove it if we all agree that this feature makes that one redundant.

Please do let me know if any added changes are required. Happy to make those.

poppastring commented 1 year ago

@thousandtyone This looks good!