Settings that affect your entire site can be changed in Jekyll’s configuration file: _config.yml
, found in the root of your project. If you don’t have this file you’ll need to copy or create one using the theme’s default _config.yml
as a base.
Note: for technical reasons, _config.yml
is NOT reloaded automatically when used with jekyll serve
. If you make any changes to this file, please restart the server process for them to be applied.
Take a moment to look over the configuration file included with the theme. Comments have been added to provide examples and default values for most settings. Detailed explanations of each can be found below.
Site settings
Site URL
The base hostname and protocol for your site. If you’re hosting with GitHub Pages this will be something like url: "https://dexfolio.github.io"
or url: "https://dexfolio.com"
if you have a custom domain name.
GitHub Pages now forces https://
for new sites so be mindful of that when setting your URL to avoid mixed-content warnings.
Note: Jekyll 3.3 overrides this value with url: http://localhost:4000
when running jekyll serve
locally in development. If you want to avoid this behavior set JEKYLL_ENV=production
to force the environment to production.
{: .notice–warning}
Site base URL
This little option causes all kinds of confusion in the Jekyll community. If you’re not hosting your site as a GitHub Pages Project or in a subfolder (eg: /blog
), then don’t mess with it.
For more information on how to properly use site.url
and site.baseurl
as intended by the Jekyll maintainers, check Parker Moore’s post on the subject.
Note: When using baseurl
remember to include it as part of your path when testing your site locally. Values of url:
and baseurl: "/blog"
would make your local site visible at http://localhost:4000/blog
and not http://localhost:4000
.
Reading files
Nothing out of the ordinary here. include
and exclude
may be the only things you need to alter.
Conversion and Markdown processing
Again nothing out of the ordinary here as the theme adheres to the defaults used by GitHub Pages. Kramdown for Markdown conversion, Rouge syntax highlighting, and incremental building disabled. Change them if you need to.
Front Matter Defaults
To save yourself time setting Front Matter Defaults for posts, pages, and collections is the way to go. Sure you can assign layouts and toggle settings like reading time, comments, and social sharing in each file, but that’s not ideal.
Using the default
key in _config.yml
you could set the layout and enable author profiles, reading time, comments, social sharing, and related posts for all posts — in one shot.
defaults:
# _posts
- scope:
path: ""
type: posts
values:
layout: post
Pages Front Matter defaults can be scoped like this:
defaults:
# _pages
- scope:
path: ""
type: pages
values:
layout: page
And collections like this:
defaults:
# _portfolio
-
scope:
path: ""
type: "portfolio"
values:
layout: "portfolio-details"
And of course any default value can be overridden by settings in a post, page, or collection file. All you need to do is specify the settings in the YAML Front Matter. For more examples be sure to check out the demo site’s _config.yml
.
Outputting
The default permalink style used by the theme is permalink: /:categories/:title/
. If you have a post named 2016-01-01-my-post.md
with categories: foo
in the YAML Front Matter, Jekyll will generate _site/foo/my-post/index.html
.
Note: If you plan on enabling breadcrumb links — including category names in permalinks is a big part of how those are created.
Paginate
If using pagination on the homepage you can change the amount of posts shown with:
paginate: 5
You’ll also need to include some Liquid and HTML to properly use the paginator, which you can find in the Layouts section under [Home Page]({{ “/docs/layouts/#home-page” | relative_url }}).
The paginator only works on files with name index.html
. To use pagination in a subfolder — for example /recent/
, create /recent/index.html
and set the paginate_path
in _config.yml
to this:
paginate_path: /recent/page:num/
Please note: When using Jekyll’s default pagination plugin paginator.posts
can only be called once. If you’re looking for something more powerful that can paginate category, tag, and collection pages I suggest jekyll-paginate-v2.
Disqus Comments
Disqus is integrated in Dexfolio but is set to disabled for demo.
Change the shortname:
value to your disqus shortname and set enable:
to true
to enable it on site.
disqus:
enable: false # disque is enabled. Set as false to disable it
# Leave shortname blank to disable comments site-wide.
# Disable comments for any post by adding `comments: false` to that post's YAML Front Matter.
shortname: dexfolio
That’s all what you need to setup Disqus from the theme side. If you get any issue regarding that comments are unable to load. First make sure you have registered your website with Disqus (Step 1)
And also check Disqus troubleshooting guide if you still have issues.
Google Map Settings
Goto Google Map Embed search your location get html code and replace the value of code:
.
If you would like to disable google maps
than set value of enable:
to false
and for enabling it set the value to true
.
google_maps:
enable: true #for disabling google maps set vaue to false
code: '<iframe width="600" height="500" id="gmap_canvas" src="https://maps.google.com/maps?q=%2016122%20Collins%20St&t=&z=9&ie=UTF8&iwloc=&output=embed" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"></iframe>'
Plugins
When hosting with GitHub Pages a small set of gems have been whitelisted for use. The theme uses a few of them which can be found under gems
. Additional settings and configurations are documented in the links below.
Plugin | Description |
---|---|
jekyll-paginate | Pagination Generator for Jekyll. |
jekyll-sitemap | Jekyll plugin to silently generate a sitemaps.org compliant sitemap for your Jekyll site. |
jekyll-feed | A Jekyll plugin to generate an Atom (RSS-like) feed of your Jekyll posts. |
If you’re hosting elsewhere then you don’t really have to worry about what is whitelisted as you are free to include whatever Jekyll plugins you desire.
Note: The jekyll-include-cache plugin needs to be installed in your Gemfile
and added to the plugins
array of _config.yml
. Otherwise you’ll throw Unknown tag 'include_cached'
errors at build.