I'm not sure if you are already aware of that or not but to remove .html extension from GitHub Pages all you have to do is remove .html extension from your links.
In other words it already works and you don't have to do anything. You don't have to use subdirectories, CNAME, redirects, Jekyll _config.yml, YAML front-matter or any other hack suggested all over the web.
For example this file is named index.html but you can access is as those URLs:
some of which may be insecure in some cases (see details).
See the tests to experiment yourself how it works and see how those files are named in the GitHub repository.
This is based on the information originally posted as an answer to: Remove html extension from GitHub Pages quwstion on Stack Overflow. See the full answer for more details.