diff --git a/Mostlylucid.Shared/Config/NewsletterConfig.cs b/Mostlylucid.Shared/Config/NewsletterConfig.cs
index 5de13f8..fb4b4a4 100644
--- a/Mostlylucid.Shared/Config/NewsletterConfig.cs
+++ b/Mostlylucid.Shared/Config/NewsletterConfig.cs
@@ -5,6 +5,5 @@ public class NewsletterConfig : IConfigSection
public static string Section => "Newsletter";
public string SchedulerServiceUrl { get; set; } = string.Empty;
-
public string AppHostUrl { get; set; } = string.Empty;
}
\ No newline at end of file
diff --git a/Mostlylucid/Markdown/customconfigsectionextensions.md b/Mostlylucid/Markdown/customconfigsectionextensions.md
new file mode 100644
index 0000000..9b331b4
--- /dev/null
+++ b/Mostlylucid/Markdown/customconfigsectionextensions.md
@@ -0,0 +1,158 @@
+# Custom Config Section Extensions
+
+2024-09-27T06:20
+# Introduction
+It seems like everyone has a version of this code, I first came across this approach from [Filip W](https://www.strathweb.com/2016/09/strongly-typed-configuration-in-asp-net-core-without-ioptionst/) and recently my old colleague Phil Haack has [his version](https://haacked.com/archive/2024/07/18/better-config-sections/).
+
+Just for completion this is how I do it.
+
+[TOC]
+
+# Why?
+The why is to make it easier to work with configuration. At the moment the premier way is using `IOptions` and `IOptionsSnapshot` but this is a bit of a pain to work with. This approach allows you to work with the configuration in a more natural way.
+The limitations are that you can't use the `IOptions` pattern, so you don't get the ability to reload the configuration without restarting the application. However honestly this is something I almost never want to do.
+
+# The Code
+In my version I use the recent static Interface members to specify that all instances of this class must declare a `Section` property. This is used to get the section from the configuration.
+
+```csharp
+public interface IConfigSection {
+ public static abstract string Section { get; }
+}
+```
+So for each implementation you then specify what section this should be bound to:
+
+```csharp
+public class NewsletterConfig : IConfigSection
+{
+ public static string Section => "Newsletter";
+
+ public string SchedulerServiceUrl { get; set; } = string.Empty;
+ public string AppHostUrl { get; set; } = string.Empty;
+}
+```
+
+In this case it's looking for a section in the configuration called `Newsletter`.
+
+```json
+ "Newsletter": {
+ "SchedulerServiceUrl" : "http://localhost:5000",
+ "AppHostUrl" : "https://localhost:7240"
+
+ }
+
+```
+
+We will then be able to bind this in the `Program.cs` file like so:
+
+```csharp
+
+var builder = WebApplication.CreateBuilder(args);
+var config = builder.Configuration;
+services.ConfigurePOCO(config);
+
+```
+
+We can also get the value of the config in the `Program.cs` file like so:
+
+```csharp
+var newsletterConfig = services.ConfigurePOCO(config);
+
+```
+
+# The Extension Method
+To enable all this we have a fairly simple extension method that does the work of binding the configuration to the class.
+
+The code below allows the following:
+
+```csharp
+// These get the values and bind them to the class while adding these to Singleton Scope
+var newsletterConfig = services.ConfigurePOCO(config);
+var newsletterConfig = services.ConfigurePOCO(configuration.GetSection(NewsletterConfig.Section));
+// Or for Builder...These obviously only work for ASP.NET Core applications, take them out if you are using this in a different context.
+var newsletterConfig = builder.Configure();
+var newsletterConfig = builder.Configure(NewsletterConfig.Section);
+// These just return a dictionary, which can be useful to get all the values in a section
+var newsletterConfig = builder.GetConfigSection();
+
+```
+
+This is all enabled by the following extension class.
+
+You can see that the main impetus of this is using the static interface members to specify the section name. This is then used to get the section from the configuration.
+
+
+```csharp
+namespace Mostlylucid.Shared.Config;
+
+public static class ConfigExtensions {
+ public static TConfig ConfigurePOCO(this IServiceCollection services, IConfigurationSection configuration)
+ where TConfig : class, new() {
+ if (services == null) throw new ArgumentNullException(nameof(services));
+ if (configuration == null) throw new ArgumentNullException(nameof(configuration));
+
+ var config = new TConfig();
+ configuration.Bind(config);
+ services.AddSingleton(config);
+ return config;
+ }
+
+ public static TConfig ConfigurePOCO(this IServiceCollection services, ConfigurationManager configuration)
+ where TConfig : class, IConfigSection, new()
+ {
+ var sectionName = TConfig.Section;
+ var section = configuration.GetSection(sectionName);
+ return services.ConfigurePOCO(section);
+ }
+
+ public static TConfig Configure(this WebApplicationBuilder builder)
+ where TConfig : class, IConfigSection, new() {
+ var services = builder.Services;
+ var configuration = builder.Configuration;
+ var sectionName = TConfig.Section;
+ return services.ConfigurePOCO(configuration.GetSection(sectionName));
+ }
+
+
+ public static TConfig GetConfig(this WebApplicationBuilder builder)
+ where TConfig : class, IConfigSection, new() {
+ var configuration = builder.Configuration;
+ var sectionName = TConfig.Section;
+ var section = configuration.GetSection(sectionName).Get();
+ return section;
+
+ }
+
+ public static Dictionary GetConfigSection(this IConfiguration configuration, string sectionName) {
+ var section = configuration.GetSection(sectionName);
+ var result = new Dictionary();
+ foreach (var child in section.GetChildren()) {
+ var key = child.Key;
+ var value = child.Value;
+ result.Add(key, value);
+ }
+
+ return result;
+ }
+
+ public static Dictionary GetConfigSection(this WebApplicationBuilder builder)
+ where TConfig : class, IConfigSection, new() {
+ var configuration = builder.Configuration;
+ var sectionName = TConfig.Section;
+ return configuration.GetConfigSection(sectionName);
+ }
+}
+```
+
+# In Use
+To use these is pretty simple. In any class where you need this config you can simply inject it like so:
+
+```csharp
+public class NewsletterService(NewsletterConfig config {
+
+}
+```
+
+
+# In Conclusion
+Well that's it...pretty simple but it's a technique I use in all of my projects. It's a nice way to work with configuration and I think it's a bit more natural than the `IOptions` pattern.
\ No newline at end of file
diff --git a/Mostlylucid/Views/Shared/_Layout.cshtml b/Mostlylucid/Views/Shared/_Layout.cshtml
index 43d9fca..a56f352 100644
--- a/Mostlylucid/Views/Shared/_Layout.cshtml
+++ b/Mostlylucid/Views/Shared/_Layout.cshtml
@@ -76,14 +76,14 @@
x-data="globalSetup()"
x-init="themeInit()"
:class="isMobileMenuOpen ? 'max-h-screen overflow-hidden relative' : ''"
- class="bg-custom-light-bg dark:bg-custom-dark-bg "
->
-
+ class="bg-custom-light-bg dark:bg-custom-dark-bg ">
+
+