+
+
+
+
+
+
+
+ @if (string.IsNullOrWhiteSpace(Configuration["IndexNow:ApiKey"]))
+ {
+ Not configured
+ }
+ else
+ {
+ @Configuration["IndexNow:ApiKey"]
+ }
+
+
diff --git a/src/Moonglade.Web/Pages/Settings/SocialLinks.cshtml b/src/Moonglade.Web/Pages/Settings/SocialLinks.cshtml
new file mode 100644
index 000000000..a74cef2f6
--- /dev/null
+++ b/src/Moonglade.Web/Pages/Settings/SocialLinks.cshtml
@@ -0,0 +1,83 @@
+@page "/admin/settings/social-links"
+@Html.AntiForgeryToken()
+@{
+ var bc = BlogConfig.SocialLinkSettings;
+ var settings = new SocialLinkSettingsJsonModel
+ {
+ IsEnabled = bc.IsEnabled,
+ JsonData = bc.Links.ToJson(true)
+ };
+}
+
+@section scripts {
+
+
+
+}
+
+@section head {
+
+}
+
+@section admintoolbar {
+
+}
+
+
\ No newline at end of file
diff --git a/src/Moonglade.Web/Pages/Settings/_SettingsHeader.cshtml b/src/Moonglade.Web/Pages/Settings/_SettingsHeader.cshtml
index ba7999249..1c01cdb6b 100644
--- a/src/Moonglade.Web/Pages/Settings/_SettingsHeader.cshtml
+++ b/src/Moonglade.Web/Pages/Settings/_SettingsHeader.cshtml
@@ -22,6 +22,9 @@
@SharedLocalizer["Notification"]
+
+ @SharedLocalizer["Social Links"]
+
@SharedLocalizer["Advanced"]
diff --git a/src/Moonglade.Web/Pages/Shared/_Aside.cshtml b/src/Moonglade.Web/Pages/Shared/_Aside.cshtml
index 6a47ad07d..18c2c2726 100644
--- a/src/Moonglade.Web/Pages/Shared/_Aside.cshtml
+++ b/src/Moonglade.Web/Pages/Shared/_Aside.cshtml
@@ -40,6 +40,13 @@
}
+ @if (BlogConfig.SocialLinkSettings.IsEnabled)
+ {
+
+ @await Component.InvokeAsync("SocialLink")
+
+ }
+
@if (BlogConfig.GeneralSettings.WidgetsFriendLink)
{
diff --git a/src/Moonglade.Web/Pages/Shared/_Layout.cshtml b/src/Moonglade.Web/Pages/Shared/_Layout.cshtml
index a540bd6db..8d5a26eab 100644
--- a/src/Moonglade.Web/Pages/Shared/_Layout.cshtml
+++ b/src/Moonglade.Web/Pages/Shared/_Layout.cshtml
@@ -1,6 +1,7 @@
@using Moonglade.Utils
@using Microsoft.AspNetCore.Localization
@using System.Globalization
+@inject IConfiguration Configuration
@{
if (string.IsNullOrEmpty(BlogConfig.GeneralSettings.AvatarUrl))
@@ -24,9 +25,19 @@
langCode = CultureInfo.CurrentUICulture.ToString().ToLower();
}
}
+
+ // Get `sec-ch-prefers-color-scheme` header value
+ // This is to enhance user experience by stopping the screen from blinking when switching pages
+ bool useServerSideDarkMode = false;
+ bool usePrefersColorSchemeHeader = Configuration.GetSection("PrefersColorSchemeHeader:Enabled").Get();
+ var prefersColorScheme = Context.Request.Headers[Configuration["PrefersColorSchemeHeader:HeaderName"]!];
+ if (usePrefersColorSchemeHeader && prefersColorScheme == "dark")
+ {
+ useServerSideDarkMode = true;
+ }
}
-
+
@@ -171,13 +182,13 @@
{
- @if(BlogConfig.GeneralSettings.UseGravatarAsProfilePicture)
+ @if (BlogConfig.GeneralSettings.UseGravatarAsProfilePicture)
{
}
else
{
-
+
}
@@ -187,14 +198,14 @@
{
}
else
{
+ class="rounded-circle blogger-head-pic" />
}
diff --git a/src/Moonglade.Web/Pages/Shared/_LayoutAdmin.cshtml b/src/Moonglade.Web/Pages/Shared/_LayoutAdmin.cshtml
index ba182e4cc..9993d13cc 100644
--- a/src/Moonglade.Web/Pages/Shared/_LayoutAdmin.cshtml
+++ b/src/Moonglade.Web/Pages/Shared/_LayoutAdmin.cshtml
@@ -1,12 +1,24 @@
@inject IOptions
AuthOptions
+@inject IConfiguration Configuration
+
@{
if (string.IsNullOrEmpty(BlogConfig.GeneralSettings.AvatarUrl))
{
BlogConfig.GeneralSettings.AvatarUrl = Url.Action("Avatar", "Assets");
}
+
+ // Get `sec-ch-prefers-color-scheme` header value
+ // This is to enhance user experience by stopping the screen from blinking when switching pages
+ bool useServerSideDarkMode = false;
+ bool usePrefersColorSchemeHeader = Configuration.GetSection("PrefersColorSchemeHeader:Enabled").Get();
+ var prefersColorScheme = Context.Request.Headers[Configuration["PrefersColorSchemeHeader:HeaderName"]!];
+ if (usePrefersColorSchemeHeader && prefersColorScheme == "dark")
+ {
+ useServerSideDarkMode = true;
+ }
}
-
+
diff --git a/src/Moonglade.Web/Pages/Shared/_PostListEntry.cshtml b/src/Moonglade.Web/Pages/Shared/_PostListEntry.cshtml
index af03d0477..b250aceb1 100644
--- a/src/Moonglade.Web/Pages/Shared/_PostListEntry.cshtml
+++ b/src/Moonglade.Web/Pages/Shared/_PostListEntry.cshtml
@@ -30,7 +30,7 @@
}
- @(Model.ContentAbstract)
+ @(ContentProcessor.HtmlDecode(Model.ContentAbstract))
@if (null != Model.Tags)
{
diff --git a/src/Moonglade.Web/Pages/SignIn.cshtml b/src/Moonglade.Web/Pages/SignIn.cshtml
index 8f2a04362..dad79c28c 100644
--- a/src/Moonglade.Web/Pages/SignIn.cshtml
+++ b/src/Moonglade.Web/Pages/SignIn.cshtml
@@ -51,11 +51,11 @@
-
+
-
+
@@ -88,6 +88,14 @@
d = new Date();
document.querySelector('#img-captcha').src = `/captcha-image?${d.getTime()}`;
};
+
+ function showCaptcha() {
+ var captchaContainer = document.getElementById('captcha-container');
+ if (captchaContainer.style.display === 'none') {
+ captchaContainer.style.display = 'block';
+ getNewCaptcha();
+ }
+ }
\ No newline at end of file
diff --git a/src/Moonglade.Web/Pages/_CommentForm.cshtml b/src/Moonglade.Web/Pages/_CommentForm.cshtml
index 9af070785..de6a74fe1 100644
--- a/src/Moonglade.Web/Pages/_CommentForm.cshtml
+++ b/src/Moonglade.Web/Pages/_CommentForm.cshtml
@@ -29,12 +29,13 @@
aria-label="@SharedLocalizer["Your comments (Markdown supported)"]"
placeholder="@SharedLocalizer["Your comments (Markdown supported)"]"
maxlength="1024"
- required>
+ required
+ onfocus="viewpost.showCaptcha()">