Skip to content

Commit

Permalink
Try using json element for topic names
Browse files Browse the repository at this point in the history
  • Loading branch information
IanWold committed Oct 14, 2024
1 parent fbca0b9 commit 43ecdf9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions build.csx
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,11 @@ new MetalsharpProject()
}
}

if (post.Metadata.TryGetValue("topics", out var topicsObject) && topicsObject is IEnumerable<string> topicNames)
if (post.Metadata.TryGetValue("topics", out var topicsObject) && topicsObject is JsonElement topicNamesElement)
{
foreach (var topicName in topicNames)
foreach (var topicNameElement in topicNamesElement.EnumerateArray())
{
var topicName = topicNameElement.GetString();
if (topicPosts.TryGetValue(topicName, out var topicPostsList))
{
seriesPosts[topicName] = [ ..topicPostsList, post.Metadata ];
Expand Down

0 comments on commit 43ecdf9

Please sign in to comment.