-
Notifications
You must be signed in to change notification settings - Fork 135
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
Release v14.10.0 #825
Merged
Release v14.10.0 #825
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
Introduced a new configuration block for "IndexNow" in the `appsettings.json` file. This block includes an `ApiKey` for authentication and a list of `PingTargets` which are the endpoints of various search engines (e.g., `api.indexnow.org`, `www.bing.com`, `search.seznam.cz`, `yandex.com`). This enables the application to notify these search engines about content changes, potentially improving indexing speed and accuracy.
Introduced the IIndexNowClient interface in the new Moonglade.IndexNow.Client namespace. This interface includes the SendRequestAsync method, which accepts a Uri and returns a Task, indicating asynchronous operation. Also added a using directive for the System.Net namespace to support network-related functionality.
Introduced the IndexNowClient class in the Moonglade.IndexNow.Client namespace, implementing the IIndexNowClient interface. Added the SendRequestAsync method, which currently throws a NotImplementedException. Included necessary using directives for various System namespaces.
Introduced a new namespace `Moonglade.IndexNow.Client` and a static class `ServiceCollectionExtension`. Added an extension method `AddIndexNowClient` to the `IServiceCollection` interface, which registers an `IIndexNowClient` implementation (`IndexNowClient`) with an HTTP client and a resilience handler. This enhances the integration of the IndexNow client into the application's dependency injection system.
Added a using directive for Moonglade.IndexNow.Client in Program.cs. Registered IndexNowClient service in the dependency injection container to enable its use throughout the application.
Updated IndexNowClient to use dependency injection for ILogger<IndexNowClient> and IConfiguration. Modified SendRequestAsync to accept a Uri parameter. Added configuration retrieval for IndexNow:PingTargets and IndexNow:ApiKey. Implemented checks for these settings, logging a warning if ApiKey is missing and throwing an InvalidOperationException if PingTargets is not configured. NotImplementedException remains at the end of the method.
Updated ServiceCollectionExtension.cs to include additional namespaces: Microsoft.Extensions.Configuration and Moonglade.Utils. Modified AddIndexNowClient method to accept an IConfigurationSection parameter. Replaced the single HttpClient implementation for IIndexNowClient with a new approach that retrieves an array of PingTargets from the configuration section and iterates over them. For each PingTarget, an HttpClient is added to the service collection with specific configuration settings, including BaseAddress, User-Agent, ContentType, and Host headers. Updated Program.cs to pass the IndexNow configuration section to the AddIndexNowClient method.
Introduced the Moonglade.Web.Handlers namespace and added the IndexNowMapHandler class. This class includes a static property `Handler` for asynchronous HTTP request handling. The `Handle` method processes requests by checking for an API key in the configuration. If the API key is missing, it responds with a 404 status and a message. If the API key is present, it responds with the key in plain text.
Introduced a new route in Program.cs that maps the endpoint /indexnowkey.txt to IndexNowMapHandler.Handler. This route is added alongside existing routes for controllers, Razor Pages, and other specific endpoints like /robots.txt and /manifest.webmanifest.
Updated IndexNowClient to use IHttpClientFactory for creating HTTP clients. Modified SendRequestAsync to iterate over pingTargets and construct IndexNowRequest objects. Added KeyLocation property to IndexNowRequest. Refactored IndexNowMapHandler with new namespace and updated imports.
Updated using directives to remove unused namespaces and add necessary ones. Refactored IndexNowClient to use constructor injection for ILogger, IConfiguration, and IHttpClientFactory. Changed SendRequestAsync to an async method, added checks and logging for apiKey and pingTargets configuration. Implemented HTTP client creation and request sending per IndexNow protocol. Removed NotImplementedException.
Updated the condition to check if `pingTargets` is null or empty for better performance and clarity. Replaced `pingTargets == null || !pingTargets.Any()` with `pingTargets == null || pingTargets.Length == 0` to directly check the array length.
Updated using directives to include System.Net.Http.Headers. Modified HttpClient BaseAddress to use HTTPS protocol. Structured User-Agent header with ProductInfoHeaderValue. Replaced Content-Type header with Accept header. Added scoped service registration for IIndexNowClient.
Refactored IndexNowClient to use private readonly fields for configuration values and introduced helper methods for creating request bodies and handling responses. Reordered and updated using directives across multiple files for consistency and removed unused directives. Improved logging of HTTP response statuses.
Add IndexNow Support
Incremented AssemblyVersion and FileVersion from 14.9.0.0 to 14.10.0.0. Changed Version from 14.9.0 to 14.10.0-preview.1, indicating a pre-release.
Added UseGravatarAsProfilePicture to GeneralSettings class. Updated _Layout.cshtml and _WidgetsProfile.cshtml to use the new property instead of useOwnerEmailAsAvatar. Removed useOwnerEmailAsAvatar from appsettings.json.
Introduce a new settings entry in General.cshtml to allow users to enable or disable the use of Gravatar as their profile picture. The new section includes: - An icon (bi-person-circle) to represent the setting. - A label for the UseGravatarAsProfilePicture option. - Descriptive text to inform users about setting up Gravatar. - A switch control to toggle the UseGravatarAsProfilePicture setting, with a hidden input to ensure a value is always submitted.
Added a new localization entry for the phrase "Use my Gravatar as profile picture" in three resource files: `Program.de-DE.resx` (German), `Program.zh-Hans.resx` (Simplified Chinese), and `Program.zh-Hant.resx` (Traditional Chinese). This enhances the application's multilingual support.
Added a new data entry for the message "Please make sure you have setup Gravatar with your email address" in the German (de-DE), Simplified Chinese (zh-Hans), and Traditional Chinese (zh-Hant) resource files. This message ensures that users are informed to register their email with Gravatar to use it as their profile picture.
Gravatar as profile picture
Introduced a new function `calculateReadingTime` to estimate the reading time of a blog post. The function: - Defines average reading speeds for English, German, and Chinese. - Extracts the text content of the blog post. - Counts the number of English/German words and Chinese characters. - Calculates the reading time for each language. - Sums these times to get the total reading time. - Rounds the total reading time to the nearest minute. - Updates the DOM element with the ID `reading-time` to display the estimated reading time.
- Added a call to `viewpost.calculateReadingTime()` in `Post.cshtml` to calculate the reading time of a blog post. - Added an icon and a span element with the ID `reading-time` to display the calculated reading time in the post header in `Post.cshtml`. - Exported `calculateReadingTime` function in `viewpost.module.js` to allow it to be called from other modules.
Feature/estimate time to read
Added System.Globalization namespace and updated date formatting to use CultureInfo.InvariantCulture in CreatePostCommand.cs, UpdatePostCommand.cs, and Seed.cs. This ensures consistent date string formatting across different cultures.
Use CultureInfo.InvariantCulture for date formatting
Updated the Azure.Storage.Blobs package version from 12.21.2 to 12.22.0 in the Moonglade.ImageStorage.csproj file to incorporate the latest features and bug fixes.
Changed the version in `Directory.Build.props` from `14.10.0-preview.1` to `14.10.0-beta.1`, indicating a progression from a preview release to a beta release.
Enhanced the mention details display by including the Worker property of the item object. This change ensures that the worker associated with each mention is now visible in the user interface, providing more context to the users.
Upgraded the Microsoft.Identity.Web package from version 3.1.0 to 3.2.0 in the Moonglade.Auth.csproj file to incorporate the latest features and bug fixes.
Updated the version tag in the `Directory.Build.props` file from `14.10.0-beta.1` to `14.10.0-rc.1`. This change marks the transition from the beta phase to the release candidate phase, indicating increased stability and readiness for final release.
- Updated `IndexNowClient` to add comments on key file location options, comment out `KeyLocation`, and use square brackets for `UrlList`. - Changed `IndexNowMapHandler` error message to "No IndexNow API Key is present." - Modified `Program.cs` to dynamically map IndexNow key file route based on API key from configuration.
Modified DiscoverWebmentionEndpoint to check HTTP response status before reading HTML content. This ensures the method handles unsuccessful HTTP requests gracefully by returning null, enhancing robustness and preventing further processing of failed responses.
Updated the log message to include the `targetUrl` when a Webmention endpoint is not found. This provides more context in the log output, making it easier to identify which target URL did not have a Webmention endpoint, thereby aiding in debugging and monitoring.
Updated IndexNowClient to use JsonSerializerOptions with JsonNamingPolicy.CamelCase to address 422 errors from case sensitivity in search engines. Removed commented-out code causing issues with search.seznam.cz and yandex.com. Removed KeyLocation property from IndexNowRequest class and its assignment in CreateRequestBody method.
Updated the version number in `Directory.Build.props` from `14.10.0-rc.1` to `14.10.0-rc.2`, indicating a new iteration in the release candidate phase.
Upgraded the Azure.Storage.Blobs package from version 12.22.0 to 12.22.1 in the Moonglade.ImageStorage.csproj file to incorporate the latest fixes and improvements.
The <Version> element in the Directory.Build.props file has been updated from 14.10.0-rc.2 to 14.10.0. This change signifies the transition from a release candidate stage to a final stable release, indicating that the software is now ready for general use.
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.