Skip to content

Commit 9eb325a

Browse files
authored
Merge pull request #9 from jupyter-book/agoose77/fix-sort-blogposts
📂 Sort blogposts in preview selection
2 parents ec1bcd5 + c95f60c commit 9eb325a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugins/blog.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const blogPostsDirective = {
1111
},
1212
run(data, vfile, ctx) {
1313
const size = data.options.limit ?? 3;
14-
const paths = globSync("posts/*.md");
14+
const paths = globSync("posts/*.md").sort(); // For now, string sort
1515
const nodes = paths.map((path) => {
1616
const ext = extname(path);
1717
const content = readFileSync(path, { encoding: "utf-8" });

0 commit comments

Comments
 (0)