-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v14.12.0 #838
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Enhanced user experience by dynamically setting the theme based on the `sec-ch-prefers-color-scheme` header to prevent screen blinking during page transitions. - `_Layout.cshtml`: Added logic to check the header and set `data-bs-theme` attribute. - `_LayoutAdmin.cshtml`: Applied similar changes as `_Layout.cshtml`. - `Program.cs`: Removed outdated code and comments, now reads client's preference directly.
Updated AssemblyVersion and FileVersion from 14.11.0.0 to 14.12.0.0. Updated Version from 14.11.0 to 14.12.0-preview.1.
Added `@inject IConfiguration Configuration` to `_Layout.cshtml` and `_LayoutAdmin.cshtml` for configuration access. Introduced `usePrefersColorSchemeHeader` from config to control dark mode based on `sec-ch-prefers-color-scheme` header. Improved code readability by adding spaces around `@if` statements and in self-closing `<img>` tags.
Updated PrefersColorSchemeMiddleware to accept IConfiguration, allowing it to read settings from the configuration. The middleware now dynamically sets response headers based on the configured header name. Updated _Layout.cshtml, _LayoutAdmin.cshtml, and Program.cs to use the new PrefersColorSchemeHeader settings. Removed the Experimental section from appsettings.json and replaced it with PrefersColorSchemeHeader, which includes Enabled and HeaderName settings.
Updated the configuration key from `PrefersColorScheme:HeaderName` to `PrefersColorSchemeHeader:HeaderName` in the following files: - PrefersColorSchemeMiddleware.cs - _Layout.cshtml - _LayoutAdmin.cshtml This change ensures the application reads the header name from the updated configuration section.
Injected IConfiguration for accessing configuration settings. Added anti-forgery token for enhanced security. Introduced "Index Now" settings section with: - Icon and label for "Index Now" feature. - Conditional display of "Index Now" API key.
Changed the icon for the "EnableWebmention" setting from `bi-arrow-right-circle` to `bi-bell` and the icon for the "EnablePingback" setting from `bi-arrow-right-circle` to `bi-signpost` in the `Advanced.cshtml` file. These updates aim to enhance the visual representation and clarity of these settings.
Introduced a `utcNow` variable in `CreatePostCommand.cs` and `UpdatePostCommand.cs` to store the current UTC time using `DateTime.UtcNow`. This variable is used to set `CreateTimeUtc`, `LastModifiedUtc`, and `PubDateUtc` fields, ensuring all timestamps within the same operation are consistent.
Introduced LastModifiedUtc property to track post modifications. Updated PostController to include IConfiguration and added a cooldown mechanism for firing IIndexNowClient based on LastModifiedUtc and a configurable interval. Updated EditPost view and model to handle LastModifiedUtc.
Add cooldown time to indexnow ping
Updated Moonglade.ImageStorage.csproj to use Azure.Storage.Blobs 12.22.2. Updated Moonglade.Web.csproj to use TinyMCE 7.4.1.
Corrected the placement of the `checked` attribute in `EditPost.cshtml` to ensure it is properly applied based on the `IsChecked` property of the `cat` object. Added a conditional block to display an "Unpublish this post" button if the post is published, enhancing the UI for post management.
Added a new localization entry for the phrase "Unpublish this post" in the following resource files: * `Program.de-DE.resx` with the value "Veröffentlichung dieses Artikels aufheben" * `Program.ja-JP.resx` with the value "この記事を非公開にする" * `Program.zh-Hans.resx` with the value "取消发布这篇文章" * `Program.zh-Hant.resx` with the value "取消發佈這篇文章"
Updated `EditPost.cshtml` to trigger a Bootstrap modal for the "Unpublish this post" action, enhancing user experience by requiring confirmation. Introduced `_UnpublishPostModal.cshtml` to define the modal's structure, including a warning message, post title, and "Cancel" and "Confirm" buttons.
Added new localization entries to resource files for German, Japanese, Simplified Chinese, and Traditional Chinese. The new entries include: - "Unpublish Post" with translations for each language. - A detailed message explaining the impact of unpublishing a post on SEO, with translations for each language. - The word "Confirm" with translations for each language.
Introduced `UnpublishPostCommand` and handler in `UnpublishPostCommand.cs` to unpublish posts by setting `IsPublished` to false, clearing `PubDateUtc` and `RouteLink`, updating `LastModifiedUtc`, and removing the post from the cache. Added a new endpoint in `PostController.cs` to handle HTTP PUT requests at `"{postId:guid}/unpublish"` and return a `204 No Content` status.
- Remove post title from modal body. - Update "Confirm" button to call `UnpublishPost` function with post ID. - Add `UnpublishPost` function to make API call, show success toast, and reload page.
Unpublish posts
Updated `calculateReadingTime` to include Japanese characters. Added `japaneseCharactersPerMinute` constant for average reading speed. Extracted Japanese characters using regex and calculated their reading time, stored in `japaneseReadingTime`. Included Japanese reading time in total reading time, which is now rounded to the nearest minute and displayed in the `reading-time` element.
Updated the version number in `Directory.Build.props` from `14.12.0-preview.1` to `14.12.0-preview.2`, indicating a new iteration or minor update in the preview phase of the project.
Introduced a new "Experimental" section in the `appsettings.json` file. This section includes an empty array for "SocialLinks", intended for future experimental features or settings related to social links.
Social link (preview)
Added `using System.Web;` and `using System.Xml.Linq;` to `ContentProcessor.cs`. Modified the `ContentProcessor` class to decode HTML entities in plain text before ellipsizing it. Introduced a new method `HtmlDecode` to address issue #833, ensuring umlauts like (ä, ö, ü) are displayed correctly in the abstract.
Fix umlauts encoding
Upgraded the Npgsql.EntityFrameworkCore.PostgreSQL package from version 8.0.8 to 8.0.10 in the Moonglade.Data.PostgreSql.csproj file. This update includes potential bug fixes, performance improvements, and new features available in the newer version.
Added a new property `SocialLinkSettings` to the `IBlogConfig` interface and implemented it in the `BlogConfig` class. Updated the `LoadFromConfig` method to initialize `SocialLinkSettings` from the configuration dictionary. Introduced a new `SocialLinkSettings` class with properties `IsEnabled` and `Links`, and provided a static `DefaultValue`. Updated `BlogConfigInitializer` to handle `SocialLinkSettings` initialization using the mediator pattern.
Introduced a new POST endpoint in SettingsController mapped to "social-link". This endpoint updates the SocialLinkSettings in blogConfig with the provided model, saves the configuration asynchronously, and returns a 204 No Content response.
Refactored `GetAllSocialLinksQueryHandler` to use `IBlogConfig` instead of `IConfiguration` for configuration management. Updated the handler to access social link settings directly from `blogConfig.SocialLinkSettings` and check if the feature is enabled via `IsEnabled`. Modified `_Aside.cshtml` to reflect the new configuration structure. Removed the `Experimental` section from `appsettings.json` as social links are now managed through `IBlogConfig`. These changes improve code readability, maintainability, and simplify the logic for managing social links.
Added a `using` directive for `System.ComponentModel.DataAnnotations` in `SocialLink.cs`. Introduced a new class `SocialLinkSettingsJsonModel` in `SocialLink.cs` with properties `IsEnabled` and `JsonData`, where `JsonData` has a `MaxLength` attribute of 1024. Added a new navigation link for "Social Links" in `_SettingsHeader.cshtml`. Created a new Razor page `SocialLinks.cshtml` for managing social link settings, including an anti-forgery token for security, initialization of `SocialLinkSettingsJsonModel` with current settings, script sections for loading Monaco editor and handling form submission, styling for the Monaco editor container, a warning alert indicating the feature is under development, and a form for enabling/disabling social links and editing JSON data using the Monaco editor.
Updated SocialLinkSettings, GetAllSocialLinksQuery, and SettingsController to use SocialLink[] instead of List<SocialLink>. Adjusted default value initializations, return types, and added validation for JsonData in SettingsController. Updated Default.cshtml view to reflect these changes.
- Increase min-height of `.monaco-target` element for better content space. - Reposition alert message within form and wrap in a new `div`. - Add `@section admintoolbar` with `_SettingsHeader` partial view. - Reformat `checked` attribute logic in `form-check-input` for readability.
Added `IsEnabled` and `JsonData` properties to `SocialLinkSettingsJsonModel` in `SocialLink.cs`. Updated `Program.de-DE.resx`, `Program.ja-JP.resx`, `Program.zh-Hans.resx`, and `Program.zh-Hant.resx` with translations for "Enable Social Links" and "Social Links".
Save and edit social links in admin portal
Transitioned the version tag in the `Directory.Build.props` file from `14.12.0-beta.1` to `14.12.0-rc.1`, indicating a move from beta to release candidate. This change reflects increased stability and feature completeness as we approach the final release.
The DotNetVersion property, previously set to Environment.Version.ToString(), has been removed from the anonymous object in the WriteResponse method of the ConfigureEndpoints class. This change simplifies the object by excluding the .NET version information.
The <Version> element in the Directory.Build.props file has been updated from 14.12.0-rc.1 to 14.12.0. This change signifies that the software has moved from a release candidate to a final release version, indicating it is now stable and ready for general availability.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.