Blog posts are not showing in Jekyll? - ruby

I have created a blog using Jekyll now theme. And I've created repo in github to publish the blog. But the posts are not showing in github pages.
repo: https://github.com/mubumbz/blog
blog: http://mubumbz.github.io/blog/

In my case the blog post time was a future date (due to timezone mismatch) hence it was not published though _posts folder had my markdown file
executing 'jekyll build' will give the same message
sachinms#MS:/my-new-blog/my-personal-blog$ jekyll build
Configuration file: /my-new-blog/my-personal-blog/_config.yml
Theme Config file: /home/sachinms/gems/gems/jekyll-theme-chirpy-4.0.1/_config.yml
Source: /my-new-blog/my-personal-blog
Destination: /my-new-blog/my-personal-blog/_site
Incremental build: disabled. Enable with --incremental
Generating...
Skipping: _posts/2021-07-17-Minimal-API-ASPNET-6.md has a future date
done in 0.38 seconds.
Auto-regeneration: disabled. Use --watch to enable.

you must post added _post directory and post name must be year-mouth-day-post_name.md format
after on the blog main directory run command bundle exec jekyll build or jekyll build and push remote repo.

Related

Minima theme build shows "Liquid Exception: Invalid syntax for include tag. File contains invalid characters or sequences"

Here's a link to my website Facey's Thoughts and here's a link to the GitHub Pages project.
Cloning the (working) repository to my local machine and trying to run jekyll build fails with this error:
Liquid Exception: Invalid syntax for include tag. File contains invalid characters or sequences: social-icons/.svg Valid syntax: {% include file.ext param='value' param2='value' %} in assets/minima-social-ico.html
The Jekyll version is still the same as what's specified in my Gemfile:
jekyll 4.3.1. I have no idea what's changed.
I've tried removing the minima-social-ico.svg file; I've tried removing the posts that I was trying to add; I've tried searching Online for something similar to this issue without luck.
I tried jekyll build with local files, cloning my GitHub pages repo to a new directory, and that repo for sure built last night, and I've tried removing any new .markdown files that I made since the last time it successfully built.
I tried the following:
If I comment out social_links from my _config.yml file, it will build, I assume because it's not using the minima_social_icons.svg file. Why did it work and now it doesn't?
The problem is more with using the remote theme without locking to a specific commit/tag. (Since the v3.0 is still in development, any breaking change added to the main branch will break the build as well, if we refer to the latest changes always.)
One can lock to a specific commit/tag as: (in _config.yml file)
remote_theme: jekyll/minima#<insert-commit-hash_or_tag>
This time the breaking change was #686. Using social links more explicitly, as mentioned by Yshmarov should resolve the issue.
minima:
social_links:
- { platform: github, user_url: "https://github.com/jekyll/jekyll" }
- { platform: twitter, user_url: "https://twitter.com/jekyllrb" }
Updating social links to be more explicit solved it for me:
social_links:
- { platform: rss, user_url: "/feed.xml" }
- { platform: github, user_url: "https://github.com/yshmarov/" }
- { platform: twitter, user_url: "https://twitter.com/yarotheslav" }
- { platform: linkedin, user_url: "https://www.linkedin.com/in/yshmarov/" }

Kitty image is missing in 'Welcome to Jekyll' post but shown at index.md and about.md

My goal is to display an image in posts using Jekyll + Github Pages. I ran into 404 error and the image did not show. My repo is at https://github.com/kuolai/blogubb. The site is at https://kuolai.github.io/blogubb. If you go to the site, you will see a kitty image at the home page. But if you go to the post Welcome to Jekyll, there is no image!!
Steps I did to create remote repo and the site:
gihub.com/new to create a remote repo
The local repo was created with jekyll new blogubb
_config.yml with one line change `baseurl: "blogubb"
The photo is a cute kitty stored in assets/img/kitty.png
The only post, the default post, 2021-11-13-welcome-to-jekyll.markdown, with one line added ![](/assets/img/kitty.png)
git checkout -b "gh-pages"
git remote add origin .../blogubb.git
git push origin gh-pages
Other than kitty image not shown in Welcome to Jekyll post, everything looks good.
I also tried
localhost:4000, and it worked
![](/assets/img/kitty.png) at home page index.markdown, and it worked
![](/assets/img/kitty.png) at about page about.markdown, and it worked
even https://github.com/kuolai/blogubb/blob/gh-pages/_posts/2021-11-13-welcome-to-jekyll.markdown worked at repo
The error message from the console of Chrome DevTools:
GET https://kuolai.github.io/assets/img/kitty.png 404
welcome-to-jekyll.html:50
To make a minimum case, I was able to re-create the problem with minimal lines of changes. Please help.
I solved it. Replace
![](/assets/img/kitty.png)
with
![]({{"/assets/img/kitty.png" | relative_url }} )
The document of Liquid Filters is in https://jekyllrb.com/docs/liquid/filters/

Github pages : build failed => how to debug?

I have a message from github telling me that my page build failed.
Without any more information. :(
Of course I have read this page...
But how can I have more info on what's going wrong?
It builds really fine locally:
jekyll build
Configuration file: /srv/jekyll/_config.yml
Source: /srv/jekyll
Destination: /srv/jekyll/_site
Incremental build: disabled. Enable with --incremental
Generating...
Building site for default language: "fr" to: /srv/jekyll/_site
Loading translation from file /srv/jekyll/_i18n/fr.yml
GitHub Metadata: No GitHub API authentication could be found. Some fields may be missing or have incorrect data.
Building site for language: "en" to: /srv/jekyll/_site/en
Loading translation from file /srv/jekyll/_i18n/en.yml
Build complete
done in 1.265 seconds.
Auto-regeneration: disabled. Use --watch to enable.
Here's my _config.yml:
title: My site
description: My description
email: email#example.com
baseurl: "" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site, e.g. http://example.com
twitter_username: example
github_username: example
# Build settings
markdown: kramdown
theme: minima
plugins:
- jekyll-feed
- jekyll-multiple-languages-plugin
- jekyll-redirect-from
languages: ['fr', 'en']
exclude_from_localizations: ['assets', 'CNAME']
defaultLang: fr
languageNames:
fr: Français
en: English
it: Italiano
Any tip?
Cheers
The plugin jekyll-multiple-languages-plugin is not supported by GitHub Pages.
Test if your site builds fine locally with github-pages gem instead of jekyll gem

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.

root command not found

I'm trying to setup a blog using octopress by following this guide. I'm stuck at the step where I do
root: /octopress
and my terminal shows
bash: root:: command not found
My echo PATH output
/Users/aniruddhabarapatre1/.rvm/gems/ruby-2.1.1/bin:/Users/aniruddhabarapatre1/.rvm/gems/ruby-2.1.1#global/bin:/Users/aniruddhabarapatre1/.rvm/rubies/ruby-2.1.1/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/local/MacGPG2/bin:/Users/aniruddhabarapatre1/.rvm/bin
This should be an edit in a file _config.yml, not a command:
modify _config.yml
root: /octopress #this is important since we intend the blog to be project page, instead of organization page
So you must edit that _config.yml file to add/modify that line.

Resources