# Building Jekyll-Pagination-v2 locally, push to GitHub

**URL:** <https://talk.jekyllrb.com/t/building-jekyll-pagination-v2-locally-push-to-github/4695>\
**Category:** Help\
**Created:** [July 8, 2020, 6:26pm UTC](https://talk.jekyllrb.com/t/building-jekyll-pagination-v2-locally-push-to-github/4695 "2020-07-08T18:26:21Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sebastian-Osmel](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@Sebastian-Osmel](https://talk.jekyllrb.com/u/Sebastian-Osmel)\
**Post date:** [July 8, 2020, 6:26pm UTC](https://talk.jekyllrb.com/t/building-jekyll-pagination-v2-locally-push-to-github/4695/1 "2020-07-08T18:26:21Z")

</div>

Hi, bundle exec jekyll serve is working. In the local build, I can see the files in my posts folder. The theme I am using–Phantom by Jami Gibbs–has employed the use of jekyll-pagination-v2. I understand that is probably because jekyll-pagination-v2 is not supported by github. I am determined to get my website working(link to repo: [https://github.com/Sebastian-O-Rodriguez/Sebastian-O-Rodriguez.github.io](https://github.com/Sebastian-O-Rodriguez/Sebastian-O-Rodriguez.github.io)).

This is my local website, showing a post.

 ![gh-loca](https://canada1.discourse-cdn.com/flex030/uploads/jekyllrb/original/2X/0/089c4a0cb18d25885791911124ce0f1a7919a809.png)

Please check the link to my site to see how it looks through github [sebastian-o-rodriguez.github.io](https://sebastian-o-rodriguez.github.io)  
I am unsure if changing to pagination supported by github or using a local build and sending it to github-pages. If I were to do either option, I have no idea where to start. I have tried the former and cannot get jekyll-pagination to work. On the other hand, I have no experience in building and pushing built files to the repo.

I could really use some advice of what the next step for me is, and possibly a reference to get going. Thanks in advance!

---

<div class="post-metadata">

**Author:** ![brad](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/brad/32/2543_2.png) [@brad](https://talk.jekyllrb.com/u/brad)\
**Post date:** [July 9, 2020, 4:18pm UTC](https://talk.jekyllrb.com/t/building-jekyll-pagination-v2-locally-push-to-github/4695/2 "2020-07-09T16:18:30Z")

</div>

Howdy Sebastian and welcome to the Jekyll forums.

As you’ve learned, you can’t use `jekyll-paginate-v2` with Github Pages. You didn’t say in your post if you need the functionality of that plugin or if you could use the supported `jekyll-paginate`. If you can get by without `jekyll-paginate-v2`, that would be the easier option. All you’ll need to do is [update your config file per the docs](https://jekyllrb.com/docs/pagination/).

If you wish to keep the `jekyll-paginate-v2` plugin, you’ll need to setup a local development environment. I’ve got a [script in my dotfiles](https://github.com/bradonomics/dotfiles/blob/master/bin/ghpages-deploy.sh) that you can reference for getting the built files published on your `gh-pages` branch.

On an unrelated note, you should get a `.gitignore` file set-up with at least the following:

```auto
_site
*-cache/
*.DS_Store

```

None of those files are needed in the repo.

---

<div class="post-metadata">

**Author:** ![Sebastian-Osmel](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@Sebastian-Osmel](https://talk.jekyllrb.com/u/Sebastian-Osmel)\
**Post date:** [July 9, 2020, 6:44pm UTC](https://talk.jekyllrb.com/t/building-jekyll-pagination-v2-locally-push-to-github/4695/3 "2020-07-09T18:44:42Z")

</div>

Hey brad,

thanks for the welcome! After looking more into the matter, I do need `jekyll-paginate-v2` after all. Your linked dotfile seems really useful, but I have some questions implementing it. As of now, I have updateed my `.gitignore` and added `ghpages-deploy.sh` [to the master folder.](https://github.com/SebastianGlobal/sebastianglobal.github.io) How do I use this script to deploy a static build of the website (where non-whitelisted plugins will work)?

As a side note, I have also tried to use [this](https://github.com/jeffreytse/jekyll-deploy-action) to build my site and deploy it, to little avail.

---

<div class="post-metadata">

**Author:** ![brad](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/brad/32/2543_2.png) [@brad](https://talk.jekyllrb.com/u/brad)\
**Post date:** [July 9, 2020, 7:10pm UTC](https://talk.jekyllrb.com/t/building-jekyll-pagination-v2-locally-push-to-github/4695/4 "2020-07-09T19:10:38Z")

</div>

Before you start, a disclaimer: I’ve never tested that deploy script on a Mac. For all I know it’ll burn your system to the ground. Now, with that out of the way…

You’ll probably want to move that script to your `~/bin` directory so you can use it for more than just this project. Regardless, you’ll need to make it executable: `chmod +x ghpages-deploy.sh`. Before you run the script, you’ll need to make sure you have a `gh-pages` branch ( `git branch gh-pages`). After that you should be able to run `ghpages-deploy.sh` or `./ghpages-deploy.sh`.

---

<div class="post-metadata">

**Author:** ![Sebastian-Osmel](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@Sebastian-Osmel](https://talk.jekyllrb.com/u/Sebastian-Osmel)\
**Post date:** [July 9, 2020, 8:52pm UTC](https://talk.jekyllrb.com/t/building-jekyll-pagination-v2-locally-push-to-github/4695/5 "2020-07-09T20:52:11Z")

</div>

I have access to an ubuntu 16.04 machine. Would it be more powerful to switch over for a project like this?

---

<div class="post-metadata">

**Author:** ![brad](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/brad/32/2543_2.png) [@brad](https://talk.jekyllrb.com/u/brad)\
**Post date:** [July 9, 2020, 9:09pm UTC](https://talk.jekyllrb.com/t/building-jekyll-pagination-v2-locally-push-to-github/4695/6 "2020-07-09T21:09:34Z")

</div>

I don’t think computing power is an issue is it? As far as compatibility, I’ve built Jekyll sites on Windows and Linux and worked with people who have built them on Mac. Your operating system shouldn’t matter. If you are getting errors, publish them here and we’ll try to work through them.

---

<div class="post-metadata">

**Author:** ![Sebastian-Osmel](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@Sebastian-Osmel](https://talk.jekyllrb.com/u/Sebastian-Osmel)\
**Post date:** [July 9, 2020, 9:18pm UTC](https://talk.jekyllrb.com/t/building-jekyll-pagination-v2-locally-push-to-github/4695/7 "2020-07-09T21:18:56Z")

</div>

Well noted. I went ahead with the steps you instructed for mac, and `ghpages-deploy.sh` and ended with the following message.

 ![Screen Shot 2020-07-09 at 5.16.38 PM](https://canada1.discourse-cdn.com/flex030/uploads/jekyllrb/original/2X/d/df6cde06f974edd9da23880d12cba736ebe5b515.png)

I am unfamiliar with bash scripts like this, so I don’t if this worked as intended, how to fix if not, etc.

Is it imporant to go into settings and make gh-pages the source for the website or something of that sort?

---

<div class="post-metadata">

**Author:** ![brad](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/brad/32/2543_2.png) [@brad](https://talk.jekyllrb.com/u/brad)\
**Post date:** [July 9, 2020, 9:25pm UTC](https://talk.jekyllrb.com/t/building-jekyll-pagination-v2-locally-push-to-github/4695/8 "2020-07-09T21:25:02Z")

</div>

It looks like everything worked except the files didn’t get pushed to Github. You created the branch locally but didn’t tell Github about it. Switch to your gh-pages branch (`git checkout gh-pages`). Type the code it shows there (`git push --set-upstream origin gh-pages`). Don’t forget to switch back to your master branch before making updates to the site.

---

<div class="post-metadata">

**Author:** ![Sebastian-Osmel](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@Sebastian-Osmel](https://talk.jekyllrb.com/u/Sebastian-Osmel)\
**Post date:** [July 9, 2020, 9:33pm UTC](https://talk.jekyllrb.com/t/building-jekyll-pagination-v2-locally-push-to-github/4695/9 "2020-07-09T21:33:20Z")

</div>

Okay. I did the following:

`git checkout gh-pages`  
`git push --set-upstream origin gh-pages`  
`git checkout master`  
`ghpages-deploy.sh`

and got this:

 ![sc-2](https://canada1.discourse-cdn.com/flex030/uploads/jekyllrb/original/2X/4/49a3cde9add69eb9a2769075d5a3c020b0677590.png)

I think this means everything worked for the most part, but [the website](https://sebastianglobal.github.io/) is still not showing the posts like it does when i had run `bundle exec jekyll serve --watch` before.

---

<div class="post-metadata">

**Author:** ![brad](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/brad/32/2543_2.png) [@brad](https://talk.jekyllrb.com/u/brad)\
**Post date:** [July 9, 2020, 9:54pm UTC](https://talk.jekyllrb.com/t/building-jekyll-pagination-v2-locally-push-to-github/4695/10 "2020-07-09T21:54:48Z")

</div>

It’s not publishing to [your gh-pages branch on GitHub](https://github.com/Sebastian-O-Rodriguez/Sebastian-O-Rodriguez.github.io/tree/gh-pages). So let’s go through the deploy step-by-step.

1. Switch to your `gh-pages` branch.
2. Open your project directory in Finder and delete everything (including hidden files) execpt your `.git` directory. (Note, you can do this via the terminal but you can also burn everything to the ground in a hurry …so, Finder is probably best.)
3. Switch back to the `master` branch.
4. Remove temp directory from the previous build: `rm -rf $HOME/.tmp/jekyll`
5. Recreate the temp directory to hold the build output: `mkdir -p $HOME/.tmp/jekyll`
6. Build Jekyll and output to temp directory: `JEKYLL_ENV=production jekyll build --destination $HOME/.tmp/jekyll`
7. Switch back to the `gh-pages` branch.
8. Copy files from temp directory: `cp -r $HOME/.tmp/jekyll/. .`
9. Add files to index and commit: `git add . && git commit -m "Deploy changes"`
10. Push files to origin: `git push`

---

<div class="post-metadata">

**Author:** ![Sebastian-Osmel](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@Sebastian-Osmel](https://talk.jekyllrb.com/u/Sebastian-Osmel)\
**Post date:** [July 9, 2020, 10:42pm UTC](https://talk.jekyllrb.com/t/building-jekyll-pagination-v2-locally-push-to-github/4695/12 "2020-07-09T22:42:14Z")

</div>

Brad,

I have done the exactly as you described, and I think it all went accordingly.

 ![s3](https://canada1.discourse-cdn.com/flex030/uploads/jekyllrb/original/2X/a/a804e06699a30b94ce2b1f9da71cced14ed9b4f4.jpeg)

I believe that the necessary files were pushed to the gh-pages branch, but [the website](https://sebastianglobal.github.io/) still hasn’t changed. it doesn’t seem to be (in my `novice` view) to be a problem with with the deploy script, but something else. What other steps could I take to fix the cause of this issue?

---

<div class="post-metadata">

**Author:** ![brad](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/brad/32/2543_2.png) [@brad](https://talk.jekyllrb.com/u/brad)\
**Post date:** [July 10, 2020, 3:05pm UTC](https://talk.jekyllrb.com/t/building-jekyll-pagination-v2-locally-push-to-github/4695/13 "2020-07-10T15:05:06Z")

</div>

It looks like you’re pushing to the wrong place. In your first post you said we were working in the [Sebastian-O-Rodriguez.github.io](https://github.com/Sebastian-O-Rodriguez/Sebastian-O-Rodriguez.github.io) repository. In the screenshot you’ve added, you are pushing these built files to [sebastianglobal.github.io](https://github.com/Sebastian-O-Rodriguez/sebastianglobal.github.io).

You’ll need to [change your upstream](https://docs.github.com/en/github/using-git/changing-a-remotes-url) if this is the project you want to push to [Sebastian-O-Rodriguez.github.io](http://Sebastian-O-Rodriguez.github.io) or `cd` into the correct project directory.

---

<div class="post-metadata">

**Author:** ![Sebastian-Osmel](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@Sebastian-Osmel](https://talk.jekyllrb.com/u/Sebastian-Osmel)\
**Post date:** [July 10, 2020, 11:37pm UTC](https://talk.jekyllrb.com/t/building-jekyll-pagination-v2-locally-push-to-github/4695/14 "2020-07-10T23:37:53Z")

</div>

I am currently at a loss. Not that it should matter, but I have been using github desktop to switch from gh-pages to master, and vice versa. Another concern I have is, I tried to use octopress to build locally before you responded to my post, and had added a source branch, I deleted it using `set branch -d source`. I don’t know if this will affect things. After, I did the following from sebastian-o-rodriguez directory:

1. Switch to your `gh-pages` branch.

`git push --set-upstream origin gh-pages` (just to make sure i did this in this correct directory)

1. Open your project directory in Finder and delete everything (including hidden files) execpt your `.git` directory. (Note, you can do this via the terminal but you can also burn everything to the ground in a hurry …so, Finder is probably best.)
2. Switch back to the `master` branch.
3. Remove temp directory from the previous build: `rm -rf $HOME/.tmp/jekyll`
4. Recreate the temp directory to hold the build output: `mkdir -p $HOME/.tmp/jekyll`
5. Build Jekyll and output to temp directory: `JEKYLL_ENV=production jekyll build --destination $HOME/.tmp/jekyll`
6. Switch back to the `gh-pages` branch.
7. Copy files from temp directory: `cp -r $HOME/.tmp/jekyll/. .`
8. Add files to index and commit: `git add . && git commit -m "Deploy changes"`
9. Push files to origin: `git push`

here is my final output this time.

 ![Screen Shot 2020-07-10 at 7.36.25 PM](https://canada1.discourse-cdn.com/flex030/uploads/jekyllrb/original/2X/2/24a3d6286fdef192d1765cf7dd77a908724be9a4.jpeg)

repo

[here](https://github.com/Sebastian-O-Rodriguez/Sebastian-O-Rodriguez.github.io)

i did not use sebastianglobal repo this time! However, I still have not gotten things to work. trying my best not to pull my hair out.

---

<div class="post-metadata">

**Author:** ![brad](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/brad/32/2543_2.png) [@brad](https://talk.jekyllrb.com/u/brad)\
**Post date:** [July 12, 2020, 5:04pm UTC](https://talk.jekyllrb.com/t/building-jekyll-pagination-v2-locally-push-to-github/4695/15 "2020-07-12T17:04:23Z")

</div>

Looking at the gh-pages branch on GitHub it looks like everything worked. My guess now is [your settings](https://github.com/Sebastian-O-Rodriguez/Sebastian-O-Rodriguez.github.io/settings). Scroll down to GitHub Pages and check that your source branch set to `gh-pages`.

---

<div class="post-metadata">

**Author:** ![Sebastian-Osmel](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@Sebastian-Osmel](https://talk.jekyllrb.com/u/Sebastian-Osmel)\
**Post date:** [July 12, 2020, 11:04pm UTC](https://talk.jekyllrb.com/t/building-jekyll-pagination-v2-locally-push-to-github/4695/16 "2020-07-12T23:04:50Z")

</div>

Brad,

I compelled to let you know how grateful I am for all your help. It’s truly been a pleasure, and a great learning experience it has been.

In terms of `source branch set to gh-pages` I find myself in a bit of a pickle. I created `sebastian-o-rodriguez.github.io` as a `USER` site instead of a `project` site. From what I understand, this means i either have to morph the workflow of this site so that gh-pages merges into the master, or (I guess) create a github pages as a PROJECT site in order to do this.

For further reference, this is what my “set source” looks like

 ![Screen Shot 2020-07-12 at 7.04.21 PM](https://canada1.discourse-cdn.com/flex030/uploads/jekyllrb/original/2X/7/7d23a43648f8376bc5afd344434a8e8945fd345f.png)

Which option do you think would be best in this situation? If I were to create a workaround for this user site, how would I do so?

---

<div class="post-metadata">

**Author:** ![Sebastian-Osmel](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@Sebastian-Osmel](https://talk.jekyllrb.com/u/Sebastian-Osmel)\
**Post date:** [July 15, 2020, 12:03am UTC](https://talk.jekyllrb.com/t/building-jekyll-pagination-v2-locally-push-to-github/4695/17 "2020-07-15T00:03:48Z")

</div>

Brad,

long story short, your `ghpages-deploy.sh` is really amazing. Something clicked today and I have everything working (well, the deploy process works lol). I easily use ghpages-deploy.sh to update my launched site, and am now working through aesthetic bugs much more easily. Thanks again man.

-sebastian

---

<div class="post-metadata">

**Author:** ![brad](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/brad/32/2543_2.png) [@brad](https://talk.jekyllrb.com/u/brad)\
**Post date:** [July 15, 2020, 2:31pm UTC](https://talk.jekyllrb.com/t/building-jekyll-pagination-v2-locally-push-to-github/4695/18 "2020-07-15T14:31:48Z")

</div>

I’m glad things are making more sense for the local build/deploy script.

As for the project vs user issue, that’s more of a personal preference. My [Bradonomics repo](https://github.com/bradonomics/bradonomics.com) is setup to publish with a custom domain from my user account. Building my personal site at the root doesn’t preclude me from building project sites. See my [SimpleSheets Shopping Cart](https://bradonomics.github.io/simplesheets-shopping-cart/) for example. I have helped others setup orginizational accounts to host sites on Pages. It’s all up to your work flow.

---

<div class="post-metadata">

**Author:** ![Sebastian-Osmel](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@Sebastian-Osmel](https://talk.jekyllrb.com/u/Sebastian-Osmel)\
**Post date:** [July 24, 2020, 7:29am UTC](https://talk.jekyllrb.com/t/building-jekyll-pagination-v2-locally-push-to-github/4695/19 "2020-07-24T07:29:32Z")

</div>

Brad,

I have decided that [sebastian-o-rodriguez.github.io/about](http://sebastian-o-rodriguez.github.io/about) is just way too long, so I now have ownership over [sebrod.com](http://sebrod.com). According to documentation from github, I have gone to the settings and added ‘[sebrod.com](http://sebrod.com)’ as a custom domain and saved it. On the website i bought from, [namecheap.com](http://namecheap.com), I added the following:  
for `TYPE, HOST, VALUE` respectively  
`CNAME record` , `www` , `sebastian-o-rodriguez.github.io`

I set the four `A record` , `@` , and each ip address to the namecheap website as well.

I am not sure what steps I will need to take. As a reminder, the repository currently hosting my site is ‘about’. If I go to [www.sebrod.com](http://www.sebrod.com) things are looking really messed up. Also, I added a CNAME file including “[www.sebrod.com](http://www.sebrod.com)” to my repository.

---

<div class="post-metadata">

**Author:** ![brad](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/brad/32/2543_2.png) [@brad](https://talk.jekyllrb.com/u/brad)\
**Post date:** [July 24, 2020, 10:11pm UTC](https://talk.jekyllrb.com/t/building-jekyll-pagination-v2-locally-push-to-github/4695/20 "2020-07-24T22:11:07Z")

</div>

What’s in your `_config.yml` for `url:`? My best guess is, you didn’t update that to point to the new domain.

---

<div class="post-metadata">

**Author:** ![Sebastian-Osmel](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@Sebastian-Osmel](https://talk.jekyllrb.com/u/Sebastian-Osmel)\
**Post date:** [July 24, 2020, 10:43pm UTC](https://talk.jekyllrb.com/t/building-jekyll-pagination-v2-locally-push-to-github/4695/21 "2020-07-24T22:43:25Z")

</div>

Yeah, I just changed

`url: www.sebrod.com`  
I also changed the repository to `www.sebrod.com` but i don’t know if i should have done this.

edit: I got it to work. You were spot on, as usual. Thanks!
