Can't use Post.slug with Jekyll on Github Pages - jekyll

I can get a post's slug using Post.slug when I build and serve Jekyll locally (using latest version of Jekyll), but when I push to Github, the value is no longer accessible. I can't figure out why.

slug for post is what I introduced into Jekyll 3.0.1 for uncased slugified title of posts (see here). It doesn't exist in any version prior to 3.0.1. Just like others mentioned above, GitHub hasn't adopted the latest version of Jekyll.

Related

Jekyll SystemStackErorr "stack level too deep" on serve with github pages

I can't serve a jekyll site locally and I get notified that there is a problem with GitHub pages when I commit to GitHub.
bundle exec jekyll -v 11:28:34
jekyll 3.7.3
ruby --version 11:28:42
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
When I run:
bundle exec jekyll serve
will fail and spit out hundreds (more like thousnads) of error messages starting with:
bundler: failed to load command: jekyll (/usr/local/bin/jekyll)
SystemStackError: stack level too deep
/usr/local/lib/ruby/gems/2.5.0/gems/kramdown-1.17.0/lib/kramdown/parser/base.rb:106:in `new'
/usr/local/lib/ruby/gems/2.5.0/gems/kramdown-1.17.0/lib/kramdown/parser/base.rb:106:in `add_text'
/usr/local/lib/ruby/gems/2.5.0/gems/kramdown-1.17.0/lib/kramdown/parser/html.rb:171:in `parse_raw_html'
/usr/local/lib/ruby/gems/2.5.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown/html.rb:60:in `handle_kramdown_html_tag'
From what I could tell, this can sometimes happen if you use jekyll serve as opposed to bundle exec jekyll serve and if there is a mismatch between your version of jekyll and the one required by github pages, but here I do use bundle exec and so the correct version of jekyll is used.
jekyll itself works if i try to create a new site with jekyll new blah and i can serve that one locally without a problem, but the combo of jekyll and github pages is giving me grief.
I am puzzled and do not know how to proceed.
All this is on Mac OS X 10.13.6.
Not relating to the original cause of the problem here, but i stumbled upon this and had the error stack level too deep. So i guess this might help someone.
I traced my problem to a field that i named as max in some yaml dictionary in the front matter. Maybe you have named a field which has a special meaning in jekyll.

Can't get github hosting to work with Jekyll 3.0.0

I am new to both Jekyll and github. I have followed the instructions here to get a blog on github using Jekyll. When I type jekyll serve from my local directory I get
D:/projects/gitblog/MyName.github.com/jekyll-bootstrap/_plugins/debug.rb:13:in `<module:Jekyll>': cannot load such file -- jekyll/post (LoadError)
Can someone help me with this? Based on some thing I have read, this might be a problem with the latest version of Jekyll, which I am using,
Try deleting the file _plugins/debug.rb and run the server again.

Learning Jekyll requirements

I wanted to learn Jekyll mainly for designing websites and blogs.
What are the necessary required skills that I should have before I can start digging into Jekyll/
Thank you in advance.
Today I learned Jekyll. It's pretty straigt forward!
The minimum prerequisites are knowledge of HTML and CSS. Nice to have but not required before you start is some knowledge about Liquid Jekyll's templating engine.
I used Jekyll's own tutorial, that David already pointed out and read through the first few pages. Then I got hands on with it by following the quick start instructions from their homepage:
gem install jekyll
jekyll new my-awesome-site
cd my-awesome-site
jekyll serve
# => Now browse to http://localhost:4000
Installing it on my Mac worked fine with the pre installed Ruby and its packagemanager RubyGems on my Mac OS X 10.9. I already installed node.js and it's packagemanager npm before, but i haven't seen where it's needed but maybe somewhere under the hood.
From here I inspected the demo package, read a bit in the docs and googled my way through till I had a working site build by Jekyll.
Have fun!
P.S. For the posts and sites I refreshed my knowledge about the markdown syntax.
Well except html, css and javascript, you just have to learn Jekyll itself it's really easy.
Go for it !

Why does my site work using Jekyll 1.4.3 but not Jekyll 2.0.2?

After upgrading my web application based on Jekyll 1.4.3 to Jekyll 2.0.2, my home page does not incorporate the specified layout file.
Here are the steps to reproduce:
Download https://github.com/morea-framework/basic-template/tree/jekyll-2.0.
This is the jekyll-2.0 branch of my web application, which is a stripped down version to illustrate the problem. If you clone the repo, be sure to switch to the jekyll-2.0 branch.
gem uninstall jekyll
gem install jekyll -v '1.4.3'
This installs the version of jekyll in which the site builds correctly. For reasons not apparent to me, I ran into problems when I had both 1.4.3 and 2.0.2 installed simultaneously.
cd basic-template/master/src
jekyll serve --baseurl ''
This brings up my web application. If you now go to http://localhost:4000, you should see:
Now control-c to stop the application, and invoke:
gem uninstall jekyll
gem install jekyll
jekyll serve --baseurl ''
These three commands uninstalls Jekyll 1.4.3, installs Jekyll 2.0.2, and reruns Jekyll. Now if you refresh http://localhost:4000, you should see:
As you can see, the CSS styling is no longer present. That's because the layout specified in the Front Matter has for some reason not been included.
Can anyone tell me why my code no longer works correctly under Jekyll 2.0.2?
Your post references the post.html layout in it's front matter, which in turn references the default layout. The default layout doesn't exist in your _layouts folder:
https://github.com/morea-framework/basic-template/blob/jekyll-2.0/src/_layouts/post.html
You should always have a default layout.

How to install a jekyll plugin for an octopress blog?

I have recently found excellent Octopress & Jekyll frameworks, and I am going
to switch my homepage to octopress from wordpress (which is rather well documented).
However, I am eager to add several plugins to octopress. For example, the one that
generates bibliographies. There are several plugins for Jekyll for doing this
(for example, https://github.com/inukshuk/jekyll-scholar)
However, I was not able to make it functional for an octopress website;
I tried to follow the install instructions, and instead of jekyll plugin directory
use the octopress plugin directory; it did not work out.
Can anyone provide me with general instructions how the jekyll plugin should be installed for a simple octopress blog (an example for jekyll-scholar would be enough).
Not 100% sure, as I'm new to Octopress and Jekyll myself but here goes:
Install
$ [sudo] gem install jekyll-scholar
Usage
Create a file called ext.rb in the plugins directory of Octopress.
The contents of the ext.rb file should be
require 'jekyll/scholar'
To adjust the Jekyll-Scholar settings, use the configuration file _config.yml