Skip to content

Commit

Permalink
Scss/Sass files are now invalidated whenever any other Scss/Sass file…
Browse files Browse the repository at this point in the history
  • Loading branch information
daveaglick committed Jan 9, 2024
1 parent c14b82c commit 1e6226f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 1.0.0-beta.72

- Added an improved warning message and early exit out of recursive settings expansion.
- Added a `MediaTypes.IsMediaType()` method to help determine if a given path matches specified media type(s).

# 1.0.0-beta.71

Expand Down
12 changes: 12 additions & 0 deletions src/core/Statiq.Common/Content/MediaTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1127,5 +1127,17 @@ public static bool TryGet(string path, out string mediaType, bool defaultIfNotFo
/// <returns>The extensions that result in the specified media type.</returns>
public static IEnumerable<string> GetExtensions(string mediaType) =>
ExtensionMappings.Where(x => x.Value.Equals(mediaType, StringComparison.OrdinalIgnoreCase)).Select(x => x.Key);

/// <summary>
/// Checks whether the given path is of the specified media type(s).
/// </summary>
/// <param name="path">The path to check.</param>
/// <param name="mediaTypes">The media types of check.</param>
/// <returns><c>true</c> if the path is of the specified media type(s), <c>false</c> otherwise.</returns>
public static bool IsMediaType(string path, params string[] mediaTypes)
{
string pathMediaType = Get(path);
return mediaTypes.Any(x => x.Equals(pathMediaType, StringComparison.OrdinalIgnoreCase));
}
}
}
2 changes: 1 addition & 1 deletion src/core/Statiq.Core/Modules/Control/CacheDocuments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ protected override async Task<IEnumerable<IDocument>> ExecuteContextAsync(IExecu
return await context.ExecuteModulesAsync(Children, context.Inputs);
}

// If we're reseting the cache, reset it but then continue
// If we're resetting the cache, reset it but then continue
if (context.Settings.GetBool(Keys.ResetCache))
{
context.LogInformation($"Resetting cache due to {nameof(Keys.ResetCache)} metadata");
Expand Down

0 comments on commit 1e6226f

Please sign in to comment.