What I'm doing wrong in jekyll that I have a link to Index page in the navigation bar?
>bundle exec jekyll --version
jekyll 3.3.1
>bundle --version
Bundler version 1.13.6
>ruby --version
ruby 2.3.3p222 (2016-11-21 revision 56859) [x64-mingw32]
It seems that it appears if README.md has the following content
# raisercostin's blog
It seems that it dissapears if README.md has the following content
# raisercostin's blog
My blog
It looks like a bug in the default and other themes.
Related
I wish to add Jekyll (only the blog portion) to my already existing website. I currently have this repo on my Github (https://github.com/TonyHoanTrinh/TonyHoanTrinh.github.io). Where I currently have a folder for Images. An index.html, main.js and style.css files.
My question is how would I be able to add the Jekyll blog portion to my website which already has a layout and theme?
I've been looking at several Jekyll tutorials but they have it start the project from the beginning using a theme and etc. I already have a website with a layout and styling from myself. But I wish to add the Jekyll blog portion to my website. I noticed an existing post on doing this but its from the context of config.yml and other files which I'm not sure pertains to my project.
My question is how would I be able to add the Jekyll blog portion to my website which already has a layout and theme?
With Jekyll you can do that very easily. Just follow these steps:
You can leave the static html files in the root (and subdirectories). They will not collide with Jekyll.
Create an empty _config.yml file in the root.
Create a layout your posts overview and for your single post layout in a _layouts folder in the root.
Create a _posts folder in the root and add your first file/blog post in this format: 2018-12-31-happy-new-year.md
Make sure the blog post (.md file) looks like this:
---
title: Happy New Year
---
Your content
Now run 'jekyll serve' from the command line in the root of your website. Jekyll (if installed correctly) will create a _site folder with the generated website (in plain HTML).
That is all! More info about setting up Jekyll can be found at the Jekyll website.
So I followed the guide on the Jekyll website by installing and running Jekyll (sure I don't have to post this here). And the site is up and running perfectly but for some reason I don't see the _layouts directory that's supposed to be there. In the pages I can see that it references some layouts i.e:
index.html
---
layout: default
---
<div class="home">
about.md
---
layout: page
title: About
permalink: /about/
---
This is the base Jekyll theme.
But when you look at the directory stucture of the project:
No layouts folder.. what's up with that? Everything works though. And it looks perfectly fine when run on localhost.
You must be running the recent Jekyll version 3.2, which introduces Gem based themes (from https://jekyllrb.com/docs/themes/):
Jekyll themes package layouts, includes, and stylesheets in a way that can be overridden by your site’s content.
The theme is set in _config.yml:
theme: minima
Initial files that were previously in _layouts, _includes, and _sass are now packaged with the theme.
Basically Jekyll wants you to use themes, so you can't see _layouts, _includes, _sass, _assets anymore.
To use previous behaviour simply copy from the gemfile:
open $(bundle show minima)
Copy the 4 folders into your jekyll directory
If you want the older style of Jekyll website directory which includes all the 4 folders then you can use this command :
jekyll new my-new-website-name --blank
I have done the same while creating a personal site.
i have been trying to create jekyll site and host on git-pages. Localy everything works fine. But on github-pages works only first pages and 10 newest blog post.
But after going to any of other pages like "Blogas" or "Straipniai" every link starts with 'localhost:4000' and naturaly breaks css, javascript...
And i am not sure where is problem, because everything is same even if i make change in /_includes/header.html site.url to site.baseurl.
Here is git-hub
And site
I think the problem is that you somehow have both a .md and an .html version of the same pages. The .html version you built locally and GH is preferring it. it has localhost in the urls so it won't work. Try deleting the .html files in those sub folders and see what happens. For example, delete the index.html file from invisibleghostt.github.io/blogas/ and see if that page is fixed.
No idea how you got those files in there, they should not be there.
Look, there are a few things you'd better fix on your _config.yml:
url: "http://codas.lt" # add the site url
gems: # remove `jekyll` from gems
- jekyll-sitemap
- jekyll-gist
- octopress
include: [".htaccess"] # remove this line (GitHub Pages does not support .htaccess)
The other thing is, you'll need to remove all the folders from the folder _posts, as explained here:
If you organized your categories as
/_posts/code/2008-12-24-closures.md, you will need to restructure your
directories to put the categories above the _posts directories, as
follows: /code/_posts/2008-12-24-closures.md.
You are probably working locally with a Jekyll version which diverges from GitHub Pages' (currently is Jekyll 3.0.3). That's why your site works locally and doesn't work there. To avoid that, build Jekyll with Bundler (a dependency manager). On this answer you can see how to do that, step-by-step.
Hope to have helped! :)
Note: If you get stuck in how to adapt your theme to work with GitHub Pages, you can try GitLab Pages, as you can easily set the Jekyll version you want to use to build your site. For example, this project builds the site with Jekyll 2.5.3.
I have just begun working with Jekyll and it seems like a really neat tool, however I cannot make highlighting to work. I would like to use 'rouge' highlighter for that purpose to use the same tool that will be later used by github pages - but when my pages are being served, they contain only raw code block.
I have no idea what I am doing wrong.
This are the steps that I am following:
I am following Jekyll Bootstrap Quick Start instructions to the letter Link
Running command jekyll serve works as expected, default website is served. No errors in command line.
I am installing rouge via gem install rouge
I have verified that rouge is installed by checking gem list
I am adding highlighter: rouge to _config.yml file (replacing the default pygments)
I have added to following section to markdown page:
``` csharp
public interface ITest : ITestKey
{
Task<string> SayHello(string name);
}
```
I have created css style file by running rougify style monokai > test.css command
I have added that style to served page
<link href="{{ ASSET_PATH }}/css/test.css" rel="stylesheet" type="text/css" media="all">
Now I would expect that the served page would contain code block with appropriate spans. That is not the case though - no errors or warning are thrown but the outcome of transformation is as follows:
<div class="highlighter-rouge">
<pre class="highlight">
<code>
public interface ITest : ITestKey
{
Task<string> SayHello(string name);
}
</code>
</pre>
</div>
Could anyone please help ?
First things first then.
1st. Run Jekyll trough Bundler, which is the most recommended method, specially when hosting on GitHub Pages.
To do that:
Open your terminal and type gem install bundler
Run bundle update in order to update all your local gems.
Add a Gemfile (without any extension) to your site root and inside it type:
source 'https://rubygems.org'
gem 'github-pages'
gem 'wdm'
Open the terminal and go to your project folder. Run bundle install.
This will make bundler install all gem dependencies for you. Adding the gem wdm will allow you to run everything properly on Windows. Bundler will create a file called Gemfile.lock where it's gonna be listed all the gems and dependencies used.
2nd. Don't leave blank spaces between ``` and the code language:
```cs
public interface ITest : ITestKey
{
Task<string> SayHello(string name);
}
```
3rd: Add GFM to your _config.yml by doing like this:
markdown: kramdown
kramdown:
input: GFM
4th: Serve Jekyll with bundler by this running this command: bundle exec jekyll serve --watch
Done! You should be ok then!
For this part:
I have created css style file by running rougify style monokai >
test.css command
I have added that style to served page
<link href="{{ ASSET_PATH }}/css/test.css" rel="stylesheet"
type="text/css" media="all">
I'm not sure what you're doing, so I'm not on the loop to guide you through.
Hope to have helped!
All right.
Turns out I was doing everything well...
However I was also using MetroUI Styling with default metro.js file included to website.
Turns out that default metroui script was breaking the formatting...
I'm new to Octopress. I created a custom about-me like page as the home page (source/index.md) and moved the default source/index.html to /source/blog/index.html.
In my Rakefile, I changed blog_index_dir from source to source/blog.
In source/blog/index.html I changed the reference to /archives to /blog/archives.
In source/_includes/custom/navigation.html I changed the links to Blog and Archives to /blog and /blog/archives.
I haven't deployed my site yet because I'm still working on it, but when I view it using rake watch and Pow, my posts show up in the sidebar under Recent Posts, but no posts show up in the Blog page.
The source code for my site is at https://github.com/benlindsay/blog
I forgot to change the line in _config.yml from
paginate_path: "posts/:num"
to
paginate_path: "blog/posts/:num". That fixed the problem.