# Github-pages docs \_posts cannot be reached

**URL:** <https://talk.jekyllrb.com/t/github-pages-docs-posts-cannot-be-reached/1144>\
**Category:** Uncategorized\
**Created:** [November 3, 2017, 2:48pm UTC](https://talk.jekyllrb.com/t/github-pages-docs-posts-cannot-be-reached/1144 "2017-11-03T14:48:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![frankieliu](https://avatars.discourse-cdn.com/v4/letter/f/74df32/32.png) [@frankieliu](https://talk.jekyllrb.com/u/frankieliu)\
**Post date:** [November 3, 2017, 2:48pm UTC](https://talk.jekyllrb.com/t/github-pages-docs-posts-cannot-be-reached/1144/1 "2017-11-03T14:48:51Z")

</div>

Hello,

This is a question regarding jekyll and its use in github-pages.

From github, I created a docs folder in the project repository and set the github setting to publish with master docs.

Then I did a jekyll new . to create the default files in the docs directory, and I added the gem githubs-page and modified Gemfile according to the jekyllrb docs github-pages . I then did a jekyll build and bundle exec jekyll serve and looked at localhost:4000 in my browser, everything looked fine, include in the feed.xml that shows the posts, that is, I could click through to the posts. I went on to commit and push my changes to github and looked at my github\_dot\_io project page (link below).

The style didn’t match (minima), and although I can see the posts being enumerated (posts which I added to the docs \_posts directory, I cannot actually access them in github\_dot\_io as in my local jekyll build - serve.

I am suspecting that I don’t understand how jekyll references the \_posts directory under a project page. \_posts works fine in my github-pages user page, but not if it is part of a sub-directory for a particular project.

The instructions in jekyllrb docs github-pages do say that the project URL gets complicated, but I am not referring directly to the \_posts directory, rather the jekyll-feed plugin seems to be doing most of this referencing. Looking at my local index.html, it does point to /category/date/topic entries, for my individual posts, I wonder if the relative path is not being respected in my github-pages, I did a quick diff between the index.html in my local directory and the one generated by github-pages the only difference is the following:

link rel=“canonical” href=“http: _slash_ _slash_ localhost:4000/” \<- local  
(sorry for the _slash_, I can only have two links in my post)

link rel=“canonical” href="/" \<- github io

This seems to be valid to me, perhaps I don’t understand how github-pages is running jekyll, or whether each project is treated on its own (as in being allowed to have its own \_posts), or whether there is some dependency between the user page and the individual project pages, or how the server treats relative paths.

For reference, my setup is at [https://github.com/frankieliu/pgm/tree/master/docs](https://github.com/frankieliu/pgm/tree/master/docs) and the corresponding github-page at [https://frankieliu.github.io/pgm](https://frankieliu.github.io/pgm)

Thank you. -f

---

<div class="post-metadata">

**Author:** ![ashmaroli](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@ashmaroli](https://talk.jekyllrb.com/u/ashmaroli)\
**Post date:** [November 3, 2017, 3:09pm UTC](https://talk.jekyllrb.com/t/github-pages-docs-posts-cannot-be-reached/1144/2 "2017-11-03T15:09:32Z")

</div>

Your issue here is that you have not configured the `baseurl` setting properly. When setting up for GitHub Pages docs, you need to set `baseurl: /<REPO-NAME>`. In your case, it would be:

```auto
baseurl: "/pgm"

```

Setting that should resolve the CSS and links to your posts just fine…

---

<div class="post-metadata">

**Author:** ![frankieliu](https://avatars.discourse-cdn.com/v4/letter/f/74df32/32.png) [@frankieliu](https://talk.jekyllrb.com/u/frankieliu)\
**Post date:** [November 3, 2017, 3:35pm UTC](https://talk.jekyllrb.com/t/github-pages-docs-posts-cannot-be-reached/1144/3 "2017-11-03T15:35:28Z")

</div>

Thank you @ashmaroli that did the trick.

When serving locally, after the suggested change in \_config.yml , I use

bundle exec jekyll serve --baseurl “”

to see it in localhost:4000

Is there a better way of doing this?

Thanks again.

---

<div class="post-metadata">

**Author:** ![ashmaroli](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@ashmaroli](https://talk.jekyllrb.com/u/ashmaroli)\
**Post date:** [November 3, 2017, 3:56pm UTC](https://talk.jekyllrb.com/t/github-pages-docs-posts-cannot-be-reached/1144/4 "2017-11-03T15:56:07Z")

</div>

Either that or do a regular `bundle exec jekyll serve` and access your site at `http://localhost:4000/pgm`

---

<div class="post-metadata">

**Author:** ![frankieliu](https://avatars.discourse-cdn.com/v4/letter/f/74df32/32.png) [@frankieliu](https://talk.jekyllrb.com/u/frankieliu)\
**Post date:** [November 3, 2017, 4:12pm UTC](https://talk.jekyllrb.com/t/github-pages-docs-posts-cannot-be-reached/1144/5 "2017-11-03T16:12:50Z")

</div>

Great, thanks for the alternate solution.

–edit: @ashmaroli : your suggestion in

> [@Github-pages docs \_posts cannot be reached](http://talk.jekyllrb.com/t/github-pages-docs-posts-cannot-be-reached/1144/4):
>
> Either that or do a regular bundle exec jekyll serve and access your site at http://localhost:4000/pgm

doesn’t work, note I did a build followed by a serve, and pointed to localhost:4000/pgm

–edit:  
There is a missing / at the end, then it works: [http://localhost:4000/pgm/](http://localhost:4000/pgm/)

Also I found this post which contains more information:

> [@Links on my repos doesnt seem to be woking anymore](http://talk.jekyllrb.com/t/links-on-my-repos-doesnt-seem-to-be-woking-anymore/817/11):
>
> What exactly are you trying to achieve with baseurl: ''? The correct way to use it has been best summarized here by one of the Jekyll maintainers: [https://byparker.com/blog/2014/clearing-up-confusion-around-baseurl/](https://byparker.com/blog/2014/clearing-up-confusion-around-baseurl/)

---

<div class="post-metadata">

**Author:** ![ashmaroli](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@ashmaroli](https://talk.jekyllrb.com/u/ashmaroli)\
**Post date:** [November 4, 2017, 1:17pm UTC](https://talk.jekyllrb.com/t/github-pages-docs-posts-cannot-be-reached/1144/6 "2017-11-04T13:17:53Z")

</div>

> [@frankieliu](#):
>
> There is a missing / at the end

Ah right! my bad… Thanks for the correction! 😃
