Fresh Jekyll Install on Sierra OS - ruby

I have never installed Jekyll before, this is my first time.
I went through the process of installing xcode, ruby version 3.2.1 installed, jekyll version 3.2.1 installed. All of this is was freshly installed in the last 2 days.
When I go to localhost:4000 I get the content of the default jekyll page, but none of the style. It looks like this:
Unstyled Default Jekyll Page
Here is what the file structure looks like, I have not changed any file at all since installing. File Structure
When I inspect the page it gives this as its css link as:
<link rel="stylesheet" href="http://example.com/css/main.css">
I am at a loss of how to continue. Can anyone help me?

The css is a bit messed up because the domain is wrong in the _config.yml. You can remove the example url and it’ll work nicely.
Should look like this.
baseurl: "" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site
If you get a domain you can update then.
UPDATE:
As mentioned in the comment below, this is now fixed and set by default in Jekyll 3.3.0.
When you generate a new site the css should link-up properly and the relevant section of the _config.yml will look like this:
baseurl: "" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site, e.g. http://example.com

Related

Github-pages showing only front-matter

I'm unable to see the index.html get rendered with jekyll's front matter. In fact, the front matter is all I see on the webpage.
Here is the folder layout:
and the _config.yml:
title: badabing badaboom
email: xyz#gmail.com
description: tbd
#baseurl: "" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site, e.g. http://example.com
twitter_username:
github_username:
encoding: utf-8
# Build settings
theme: jekyll-theme-clean-blog
plugins:
- jekyll-feed
remote_theme: StartBootstrap/startbootstrap-clean-blog-jekyll
# Exclude from processing.
# The following items will not be processed, by default.
# Any item listed under the `exclude:` key here will be automatically added to
# the internal "default list".
#
# Excluded items can be processed by explicitly listing the directories or
# their entries' file path in the `include:` list.
Any ideas on how I could fix this, or what I should look into?
My god... *facepalm
I just needed to get rid of .nojekyll
GitHub Pages will use Jekyll to build your site by default. If you
want to use a static site generator other than Jekyll, disable the
Jekyll build process by creating an empty file called .nojekyll in the
root of your publishing source, then follow your static site
generator's instructions to build your site locally.

don't have related_posts.rb or one of its dependencies installed

I am trying to implement related_posts-jekyll_plugin plugin to show the related post based on post tag on jekyll blog. When running jekyll server I got following error, how can I solve it?
$ jekyll serve
Configuration file: D:/git/blog/_config.yml
Dependency Error: Yikes! It looks like you don't have D:/git/blog/_plugins/related_posts.rb or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'cannot load such file -- jekyll/post' If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/!
jekyll 3.6.0 | Error: D:/git/blog/_plugins/related_posts.rb
My _config.yml file contains following content.
title: Kiran's blog | Kiran Shahi is a .NET developer from Nepal
email: mail#example.com
description: > # this means to ignore newlines until "baseurl:"
Welcome to kiran's blog. Kiran Shahi is a .NET guy. He is passionate about technology.
baseurl: "/blog" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site, e.g. http://example.com
twitter_username: itskirans
github_username: kiranshahi
future: true
paginate: 5
# Build settings
markdown: kramdown
gems:
- jekyll-feed
- jekyll-paginate
exclude:
- Gemfile
- Gemfile.lock
Although we can't see your config file, It Looks like you have related_posts.rb in your gem list in your config file. As this plugin is not a gem but just a plugin file you do not need to list it there. Just remove it from that section.

Github pages Jekyll static blog outdated

I setup a Jekyll blog on Github-Pages 5 months ago. It was working at that time, and I though it would be a nice place to post things.
Long story short, I wrote a first post, but then I never used, until yesterday when I wanted to check that all was working fine, but it was not. I also could not run Jekyll locally.
I do not use ruby on my daily basis ,so they were outdated. I though maybe if I update it and generate the site again everything is going to be working fine.
I updated ruby from 2.1.2 to 2.2.1, and I tried other things to make it work. Now is working locally, but throwing this
Generating...
Defaults: An invalid front-matter default set was found:
[{"scope"=>{"path"=>"_posts/"}, "values"=>{"author"=>"Agustin Gambina"}}]
Defaults: An invalid front-matter default set was found:
[{"scope"=>{"path"=>"_posts/"}, "values"=>{"author"=>"Agustin Gambina"}}]
I also added a Gemfile to the root directory
source 'https://rubygems.org'
require 'json'
require 'open-uri'
versions = JSON.parse(open('https://pages.github.com/versions.json').read)
gem 'github-pages', versions['github-pages']
When I run
github-pages health-check
I get this
Checking domain littlebit.me...
Uh oh. Looks like something's fishy: Domain does not resolve to the GitHub Pages server
Does anyone know why it happened to me that is not working anymore? was because it was outdated and something changed?
thank you
You have an error in your _config.yml file :
-
-
scope:
path: "_posts/scala"
values:
author: Agustin Gambina
Must be :
-
scope:
path: "_posts/scala"
values:
author: Agustin Gambina
This is not a fatal error, so your site build, but your rule is not applied.
Concerning the health-check, it works for me as it checks littlebit.me that resolve to github IPs.
$: dig littlebit.me
...
littlebit.me. 1800 IN A 192.30.252.154
littlebit.me. 1800 IN A 192.30.252.153
If it doesn't work on your PC, you may have a DNS problem. Maybe you've set a bad value in your hosts file ?

I am having issue seeing jekyll in browser. Nothing appears when I type 'localhost:4000' into url

I am new to this so hopefully I make sense when I ask this question.
I am doing this on windows 7 through the command prompt.
I have installed jekyll but I am having trouble with seeing the jekyll web page. Nothing appears. What I see when I write 'jekkyl serve' is:
c:\users\spiridon\desktop\portfolio\jekyll serve
Configuration file: c:users/spiridon/desktop/portfolio/_config.yml
source: c:users/spiridon/desktop/portfolio
destination: : c:users/spiridon/desktop/portfolio/_site
generating...
c:/ruby193/lib/ruby/gems/1.9.1/gems/posix-spawn-0.3.9/lib/posix/spawn.rb:164: warning: cannot close fd before spawn
'which' is not recognized as an internal or external command, operable program or batch file.
←[31m Liquid Exception: no such file or directory - python c:/ruby193/lib/ruby/gems/1.9.1/gems/pygments/mentos.py in _posts/2014-10-23-welcome-to-jekyll.markdown←[0m
done.
Please add the following to your Gemfile to avoid polling for changes:
require 'rbconfig'
if RBConfig: :CONFIG['target_os'] =~ /mswin|mingw|cygwin/i
gem 'wdm', >= 0.1.0'
end
Auto-regeneration: enabled for 'c:/users/spiridon/desktop/portfolio'
Configuration file: c:/users/spiridon/desktop/portfolio/_config.yml
server address: http://0.0.0.0:4000/
server running... press ctrl-c to stop.
i am using ruby193
jekyll 2.4.0
this is my _config.yml:
# Site settings
title: Your awesome title
email: your-email#domain.com
description: > # this means to ignore newlines until "baseurl:"
Write an awesome description for your new site here. You can edit this
line in _config.yml. It will appear in your document head meta (for
Google search results) and in your feed.xml site description.
baseurl: "" # the subpath of your site, e.g. /blog/
url: "http://yourdomain.com" # the base hostname & protocol for your site
twitter_username: jekyllrb
github_username: jekyll
# Build settings
markdown: kramdown
I am brand new to this language and most other programming languages. I have also watched youtube videos and searched online for a solution but could not find anything. thank you.
From the Jekyll homepage
While Windows is not an officially-supported platform, it can be used
to run Jekyll with the proper tweaks.
Please follow all instructions on this page dedicated to hints to get Jekyll running on Windows or try this Jekyll Windows project.
The errors you get will probably be gone once you followed one of the above hints but still a short explanation:
'which' is not recognized as an internal or external command, operable program or batch file.
i.e. windows has no program called which.
which does not exists on Windows systems. On unixoid systems it's used to resolve what exactly is executed when you run the command given as attribute to which.
From the Wikipedia:
In the Internet Protocol version 4 the address 0.0.0.0 is a non-routable meta-address used to designate an invalid, unknown or non applicable target.
So it's no surprise opening it in the browser doesn't work. Jekyll cannot start a server at it runs into errors. So it displays this generic IP as server address.

How can I debug plugins that are being silently ignored?

Newcomer to Jekyll here (previously on Hyde).
Ruby files placed in the _plugins/ directory are apparently silently ignored.
I am using version 0.11.2 of Jekyll, with ruby 1.8.7 on Ubuntu 12.04.
Should an extra config parameter be added to load these plugins? The doc doesn't say so - the sane default should be to look into _plugins, and they should be required automatically. How can one debug the loading of Jekyll plugins?
For my instance of jekyll (also 0.11.2, but with ruby 1.9.2p290 on a Mac), I don't have to add any extra configuration, but you can try adding the following line to your top level "_config.yml" file.
plugins: _plugins
or, possibly,
plugins: ./_plugins
The simplest way to test that your plugins are working is to remove all of them except for one that you know will work. I've put together the following which works as expected on my install.
Create a new file in the root of your jekyll source directory called "plugin_test.md" with the following contents:
---
layout: default
title: Plugin Test
---
the quick brown fox jumps over the lazy dog.
Testing plugin output of '_plugins/testplugin.rb': {% testplugin %}
Note that you may need to change "layout: default" to whatever you are actually using.
Create a new file at "_plugins/testplugin.rb" with the following contents:
module Jekyll
class TestPlugin < Liquid::Tag
def render(context)
"It's Working!"
end
end
end
Liquid::Template.register_tag('testplugin', Jekyll::TestPlugin)
Run jekyll on your source dir.
All that testplugin.rb does is replace instances of the liquid tag {% testplugin %} with the text "It's Working!". If your plugins are triggering, you'll see the output
Testing plugin output of '_plugins/testplugin.rb': It's Working!"
on the page "plugin_test.html" at your output site root. If you see:
Testing plugin output of '_plugins/testplugin.rb':
that means that the plugin didn't trigger. If you run into that, I think it's a sign that something is pretty out of whack and would advise reinstalling jekyll.
I know I'm little bit late but for others who still come across this question I would like to add my resolution:
Restart the server to get the newly added plugin working. So stop jekyll serve (Ctrl C) and restart it again with jekyll serve.

Resources