Skip to content

Commit

Permalink
Lowercase filenames to match default slugs
Browse files Browse the repository at this point in the history
Currently, all slugs are forced to lowercase on Readme.com.
However when syncing, it left the name as uppercase, which **always**
resulted in a 404, and thus a new page being created.
  • Loading branch information
ollyfg committed Jun 22, 2021
1 parent 314e74b commit 8764c6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cmds/docs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ exports.run = function (opts) {
files.map(async filename => {
const file = await readFile(path.join(folder, filename), 'utf8');
const matter = frontMatter(file);
// Stripping the markdown extension from the filename
const slug = filename.replace(path.extname(filename), '');
// Stripping the markdown extension from the filename and lowecasing to get the default slug
const slug = filename.replace(path.extname(filename), '').toLowerCase();
const hash = crypto.createHash('sha1').update(file).digest('hex');

return request
Expand Down

0 comments on commit 8764c6c

Please sign in to comment.