broken links to css/js with Jekyll on local version - github

I use Jekyll to build my blog, here is the code on github
when I generate the code with the command jekyll pygments, it builds the site in the _site directory.
when I open the _site/index.html page in a browser, the css/js links are broken because they looks like the following
/css/style.css
to make it works the links should not begin with the /
what should I do to test the site on my local machine with working links to css/js?
Thanks

ok i found the solution:
Running Jekyll with its standalone server
jekyll --auto --server
and then access in the browser at
http://localhost:4000

Related

why jekyll tag not working on github give 404 erro but it works on localhost

I use this tutorial for create tags on jekyll its work correctly on localhost when I click on a tag link it take me to the /tags/tag_name page but when I push it to the github this directory (/tags/tag_name page) give me 404 error! how can i fix this problem?
If you site lives at http://example.com/mysite, you need to set baseurl: /mysite in _config.yml, and call you pages like this :
Tag
It seems that github disables custom plugins for security reasons, thus, the .rb file that this tutorial uses will not work. There does seem to be a workaround, however, which involves compiling your Jekyll source code to the _site directory before pushing to github server. See this post

Why is Jekyll not working in local when I add a new post?

I am testing my github site with Jekyll, but when I add a new post it is not generating the post in the _posts folder, so it can't get site.posts in index.html.
I had jekyll serve running in local.
My folder:
The local page:
The local:
However, it works fine on the github site. So what's the problem?
This a Jekyll 3.x behavior.
Posts with a date in the future are not published, except if you :
set a future: true variable in _config.yml
or
do a jekyll serve --future
This is not a problem under Jekyll 2.x and Github pages.
I had the same problem: I could see my code on github pages, but not locally. The problem seemed to be with incompatibility between jekyll-paginate and the current Rubygems version of Jekyll: 3.4.0.
I uninstalled that version of jekyll with gem uninstall jekyll and then installed the version used by Github Pages: 3.3.1.
Works like a charm now!

Emoji for jekyll

I've built a site on Github pages with Jekyll. Recently I tried running an emoji_for_jekyll plugin. When I build and run the site locally, it seems to work. However, when I commit and view it online the emoji disappear and all that's left is the syntax (:smile:)
Here is a page on my site http://joshuahouston.github.io/code/2014/12/10/the-emoji-test.html
This is the resource I've followed. The 3 steps seem easy enough.
Install the emoji_for_jekyll gem:
gem install emoji_for_jekyll
Add emoji_for_jekyll to the list of gems in config.yml:
gems: ["emoji_for_jekyll"]
See beautiful emoji!
or
Copy emoji_for_jekll.rb and emoji.json into the _plugins directory
And you can view my site's pages on Github and they're even working there! https://github.com/joshuahouston/joshuahouston.github.io/blob/master/_posts/2014-12-10-the-emoji-test.markdown
Do you know what I'm missing? Why aren't the pages being generated correctly for the site but correctly elsewhere? Thank you.
Not all plugins can be run on Gitub pages (see documentation here).
If you want to use emojies on your gh-pages, you'll have to use parkr jemoji.
gem install jemoji
remove your _plugins folder content
change gems in _config.yml to gems: ["jemoji"]
test with a jekyll serve
push to Github
be happy ;-)
In my case, I test directly on Github. I did two changes:
Step 1: add gem 'jemoji' to Gemfile
Step 2: add - jemoji to _config.yml

How can I confirm that my Jekyll is installed well?

This is my test page. I'm on windows 8.1
http://hypergroups.github.io/
jekyll --server --auto
this is an deprecated command.
And I've tried serve, but maybe I'm not right, and maybe I haven't configure the enviroment well?
I want to make this be successful
http://localhost:4000/hypergroups/index.html
Make sure that your _config.yml isn't empty.
Also Jekyll will serve pages # http://localhost:4000 from the _site sub directory of the directory you run Jekyll from.

Jekyll on github doesn't works the same as local jekyll server

Project
demo
The next button works very well when I ran all the codes on local jekyll server.
But it doesn't work on online Github Jekyll server.
Looking forward to the best answer.
Make sure you
using correct Jekyll
Currently
gem 'jekyll', '=0.12.0'