
Using Jekyll and GitHub Pages - pulkitsh1234
https://pulkitsharma07.github.io/2017/09/23/using-jekyll-and-github-pages/
======
geraldbauer
FYI: You can find more than 200+ (free, open source) ready-to-fork (use)
Jekyll themes on Dr Jekyll's [1]. PS: Dr Jekyll's itself is an (open source)
Jekyll site on GitHub Pages. Happy Jekylling. [1]
[https://drjekyllthemes.github.io](https://drjekyllthemes.github.io)

------
robinwassen
Last time I tried GitHub Pages it got stuck in cache for several hours, could
not get the article to update.

So switched to Netlify ([https://www.netlify.com](https://www.netlify.com))
which took about 15 minutes to setup for Jekylll, custom domain and SSL. Was a
relief to be in control again.

~~~
ryaneager
This sounds suspiciously like an ad...

~~~
onion2k
I use Netlify. It's _very_ good.

~~~
prophesi
Yeah, I'm a fan. I used their Netlify-CMS, and fell in love. You can either
have them host your site wherein they put all your static assets on cloudfare,
or self-host it all and set up the git push scripts yourself. I went with the
latter method and set up a service worker to cache most of the site.

The result is a lightning fast static site with dynamic content that is easy
for a non-developer to use!

------
wazanator
For anyone looking to learn how to use Jekyll Cloud Cannon[1] has a really
well made set of tutorials and some nice looking free themes.

Personally I would skip GitHub and just put it up on a cheap vps, you can set
it up to auto compile on a git push like GitHub as well. [2]

[1][https://learn.cloudcannon.com](https://learn.cloudcannon.com)
[2][https://www.digitalocean.com/community/tutorials/how-to-
set-...](https://www.digitalocean.com/community/tutorials/how-to-set-up-a-
jekyll-development-site-on-ubuntu-16-04)

------
JetSpiegel
Instead of committing generated HTML to a git repo, you could use GitLab Pages
and use any static site generator and run any custom scripts you like. They
run commands on a container, you are not restricted to the blessed GitHub
choices.

~~~
amenghra
If you want something similar for GitHub, you can probably combine GitHub +
Travis.

You can set things up so Travis has a bunch of encrypted variables and can
push to your github.

------
_asummers
I've started playing around with using Firebase to host static sites. The free
tier is pretty generous, and I won't exceed any of those restrictions anytime
soon. SSL by default, custom domains, etc. are pretty nice. It's a Google
product now, so do with that what you will, but setup was really
straightforward.

~~~
rockostrich
I haven't used Firebase since before they were acquired by Google. Have they
added features that allow you to serve web pages? Do you have some sort of UI
set up to manage it or do you just manually update Firebase?

~~~
soneca
I'm also curious on your (GP's) set up

~~~
_asummers
Replied to your parent.

------
siegecraft
Unless Jekyll has changed a lot, using themes is a major pain. Since Jekyll
doesn't enforce any particular structure, there's no way to have drop-in
themes. Using a new theme is really about cloning a theme and then re-writing
your site to hopefully make use of it. Or pick at bits and pieces you like and
make your own custom theme.

------
hobarrera
I'm amazed there's no mention of GitLab's Pages. They seem to be quite
superior in this aspect.

You can just configure CI to run any arbitrary script(s), and publish the
resulting files. This also includes Jekyll (which is trivial to set up), but
also other much complex scenarios.

------
a9t9
Another Jekyll advantage: Jekyll it makes it easy to host a blog under your
main domain.com/blog, without the need to use a subdomain, without the need to
fiddle with Wordpress and without the need to switch your whole website to a
(new) CMS. This is a huge timesaver (We use it at
[https://a9t9.com/blog](https://a9t9.com/blog) and a very happy with it.)

According to the SEO Guru(s), this brings a SEO advantage
[https://moz.com/community/q/moz-s-official-stance-on-
subdoma...](https://moz.com/community/q/moz-s-official-stance-on-subdomain-vs-
subfolder-does-it-need-updating)

------
edem
I don't see why this is a problem. I don't use themes at all and I have my own
look and feel. If you check the docs you will see that overriding the default
theme is oretty straightforward.

------
chrsstrm
Unless I'm mistaken, it seems the author missed this short paragraph in the
docs:

 _With a clear understanding of the theme’s files, you can now override any
theme file by creating a similarly named file in your Jekyll site directory._

So the gem is the base theme and you overwrite any of those theme files by
inserting a same-named file in the same dir structure in your project root.
I've haven't jumped to Jekyll 3 yet but if I'm reading this correctly, this
doesn't seem like that big of a deal.

~~~
pulkitsh1234
Yes I'm aware of that :-) It's mentioned here too :
[https://jekyllrb.com/docs/themes/#converting-gem-based-
theme...](https://jekyllrb.com/docs/themes/#converting-gem-based-themes-to-
regular-themes) In fact, I have added that as an update on the post too.

I can't see why someone should use gem-based themes, when eventually they'll
need to dump the entire code into the Jekyll project.

~~~
chrsstrm
Except you don't drop the entire theme code into your project, just the pieces
you want to overwrite. I have to believe here that the idea was to make themes
extendable, not customizable (in the way previous Jekyll themes operated).
This feels very similar to the concept of a child theme in WordPress, which
simply extends the parent theme. Since we're just extending the parent theme
and not editing those files, sure, put them in a gem and let me leave them out
of my repository. Now you're only tracking the delta of your changes, not the
whole theme. When done correctly, this should also let you more easily swap
out the parent theme to something different while maintaining your changes
with minimal effort.

Again, I haven't played with this yet, but the more I think about it the more
it makes sense and I'm kind of looking forward to porting a few of the sites I
manage.

------
spinningarrow
> I have seen some repositories where people have written Travis jobs to do
> this exact thing. I feel that is an overkill, a slow process and downright
> exploitation of a free service

Is the “exploitation of a free service” part valid?

~~~
Sir_Cmpwn
No, it's nonsense. This sort of thing is what Travis is designed to do.

------
AdrianRossouw
part of the point of jekyll to me is being in control of all the markup on the
page, which is why the idea of using a theme goes against how I would use it.

------
enriquto
I never understood the purpose of those "static page generators". The only
thing they really do is add a html header to your text? Honestly, for all that
hassle I prefer to copy-paste manually a few lines of html every time that I
write a new file, and that's it.

~~~
antigirl
and footer and sidebar and other 'components'.

~~~
JorgeGT
They do much more: primarily, they translate from markdown to HTML. This is,
you don't write your content in HTML, you write it in a markup language that
the static generator converts in an HTML document. Then, they can manage tags,
paginating, menu structures, etc.

For instance, you can write

> {% note %} Something I want to emphasize {% endnote %}

And this will be converted by the generator into a properly-styled <div>
according to your theme. If you change the theme, another run of the generator
will convert the note to a different style, without you needing to change your
content.

~~~
enriquto
but that's exactly the purpose of HTML and CSS

    
    
          an <em> emphasized </em> word
    

and then you style the tag however you want. You just change the .css file, no
need to rerun anything.

~~~
JorgeGT
In that example yes, but if I put {% author %} Name {% author %}, a static
build system can put the author name centered in the top of the page, or in a
signature at the bottom, or in a floating div on the sidebar, or...

In your HTML document, you would need to change the structure manually for
each content file, of which you can have thousands.

~~~
enriquto
I understand. However, in the rare cases I have to make global changes, I
prefer to write a throwaway awk program that does the job automatically.

