jekyll / jekyll

:globe_with_meridians: Jekyll is a blog-aware static site generator in Ruby
https://jekyllrb.com
MIT License
48.95k stars 9.95k forks source link

Incremental build generates incorrect site summary #7150

Closed cykerway closed 5 years ago

cykerway commented 6 years ago

My Reproduction Steps

  1. Edit index.html.
  2. jekyll build.
  3. touch index.html.
  4. jekyll build -I.
  5. jekyll build -I.

The Output I Wanted

I wanted to see the site successfully built.

However, the last step (incremental build) generates incorrect page summary. Code to generate page summary:

{{ post.content | strip_html | strip_newlines | truncate: 160 | escape }}

Expected output: <table> Actual output: ``.

It looks like some character escape has gone wrong.

ashmaroli commented 6 years ago

@cykerway Unfortunately {{ page.content }} or {{ post.content }} is known to not work properly with --incremental switch

cykerway commented 6 years ago

@ashmaroli I didn't find this in online documentation. Do you have any links to explain this?

ashmaroli commented 6 years ago

Do you have any links to explain this?

Unfortunately, no citation. The reason behind this is only a hypothesis and not fully understood. One of the reasons is that since none of the "posts" have been modified, the regenerating incremental site does not "read" the post-source-files and therefore, the current site has no knowledge of those posts' very existence itself, let alone their content.

Ideally, if none of the files have changed between two runs of bundle exec jekyll build -I, the contents of ./_site shouldn't change at all either.

jekyllbot commented 6 years ago

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the 3.3-stable or master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider building it first as a plugin. Jekyll 3 introduced hooks which provide convenient access points throughout the Jekyll build pipeline whereby most needs can be fulfilled. If this is something that cannot be built as a plugin, then please provide more information about why in order to keep this issue open.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.