Skip to content

Repo files leak to built site #449

Open
@yochem

Description

@yochem

When Jekyll builds the site, all non-dotfiles are copied to the _site folder and included on the hosted website.

For example:

It would be better to exclude these from the build. There are two approaches:

  1. List them in the exclude field of the config file. Easy, but have to maintain a list of files to exclude, and "In Jekyll 3, the exclude configuration option replaces the default exclusion list.", which means the default exclude list also has to be included. Current repo would then have the following exclude list:
exclude:
  - .jekyll-cache/
  - .sass-cache/
  - Dockerfile
  - Gemfile
  - Gemfile.lock
  - README.md
  - TRANSLATORS.md
  - docker-compose.yml
  - gemfiles/
  - node_modules/
  - package-lock.json
  - package.json
  - script/
  - scripts/
  - vendor/
  1. Create a separate folder for the website files, resulting in the following repo structure:
├── Dockerfile
├── Gemfile
├── Gemfile.lock
├── README.md
├── TRANSLATORS.md
├── docker-compose.yml
├── package-lock.json
├── package.json
├── public
│   ├── CNAME
│   ├── _config.yml
│   ├── _config_local.yml
│   ├── _layouts/
│   ├── assets/
│   ├── css/
│   ├── index.md
│   ├── js/
│   ├── lang/
│   └── spec/
├── script
│   ├── bootstrap
│   ├── cibuild
│   └── server
└── scripts
    └── collect.js

This separates the jekyll files from the non-web repo files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions