From a4bdac7b5534db8ac02b709027a42b056e4954eb Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Mon, 20 Jun 2022 09:29:09 -0400 Subject: [PATCH] Move logos to admin theme - Fix web log SQLite update - Fix post SQLite retrieval - WIP on default theme --- src/MyWebLog.Data/SQLiteData.fs | 19 ++--- src/admin-theme/layout-partial.liquid | 4 +- src/admin-theme/layout.liquid | 2 +- .../img => admin-theme/wwwroot}/logo-dark.png | Bin .../wwwroot}/logo-light.png | Bin src/default-theme/index.liquid | 12 +++ src/default-theme/layout.liquid | 2 +- src/default-theme/single-post.liquid | 77 ++++++++++++++++++ src/default-theme/version.txt | 2 + 9 files changed, 104 insertions(+), 14 deletions(-) rename src/{MyWebLog/wwwroot/img => admin-theme/wwwroot}/logo-dark.png (100%) rename src/{MyWebLog/wwwroot/img => admin-theme/wwwroot}/logo-light.png (100%) create mode 100644 src/default-theme/single-post.liquid create mode 100644 src/default-theme/version.txt diff --git a/src/MyWebLog.Data/SQLiteData.fs b/src/MyWebLog.Data/SQLiteData.fs index 647e6e2..49c6e7f 100644 --- a/src/MyWebLog.Data/SQLiteData.fs +++ b/src/MyWebLog.Data/SQLiteData.fs @@ -1046,15 +1046,12 @@ type SQLiteData (conn : SqliteConnection) = cmd.CommandText <- "SELECT * FROM post WHERE id = @id" cmd.Parameters.AddWithValue ("@id", PostId.toString postId) |> ignore use! rdr = cmd.ExecuteReaderAsync () - if rdr.Read () then - match verifyWebLog webLogId (fun p -> p.webLogId) Map.toPost rdr with - | Some post -> - let! post = appendPostCategoryTagAndMeta post - let! post = appendPostRevisionsAndPermalinks post - return Some post - | None -> - return None - else + match verifyWebLog webLogId (fun p -> p.webLogId) Map.toPost rdr with + | Some post -> + let! post = appendPostCategoryTagAndMeta post + let! post = appendPostRevisionsAndPermalinks post + return Some post + | None -> return None } @@ -1690,7 +1687,7 @@ type SQLiteData (conn : SqliteConnection) = time_zone = @timeZone, auto_htmx = @autoHtmx, feed_enabled = @feedEnabled, - feed_name = @feedName + feed_name = @feedName, items_in_feed = @itemsInFeed, category_enabled = @categoryEnabled, tag_enabled = @tagEnabled, @@ -1705,7 +1702,7 @@ type SQLiteData (conn : SqliteConnection) = cmd.CommandText <- """UPDATE web_log SET feed_enabled = @feedEnabled, - feed_name = @feedName + feed_name = @feedName, items_in_feed = @itemsInFeed, category_enabled = @categoryEnabled, tag_enabled = @tagEnabled, diff --git a/src/admin-theme/layout-partial.liquid b/src/admin-theme/layout-partial.liquid index 83f7057..13e3ace 100644 --- a/src/admin-theme/layout-partial.liquid +++ b/src/admin-theme/layout-partial.liquid @@ -52,7 +52,9 @@
-
myWebLog
+
+ myWebLog +
diff --git a/src/admin-theme/layout.liquid b/src/admin-theme/layout.liquid index 8292b75..ecac8df 100644 --- a/src/admin-theme/layout.liquid +++ b/src/admin-theme/layout.liquid @@ -58,7 +58,7 @@
- myWebLog + myWebLog
diff --git a/src/MyWebLog/wwwroot/img/logo-dark.png b/src/admin-theme/wwwroot/logo-dark.png similarity index 100% rename from src/MyWebLog/wwwroot/img/logo-dark.png rename to src/admin-theme/wwwroot/logo-dark.png diff --git a/src/MyWebLog/wwwroot/img/logo-light.png b/src/admin-theme/wwwroot/logo-light.png similarity index 100% rename from src/MyWebLog/wwwroot/img/logo-light.png rename to src/admin-theme/wwwroot/logo-light.png diff --git a/src/default-theme/index.liquid b/src/default-theme/index.liquid index 0e2c582..a34aec2 100644 --- a/src/default-theme/index.liquid +++ b/src/default-theme/index.liquid @@ -43,4 +43,16 @@ {% endfor %} + diff --git a/src/default-theme/layout.liquid b/src/default-theme/layout.liquid index ece513e..9a56e9f 100644 --- a/src/default-theme/layout.liquid +++ b/src/default-theme/layout.liquid @@ -53,7 +53,7 @@

- myWebLog + myWebLog