3

I've used Jekyll to build my website and it works as intended locally. However, when I deploy my website to github pages, the blog posts no longer show up.

I have consulted a previous question: Jekyll post not generated, but it did not solve my problems.

When I do bundle exec jekyll serve locally, i get the following message

 Incremental build: disabled. Enable with --incremental
      Generating... 
       Jekyll Feed: Generating feed for posts
         AutoPages: Disabled/Not configured in site.config.
        Pagination: Complete, processed 1 pagination page(s)
                    done in 6.303 seconds.

which seem to indicate that everything is working ok. What is the problem?

Magi
  • 273
  • 2
  • 8

1 Answers1

2

If everything is right you will have a message with an information that your server is running afaik.

For example this is my message (note last line):

$ bundle exec jekyll serve
Configuration file: /Users/alexfreik/Documents/GitHub/ltc-webpage/_config.yml
            Source: /Users/alexfreik/Documents/GitHub/ltc-webpage
       Destination: /Users/alexfreik/Documents/GitHub/ltc-webpage/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
       Jekyll Feed: Generating feed for posts
                    done in 0.94 seconds.
 Auto-regeneration: enabled for '/Users/alexfreik/Documents/GitHub/ltc-webpage'
    Server address: http://127.0.0.1:4000/
  Server running... press ctrl-c to stop.

Do you have this information?

EDIT: The problem was in the incorrectly set pagination.

AlexFreik
  • 64
  • 1
  • 3
  • Yes. My message looks similar to yours. Everything is ok when I run jekyll locally. But the blog posts disappear when I deploy to github pages. – Magi Jan 20 '22 at 05:04
  • Can you add `gem "github-pages"` in your `group :jekyll_plugins` in the `Gemfile`? – AlexFreik Jan 21 '22 at 15:22
  • 1
    Indeed. It seems you have some problems with your pagination. When I replaced `for post in paginator.posts` with `for post in site.posts` (and tested in my GitHub repo-clone of your website) the post have appeared at GitHub pages – AlexFreik Jan 22 '22 at 11:42
  • maybe will be of any help https://jekyllrb.com/docs/pagination/ . I skimmed through this docs and found some warning `Don't set a permalink Setting a permalink in the front matter of your blog page will cause pagination to break. Just omit the permalink.` And it seems that you are using permalinks. Also I have skimmed through GitHub Actions build log, and found particularly interesting line `Pagination: Pagination is enabled, but I couldn't find an index.html page to use as the pagination template. Skipping pagination.`. It seems that it is the root of problems – AlexFreik Jan 22 '22 at 11:48
  • This error was logged when I replaced permalink with `pagination_path` so maybe I just broke something when replaced the permalink line))) – AlexFreik Jan 22 '22 at 11:55
  • 1
    Getting rid of the permalink and changing to site.posts instead of paginator.posts actually fixed the problem. Thank you very much! – Magi Jan 22 '22 at 22:41
  • No problem, ahah) but it seems that you wanted this pagination functionality so you still need to debug this ) – AlexFreik Jan 23 '22 at 16:55