Skip to content

Commit

Permalink
Merge pull request #9 from jupyter-book/agoose77/fix-sort-blogposts
Browse files Browse the repository at this point in the history
πŸ“‚ Sort blogposts in preview selection
  • Loading branch information
agoose77 authored Nov 13, 2024
2 parents ec1bcd5 + c95f60c commit 9eb325a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/blog.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const blogPostsDirective = {
},
run(data, vfile, ctx) {
const size = data.options.limit ?? 3;
const paths = globSync("posts/*.md");
const paths = globSync("posts/*.md").sort(); // For now, string sort
const nodes = paths.map((path) => {
const ext = extname(path);
const content = readFileSync(path, { encoding: "utf-8" });
Expand Down

0 comments on commit 9eb325a

Please sign in to comment.