Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin not working #32

Closed
GiacomoLaw opened this issue Feb 18, 2019 · 20 comments
Closed

Plugin not working #32

GiacomoLaw opened this issue Feb 18, 2019 · 20 comments
Assignees
Labels
question Further information is requested

Comments

@GiacomoLaw
Copy link

GiacomoLaw commented Feb 18, 2019

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!

@keithmifsud
Copy link
Owner

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?

@GiacomoLaw
Copy link
Author

Source is public: https://github.com/giacomolaw/blog

Thanks :)

@keithmifsud
Copy link
Owner

Hi @GiacomoLaw I will very happily look into this in the next 10 hrs..promise :) Sorry..It is late now :(

@GiacomoLaw
Copy link
Author

Thank you, no hurry!

😄

@keithmifsud keithmifsud self-assigned this Feb 19, 2019
@keithmifsud keithmifsud added the question Further information is requested label Feb 19, 2019
@keithmifsud
Copy link
Owner

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.

jtb

@keithmifsud
Copy link
Owner

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.

@GiacomoLaw
Copy link
Author

Yep it’s hosted on GitHub pages. I’ll take a look at Firebase, thank you!

@keithmifsud
Copy link
Owner

Sure. If you need help with Firebase, just let me know.

@GiacomoLaw
Copy link
Author

Is there a guide on setting it up for windows? Thanks 🙂

@keithmifsud
Copy link
Owner

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.

@GiacomoLaw
Copy link
Author

So do I have to rebuild the site very time I make a blog post?

@keithmifsud
Copy link
Owner

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.

@keithmifsud
Copy link
Owner

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"
  }
}

@keithmifsud
Copy link
Owner

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.

@GiacomoLaw
Copy link
Author

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!

@keithmifsud
Copy link
Owner

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?

@GiacomoLaw
Copy link
Author

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!

@mlhaufe
Copy link

mlhaufe commented Jan 27, 2021

There may be a workaround for GitHub Pages:

https://blog.samplasion.js.org/build-jekyll-with-custom-plugins-on-github-pages

@erin-bristow
Copy link

erin-bristow commented Jan 20, 2022

@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.

@erin-bristow
Copy link

erin-bristow commented Jan 20, 2022

[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.

nooriro added a commit to nooriro/nooriro.github.io that referenced this issue Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants