How can I confirm that my Jekyll is installed well? - github

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.

Related

Jekyll can't find layout

I am using git page to make a github website. I am using academicpages/academicpages.github.io. I forked this repo to my gitpage repo, and edited the pages in the /_pages folder. But when I build the site with jekyll, I get the following:
Jekyll Feed: Generating feed for posts
Build Warning: Layout 'single' requested in pages/about.md does not exist.
Build Warning: Layout 'archive' requested in pages/dissertation.md does not exist.
Build Warning: Layout 'archive' requested in pages/research.md does not exist.
Build Warning: Layout 'archive' requested in pages/software does not exist.
Build Warning: Layout 'archive' requested in pages/teaching.md does not exist.
I am not following this because, in the git repo I made I have the layouts in the _layouts folder. archive.html and single.html are all in there.
Then what could be causing the problem?
One question though would be, should I have all these files in the git website folder on my hard drive? Since I forked the theme repo, the files are all on my git repo, and I don't have the layout files on my hard drive.
From the documentation within https://github.com/academicpages/academicpages.github.io
To run locally (not on GitHub Pages, to serve on your own computer)
Clone the repository and made updates as detailed above
Make sure you have ruby-dev, bundler, and nodejs installed: sudo apt install ruby-dev ruby-bundler nodejs
Run bundle clean to clean up the directory (no need to run --force)
Run bundle install to install ruby dependencies. If you get errors, delete Gemfile.lock and try again.
Run bundle exec jekyll liveserve to generate the HTML and serve it from localhost:4000 the local server will automatically rebuild and refresh the pages on change.
So, yes, basically you clone the repo to have all files on your harddisk, then dependencies are installed and finally you start your site locally using jekyll serve or jekyll serve -i.

Github pages cannot display markdown correctly

I am using github pages + jekyll to establish my blog.
It worked properly before pushed my latest commit. This commit adds a cname file and just edits some words without any alterations over the architecture of my site.
- <h3 class="description">aaaaaaaaaa</h3>
+ <h3 class="description">bbbbbbbbbb</h3>
After that markdown does not appear properly.
When I write #head1. It does not appear title head1, it just appears #head1 directly.
However, if I use jekyll serve build in localhost:4000, it appears correctly.
This is my _config.yml:
markdown: kramdown
markdown_ext: markdown,mkd,mkdn,md
textile_ext: textile
highlighter: pygments
Any ideas what has been causing this error?
UPDATED!
This is most likely due to Jekyll 3 upgrade on GitHub Pages.
From May 1st 2016 on, GitHub will not support rdiscount nor redcarpet anymore. Also, since February 1st, GitHub Pages only supports rouge:
Starting May 1st, 2016, GitHub Pages will only support kramdown,
Jekyll's default Markdown engine.
GitHub Pages now only supports
Rouge.
You can check this out here.
In order to deal with it, proceed as the following:
First, try as explained on this answer. Instead of #Heading you'll write # Heading.
Second, adjust your _config.yml: change highlighter and markdown for
highlighter: rouge
markdown: kramdown
kramdown:
input: GFM
Third, to build your site locally, use Bundler, the method recommended by GitHub:
Install Bundler:
gem install bundler
Then run bundle update - this will update all your gems, including github-pages, if you already have this gem installed locally.
Then, create a Gemfile (leave it without any file extension) with the following content:
source 'https://rubygems.org'
gem 'github-pages'
Save it to your project's root.
Then, run bundle install on your project. This will create a file called Gemfile.lock and will install all required gems and their dependencies.
Finally, run bundle exec jekyll serve --watch and you'll be able to view your website locally exactly as you'll view online (when hosting on GitHub).
You should be OK by then!
PS. If your project needs more gems, as jekyll-paginate or jekyll-mentions, you'll need to add them to the Gemfile, for example:
source 'https://rubygems.org'
gem 'github-pages'
gem 'jekyll-paginate'
Also, add them to your project's _config.yml:
gems:
- jekyll-paginate
- jekyll-mentions
Here you'll see a list of gem versions currently supported by GitHub Pages. Here you read about Upgrading Jekyll 2 to 3.
Hope to have helped!
A slight observation running my own Jekyll powered github pages blog,
A space between the # representing the heading size, and the heading text is important otherwise the markdown will not display as intended. Therefore with your example, I would display my markdown heading as,
# Zookeeper Atomic Broadcast for heading 1
## Zookeeper Atomic Broadcast for heading 2
### Zookeeper Atomic Broadcast for heading 3
#### Zookeeper Atomic Broadcast for heading 4
##### Zookeeper Atomic Broadcast for heading 5
GitHub support markdown as well jekyll.
First of all rename your file with the .md extension
If you have .nojekyll in your folder it will disable njekyll.
Verify that you don't have this is your folder.
Read the docs && GitHub relevant doc on how to prepare and deploy
Running Jekyll
Use the command git checkout to switch to the default branch that the GitHub Pages build server uses to generate your site. The default branch you switch to depends on the type of GitHub Pages site you're building.
For Project Pages sites, switch to gh-pages.
For User Pages or Organization Pages sites, switch to master. For more information, see "User, Organization, and Project Pages".
Use the command bundle exec jekyll serve in the root of your repository to run the GitHub Pages build server with Bundler.
bundle exec jekyll serve
Navigate to http://localhost:4000 to see your local site.

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

Jekyll not processing plugins on server

Jekyll is processing my _plugins folder fine on my local machine (OS X 10.7.4, ruby 1.9.3), but it's not processing them on the server (Ubuntu 12.04, ruby 1.9.3). Both have the same version of Jekyll installed (0.11.2).
I'm trying to use the generate_sitemap plugin, here.
I'm deploying via git and the post-receive hook, which looks like this:
#!/bin/bash -l
GIT_REPO=/my_repo.git
TMP_GIT_CLONE=/my_temp_folder/
PUBLIC_WWW=/my_public_folder/
git clone $GIT_REPO $TMP_GIT_CLONE
jekyll --no-auto $TMP_GIT_CLONE $PUBLIC_WWW
rm -Rf $TMP_GIT_CLONE
exit
I am seeing this error when I deploy:
remote: /home/ed/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': iconv will be deprecated in the future, use String#encode instead.
But, from what I've read, that's a Maruku warning and has nothing to do with the plugins.
Anybody have any ideas about what I can try to figure this out? I'm at a bit of a loss.
It's very hard to debug with Jekyll, but it's a great tool !!!
I assume you have more than one plugin in your _plugins folder.
So maybe one or some of your plugins , cause the problem.
If I'm right, you can do the following :
Kill your Jekyll
Create a backup of your plugins in another location (not in _plugins
folder).
Leave just one plugin in your _plugins folder and start Jekyll.
If it works , copy another plugin to the _plugins folder, until you
find the one which fails the Jekyll.
When you find it, you can add debug printouts to the problematic plugin (that's what I did).
Something like :
puts "before .... "
I have built the http://www.cloudifysource.org/ only with Jekyll and you can find and use lots of our useful examples in our GitHub repo : https://github.com/CloudifySource/cloudifysource.github.com
I had the same problem with Jekyll not loading plugins when called from the post-receive hook.
As is mentioned in the comments above, changing the current working directory to $TMP_GIT_CLONE does the trick.
You don't have to change anything in _config.yml.
#!/bin/bash -l
GIT_REPO=/my_repo.git
TMP_GIT_CLONE=/my_temp_folder/
PUBLIC_WWW=/my_public_folder/
git clone $GIT_REPO $TMP_GIT_CLONE
cd $TMP_GIT_CLONE # move to the temp dir
jekyll --no-auto $TMP_GIT_CLONE $PUBLIC_WWW
cd # move back to allow deletion
rm -Rf $TMP_GIT_CLONE
exit
This is a real head-scratcher seeing as executing the original post-receive hook manually as the git user works just fine... Anyway, Jekyll is now loading plugins on my server and hopefully making this a proper answer will help others to find this solution.
Lately, I start to build https://github.com/alswl/code-standards-jekyll with jekyll.
I write two plugins in _plugins, and I found it was hard to debug.
At first, I use puts "balabala" to debug, it seems work.But once I met problem that didn't generate anything in the _site folder, and there was no 'balabala' in the console, I was panic.
After I read the jekyll source, I try to set auto=false in _config.yml, running jekyll will produce some debug trace stack error. Thank godness.
So, ues auto=false will help you to debug plugins.

broken links to css/js with Jekyll on local version

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