Jekyll Install and Blogging Notes
Ubuntu 20.04 Install Notes
Jekyll Install
GitHub Pages
- create new repo w/ README.md
- change settings
-
- GitHub Pages
-
- Source: Branch:
main
Folder:/ (root)
- Source: Branch:
-
- Save
- Mastering GitHub Markdown
GitHub + Jekyll
- git clone https://url/…/blog.git
- cd blog
- jekyll new . –force
- bundle exec jekyll serve –host=0.0.0.0 –livereload
Config
- Modify
_config.yml
: title, description, baseurl, url, etc. - Modify
Gemfile
: -
- remove this line:
gem "jekyll"...
- remove this line:
-
- uncomment this line:
gem "github-pages"...
- uncomment this line:
Ruby Gems
- After the
Gemfile
is modified, run these commands: -
- bundle update
-
- bundle install
-
- To rebuild the sitr:
bundle exec jekyll build
- To rebuild the sitr:
Modifying the Theme
-
- Location of Theme listed in
_config.yml
:bundle info --path minima
- Location of Theme listed in
-
- Copy that subdirectory’s
_layout
folder to underneath the currentblog
folder.
- Copy that subdirectory’s
-
-
- This will override the theme’s defaults.
-
-
-
- Ex:
~/gems/gems/minima-2.5.1$ cp -av _layouts/ ~jftuga/blog/
- Ex:
-
-
- The same can be done with the other folders:
_includes
,_sass
, andassets
- The same can be done with the other folders:
-
-
- Once this is done, you can remove this line from your
_config.yml
file:theme: minima
- Once this is done, you can remove this line from your
-
-
-
- You also need to remove this line from your
Gemfile
file:gem "minima", "~> 2.5"
- You also need to remove this line from your
-
-
- You will now need to rerun:
bundle update
- You will now need to rerun:
-
- Followed by:
bundle exec jekyll serve --host=0.0.0.0 --livereload --incremental
- Followed by:
Redirection
- To rediect
https://username.github.io
tohttps://username.github.io/blog/
, see the following instructions: - Redirecting GitHub Pages
- You should also set the Jekyll theme to
jekyll-theme-minimal
in the_config.yml
file
Running locally on Raspberry Pi 3 with Buster
- Installing Jekyll on a Raspberry Pi
-
- Updated the ruby version to
2.6.6
in this file: install_ruby_rpi.sh
- Updated the ruby version to
- Fix for this error:
Conversion error: Jekyll::Converters::Scss encountered an error while converting 'assets/css/styles.scss':
Invalid US-ASCII character "\xE2" on line 3
1) Add this to your _config.yml
file:
2) encoding: utf-8
3) Remove or replace all non-ascii characters in your blog by running:
4) grep --color='auto' -P -n "[\x80-\xFF]" *
5) Follow these instructions to change the locale
:
# Install program to configure locales
RUN apt-get install -y locales
RUN dpkg-reconfigure locales && \
locale-gen C.UTF-8 && \
/usr/sbin/update-locale LANG=C.UTF-8
# Install needed default locale for Makefly
RUN echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen && \
locale-gen
# Set default locale for the environment
ENV LC_ALL C.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
6) You may need to reboot after making this change.
7) Now, you should be able to run:
8) bundle exec jekyll serve --host=0.0.0.0 --livereload --incremental --verbose
Original Post Below
You’ll find this post in your _posts
directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run jekyll serve
, which launches a web server and auto-regenerates your site when a file is updated.
Jekyll requires blog post files to be named according to the following format:
YEAR-MONTH-DAY-title.MARKUP
Where YEAR
is a four-digit number, MONTH
and DAY
are both two-digit numbers, and MARKUP
is the file extension representing the format used in the file. After that, include the necessary front matter. Take a look at the source for this post to get an idea about how it works.
Jekyll also offers powerful support for code snippets:
Check out the Jekyll docs for more info on how to get the most out of Jekyll. File all bugs/feature requests at Jekyll’s GitHub repo. If you have questions, you can ask them on Jekyll Talk.