Why is my completely new Jekyll blog blank when I add the supported Hacker theme? - jekyll

I am trying to get started with a Jekyll blog. I followed these instructions to setup the blog using the default minima theme. This actually worked without any problems, but I wanted to change to the Hacker theme. To do that it simply asks for the following changes to me _config.yml:
remote_theme: pages-themes/hacker#v0.2.0
plugins:
- jekyll-remote-theme # add this line to the plugins list if you already have one
After making these changes I went to the URL https://galenseilis.github.io/ where I see that nothing renders anymore.
The current state can be observed at https://github.com/galenseilis/galenseilis.github.io, but everything should be the default values except where I made changes to the Gemfile and _config.yml. But since I may change the content of the repo as I troubleshoot, so here is a snapshot of these files:
Gemfile
source "https://rubygems.org"
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
# gem "jekyll", "~> 4.3.2"
# This is the default theme for new Jekyll sites. You may change this to anything you like.
# gem "minima", "~> 2.5"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.12"
end
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
platforms :mingw, :x64_mingw, :mswin, :jruby do
gem "tzinfo", ">= 1", "< 3"
gem "tzinfo-data"
end
# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]
# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
# do not have a Java counterpart.
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]
_config.yml
title: Your awesome title
email: your-email#example.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: "" # the base hostname & protocol for your site, e.g. http://example.com
twitter_username: jekyllrb
github_username: jekyll
# Build settings
# theme: minima
# theme: jekyll-theme-hacker
remote_theme: pages-themes/hacker#v0.2.0
plugins:
- jekyll-feed
- jekyll-remote-theme
Reverting the recommended changes for the Hacker theme back to the original state using minima theme returns the rending of the page. So maybe the changes I have made are insufficient if not incorrect somehow?

Related

Running Jekyll Blog on Windows Hosts at http://127.0.0.1:4000C:/Program Files/Git/blog/

I created a new blog using Jekyll and would like to host it on GitHub Pages. Before I push the changes, I want to preview the site locally on a Windows 10 box. The problem is Jekyll is hosting index.html under the URL http://127.0.0.1:4000C:/Program Files/Git/blog/ and the assets under http://127.0.0.1:4000/assets. For some reason it is appending C:/Program Files/Git to the path for index.html.
I expect it to host under http://127.0.0.1:4000/blog. Any ideas as to what I'm doing wrong?
See the Bash output below. Notice the server address and the errors attempting to download assets.
_config.yml
title: Testing 123
email: testing123#gmail.com
description: >- # this means to ignore newlines until "baseurl:"
Blog Description
baseurl: "" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site, e.g. http://example.com
twitter_username: testing123
github_username: testing123
show_downloads: false
google_analytics: UA-00000000-1
repository: joebuschmann/joebuschmann.github.io
# Build settings
theme: jekyll-theme-minimal
plugins:
- jekyll-feed
Gemfile
source "https://rubygems.org"
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
#gem "jekyll", "~> 4.0.0"
# This is the default theme for new Jekyll sites. You may change this to anything you like.
#gem "minima", "~> 2.5"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.12"
end
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
install_if -> { RUBY_PLATFORM =~ %r!mingw|mswin|java! } do
gem "tzinfo", "~> 1.2"
gem "tzinfo-data"
end
# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.1", :install_if => Gem.win_platform?

Deploying jekyll app on Cloudcannon fails

I am trying to deploy my jekyll app on the Cloudcannon CMS platform for Jekyll, but my build fails with this output:
Syncing raw files... done
Checking existing local bundle state... failed
Loading gem cache...
Checking gem cache (bundle_cache/Jw8rkIm9v3Cmawv2raEpkN96fz3R5X1Q_XMn7xpGB1s.zip)... no cache
$ export JEKYLL_ENV="production"
$ ruby -v
ruby 2.3.8p459 (2018-10-18 revision 65136) [x86_64-linux]
$ bundle version
Bundler version 2.0.1 (2019-01-04 commit d7ad2192f)
$ bundle config --global jobs 4
Configured concurrent installs!
$ bundle install
Using local cacheable path...
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
jekyll-feed-0.12.0 requires ruby version >= 2.4.0, which is incompatible with
the current version, ruby 2.3.8p459
What am I doing wrong and how can I update the ruby version correctly?
My Gemfile looks like this:
source "https://rubygems.org"
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
gem "jekyll", "~> 3.8.5"
# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima", "~> 2.0"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-feed", "~> 2.4.0"
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.0" if Gem.win_platform?
I tried to change the jekyll-feed version and bundle it again but it gave me the same results and I don't want to remove that plugin because I need it.
The issue could be from your Gemfile.lock.
The latest version of jekyll-feed is 0.12.1
Correct your Gemfile to point to any version of jekyll-feed greater than or equal to 0.12.0:
gem "jekyll-feed", "~> 0.12"
The run bundle update so that the new version is installed and included in your Gemfile.lock
Then commit and push your updated Gemfile and the Gemfile.lock into your remote repository.
Jordan from CloudCannon here.
ashmaroli is correct, you're referencing an invalid version number for jekyll-feed. Following ashmaroli's steps should resolve the problem.
As a side note, we'll be adding support for multiple Ruby versions within the next month or two. This will resolve any future incompatibilities with plugins that require a later version of Ruby.
If you have any more questions feel free to contact us, we're more than happy to help :)

How do I install one of Github Pages' Jekyll themes for local preview?

I'm trying to install Github Pages' Slate theme on my CentOS 7 VM so I can locally preview my new site using the bundle exec jekyll serve command.
I followed the instructions as best as I could.
I changed the theme minima to jekyll-theme-slate in my _config.yml file.
Then I changed gem "minima", "~> 2.0" to gem "github-pages", group: :jekyll_plugins in my Gemfile file.
After that (since these are their only instructions), I ran bundle exec jekyll serve and it told me I had gems that weren't installed (duh), and suggested running bundle install.
I ran bundle install, which told me there was a conflict in version types of the dependencies and it suggested that bundle update could potentially resolve that issue.
No problem, I ran bundle update. A few plugins/features actually reverted versions here, but I got the Slate theme installed on my machine now, version 0.0.4 for whatever reason.
After that, I ran bundle exec jekyll serve again. I got this error:
Configuration file: /home/peri/my-site/_config.yml
Configuration file: /home/peri/my-site/_config.yml
jekyll 3.4.3 | Error: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
In a way, that error makes sense. For a custom theme to work, I probably need a tool to run their custom scripts. But first, I noticed this extra section in the theme's installation instructions, which directly mentions being able to locally preview the site with that theme.
I downloaded the source, instead of cloning it...I don't need the .git stuff do I?
I edited the script/bootstrap file because /usr/local requires root and using sudo doesn't know about any binary called gem or bundle. I changed gem and bundle to their respective absolute paths and ran sudo ./script/bootstrap inside of slate-master.
Point of the story is, it didn't work for my home/peri/my-site directory when I ran bundle exec jekyll serve. Presumably, it's because they intended for the user's site to be integrated into their theme's source code? That doesn't seem intuitive or correct. So, I investigated ExecJS.
I installed it. gem install execjs
I added gem "execjs", "2.7.0" to my Gemfile file.
Got the same error as before.
How am I supposed to install this Jekyll theme?
Follow these steps after changing the theme in _config.yml:
Gemfile should have only this content:
source "https://rubygems.org"
gem "github-pages"
remove bundler current config: rm -r .bundle/
remove Gemfile.lock: rm Gemfile.lock
Install local dependencies in an isolated folder just for this website: bundle install --path=vendor/bundle
You won't have post and page and home themes, you will need to use just default in all your posts.
Generate and run server: bundle exec jekyll s

Jekyll generator not loaded

I currently experienced an issue with Jekyll generators. Just implemented one regarding AMP. So I placed it inside the _plugins folder, and named it amp_generate.rb.
Tried to add some puts 'foo' but nothing on my terminal...
Giving a look at jekyll serve -V, it seems the generator never appears...
Any idea? Here is the source code : https://github.com/tiste/www
You're running in safe: true mode (like on github pages) because gem 'github-pages', group: :jekyll_plugins instruct jekyll to run in github pages context.
Simply change to gem 'github-pages'.
You can even simplify your Gemfile to be :
source 'https://rubygems.org'
ruby RUBY_VERSION
gem 'github-pages'

Heroku doesn't get local changes in CSS

I have weird problem.
My heroku app doesn't get local changes from CSS.
But it gets all changes from .html.erb files.
For example: If I write body {background:black!important } in custom.css, background will be black only locally and will be normal in heroku app.
But If I write body style="background:black} in .html.erb file, I will get changes.
What do I do?
Do you need my gem or CSS or SCSS files?
My Gemfile
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.5.1'
# Use sqlite3 as the database for Active Record
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'devise'
gem 'jquery-turbolinks', '~> 2.1'
gem "rest-client"
gem 'will_paginate'
gem 'bootstrap-will_paginate'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :production do
gem 'pg', '0.15.1'
gem 'rails_12factor', '0.0.2'
gem 'heroku-deflater'
# gem 'unicorn'
end
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
gem 'sqlite3'
# Use SCSS for stylesheets
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
My production.rb file
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web servers
# and those relying on copy on write to perform better.
# Rake tasks automatically ignore this option for performance.
config.eager_load = true
# Full error reports are disabled and caching is turned on.
config.consider_all_requests_local = true
config.action_controller.perform_caching = true
# Enable Rack::Cache to put a simple HTTP cache in front of your application
# Add `rack-cache` to your Gemfile before enabling this.
# For large-scale production use, consider using a caching reverse proxy like
# NGINX, varnish or squid.
# config.action_dispatch.rack_cache = true
# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
# config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = true
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
# yet still be able to expire them through the digest params.
config.assets.digest = true
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
# Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
config.force_ssl = false
# Use the lowest log level to ensure availability of diagnostic information
# when problems arise.
config.log_level = :debug
# Prepend all log lines with the following tags.
# config.log_tags = [ :subdomain, :uuid ]
# Use a different logger for distributed setups.
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
# Use a different cache store in production.
# config.cache_store = :mem_cache_store
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = 'http://assets.example.com'
# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify
# Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new
# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false
end
application.css
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any styles
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope.
*
*= require bootstrap
*= require_tree .
*= require_self
*= require_custom
*/
By the way, I deleted gem 'sass-rails', '~> 5.0' in gemfile and it started working. But It is weird, so I am interested to know what is the problem.
Run RAILS_ENV=production bundle exec rake assets:precompile to precompile your assets before uploading your app to Heroku.