Cover image for Host an Eleventy site on Github Pages

Host an Eleventy site on Github Pages

dancanetti profile image Daniel Canetti Originally published at danielcanetti.com ・1 min read

Github pages allows you to host your site directly from the repo on an Apex domain - essentialy it's free hosting! Even better, you can configure your Eleventy site to output to the docs directory Github uses by making a simple config change.

Copy and paste the below into your eleventy.js file (if you don't have one create this file in the root of your project), all we're doing here is changing the output from the default _site directory to docs.

module.exports = {
    dir: {
        output: "docs"

Once you've made this change - the next time you compile 11ty will create the docs directory with all your site files in it.

Some good extra reading

Posted on by:

dancanetti profile

Daniel Canetti


A Web Developer living and working in Yorkshire, England.


markdown guide