Skip to content

Commit

Permalink
When filtering content only include ".md" files
Browse files Browse the repository at this point in the history
    Current filter allows for ".md" anywhere in the file name.
    Update to force filter to allow only files ending with ".md"
  • Loading branch information
Loki-Astari committed Apr 12, 2023
1 parent 6e235c4 commit c7a6e5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/contentParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const getListPage = async (filePath) => {
// get all single pages, ex: blog/post.md
export const getSinglePage = (folder) => {
const filesPath = fs.readdirSync(folder);
const sanitizeFiles = filesPath.filter((file) => file.includes(".md"));
const sanitizeFiles = filesPath.filter((file) => file.endsWith(".md"));
const filterSingleFiles = sanitizeFiles.filter((file) =>
file.match(/^(?!_)/)
);
Expand Down

0 comments on commit c7a6e5d

Please sign in to comment.