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

[Bug]: exclude broken for md files #9592

Closed
axelfontaine opened this issue May 1, 2024 · 3 comments
Closed

[Bug]: exclude broken for md files #9592

axelfontaine opened this issue May 1, 2024 · 3 comments
Labels

Comments

@axelfontaine
Copy link

axelfontaine commented May 1, 2024

Operating System

Ubuntu 24.04

Ruby Version

ruby 3.2.3 (2024-01-18) [x86_64-linux-gnu]

Jekyll Version

jekyll 4.3.3

GitHub Pages Version

No response

Expected Behavior

In _config.yml

exclude:
  - README.md

prevents README.md from being included in _site

Current Behavior

README.md is copied to _site

Relevant log output

No response

Code Sample

No response

@mkasberg
Copy link
Contributor

I cannot reproduce this.

$ jekyll --version
jekyll 4.3.3

$ jekyll new test-exclude-md
Running bundle install in /home/mkasberg/code/test-exclude-md... 
New jekyll site installed in /home/mkasberg/code/test-exclude-md. 

$ cd test-exclude-md 

$ echo "testing" > README.md

$ bundle exec jekyll build
Configuration file: /home/mkasberg/code/test-exclude-md/_config.yml
            Source: /home/mkasberg/code/test-exclude-md
       Destination: /home/mkasberg/code/test-exclude-md/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
       Jekyll Feed: Generating feed for posts
                    done in 0.374 seconds.
 Auto-regeneration: disabled. Use --watch to enable.

$ ls _site # NOTE README.md gets created because it's not yet excluded.
404.html  about  assets  feed.xml  index.html  jekyll  README.md

$ echo "exclude:
dquote>   - README.md" > _config.yml 

$ tail -n4 _config.yml 
exclude:
  - README.md

$ bundle exec jekyll build
Configuration file: /home/mkasberg/code/test-exclude-md/_config.yml
            Source: /home/mkasberg/code/test-exclude-md
       Destination: /home/mkasberg/code/test-exclude-md/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
       Jekyll Feed: Generating feed for posts
     Build Warning: Layout 'post' requested in _posts/2024-05-23-welcome-to-jekyll.markdown does not exist.
     Build Warning: Layout 'default' requested in 404.html does not exist.
     Build Warning: Layout 'page' requested in about.markdown does not exist.
     Build Warning: Layout 'home' requested in index.markdown does not exist.
                    done in 0.327 seconds.
 Auto-regeneration: disabled. Use --watch to enable.

$ ls _site # NOTE exclude works correctly and removes README.md.
404.html  about  feed.xml  index.html  jekyll

Since I don't believe this is a bug with Jekyll, here are some other things you might check:

  • Run jekyll clean, or otherwise delete README.md from _site and see whether it gets re-created.
  • Ensure your _config.yml is valid yaml and your exclude: section is formatted correctly.
  • Ensure there are no other errors that prevent your jekyll build from running.

@jbleuzen
Copy link

Another thing that you can check :

  • You have the keyword exclude only once in your _config.yml.

I watched the issue because I thought I had the issue but with @mkasberg test I don't reproduce. After checking my conf I had the keyword exclude twice...

@mattr-
Copy link
Member

mattr- commented May 23, 2024

@axelfontaine Please feel free to reopen after checking the above comments to confirm you don't have a double exclude key in your config. If you do reopen this, you must provide a reproduction test case since we can't confirm your issue. Thanks!

@mattr- mattr- closed this as not planned Won't fix, can't repro, duplicate, stale May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants