7 ms·
Using Jekyll and GitHub Pages
- chrsstrm 9y agoUnless 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 9y agoYes I'm aware of that :-) It's mentioned here too : https://jekyllrb.com/docs/themes/#converting-gem-based-themes-to-regular-themes https://jekyllrb.com/docs/themes/#converting-gem-based-theme... 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 9y agoExcept 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.
- JetSpiegel 9y agoInstead 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 9y agoIf 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.
- robinwassen 9y agoLast 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.
- deleted 9y ago[deleted]
- ryaneager 9y agoThis sounds suspiciously like an ad...
- robinwassen 9y agoNoticed that too when i re-read it, I do not work there and are not related to them in any other way than hosting my blog there. But I like their service and dont mind promoting it :)
- orf 9y agoPerhaps, but I had exactly the same experience and came to say the same thing. Netlify is pretty damn awesome.
- onion2k 9y agoI use Netlify. It's very good.
- prophesi 9y agoYeah, 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!
- nathan_f77 9y ago
- enriquto 9y agoI 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 9y agoand footer and sidebar and other 'components'.
- JorgeGT 9y agoThey 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 9y agobut 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 9y agoIn 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.
- AdrianRossouw 9y agopart 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.
- _asummers 9y agoI'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 9y agoI 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 9y agoI'm also curious on your (GP's) set up
- _asummers 9y agoReplied to your parent.
- _asummers 9y agohttps://firebase.google.com/docs/hosting/ https://firebase.google.com/docs/hosting/ More or less, you have a directory with all your static pages, you say `firebase deploy` and then it creates a new version of your site in the firebase UI, where you can roll back to any previous version as needed. In a Hugo/whatever fashion, you'd have a script in your repo to regenerate that directory and then deploy. Still experimenting with the flow, but that seems to be the right one.
- strig 9y agoHow does firebase static hosting compare to Netlify?
- _asummers 9y ago
- a9t9 9y agoAnother 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-subdomain-vs-subfolder-does-it-need-updating https://moz.com/community/q/moz-s-official-stance-on-subdoma...
- spinningarrow 9y ago> 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 9y agoNo, it's nonsense. This sort of thing is what Travis is designed to do.
- geraldbauer 9y agoFYI: 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
- wazanator 9y agoFor 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-up-a-jekyll-development-site-on-ubuntu-16-04 https://www.digitalocean.com/community/tutorials/how-to-set-...
- siegecraft 9y agoUnless 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.
- edem 9y agoI 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.
- hobarrera 9y agoI'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.