Giter Site home page Giter Site logo

cloudscribe / cloudscribe.simplecontent Goto Github PK

View Code? Open in Web Editor NEW
333.0 29.0 65.0 63.04 MB

A simple, yet flexible content and blog engine for ASP.NET Core that can work with or without a database, supports markdown or html editing

Home Page: https://www.cloudscribe.com/docs/cloudscribe-simplecontent

License: Apache License 2.0

C# 62.02% JavaScript 1.37% CSS 0.29% PowerShell 0.20% Shell 0.08% HTML 32.17% SCSS 3.87%

cloudscribe.simplecontent's Introduction

cloudscribe SimpleContent

A simple, yet flexible content and blog engine for ASP.NET Core that can work with or without a database. This project has borrowed significantly from Mads Kristensen's MiniBlog both for ideas and code but re-implemented and extended in the newer ASP.NET Core framework. Get the big picture at cloudscribe.com

Documentation - in progress so check back often. Also note that cloudscribe SimpleContent is being used to make the documentation on cloudscribe.com

If you have questions, please visit our community forums https://www.cloudscribe.com/forum

Build Status

Windows Linux
Build status Build Status

Twitter URL Twitter Follow

Getting Started

See the Introduction to get the big picture and learn how to start new projects using our project template for Visual Studio or the .NET Core CLI

Current Features

  • Supports markdown and/or html editing, the documentation on using markdown
  • Create and edit pages and blog posts right from the web browser or using Open Live Writer
  • Built in image browser, uploader, cropper, with configurable automatic resizing, and even drag/drop images right into the editor
  • Built in Page Manager - for easy drag/drop arrangement of the page hierarchy
  • For technical articles includes built in syntax highlighter using the CodeSnippet plugin in CKEditor
  • Pages can be protected by roles for private or premium content
  • Schedule posts and pages to be published on a future date
  • Supports blog urls with or without date segments
  • Optional internal comment system for the blog. Built in support for Disqus and not difficult to integrate some other comment system
  • RSS feed built in at /api/rss
  • Google Site Map built in at /api/sitemap
  • Responsive theming support based on Bootstrap
  • Uses HTML 5 microdata to add semantic meaning and improve SEO
  • Cross platform, runs on ASP.NET Core which works on Windows, Mac, and Linux
  • Comments support - can easily be replaced by 3rd-party commenting systems such as Disqus
  • No database required - can use markdown or json for pages and can use markdown or xml for blog posts via NoDb. The XML format is the same as MiniBlog and BlogEngine.NET and you should be able to migrate from other platforms
  • You can optionally use a database - it currently supports SQLite, MS SQL, PostgresSql, and MySql using Entity Framework Core
  • Can use either cloudscribe Core or cloudscribe SimpleAuth for user accounts. (I recommend use cloudscribe Core even for small sites)
  • Can also be integrated with other authentication systems
  • Supports multiple tenants via integration using cloudscribe Core
  • Supports Localization

Planned Features

  • Support for using MongoDb - hoping for a community member to do that
  • A Utility for importing the NoDb content into Entity Framework Core or MongoDb for easy migration

Screenshots

Blog Screen shot

page edit screen shot

file browser Screen shot

file selection Screen shot

image cropper Screen shot

Blog Screen shot

Start simple with no database and migrate to a database later if you need one

Not all web site projects need a database, there can be many benefits to not using one including performance, scalability, portability, lower cost, and ease of making backup copies of the entire site. It should even be possible to make a site that runs from a thumb drive.

In fact, for blogs, there has been kind of a trend towards using Static Site Generators. This project is not a static site generator, but by storing content as json files it can get some of the same benefits and be used in a similar way to using a static site generator. For example you could host a localhost or intranet version of your site for producing and reviewing content, then when ready to publish you could commit the changes to a git repository and then do deployment from git to Azure for example, which would give you a highly scaleable site without the need or cost of a database and with a complete history of changes in git. Personal blogs and sites and small brochure sites are good candidates for not using a database.

Some sites do need a database though and we plan to support using both Entity Framework Core and MongoDb. If you need users to be able to register on your site or if you have more than a few editors, or for larger projects, you will typically want a database.

My plan is to usually build sites without a database (except for large projects), but implement a migration utility to be able to migrate any site from files to a database later if the needs of the project require it.

cloudscribe.simplecontent's People

Contributors

crispinf avatar dependabot[bot] avatar jacobsdatasolutions avatar jimkerslake avatar joeaudette avatar markidox avatar mfoitzik avatar programmino avatar scott-wi avatar simonannetts avatar stewartbellamy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cloudscribe.simplecontent's Issues

review views for hard coded route names

Found an issue when using custom blog routes, ie implementing a custom IBlogRoutes.

The Archive view pagination has hard coded route name and is not using the custom route. Need to inject IBlogRoutes into views and use the names from that.

Need to review all views, index view has controller and action instead of route name in pagination.

bugs in the new editing experience

Just making notes here, these things will be fixed soon. These are issues I encountered while writing my first blog post using the new editing experience.

  • there is nothing in the toolbar for headings or other element selections
  • when I tried using source view to manually add headings source view is grayed out and read only

When blog entry does not have any images then Featured and Recent posts will use main web site as image for post

Steps:

  1. Create new website using dotnet new cloudscribe -D NoDb -S a -L true (I did it few days ago for version 3.0)
  2. Enable Show Recent Posts on Default Page and Show Featured Posts on Default Page
  3. Create few blog entries without any images
  4. Go to default page for that site.
  5. You will see Recent Posts and Featured Posts with invalid image to blog entry left.

I believe that issue happened because ContentProcessor.ExtractFirstImageUrl doesn't work correctly when fallbackImageUrl is empty string and empty string is used (var defaultImageUrl = ""; //you can specify a default image) in views by default

Perhaps this line:
if (firstImageUrl == null) return fallbackImageUrl;
should be changed to
if (string.IsNullOrWhiteSpace(ImageUrl)) return fallbackImageUrl;

Also there is extra if (item == null) return string.Empty; that can be removed

Prevent empty tags; duplicate tags cause error

Just testing tag management behaviour... a couple of simple issues:
1.
Creating or editing with ", " at the end generates a false empty category that doesn't link back to the post.
2.
setting the categories as this:
"foo,bar, , "
gives "something went wrong on the server" and this in the log:
Error 127.0.0.1 cloudscribe.SimpleContent.Web.Controllers.BlogController /Blog/AjaxPost
ajax post failed with exception The instance of entity type 'PostCategory' cannot be tracked because another instance of this type with the same key is already being tracked. When adding new entities, for most key types a unique temporary key value will be created if no key is set (i.e. if the key property is assigned the default value for its type). If you are explicitly setting key values for new entities, ensure they do not collide with existing entities or temporary values generated for other new entities. When attaching existing entities, ensure that only one entity instance with a given key value is attached to the context.
This gives a similar error:
"foo,bar, Foo ,"
So does this
"foo,bar, Foo"
( I think this just require de-duplicating the list).

Create page options with new Templates - suggestion to make this clearer

Just doing my first test of this (looking great!), and found myself a little confused by the fact that the two ways of creating the page are styled differently, one being a button the other a link (see below):
image
For me this would be clearer if the upper one ("New Page …") was also a button.

breaking change - need to add reference to integration views

In the work to implement support for bootstrap 4, we had to move the previous bootstrap 3 views from the cloudscribe.Core.SimpleContent.Web project (which is the integration between cloudscribe Core and cloudscribe SimpleContent) into a new project cloudscribe.Core.SimpleContent.Views.Bootstrap3

This impacts the Administration > Content Settings page which is the page that uses these views.

Those views used to be included automatically but after updating to the latest nuget packages, the views will be missing and need to be added manually by adding a nuget reference to cloudscribe.Core.SimpleContent.Views.Bootstrap3 and then adding to the Razor options in startup code to pull in the views from the embedded resources.

options.AddCloudscribeCoreSimpleContentIntegrationBootstrap3Views();

A page scheduled to publish in future is not publishing at the designated time (5 hour offset)

Testing the "Publish Later" functionality, I set a page to publish at a given time, and it didn't.
image

And in another browser, at 15:58, we still get Page Not Found.

OK I think there's a regional settings issue. The site Time Zone by default was in America/New York. Switching this to "GB", with no change to the above page, made it show this:
image
Back into the editor, I changed the publish time to this:
image
but on loading the page it showed this:
image

I thought there might be a caching issue after changing the site Time Zone, but after restarting I see exactly the same. On saving the publication time, it is offset +5 hours from what I set in the editor. If I set it to current time minus 5 hours, the page becomes published.
My machine regional settings are default UK.

Small possibly related issue: even with my machine and browser in UK settings, the date in the "Publish Later" control shows in US date format "07/26/2018 4:15 PM" (I'd expect "26/07/2018 4:15 PM").

removing humanizer package dependency

Recent versions of SimpleContent introduced a package dependency on Humanizer. We are using the truncation logic from humanizer for auto generating blog post teasers.

However, after taking on this dependency I noticed that when publishing the published output had a huge number of language specific folders for satellite resources that are used for localizing Humanizer. It was very ugly to see.

Since we were only using a very small part of humanizer and did not need those localization files, I decided to migrate the few code files related to truncation from the humanizer project directly into simplecontent and remove the package dependency on humanizer so we can get rid of the ugly publish output.

Just making a note of it here for anyone else who may have noticed this. It is safe to delete all those extra language folders for languages you are not using and also safe to delete any language folder that only has a humanizer dll in it, after updating to the latest simplecontent nugets.

Really I partly blame Microsoft for this issue because it was their decision to dump all the publish dlls into the main root of the publish folder. It would be nicer if all of that cruft could go below a bin folder as in previous versions of asp.net. I think it evolved that way because in the early days of asp.net core when we have project.json project system, the build output published nuget packages and nuget packages were also included in the publish output and consumed directly at runtime. But when they did away with the project,json project system and moved back to .csproj they also went back to using dlls in publish output. If nuget packages were still used it would not have been ugly because the satellite assemblies would have been encapsulated in the nuget packages instead of creating this explosion of folders. When they changed back to .csproj/msbuild they should also have brought back a bin folder in publish output in my opinion to keep things tidy.

Republishing a page not working

This might be the result of some caching, not sure.
Take any published page, and set it's Publication Date into the future. It disappears for public users as expected. Set the date back into the past - the page does not re-appear. e.g. I have this page and it's not appearing:
image
There are not view roles protecting the page, and it was visible immediately before the changes.

not working on mac

@benfoster told me he got this error trying SimpleContent on Mac OSX

An unhandled exception occurred while processing the request.
FileNotFoundException: Could not find file '/usr/share/zoneinfo/Eastern Standard Time'.
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
TimeZoneNotFoundException: The time zone ID 'Eastern Standard Time' was not found on the local computer.
System.TimeZoneInfo.FindSystemTimeZoneById(String id)

I have not yet started testing on mac and linux but have machines for doing so. Logging this issue for now.

Content Templating

It would be great to have a way of templating content, so that for any new page the web editor enters information into some controls on a form, and the entered values (which might include images) are rendered as html when not editing.
The required ingredients for this are (as it seems to me!):

  1. data template (e.g. could be an xsd)
  2. method of creating/editing data template (e.g. could be freetext editor with validation)
  3. presentation template (e.g. could be html with data attributes defining which data element hydrates each html element)
  4. method of creating/editing presentation template (e.g. could be freetext editor)
  5. Auto-creation of data entry controls from data template (there are existing open source libraries for this)
  6. Method of previewing the rendered result while editing
  7. Caching of rendered html to help performance, busted on changed data values or templates.

It would be most powerful if data entered through content templates became queryable "data" rather than just shaped html.

PageTree.js currently throwing 404

Noticed after a nuget update that the Page Management screen was no longer working - only the "New Root Level Page" button appears and no existing pages appear.

Looking in the javascript console this message appears on loading the page:

Loading failed for the <script> with source “http://localhost:62453/csscsr/js/pagetree.js”.

Looks like it's related to the Web.Mvc project being merged into Web project.

I've made the change to fix it and added a test, please let me know if it looks okay. #246

Doesnt Build.... (dev or master branch)

Looks like the method name was changed.. but startup.cs file wasnt changed....

src/sourceDev.WebApp/Startup.cs
Showing the top match Last indexed a day ago
83 services.AddScoped<cloudscribe.Web.Navigation.INavigationNodePermissionResolver, cloudscribe.SimpleContent.Web.Services.PagesNavigationNodePermissionResolver>();
84
85 services.AddCloudscribeCore(Configuration);
86
87 services.Configure<List>(Configuration.GetSection("ContentProjects"));

Browse server popup - minor layout queries

I didn't find the select button immediately obvious, my eye was naturally drawn to the bottom right corner of the popup. Perhaps make it a bootstrap primary button and also duplicate it next to the very obvious delete file button?

Consider using bootstrap rows or form groups to give some white space between various components, e.g. between crop button / image name / delete file.

image

Administration Page Styling

Hi,
Just came across your projects and true impressed. I want to style the side menu etc. Where can I find the siteadmin/index view? Or how can I overwrite it? I'd greatly appreciate your prompt response.

Raj

Is Index view for blog suppose to have noindex?

Few days ago I submitted sitemap to google and today I got email that "Submitted URL marked ‘noindex’". I checked and sitemap contains link to index blog page and file:
src\cloudscribe.SimpleContent.CompiledViews.Bootstrap4\Views\Blog\Index.cshtml
contains:
<meta name="robots" content="noindex, follow" />
Is it intended behavior?
Update: I actually submitted link to blog so perhaps it is why I got that error message from google

Proposal for teaser functionality

For the blog projects I'm working on, I anticipate posting a lot of content that is text-heavy (blog entries of several thousand words, fiction, etc). For my purposes I require "teaser" functionality on the Index view of the blog, similar to other CMS systems like Drupal, Wordpress, etc that truncate the post content for display on the listing page.

The way I'm currently envisioning this is as follows:

  • Auto-teaser mode: On/Off setting for the project settings i.e. site-wide that automatically manipulate the content of posts. If enabled, the following additional settings would apply: Truncation length (integer). Truncation mode (enum): characters/words/paragraphs. A naive implementation could just use HtmlAgilityPack or similar library to strip all tags from the content when working out the teaser. Then use Humanizer to truncate it in a somewhat smart way. This would be fine for my needs.
  • Explicit teaser: Additional property of PostEntity/IPost that specifies what the teaser should be for an individual post. This will override any other teaser calculated for the post, regardless of whether auto-teaser mode is on/off.

That's about it. Another approach would be to reverse engineer Wordpress or Drupal and just see how they do it. Also, you mentioned using HTML comments embedded in the text itself. I'm OK evaluating this approach if it doesn't involve too many moving pieces. I'm not very familiar with CKeditor extensions at this point, so I don't have a clear idea of the effort involved. I reviewed the contribution guidelines and I'm OK assigning copyright for any work I do. Thanks Joe!

Following issue is coming while creating a new blog post, help me resolve.

Loved your work, thanks.
Logged in as admin.
Setup email - done
then created a new blog post, while opening the post following error thrown.
Please help in resolving the same.
System.NullReferenceException: Object reference not set to an instance of an object.

at AspNetCore._Views_Shared_CommentFormPartial_cshtml.d__10.MoveNext() in /Views/Shared/CommentFormPartial.cshtml:line 9

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.AspNetCore.Mvc.Razor.RazorView.d__16.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.AspNetCore.Mvc.Razor.RazorView.d__15.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()

at Microsoft.AspNetCore.Mvc.Razor.RazorView.d__14.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.AspNetCore.Mvc.ViewFeatures.HtmlHelper.d__60.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at AspNetCore._Views_Blog_CommentWrapperPartial_cshtml.d__0.MoveNext() in /Views/Blog/CommentWrapperPartial.cshtml:line 21

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.AspNetCore.Mvc.Razor.RazorView.d__16.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.AspNetCore.Mvc.Razor.RazorView.d__15.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()

at Microsoft.AspNetCore.Mvc.Razor.RazorView.d__14.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.AspNetCore.Mvc.ViewFeatures.HtmlHelper.d__60.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at AspNetCore._Views_Blog_PostDetailPartial_cshtml.d__16.MoveNext() in /Views/Blog/PostDetailPartial.cshtml:line 111

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.AspNetCore.Mvc.Razor.RazorView.d__16.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.AspNetCore.Mvc.Razor.RazorView.d__15.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()

at Microsoft.AspNetCore.Mvc.Razor.RazorView.d__14.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.AspNetCore.Mvc.ViewFeatures.HtmlHelper.d__60.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at AspNetCore._Views_Blog_Post_cshtml.d__0.MoveNext() in /Views/Blog/Post.cshtml:line 24

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.AspNetCore.Mvc.Razor.RazorView.d__16.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.AspNetCore.Mvc.Razor.RazorView.d__15.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()

at Microsoft.AspNetCore.Mvc.Razor.RazorView.d__14.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.d__22.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.d__21.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.AspNetCore.Mvc.ViewResult.d__26.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__19.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__24.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResultExecutedContext context)

at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)

at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__22.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)

at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)

at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__17.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__15.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.AspNetCore.Builder.RouterMiddleware.d__4.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at cloudscribe.Core.Web.Middleware.EnforceSiteRulesMiddleware.d__3.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.d__6.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.d__3.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at SaasKit.Multitenancy.Internal.TenantPipelineMiddleware`1.d__5.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at SaasKit.Multitenancy.Internal.TenantResolutionMiddleware`1.d__3.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.d__4.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.MigrationsEndPointMiddleware.d__4.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.DatabaseErrorPageMiddleware.d__6.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.DatabaseErrorPageMiddleware.d__6.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.d__7.MoveNext()

Templates - loss of last published version

Steps to reproduce:

  1. Add new page based on link list, add one image with title & link url, click add link!, then 'publish now'
  2. Add top content and 'publish now'
  3. Add bottom content and 'publish now'
  4. Now go to version history, view the top item which is the page with an image and top content and restore this version to the editor, click publish now

The correct page content is now published. But we have lost the last published version of the page, i.e. the one with top, image and bottom content. I'm not sure if this is correct behaviour or not, but you have lost a version of content that was previously published.

Content edit history - delete

Go to the content edit history for a given page and delete one of the items. When the page reloads you are taken to a content edit history view for all content. Would it be a better user experience if you were taken back to the content edit history for the page that you were editing?

Wrong default date format with new blog post causes unhandled exception

NB this issue could be because some config is necessary to support en-GB, but if so I'm not sure where! Also if this is bad/missing config, it would perhaps be better to handle the exception and give the post a date/time of server-now?
Steps to reproduce:
Set site into timezone "GB".
Browser set to English UK (tested in Chrome and Edge).
Create new blog post > the default date appears in US format, e.g. 09/25/2016 12:00 AM
When save post > something went wrong on the server > this in log:
25/09/2016 17:31:40 Error 127.0.0.1 Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware /Blog/AjaxPost
An unhandled exception has occurred while executing the request System.FormatException: String was not recognized as a valid DateTime. at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) at cloudscribe.SimpleContent.Web.Controllers.BlogController.<AjaxPost>d__15.MoveNext() in D:\Development\GitHub\cloudscribe.SimpleContent\src\cloudscribe.SimpleContent.Web\Controllers\BlogController.cs:line 446

  • if I try to edit the post date to UK format, it won't let me and it reverts to US format on tabbing out of the control.

Content Versions, including history and draft

In SimpleContent we already have the ability to make a whole page a draft. But we don’t have the ability to make an edited version of that page a draft while the existing version remains live. And we don’t have the ability to review previous versions, and restore them.
And I think these requirements can be combined into one (in contrast with mojoPortal's approach where these were two separate things that could become confusing for editors). So "Content Versioning" would deliver management of past versions and a future draft version.
This would apply to content pages. Blog posts would only need the "history" part of this as draft content can already be handled adequately.
My initial ideas on this would be:

History:

I think another tab: Content | Settings | History
History tab lists of previous versions with date/time and editor, with ability to “Restore to editor” or “Compare to current” (plus delete and delete all).
I’d suggest the “Compare” might perhaps open the page in a full browser window rather than a modal, with difference highlighting. (The modal approach means layout is rarely faithful and so comparison is not easy – anyone doing this kind of work can manage browser tabs and windows). This might be achieved by opening a page with URL param identifying the version to open, with this only working for users in an editing role. But the modal approach would be ok too.

Draft content:

Regarding drafting once a page is already published, I’ve thought through a few ways and one nice simple implementation might be…

On creating a new page…

Hide the “Is Published” check box and “Publication Date” in this context and instead have these controls:
[Save Draft] [Publish Now] [Publish Later:] […date/time picker…] [Delete]
[Developer Tools]
“Save Draft” sets “Is Published” to False on the Page.
“Publish Now” sets “Is Published” to True on the Page and sets “Publication Date” to now.
“Publish Later” sets “Is Published” to True on the Page and sets “Publication Date” to specified date/time. If none specified, do as “Save Draft”.

On editing an existing page…

always edit the draft if one exists. Depending on how this is all stored, this could always be the most recent in the history. Don’t give the ability to edit a previous (published) version (it made things too confusing in mojo - editors can achieve that by restoring the published version into the editor).
Show the “Is Published” check box and “Publication Date” in this context, but call them “Page Is Published” and “Page Publication Date”.
Provide same set of buttons/controls:
[Save Draft] [Publish Now] [Publish Later:] […date/time picker…] [Delete]
(this allows a changeover in content to be scheduled).

There could well be some loopholes here!

I feel Content Versioning would be enabled globally. I cannot imagine why it would not be useful across the board, and it doesn't make the publishing workflow any harder. So perhaps just always there in SimpleContent - no need even to switch it on. The only reason not to would be the extra storage needed for the superseded versions, but that shouldn't be an issue these days, and there could be an Administrative capability to clean out history (All, or older than a specified period (e.g. 1 month, 6 months, 1 year).

Also useful in the Administration area would be a view of all Content History (descending date order by default, filterable by Editor or page), permitting View (but not restore).

Note this does not provide any differentiation in roles for editing and publishing – we think that’s rarely needed and makes things more complex, but a potential future enhancement.

How not to delete posts/images when using nodb_storage and publishing again

This is a general question about what approach to follow when using SimpleContent and adding posts

SCENARIO

  • We have our WebApp with SimpleContent, no_db, etc.
  • The blog posts are stored under nodb_storage.
  • Once in production we use OLW to create new posts/images
  • We version the code with Git source control
  • Pushing changes to master branch will trigger a new publish of the whole application

The problem I see is that the Git repository will not be aware of new posts published through Open Live Writer.
If another developer clones the Web app repository, makes some changes and pushes changes to master triggering a new publish, wouldn't the content of nodb_storage be deleted in production?

What would be the best approach to follow for that scenario?

One option I can think of is running the WebApp in local so that we can use Open Live Writer to publish always locally (OLW attached to the localhost Metaweb API), and after that pushing the new changes to the source control so that everything what's in local is also in source control and in production.

Is there any other approach?

RSS not working

As I was looking for a replacement for ystem.ServiceModel.Syndication to create my own rss feed I stumpled upon your solution. According to the description a rss feed should be available at /api/rss.

So I simply cloned the most recent version of this repository and fired it up. Unfortunately no feed is available (404) at http://localhost:53941/ nor at http://localhost:53941/blog/api/rss which it should according to the information I found in BlogMetaPartial.cshtml.

Am I missing something or is this a bug?

per tenant static files

it would be nice to have a better way of keeping per tenant files separated, this issue was previously raised in cloudscribe core

currently we have themes separated per tenant but css and js for the theme still live below wwwroot which is shared by all tenants, and user uploaded files go below wwwroot/s1 /s2 /s3 etc with the sub folder per tenant.

  1. It would be nice if somehow theme specific css and js could be stored within the theme folder so that themes could be packaged as folders and dropped in

  2. It would be nice if somehow we could have a separate wwwroot folder per tenant where user uploaded files could go

I'm not promising to achieve this, but I will experiment to see if I can achieve it when I get a chance

Recommended Way of Adding Links to Other Pages

What is the best way to add links to other pages?
First comes to mind inserting relative URLs:
image
But what if I move the site to a subdirectory later? Is there something like server-side template tag to expand page id to a full URL? Also it would be cool to have "link to page" feature in the editor that would search for an existing page (like in WordPress for example).

need a better editor toolbar show and hide

just making a note here that I'm trying to find a good solution with the editor toolbar show/hide logic

the main issue is that when we show it, it can obscure part of the content or breadcrumbs. for a while I had a working solution that added padding to the main content to make room for it but that solution didn't work consistently with different themes and sometimes there ended up more padding than needed and padding wasn't fully removed when the toolbar was hidden

need to do more brainstorming and experimenting to come up with a theme neutral solution

I can't edit pages or post!

After you login a little pencil will appear in the upper right corner, it toggles the editor toolbar.

But it doesn't appears for me.I try it with chrome developer the following resources not found, may be this errors cause I can't see the edit button?

http://localhost:60000/js/bootstrap-wysiwyg.js 
http://localhost:60000/js/content-editor.js
http://localhost:60000/jsdev/site.js 

Markdown support?

A few people have asked me in person about markdown support for SimpleContent so I wanted to create an issue to discuss it.

In general I think it is mainly developers who like to write in markdown not typical non-technical site authors. So there is perhaps a limited audience who this would be appealing for, but that doesn't mean it isn't worth doing if there is sufficient interest.

Mainly I want to know how many people are interested in using Markdown as an alternative to using the current CKeditor WYSIWYG?

And of those interested I would like to know why?

What should the implementation be like?

From a quick look around the web it seems that most of the current blogs/content engines that use markdown are mainly static site generators so the html is generated ahead of time not rendered from markdown at runtime, but the source of truth is the markdown files. SimpleContent is not a static site generator so we would indeed be converting from markdown to html at runtime which I don't see as a problem. There are plenty of static site generators out there already and that is not what SimpleContent is meant to be.

If we were to implement use of markdown as an option, then the next conversation is what that should look like. Is it enough to be able to edit using markdown syntax in the browser or is it important that the blog posts for example are stored as markdown files on disk or would it be ok to continue using xml or json and just storing the post body within those formats as markdown?

It would be theoretically possible to serialize posts as markdown with a custom post serializer for NoDb in order to persist the files as markdown. There may be some challenges for how meta data about the post would be stored within the markup but not necessarily rendered when the markup is converted to html for display. One big disadvantage of that idea (serializing posts to markdown) is that it would mean that markdown could ONLY be used if using NoDb storage, it could not be used with a database back end unless we just store the post body as markdown in the database. Storing files as markdown on disk would have the advantage that other markdown editors or desktop tools could be used to create content offline. Another advantage of storing the posts on disk as markdown is that would improve the possibilities for people to migrate to SimpleContent from static site generators just by dropping in their markdown files, but it may also be subject to variations in markdown extensions for such things as metadata or other non-standard extensions for markdown used in specific static site generators. So there are definite pros and cons to be considered for both possible approaches.

One of the other challenges that I can think of is is using markdown to edit posts in the browser then we still need a way to upload images and then insert the markup for the image into the markdown editor. So we would need some kind of javascript to facilitate the editing experience. Probably could support dropping images into the editor in a fairly straightforward way. Having a toolbar to browse existing images on the server would be nice. Maybe there is an open source javascript editor for markdown that we could use like the one here on github. We should explore what is available and list them on this thread. From a quick search this one looks great https://github.com/sparksuite/simplemde-markdown-editor and already has events such as drop that we could handle for image upload.

There are also other challenges to consider such as how to implement code syntax highlighting which we already have as a plugin for CKeditor. How to implement easy embedding of youtube videos and other sources such as we already have in CKeditor.

Category add not available in OLW

I have noticed that when I use one of my blog samples (it uses EF) and try to create a post through Open Live Writer it can read the post categories through the api/metaweblog but I don't have the option to add a new category.
If I try with another blog like your sample with EF, I can add new categories.
But with mine I've just got the option to select any existing one. What piece is missing here that prevents OLW from enabling the option to create categories? I have registered in my DI container the implementations for Project, Page and Post commands and queries.

Templates - no content when publish later from the start

I created a page based on the new link list template added an image (from server), description and link. Selected publish later, the page then show a message like so:

image

But when the time came the page had no content and when I went to edit the content, the content I added is gone.

Not a biggy but the calendar appears partially off the bottom of the screen, is there a setting to get it to appear above the input box if it will otherwise appear off screen at the bottom?

Breadcrumbs don't work when blog isn't located at /blog

I have a starter kit set up (SimpleContent+SimpleAuth+NoDb), and I've modified the default route to make the default controller Blog:

    routes.MapRoute("default", "{controller=Blog}/{action=Index}/{id?}");

When I do this, however, the breadcrumbs don't show up. If I click "blog" in the navigation menu, I end up with an identical page, except the breadcrumbs show.

Editing a blog post doesn't work

I've got the SimpleContent starter kit set up (SimpleContent+SimpleAuth+NoDb), and while I can successfully create a blog post, I cannot edit one. The editor comes up empty. If I fill the editor fields out, a new blog post is created.

Login not working

I do a dotnet run on example.WebApp and the site boots up on 60000 and 60002. I try to login using [email protected] and admin but it does not work although the settings clearly show the user

  {
                "UniqueKey": "tenant1",
                "SiteName": "SimpleContent Demo",
                "Hostnames": [
                    "localhost:60000",
                    "localhost:53941",
                    "localhost:44348",
                    "tenant1.local:60000"
                ],
                "Theme": "default",
                "ContentProjectId": "project1",
                "EnablePasswordHasherUi": "true",
                "RecaptchaPublicKey": "",
                "RecaptchaPrivateKey": "",
                "AuthenticationScheme": "tenant1",
                "Users": [ 
                    {
                        "UserName": "admin",
                        "FYI-Comment": "this hash is a hash of the word admin, to create your own password hash, set EnablePasswordHasherUi as true, and visit /Login/HashPassword",
                        "Password": "AQAAAAEAACcQAAAAEKyu1zRJBNHJUw4r1mJwxgHfvofBmIAZSiG8X1O8dmdBFiQT0183/oqeoo0qGHv/Hw==",
                        "PasswordIsHashed": "true",
                        "Claims": [
                            {
                                "ClaimType": "ProjectId",
                                "ClaimValue": "project1"
                            },
                            {
                                "ClaimType": "DisplayName",
                                "ClaimValue": "Bilbo Baggins"
                            },
                            {
                                "ClaimType": "Email",
                                "ClaimValue": "[email protected]"
                            },
                            {
                                "ClaimType": "Role",
                                "ClaimValue": "Admins"
                            }

                        ]
                    },
                    {
                        "UserName": "member",
                        "Password": "member",
                        "PasswordIsHashed": "false",
                        "Claims": [
                            {
                                "ClaimType": "DisplayName",
                                "ClaimValue": "Mr Awesome"
                            },
                            {
                                "ClaimType": "Email",
                                "ClaimValue": "[email protected]"
                            },
                            {
                                "ClaimType": "Role",
                                "ClaimValue": "Members"
                            }

                        ]
                    }
                ]
            }```

Unable to view single posts

I have a blog with SimpleContent using Entity Framework.
I downloaded the blog views to be able to customize them.
In PostPartial I get the list of all the posts and its title with a link like this:

<span class="card-title">
    @if (Model.ProjectSettings.IncludePubDateInPostUrls)
    {
        <a asp-route="@Model.BlogRoutes.PostWithDateRouteName"
            asp-route-year="@Model.TmpPost.PubDate.Year"
            asp-route-month="@Model.TmpPost.PubDate.Month.ToString("00")"
            asp-route-day="@Model.TmpPost.PubDate.Day.ToString("00")"
            asp-route-slug="@Model.TmpPost.Slug"
            itemprop="url">@Model.TmpPost.Title</a>
    }
    else
    {
        <a asp-route="@Model.BlogRoutes.PostWithoutDateRouteName" asp-route-slug="@Model.TmpPost.Slug" itemprop="url">@Model.TmpPost.Title</a>
    }
</span>

But that is not generating any href in the rendered anchor tag (ie: <a itemprop="url" href="">Title</a>) therefore the post does not open.

I saw how some starter samples work and it seems to generate a url such as: http://localhost:5000/blog/2016/10/04/this-is-the-slug

but when I try to access one of my posts in that way (i.e manually requesting http://localhost:5000/blog/2016/10/04/new-test) I get the error view with

Error
Sorry, there was an error

but with null details about the error and no exception, as if the page didn't exist.

My questions are:

  • what piece am I missing not to have the links generated properly for the title?
  • why when accessing manually to the url that should contain my post it does not find anything?

I tried restoreing treeBuilderName in navigation.xml but it does not make any difference.

<NavNode key="Home" 
         parentKey="RootNode" 
         controller="Home" 
         action="Index" 
         text="Home"
         isRootNode="false">
  <!--treeBuilderName="cloudscribe.SimpleContent.Services.PagesNavigationTreeBuilder"-->

and I don't have any razor options. I commented out the following lines because I am using custom views

//options.AddEmbeddedViewsForNavigation();
//options.AddEmbeddedViewsForSimpleAuth();
//options.AddEmbeddedViewsForSimpleContent();

I also have one single route, the default one.
routes.MapRoute(name: "default", template: "{controller=Home}/{action=Index}/{id?}");

I'd appreciate if you point me in the right direction. Thanks!

PS: The sample with single user and Simple Content and nodb seems to have something missing also, It throws an error when accessing for example: http://localhost:5000/blog/2016/09/29/test

System.NullReferenceException: Object reference not set to an instance of an object.
   at AspNetCore._Views_Shared_CommentFormPartial_cshtml.<ExecuteAsync>d__30.MoveNext() in /Views/Shared/CommentFormPartial.cshtml

Why is my new page in the top menu? Home page cannot have child pages?

New page created, originally with no Parent Slug. It appeared in top menu - good. Edit the page and set Parent Slug to "home" (also tried "Home").
image

The Page Manager understands this:
image
(and it's different if I do not make the new page a child of /home:
image
)

but the page remains in the top menu instead of being a child page of /home:
image

I'm wondering whether all top menu pages are regarded as children of /home, which therefore cannot have child pages in the sense of a sub-menu?

Code Snippet in Content Section

Hello,

I have been poking around the blog for a few hours, and the concept is great, and I am considering using it over something like WP or whatever. What I would like to see is the ability to paste pretty code into the Content Editor. I know CKEditor has this
http://ckeditor.com/addon/codesnippet

Is this something that can be added easy to the Web Project?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.