Skip to content

Show an error if there’s a file with no extension#437

Merged
frankieroberto merged 2 commits intomainfrom
show-error-if-no-file-extension
Mar 27, 2026
Merged

Show an error if there’s a file with no extension#437
frankieroberto merged 2 commits intomainfrom
show-error-if-no-file-extension

Conversation

@frankieroberto
Copy link
Copy Markdown
Collaborator

This aims to help catch a common error: people adding a markdown file for a post but forgetting to add the .md file extension.

If a file is found, the build will fail with an error like this:

[11ty] Wrote 0 files in 0.27 seconds (v3.1.5)
[11ty] Eleventy Fatal Error (CLI):
[11ty] Found file without extension: app/lung-health-check/2025/08/lung-health-check-prototype/test
[11ty] 
[11ty] Did you forget to add an .md to it?

This will be reported by GitHub when opening a pull request (as that does a test build), or locally in terminal.

Fixes #37

This aims to help catch a common error: people adding a markdown file for a post but forgetting to add the `.md` file extension.
@edwardhorsford edwardhorsford temporarily deployed to dsps-design-show-error--pwij5v March 26, 2026 23:04 Inactive
@edwardhorsford
Copy link
Copy Markdown
Collaborator

Very nice! how do we test this?

@frankieroberto
Copy link
Copy Markdown
Collaborator Author

@edwardhorsford you can test it locally (fetch this branch, then add a file with no extension).

Or to see it on GitHub I've just opened a demo PR here: #440

Thanks to @edwardhorsford for the suggestion.

Co-Authored-By: Ed Horsford <2204224+edwardhorsford@users.noreply.github.com>
@frankieroberto frankieroberto temporarily deployed to dsps-design-show-error--pwij5v March 27, 2026 12:17 Inactive
Copy link
Copy Markdown
Collaborator

@edwardhorsford edwardhorsford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

@frankieroberto frankieroberto merged commit a8da3de into main Mar 27, 2026
3 checks passed
@frankieroberto frankieroberto deleted the show-error-if-no-file-extension branch March 27, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Idea: throw error if post has no extension

2 participants