Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repo files leak to built site #449

Open
yochem opened this issue Jul 17, 2024 · 0 comments
Open

Repo files leak to built site #449

yochem opened this issue Jul 17, 2024 · 0 comments

Comments

@yochem
Copy link

yochem commented Jul 17, 2024

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.

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

No branches or pull requests

1 participant