Closed vncoelho closed 6 years ago
I am now using the following script:
#!/bin/bash
echo "Starting bundle jekyll serve"
cp _config.yml ./_config-temp.yml
sed -i '/remote_theme/c\theme : "minimal-mistakes-jekyll"' ./_config-temp.yml
bundle exec jekyll serve --config ./_config-temp.yml
Furthermore, I am ignoring the Gemfile since github is being able to generate the page without it.
Is it correct?
If you want to test locally and host with GitHub Pages, then the preferred method is using remote_theme
. You'll also want to setup your Gemfile
to use gem "github-pages"
as it will mimic the same version of Jekyll and plugins they use.
There's no reason why you should need to switch between remote_theme
and theme
. Stick with just remote_theme
and keep your Gemfile
like this:
source "https://rubygems.org"
gem "github-pages", group: :jekyll_plugins
Refer to GitHub's docs on how to set this up if you need further help.
There's no reason you'd need to run bundle update
other than to update the github-pages
gem and it's dependencies. When you use the theme as a remote you don't update the theme as there is no gem to update.
The way that works is anytime you build the site it pulls down whatever version of the theme exists on the master
branch. So in theory you should always have the latest version when building with nothing to do by you.
If you're having issues running bundle exec jekyll serve
locally then something is up with your environment and the github-pages
gem... not the theme.
Hey, @mmistakes, thanks very much for this dip attention.
I tried the command with build
but later I saw that you edited it.
The command serve
worked but took a little bit more time to get the server up on port 4000 (around 35-40s compared to couple of seconds when running gem and theme locally).
Anyway. It was a good workaround for running it locally without any modification.
Thank you very much.
Just one last question. I check some other command on the guidelines, such as rake preview
. Should I use it for something, as well as that build
you mentioned first?
Best regards,
Now I noticed that it only worked locally when I added github: [metadata]
to the _config.yml
rake preview
is a development thing. It's used when adding new features and uses the source files in /example
to spin up jekyll serve
.
Jekyll's Minima theme did it first... that's where I got the idea.
And yes, remote theme will be slightly slower as it has to downloaded the theme every time it builds. There was some discussion about caching between builds, so maybe take a look at that project if you have feedback to add.
Closing as these concerns are all Jekyll (and it's dependencies) related... nothing specific here to the theme.
Hi, guys.
First of all, congrulations for this great template. I am wondered about the possibilities that ideas like Jekyll are promoting.
What is the best way to switch between local tests and github. Because if I run
remote_theme
locally I will problems with 'bundle update & bundle exec jekyll serve`In this sense, I am constantly commenting and uncommenting the gemfile and config.
And switching from remote to theme: