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

Line Breaks (Multiline) of processed files are broken #3037

Closed
2 tasks done
dfuchss opened this issue Feb 27, 2025 · 6 comments · Fixed by #3038
Closed
2 tasks done

Line Breaks (Multiline) of processed files are broken #3037

dfuchss opened this issue Feb 27, 2025 · 6 comments · Fixed by #3038
Labels

Comments

@dfuchss
Copy link
Contributor

dfuchss commented Feb 27, 2025

Have you checked that your issue isn't already filed?

  • I read through FAQ and searched through the past issues, none of which addressed my issue.
  • Yes, I have checked that this issue isn't already filed.

Bug description

I recognized that files processed by jekyll seem to omit all line breaks. E.g., the robots.txt is now invalid.

How to reproduce the bug

Look into https://alshedivat.github.io/al-folio/robots.txt

It should be

User-agent: *
Disallow:

Sitemap:  https://alshedivat.github.io/al-folio/sitemap.xml

but is

User-agent: * Disallow: Sitemap: https://alshedivat.github.io/al-folio/sitemap.xml

Error messages and logs

What operating system are you using?

Not applicable (e.g. you're using GitHub Pages or other hosting)

Where are you seeing the problem on?

Deployed site

More info

It seems to be broken with commit 05eb46a

@dfuchss dfuchss added the bug label Feb 27, 2025
@dfuchss dfuchss changed the title Line Endings (Multiline) of processed files are broken Line Breaks (Multiline) of processed files are broken Feb 27, 2025
@george-gca
Copy link
Collaborator

Can you check if running locally the robots.txt file also looks like this?

If it does, this will be difficult to solve, and I will have to think about that.

If it doesn't, then jekyll-minifier can be the one to blame, since it minifies some of the files. One possible solution would be to uncomment this line, but keeping only robots.txt:

# exclude: ["robots.txt", "assets/js/search/*.js"]

It this doesn't solve it, maybe jekyll-terser is the culprit. If this is the case, we must check how to exclude robots.txt from minification.

If even this doesn't solve, it is jekyll itself that minifies this file when running with JEKYLL_ENV=production. Then, again, we will have to think of another solution.

@dfuchss
Copy link
Contributor Author

dfuchss commented Feb 27, 2025

I tested all in the docker image amirpourmand/al-folio:v0.13.4

  • If I run bundle exec jekyll build the robots.txt is broken
  • If I delete _site and run bundle exec jekyll serve and look into _site/robots.txt it's also broken.

@dfuchss
Copy link
Contributor Author

dfuchss commented Feb 27, 2025

If I use JEKYLL_ENV=development, everything works fine

dfuchss added a commit to ArDoCo/ardoco.github.io that referenced this issue Feb 27, 2025
dfuchss added a commit to dfuchss/fuchss.org that referenced this issue Feb 27, 2025
@dfuchss
Copy link
Contributor Author

dfuchss commented Feb 27, 2025

Uncommenting the line

# exclude: ["robots.txt", "assets/js/search/*.js"]
also works. However, there might be more files to be excluded here that I'm not aware of.

@george-gca
Copy link
Collaborator

In case we find more, we can always make more changes. Can you submit a PR with this change?

@dfuchss
Copy link
Contributor Author

dfuchss commented Feb 27, 2025

I will create one

george-gca pushed a commit that referenced this issue Feb 28, 2025
Resolve #3037

This PR just re-enable the old exclusions of jekyll-minifier to ensure
that the files aren't altered.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants