# Jekyll
Recuerda que GitHub provee un servicio de Hosting de páginas estáticas (GitHub Pages (opens new window)) que se sirven mediante Jekyll.
# Content
- Pages (opens new window)
- Posts (opens new window)
- Front Matter (opens new window)
- Collections (opens new window)
- Page Sections in Jekyll - Separating Content from Layout (opens new window)
- Explain like I’m five: Jekyll collections (opens new window)
- Data Files (opens new window)
- Why I love Jekyll Data Files - Chen Hui Jing // JekyllConf 2019 (opens new window) YouTube
- Assets (opens new window)
- Static Files (opens new window)
# Site Structure
- Directory Structure (opens new window)
- Liquid (opens new window)
- Liquid Sandbox: You can test your Liquid code here. This sandbox only loads the default Liquid methods (opens new window)
- Variables (opens new window)
- Includes (opens new window)
- Layouts (opens new window)
- Permalinks (opens new window)
- Themes (opens new window)
- Pagination (opens new window)
# Tutorials
- Tutorials (opens new window)
- Video Walkthroughs (opens new window)
- Navigation (opens new window)
- Order of interpretation (opens new window)
- Custom 404 Page (opens new window)
- Convert an HTML site to Jekyll (opens new window)
- Using Jekyll with Bundler (opens new window)
# 404
See the 404 section in this notes
# The Jekyll Conference
- The free, online global conference for all things Jekyll (opens new window) Best Practices, Advanced Case Studies, The Future of Jekyll
# CloudCannon: The Cloud CMS for Jekyll
CloudCannon (opens new window) is cloud content management system and hosting provider for Jekyll websites. The way it works is this:
- A developer uploads a Jekyll site in the browser or syncs with GitHub, Bitbucket or Dropbox.
- CloudCannon builds the site, hosts it and
- provides an interface for non-technical people to update content.
# Editors
- Forestry (opens new window) is an editor-friendly interface over Git. This means that developers and editors can now use the same workflow and tool set.
# Themes
With gem-based themes, some of the site’s directories (such as the assets
, _layouts
, _includes
, and _sass
directories) are stored in the theme’s gem, hidden from your immediate view. Yet all of the necessary directories will be read and processed during Jekyll’s build process.
You can run bundle update <THEME>
, replacing <THEME>
with the theme name, such as minima
, to just update the theme gem:
~/.../sytws1920/apuntes(master)]$ bundle update jekyll-theme-midnight
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Using concurrent-ruby 1.1.5
...
Bundler attempted to update jekyll-theme-midnight but its version stayed the same
Bundle updated!
2
3
4
5
6
7
8
- Themes documentation (opens new window)
- Jekyll and Project Documentation Themes (opens new window)
- documentation-theme-jekyll (opens new window) Un tema muy interesante
# Converting a Jekyll Web Site to PDF
- Prince (opens new window)
- PDFKit (opens new window)
- GitHub repo wkhtmltopdf: Convert HTML to PDF using Webkit (QtWebKit) (opens new window) see https://wkhtmltopdf.org (opens new window)
# Blog: A Collection of Music Albums
- How to maintain a collection of music albums online, using Jekyll and Github Pages (opens new window). See it at http://adrienjoly.com/album-shelf/ (opens new window)
# React and Jekyll
- A npm package providing a Jekyll Boilerplate with React using Webpack (opens new window) (Not supported by GitHub Pages)
# Auth and Jekyll
# E-commerce
- Jekyll E-Commerce Tutorial: Add a Shopping Cart to Your Static Website (opens new window) 2019
- Headless E-Commerce: What, Why, & How (Tools Included) (opens new window) 2018
- GitHub repo:A Jekyll based shopping cart built with simpleCart(js) (opens new window)
- Jekyll Cart Demo (opens new window) Video en YouTube
# Developing
"
This is a common problem between different Jekyll environments.
# Some explanations
We need to understand site.url
and site.baseurl
and in which situation we need them. Those variables don't serve the same purpose.
# site.url
By default, this variable is only used in page head for the canonical
header and the RSS link
. It's also used in the xml feed to point to site resources as the software that will manage this feed doesn't know resource's urls.
This variable is only necessary for external systems.
# site.baseurl
This variable indicates the root folder of your Jekyll site. By default it is set to ""
(empty string). That means that your Jekyll site is at the root of http://example.com
.
If your Jekyll site lives in http://example.com/blog
, you have to set site.baseurl
to /blog
(note the slash). This will allow assets (css, js) to load correctly.
See how assets are loaded in you head :
<link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl }}">
that can also be :
<link rel="stylesheet" href="{{ site.baseurl }}/css/main.css">
# Working in different environments
Now you have to test your site locally and to deploy it in production. Sometimes, the baseurl
is different and the jekyll build
may not work out of the box in one of those environment.
Here we have two solutions :
# Use jekyll serve
Let's imagine that your site lives in a github repository and is served at https://username.github.io/myProject
.
You can setup the baseurl
to /myProject
. and test your site locally with jekyll serve
, your site will be served at http://127.0.0.1:4000/myProject/
# Use multiple configuration files
If, for one reason or another, you cannot use jekyll serve
, you can set a configuration file for both environment and jekyll build
depending on where you are deploying.
Let's say we have the local site served at http://localhost
and the production site served at https://username.github.io/myProject
.
We leave the _config.yml
with url: https://username.github.io
and baseurl: /myProject
We create a new _config_dev.yml
with only url: https://localhost
and baseurl: ""
Now to test locally :
jekyll build --config _config.yml,_config_dev.yml
or
jekyll build --config _config.yml,_config_dev.yml --watch
When pushed on production, the jekyll build
command will use the default _config.yml
.
# Testing
# Jekyll as a Web Service
# Maths y Jekyll
- Adding MathJax to a GitHub Pages Jekyll Blog (opens new window)
- Apuntes de AET. Código de inserción de
usando MathJaX (opens new window)
# Cursos en YouTube de Jekyll and NetlifyCMS por Thomas Bradley
- Jekyll (opens new window)
- Jekyll + NetlifyCMS (opens new window) 14 Youtube videos
- Jekyll + Patternbot (opens new window)