jekyll/jekyll

[Bug]: Error: undefined method `excerpt_separator' for #<Jekyll::Page>

remarkablemark opened this issue ยท 36 comments

Operating System

Ubuntu 22.04.3

Ruby Version

ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin21]

Jekyll Version

jekyll 3.9.4

GitHub Pages Version

github-pages 229

Expected Behavior

I expected my site to be built successfully when I run the following:

bundle exec jekyll build --safe

Current Behavior

I get an error when I have an excerpt in a page: remarkablemark/remarkablemark.github.io#71

jekyll 3.9.4 | Error:  undefined method `excerpt_separator' for #<Jekyll::Page>

Relevant log output

Run bundle exec jekyll build --safe
Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
Configuration file: /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/_config.yml
To use retry middleware with Faraday v2.0+, install `faraday-retry` gem
            Source: /home/runner/work/remarkablemark.github.io/remarkablemark.github.io
       Destination: /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
       Jekyll Feed: Generating feed for posts
jekyll 3.9.4 | Error:  undefined method `excerpt_separator' for #<Jekyll::Page @name="404.md">

      head, _, tail = doc_content.to_s.partition(doc.excerpt_separator)
                                                    ^^^^^^^^^^^^^^^^^^
/home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-3.9.4/lib/jekyll/excerpt.rb:135:in `extract_excerpt': undefined method `excerpt_separator' for #<Jekyll::Page @name="404.md"> (NoMethodError)

      head, _, tail = doc_content.to_s.partition(doc.excerpt_separator)
                                                    ^^^^^^^^^^^^^^^^^^
	from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-3.9.4/lib/jekyll/excerpt.rb:25:in `initialize'
	from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-relative-links-0.7.0/lib/jekyll-relative-links/generator.rb:173:in `new'
	from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-relative-links-0.7.0/lib/jekyll-relative-links/generator.rb:173:in `replace_relative_links_excerpt!'
	from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-relative-links-0.7.0/lib/jekyll-relative-links/generator.rb:[6](https://github.com/remarkablemark/remarkablemark.github.io/actions/runs/7820440961/job/21335167976?pr=71#step:4:7)4:in `replace_relative_links!'
	from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-relative-links-0.[7](https://github.com/remarkablemark/remarkablemark.github.io/actions/runs/7820440961/job/21335167976?pr=71#step:4:8).0/lib/jekyll-relative-links/generator.rb:44:in `block in generate'
	from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-relative-links-0.7.0/lib/jekyll-relative-links/generator.rb:39:in `each'
	from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-relative-links-0.7.0/lib/jekyll-relative-links/generator.rb:39:in `generate'
	from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-3.9.4/lib/jekyll/site.rb:175:in `block in generate'
	from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-3.9.4/lib/jekyll/site.rb:173:in `each'
	from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-3.9.4/lib/jekyll/site.rb:173:in `generate'
	from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-3.9.4/lib/jekyll/site.rb:70:in `process'
	from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-3.9.4/lib/jekyll/command.rb:2[8](https://github.com/remarkablemark/remarkablemark.github.io/actions/runs/7820440961/job/21335167976?pr=71#step:4:9):in `process_site'
	from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-3.[9](https://github.com/remarkablemark/remarkablemark.github.io/actions/runs/7820440961/job/21335167976?pr=71#step:4:10).4/lib/jekyll/commands/build.rb:65:in `build'
	from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-3.9.4/lib/jekyll/commands/build.rb:36:in `process'
	from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-3.9.4/lib/jekyll/commands/build.rb:18:in `block (2 levels) in init_with_program'
	from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
	from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
	from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
	from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
	from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
	from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/gems/jekyll-3.9.4/exe/jekyll:15:in `<top (required)>'
	from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/bin/jekyll:25:in `load'
	from /home/runner/work/remarkablemark.github.io/remarkablemark.github.io/vendor/bundle/ruby/3.1.0/bin/jekyll:25:in `<top (required)>'
	from /opt/hostedtoolcache/Ruby/3.1.2/x64/lib/ruby/gems/3.1.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:63:in `load'
	from /opt/hostedtoolcache/Ruby/3.1.2/x64/lib/ruby/gems/3.1.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:63:in `kernel_load'
	from /opt/hostedtoolcache/Ruby/3.1.2/x64/lib/ruby/gems/3.1.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:28:in `run'
	from /opt/hostedtoolcache/Ruby/3.1.2/x64/lib/ruby/gems/3.1.0/gems/bundler-2.1.4/lib/bundler/cli.rb:476:in `exec'
	from /opt/hostedtoolcache/Ruby/3.1.2/x64/lib/ruby/gems/3.1.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	from /opt/hostedtoolcache/Ruby/3.1.2/x64/lib/ruby/gems/3.1.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:[12](https://github.com/remarkablemark/remarkablemark.github.io/actions/runs/7820440961/job/21335167976?pr=71#step:4:13)7:in `invoke_command'
	from /opt/hostedtoolcache/Ruby/3.1.2/x64/lib/ruby/gems/3.1.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor.rb:399:in `dispatch'
	from /opt/hostedtoolcache/Ruby/3.1.2/x64/lib/ruby/gems/3.1.0/gems/bundler-2.1.4/lib/bundler/cli.rb:30:in `dispatch'
	from /opt/hostedtoolcache/Ruby/3.1.2/x64/lib/ruby/gems/3.1.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/base.rb:476:in `start'
	from /opt/hostedtoolcache/Ruby/3.1.2/x64/lib/ruby/gems/3.1.0/gems/bundler-2.1.4/lib/bundler/cli.rb:24:in `start'
	from /opt/hostedtoolcache/Ruby/3.1.2/x64/lib/ruby/gems/3.1.0/gems/bundler-2.1.4/exe/bundle:46:in `block in <top (required)>'
	from /opt/hostedtoolcache/Ruby/3.1.2/x64/lib/ruby/gems/3.1.0/gems/bundler-2.1.4/lib/bundler/friendly_errors.rb:1[23](https://github.com/remarkablemark/remarkablemark.github.io/actions/runs/7820440961/job/21335167976?pr=71#step:4:24):in `with_friendly_errors'
	from /opt/hostedtoolcache/Ruby/3.1.2/x64/lib/ruby/gems/3.1.0/gems/bundler-2.1.4/exe/bundle:34:in `<top (required)>'
	from /opt/hostedtoolcache/Ruby/3.1.2/x64/bin/bundle:[25](https://github.com/remarkablemark/remarkablemark.github.io/actions/runs/7820440961/job/21335167976?pr=71#step:4:26):in `load'
	from /opt/hostedtoolcache/Ruby/3.1.2/x64/bin/bundle:25:in `<main>'
Error: Process completed with exit code 1.

Code Sample

Steps to reproduce issue

Clone repository:

git clone https://github.com/remarkablemark/remarkablemark.github.io.git
cd remarkablemark.github.io

Checkout branch:

git checkout jekyll-error-undefined-method-excerpt_separator

Build site:

bundle exec jekyll build --safe

See remarkablemark/remarkablemark.github.io#71

Experiencing the same error.

jekyll 3.9.4 | Error:  undefined method `excerpt_separator" for #<Jekyll::Page @name="404.md">

/opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-3.9.4/lib/jekyll/excerpt.rb:135:in `extract_excerpt": undefined method `excerpt_separator" for #<Jekyll::Page @name="404.md"> (NoMethodError)
	from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-3.9.4/lib/jekyll/excerpt.rb:25:in `initialize"
	from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-relative-links-0.7.0/lib/jekyll-relative-links/generator.rb:173:in `new"
	from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-relative-links-0.7.0/lib/jekyll-relative-links/generator.rb:173:in `replace_relative_links_excerpt!"
	from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-relative-links-0.7.0/lib/jekyll-relative-links/generator.rb:64:in `replace_relative_links!"
	from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-relative-links-0.7.0/lib/jekyll-relative-links/generator.rb:44:in `block in generate"
	from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-relative-links-0.7.0/lib/jekyll-relative-links/generator.rb:39:in `each"
	from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-relative-links-0.7.0/lib/jekyll-relative-links/generator.rb:39:in `generate"
	from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-3.9.4/lib/jekyll/site.rb:175:in `block in generate"
	from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-3.9.4/lib/jekyll/site.rb:173:in `each"
	from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-3.9.4/lib/jekyll/site.rb:173:in `generate"
	from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-3.9.4/lib/jekyll/site.rb:70:in `process"
	from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-3.9.4/lib/jekyll/command.rb:28:in `process_site"
	from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-3.9.4/lib/jekyll/commands/build.rb:65:in `build"
	from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-3.9.4/lib/jekyll/commands/build.rb:36:in `process"
	from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-3.9.4/lib/jekyll/commands/build.rb:18:in `block (2 levels) in init_with_program"
	from /opt/build/cache/bundle/ruby/2.7.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute"
	from /opt/build/cache/bundle/ruby/2.7.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each"
	from /opt/build/cache/bundle/ruby/2.7.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute"
	from /opt/build/cache/bundle/ruby/2.7.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go"
	from /opt/build/cache/bundle/ruby/2.7.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program"
	from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-3.9.4/exe/jekyll:15:in `<top (required)>"
	from /opt/build/cache/bundle/ruby/2.7.0/bin/jekyll:23:in `load"
	from /opt/build/cache/bundle/ruby/2.7.0/bin/jekyll:23:in `<main>"
	from /opt/build/cache/bundle/ruby/2.7.0/bin/ruby_executable_hooks:22:in `eval"
	from /opt/build/cache/bundle/ruby/2.7.0/bin/ruby_executable_hooks:22:in `<main>"

I experience a similar problem building my own site. Anyone knows how to resolve this problem?

       Jekyll Feed: Generating feed for posts
jekyll 3.9.4 | Error:  undefined method `excerpt_separator' for #<Jekyll::Page @name="404.md">
/var/lib/gems/3.0.0/gems/jekyll-3.9.4/lib/jekyll/excerpt.rb:135:in `extract_excerpt': undefined method `excerpt_separator' for #<Jekyll::Page @name="404.md"> (NoMethodError)
	from /var/lib/gems/3.0.0/gems/jekyll-3.9.4/lib/jekyll/excerpt.rb:25:in `initialize'
	from /var/lib/gems/3.0.0/gems/jekyll-relative-links-0.7.0/lib/jekyll-relative-links/generator.rb:173:in `new'
	from /var/lib/gems/3.0.0/gems/jekyll-relative-links-0.7.0/lib/jekyll-relative-links/generator.rb:173:in `replace_relative_links_excerpt!'
	from /var/lib/gems/3.0.0/gems/jekyll-relative-links-0.7.0/lib/jekyll-relative-links/generator.rb:64:in `replace_relative_links!'
	from /var/lib/gems/3.0.0/gems/jekyll-relative-links-0.7.0/lib/jekyll-relative-links/generator.rb:44:in `block in generate'
	from /var/lib/gems/3.0.0/gems/jekyll-relative-links-0.7.0/lib/jekyll-relative-links/generator.rb:39:in `each'
	from /var/lib/gems/3.0.0/gems/jekyll-relative-links-0.7.0/lib/jekyll-relative-links/generator.rb:39:in `generate'
	from /var/lib/gems/3.0.0/gems/jekyll-3.9.4/lib/jekyll/site.rb:175:in `block in generate'
	from /var/lib/gems/3.0.0/gems/jekyll-3.9.4/lib/jekyll/site.rb:173:in `each'
	from /var/lib/gems/3.0.0/gems/jekyll-3.9.4/lib/jekyll/site.rb:173:in `generate'
	from /var/lib/gems/3.0.0/gems/jekyll-3.9.4/lib/jekyll/site.rb:70:in `process'
	from /var/lib/gems/3.0.0/gems/jekyll-3.9.4/lib/jekyll/command.rb:28:in `process_site'
	from /var/lib/gems/3.0.0/gems/jekyll-3.9.4/lib/jekyll/commands/build.rb:65:in `build'
	from /var/lib/gems/3.0.0/gems/jekyll-3.9.4/lib/jekyll/commands/build.rb:36:in `process'
	from /var/lib/gems/3.0.0/gems/jekyll-3.9.4/lib/jekyll/commands/build.rb:18:in `block (2 levels) in init_with_program'
	from /var/lib/gems/3.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
	from /var/lib/gems/3.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
	from /var/lib/gems/3.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
	from /var/lib/gems/3.0.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
	from /var/lib/gems/3.0.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
	from /var/lib/gems/3.0.0/gems/jekyll-3.9.4/exe/jekyll:15:in `<top (required)>'
	from /usr/local/bin/jekyll:25:in `load'
	from /usr/local/bin/jekyll:25:in `<main>'

I had the same issue. But I got it to work by rolling back to Jekyll 3.9.3.

Also running into this on gh pages, where you cannot specify the Jekyll version

You can definitely specify the Jekyll version on GitHub Pages, and even use Jekyll 4. The trick is to use GitHub Actions instead of the github-pages gem.

https://github.blog/2022-08-10-github-pages-now-uses-actions-by-default/#how-can-i-upgrade-to-jekyll-4

You can also try my guide, although it's a bit outdated: https://www.moncefbelyamani.com/making-github-pages-work-with-latest-jekyll/

Also, even if you're still using the github-pages gem, you can specify the Jekyll version by specifying the github-pages gem version. For example, if you set the gem to version 228, it will use Jekyll 3.9.3: https://rubygems.org/gems/github-pages/versions/228

You can pin the version like this in your Gemfile:

gem "github-pages", "=228"

Yes, sure, but I'm just talking about the built in gh pages functionality. I don't want to have to reconfigure the whole site because there appears to be an issue in one version of Jekyll.

Pinning the github-pages version does not appear to work, the builder uses the versions it wants regardless with the message:

Warning: The github-pages gem can't satisfy your Gemfile's dependencies.

I think the gem is meant for easily replicating the builder environment on your local machine rather than telling the builder what to use.

You're right. I forgot about that, and I even mention it in my guide. That's why I recommend using GitHub Actions since you have more control over the gem versions, and you can take advantage of Jekyll 4's improvements.

Alternatively, as mentioned in my guide, you can build your site locally with Jekyll 3.9.3, and then push the contents of the _site folder to a branch called gh-pages, and GitHub will serve the contents directly without building.

A simple way to work around this issue is defining a new workflow by copying Jekyll workflow:

  1. Go to your repository
  2. Click Action menu
  3. Press New workflow button
  4. Search Jekyll
  5. Find the workflow named Jekyll and click Configure button
  6. Press Commit changes

You may need to pull and push from your local repository to sync with the commit.

The workflow seems designed for the latest stable Jekyll. It uses Jekyll 4.3.3.

It's not that simple if you've been dragging the same Jekyll site around for nearly a decade and it doesn't work on 4.x without some changes.

For those having this issue specifically with the academicpages template (evidenced potentially by specifically the 404.md file error), it turns out if you remove the excerpt line from 404.md, about.md, and non-menu-page.md, everything deploys properly.

academicpages/academicpages.github.io#1878

after hours of debugging I was able to fix it - ayrat555/ayrat555.github.io@eae9cdc

I added a custom workflow suggested in #9544 (comment)

had to modify gem and config files

also, had to modify the source of the github pages in config

image

I think I found an easy way of using the previous release of pages-build-deployment workflow.

  1. Go to your repository
  2. Click Action menu
  3. Press New workflow button
  4. Search Jekyll
  5. Find the workflow named GitHub Pages Jekyll (not Jekyll) and click Configure button
  6. Change line number 34 to use the previous release of actions/jekyll-build-pages as like:

from:

        uses: actions/jekyll-build-pages@v1

to:

        uses: actions/jekyll-build-pages@v1.0.9
  1. Press Commit changes
  2. (maybe you need to configure Pages build and deployment source)

GitHub Pages Jekyll and pages-build-deployment are essentially same. The main difference of them is an additional report-build-status stage in pages-build-deployment.

You can find more information about 'GitHub Pages Jekyll` workflow at https://github.com/actions/jekyll-build-pages/pkgs/container/jekyll-build-pages

I encountered the same issue. It seems an excerpt separator is now required for every excerpt, so I just defined one in my _config.yml file and added it at the end of every excerpt. The build is now OK with jekyll 3.9.4

A simple way to work around this issue is defining a new workflow by copying Jekyll workflow:

  1. Go to your repository
  2. Click Action menu
  3. Press New workflow button
  4. Search Jekyll
  5. Find the workflow named Jekyll and click Configure button
  6. Press Commit changes

You may need to pull and push from your local repository to sync with the commit.

The workflow seems designed for the latest stable Jekyll. It uses Jekyll 4.3.3.

If you were using GitHub Pages as the build and deployment source, you should do the following. If not, your changes will be accepted successfully, but you will run into errors because the site would still technically be configured to use GitHub pages.

  • Change the repository from GitHub Pages to GitHub Actions
    o Go to your repository
    o Click Settings
    o Click Pages
    o Under Build and development...Source, change from Deploy from a Branch to GitHub Actions

I hope this helps someone :)

I encountered the same issue. It seems an excerpt separator is now required for every excerpt, so I just defined one in my _config.yml file and added it at the end of every excerpt. The build is now OK with jekyll 3.9.4

I've spent more than a day on this. I tried all of the above to no avail (and encountered all sorts of other problems due to fiddling with things).

This sounds like a great solution, but can you provide the lines you added to the .yaml file please?

@AndrewWPhillips see Jekyll document for the current implementation. If you do not need to use the excerpt function, just remove it from the front matter of any pages that use it.

@AndrewWPhillips see Jekyll document for the current implementation. If you do not need to use the excerpt function, just remove it from the front matter of any pages that use it.

Thanks, I worked out where to add it, but it also did not resolve my issue.

But I finally got a solution using the last above comments from @QuantKang and @jamisonjcjohnson above. (Ie add a new workflow based on "Github page Jekyll", change to "jekyll-gh-pages.yml" to use actions/jekyll-build-pages@v1.0.9, then changed Build and Deployment to use "Github Actions" (rather than master branch).

BTW I can't modify the front matter as I am using a theme from another repo. that I can't modify.

Hi, there are several approaches. Besides the approach based on the Github action specifying the build version, as many people like me compile locally, is it possible to wait until the bug is fixed by jekyll? Since this is the simplest one, we do not need any more actions than bundle updates. Is there any effort to fix the bugs inside jekyll or is this only a compatible problem between jekyll and academic pages?

I had the same issue. But I got it to work by rolling back to Jekyll 3.9.3.

How can you roll back ?

I encountered the same issue. It seems an excerpt separator is now required for every excerpt, so I just defined one in my _config.yml file and added it at the end of every excerpt. The build is now OK with jekyll 3.9.4

I've spent more than a day on this. I tried all of the above to no avail (and encountered all sorts of other problems due to fiddling with things).

This sounds like a great solution, but can you provide the lines you added to the .yaml file please?

@AndrewWPhillips 2 lines in _config.yml:

posts:
    excerpt_separator: <!--excerptEnd-->

I also had to override some layouts and includes in the Minimal Mistakes theme I am using so that the rendering is OK for the splash layout (it uses the excerpt keyword, which I had to replace: commit here).

I've spent a few hours debugging this as I have several sites hosted on Github pages that are all unable to deploy. Here's what I have found based on diving into a lot of the other comments.

GitHub Pages builds are failing with an error like this:

Error: undefined method `excerpt_separator' for #<Jekyll::Page @name="QuickStart.md">`

The file referenced is any Markdown file with a excerpt specified, which we do on lots and lots of files. This error starts in Jekyll 3.9.4, and I see it locally as well. Jekyll 3.9.3 works file. Seems like a bug that should be rolled back by Jekyll.

On Friday, Feb 9th, Github released a change to it's GitHub Pages default action that updates the github-pages gem to version 229. The main thing that 229 does is upgrade Jekyll to 3.9.4. Boom, broken.

Unfortunately, it doesn't seem like it's easy to override this. Specifying gem "github-pages", "=228" in your own gemfile gets you this message:

Warning: The github-pages gem can't satisfy your Gemfile's dependencies. If you want to use a different Jekyll version or need additional dependencies, consider building Jekyll site with GitHub Actions: https://jekyllrb.com/docs/continuous-integration/github-actions/

I opened a bug with Github Actions as this seems like something we should be able to control and override.

The workaround that @QuantKang left works for me, but I don't like switching all my repos to custom actions just to point at an old version. I feel like this is going to be fixed in the next few days, so I'm not running to update all my pages repositories just yet.

Hopefully this helps the next person that comes looking for why their GitHub Pages are busted right now.

Posting a temp workaround here too: actions/jekyll-build-pages#115 (comment)

The root cause appears to be benbalter/jekyll-relative-links#65. It's using Jekyll::Excerpt with a Jekyll::Page which is not compatible. (It must be used with a Jekyll::Document.)

I am proposing a fix for Jekyll 3.9 in #9550. This will allow Excerpts to be created for Page objects, which I think is best.

I encountered the same issue. It seems an excerpt separator is now required for every excerpt, so I just defined one in my _config.yml file and added it at the end of every excerpt. The build is now OK with jekyll 3.9.4

I've spent more than a day on this. I tried all of the above to no avail (and encountered all sorts of other problems due to fiddling with things).
This sounds like a great solution, but can you provide the lines you added to the .yaml file please?

@AndrewWPhillips 2 lines in _config.yml:

posts:
    excerpt_separator: <!--excerptEnd-->

I also had to override some layouts and includes in the Minimal Mistakes theme I am using so that the rendering is OK for the splash layout (it uses the excerpt keyword, which I had to replace: commit here).

This worked amazing for me and should be fine for anyone else using minimal mistakes. Just remember to change all instances of the excerpt command to "summary" or whatever you decide to rename it to, as well as put the "!-- excerpt-end --" within the parenthesis.

If you build your site with Actions (which is the majority of cases), your build should be fixed now. The change made it in https://github.com/actions/jekyll-build-pages/releases/tag/v1.0.11.

Still deploying the changes to Pages' legacy infrastructure now.

Thanks @parkr for patching Jekyll for us โค and sorry for all the troubles.

@parkr @yoannchaudet I hate to be a pain, but 3.9.5 is broken for me with a new error:

/usr/local/bundle/gems/jekyll-3.9.5/lib/jekyll/excerpt.rb:91: warning: Jekyll::Excerpt#yaml_file? at /usr/local/lib/ruby/2.7.0/forwardable.rb:154 forwarding to private method Jekyll::Page#yaml_file?
  Liquid Exception: undefined method `yaml_file?' for #<Jekyll::Page @name="dpa.md"> in /_layouts/empty.html

That error is from the Github pages build, and I see the same error locally with 3.9.5 on multiple sites. I don't think that's an issue with my setup, but for completeness, here is what those files look like for me:

/_layouts/empty.html is my basic layout, it has no front-matter

<!DOCTYPE html>
<html lang="en" class="no-js">
  {% include head.html %}
  <body class="{{ layout.body_class }} {{ page.body_class }} preload">
    <script>document.documentElement.classList.remove("no-js");</script>
    {{ content }}
    {% include scripts.html %}
    <script>document.body.classList.remove("preload");</script>
  </body>
</html>

dpa.md is a regular page in my site. Here is the start of the file

---
layout: policy
title: Data Processing Agreement
excerpt: "Standard agreement for the processing of Customer Data"
permalink: /dpa/
download: "/assets/documents/requestmetrics-dpa-v3.0.pdf"
sitemap:
  priority: 0.5
redirect_from:
  - /gdpr/
---

# Data Processing Agreement
Revision 3.0

I can confirm I am getting the same error as @toddhgardner after upgrading github-pages to 230 in remarkablemark/remarkablemark.github.io#71 (comment)

Not regretting my decision to spend 5 minutes moving to a custom GitHub action and controlling what version of Jekyll is used.

@chadpav This is the way ๐Ÿ™ˆ.

@toddhgardner Thanks for providing an example that trips the exception. I'll try and revert jekyll-relative-links to 0.6.1. I suspect this is the root cause of the issues we are seeing (changelog).

(aside) I totally get "you should just use a GH Pages Action like so..." But the popularity - and simplicity! - of GH Pages "just working out of the box" is huge, and it was disappointing (on GH's part, really, not your's!) that this now suddenly is breaking deploys to GHPages sites people thought were zero maintenance.

In any case, thanks Jekyll peeps for building and maintaining such an awesome system! ๐Ÿฅฐ

Second time a charm?

We sent pages-gem v231 everywhere. It reverted (for now) jekyll-relative-links to the previous release. Hopefully that clears up all the issues.

Let us know!

Thanks @yoannchaudet! I can confirm that this fixed the issue for me: remarkablemark/remarkablemark.github.io#71

Yes, the pages are building now. Thanks for the fix.