You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As far as I can see (or work out) there is no way to define the order, in which Blog Posts are listed on a Blog page. I copied / plagiarised the Blog.swift and BlogPost.swift files from the link provided in the article at https://www.hackingwithswift.com/plus/live-streams/brush-bark into my website project. The resulting Blog worked just fine but the order, in which my Blog Posts are listed, appears to be purely random (as it does in the Brush&Bark example).
I would find it very useful indeed to have blogs listed in ascending YAML Date value order. Would it be possible, please?
The text was updated successfully, but these errors were encountered:
Thanks loseth. That works a treat! I was also able to apply the same of procedure to the List of posts on the TagPage to have the posts listed in reverse chronological order.
structTags:TagPage{func body(tag:String?, context:PublishingContext)async->[anyBlockElement]{
if let tag {Text(tag).font(.title1).fontWeight(.black).margin(.top,.large).frame(width:"95%")}else{Text("All tags").font(.title1).frame(width:"95%")}letposts= context.content(tagged: tag)letsortedPosts= posts.sorted{ $0.date > $1.date }List{
for post in sortedPosts {Link(post)}}.frame(width:"95%")}}
As far as I can see (or work out) there is no way to define the order, in which Blog Posts are listed on a Blog page. I copied / plagiarised the Blog.swift and BlogPost.swift files from the link provided in the article at https://www.hackingwithswift.com/plus/live-streams/brush-bark into my website project. The resulting Blog worked just fine but the order, in which my Blog Posts are listed, appears to be purely random (as it does in the Brush&Bark example).
I would find it very useful indeed to have blogs listed in ascending YAML Date value order. Would it be possible, please?
The text was updated successfully, but these errors were encountered: