Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Editing the title of a blog post should not make it 404
We found a problem with the site which occurs in the following situation: - Someone creates a new post in prose.io. (That creates a file in the repository with a filename baseed on slug of the post which is based on its title. The slug is stored in the post's YAML frontmatter as well.) - Someone edits the title of the post in prose.io. This changes the slug which is stored in the YAML frontmatter, but not the filename in the repository.) In our code what was happening is that any list of multiple posts (e.g. on the front page) would generate links based on the slug in the YAML frontmatter. However, when looking up an individual post for display, the slug in the URL is used to form a glob pattern to find in the appropriate directory in the repository. This means that changes in the title of a blog post in prose.io can cause broken links on the site (and we currently don't automatically deploy if any such broken links are found). To fix this, this commit changes the slug which is returned by a MarkdownWithFrontmatter document to be based on its filename, not the slug found in its frontmatter. Fixes #166
- Loading branch information