V2 #1

Merged
danieljsummers merged 102 commits from v2 into main 2022-06-23 00:35:12 +00:00
2 changed files with 7 additions and 9 deletions
Showing only changes of commit aa3ee239f6 - Show all commits

View File

@ -118,14 +118,11 @@ let pageOfCategorizedPosts slugAndPage : HttpHandler = fun next ctx -> task {
let conn = ctx.Conn
match parseSlugAndPage webLog slugAndPage with
| Some pageNbr, slug, isFeed ->
let allCats = CategoryCache.get ctx
let cat = allCats |> Array.find (fun cat -> cat.slug = slug)
if isFeed then
match CategoryCache.get ctx |> Array.tryFind (fun cat -> cat.slug = slug) with
| Some cat when isFeed ->
return! Feed.generate (Feed.CategoryFeed ((CategoryId cat.id), $"category/{slug}/{webLog.rss.feedName}"))
(defaultArg webLog.rss.itemsInFeed webLog.postsPerPage) next ctx
else
let allCats = CategoryCache.get ctx
let cat = allCats |> Array.find (fun cat -> cat.slug = slug)
| Some cat ->
// Category pages include posts in subcategories
match! Data.Post.findPageOfCategorizedPosts webLog.id (getCategoryIds slug ctx) pageNbr webLog.postsPerPage
conn with
@ -139,6 +136,7 @@ let pageOfCategorizedPosts slugAndPage : HttpHandler = fun next ctx -> task {
hash.Add ("slug", slug)
return! themedView "index" next ctx hash
| _ -> return! Error.notFound next ctx
| None -> return! Error.notFound next ctx
| None, _, _ -> return! Error.notFound next ctx
}

View File

@ -3,7 +3,7 @@
"hostname": "data02.bitbadger.solutions",
"database": "myWebLog_dev"
},
"Generator": "myWebLog 2.0-alpha17",
"Generator": "myWebLog 2.0-alpha18",
"Logging": {
"LogLevel": {
"MyWebLog.Handlers": "Debug"