Closed GiacomoLaw closed 5 years ago
hmm..first..thank you for raising the issue here :) Unfortunately, I might need to leave before it is fixed as it is late where I'm at atm. Can you show your config file please..you can hide anything sensitive?
Source is public: https://github.com/giacomolaw/blog
Thanks :)
Hi @GiacomoLaw I will very happily look into this in the next 10 hrs..promise :) Sorry..It is late now :(
Thank you, no hurry!
π
Hi @GiacomoLaw thank you for waiting π
I cloned your repo and then...
bundle install
bundle exec jekyll serve
On my localhost, the plugin works but as you noted it does not work on the remote host. Is this hosted on GitHub? If it is, please note that you cannot use any Jekyll Plugin unless it has been developed by GH team such as the emoticons plugin.
By the way, I like your website, especially the search feature π Just to elaborate on my answer, if you're hosting the site on GitHub Pages, you will not be able to use any Jekyll plugins unless they have been developed by GH as listed here https://pages.github.com/versions/ . We have requested GH to allow more plugins but I don't think they will any time soon.
If this is your case and you'd like to use either JTB or another community plugin, I suggest you host the website on either Netlify or Firebase. Both are free for most use cases. My site is hosted on firebase.
Yep itβs hosted on GitHub pages. Iβll take a look at Firebase, thank you!
Sure. If you need help with Firebase, just let me know.
Is there a guide on setting it up for windows? Thanks π
It's actually very easy on any platform as the CLI is simply an NPM. This should get you started https://codinginfinite.com/firebase-database-profiler-performance-with-firebase-tools/
You need to create a project on Firebase.
But basically, I developed a small script which builds Jekyll on a separate directory and then pushes the already generated static files to firebase. The difference is that on GH you just push your source code and GH will build the site for you. With Firebase, you should build the site locally and deploy the static files to it.
So do I have to rebuild the site very time I make a blog post?
Yes, you do so already. When you run jekyll serve it builds the site and again on every change. Just jekyll build
and give a path where you want the built files.
I have this script:
#!/usr/bin/env bash
JEKYLL_ENV=production bundle exec jekyll build
rm -rf ./../publish/public
mkdir ./../publish/public
cp -rf ./_site/* ././../publish/public
cd ./../publish/
firebase deploy
In the publish
directory I have the firebase.json file:
{
"hosting": {
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"cleanUrls": true
}
}
and the .firebaserc
file:
{
"projects": {
"default": "keith-mifsud"
}
}
Basically, the first file is named deploy.sh
and lives in the website's source. Every time I want to deploy the changes, I just run it bash ./deploy.sh
and the site goes live in seconds.
Okay, thanks. I was hoping for something more simple so I could set up a friends blog, and they don't really know about any of this.
Thanks however!
You're welcome. I really don't think this is any more complicated then committing and pushing to GitHub. You may want to take a look at Netlify?
Will do, thank you! I am happy with Firebase, so I may move my personal site over there. Just for friends who have no experience with terminals and programming.
Thanks!
There may be a workaround for GitHub Pages:
https://blog.samplasion.js.org/build-jekyll-with-custom-plugins-on-github-pages
@mlhaufe thanks for that! I managed to get it going using the official Jekyll docs.
Two problems I ran into, for anyone who tries to use the Jekyll docs - after the gh-pages branch is created, switch to gh-pages branch in the settings for your github pages repository. Also need to include target_branch: gh-pages but that's the only thing I had to change in provided github-pages.yml file.
[more notes for anyone that may or may not be reading my comments] There can be issues with custom domains. The CNAME record will not be automatically placed in the new gh-pages branch, and you cannot manually create the CNAME record file in the gh-pages branch because it will be overwritten every time your site is rebuilt. In the _config.xml file you need to add 'include: CNAME' to force it to include that record.
Hi there!
Trying to add this to my site here: https://github.com/giacomolaw/blog
However, as you can see from this link, the URLs do not open in new tabs: https://giacomolaw.me/blog/...
What am I doing wrong?
Thanks!