jekyllt / jasper2

Full-featured Jekyll port of Ghost's default theme Casper v2 👻
https://jekyllt.github.io/jasper2/
MIT License
763 stars 659 forks source link

Couldn't fix the about page & author pages... #36

Closed BedirT closed 6 years ago

BedirT commented 6 years ago

We tried all the solutions you added for fixing these, but no improvement. https://nau-datascience.github.io about page and tags & author pages (basically anything other than main page and posts are not working)

biomadeira commented 6 years ago

Hi @BedirT

Read this https://github.com/jekyller/jasper2#deployment bit thoroughly. From looking into your repository it seems that you are not doing it right. Author and Tag pages are generated by ruby scripts under _plugins/, which won't be run by Github by default, for security reasons. You either push to your master the contents of the site after building it locally (would be in _site/ or ../-pages/), or get travis-ci or others CI/CD providers to build the site, and automatically push the built site contents to a gh-pages branch in your repository...

F:)

kmcconnell commented 6 years ago

Another option for deploying is to use Azure Web App (or similar service), which lets you set the path to the web root within the repo. So our web app is deployed with the path set to _site/, and we can just run bundle exec jekyll build before committing.

BedirT commented 6 years ago

I get error "The command "bundle exec rake" exited with 1"... I cannot install rake

bundle exec rake
rake aborted!
Don't know how to build task 'default' (see --tasks)
/home/travis/build/NAU-Datascience/NAU-Datascience.github.io/vendor/bundle/ruby/2.4.0/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
/home/travis/.rvm/gems/ruby-2.4.1/bin/bundle:23:in `load'
/home/travis/.rvm/gems/ruby-2.4.1/bin/bundle:23:in `<main>'
(See full trace by running task with --trace)
VictorStepanov commented 6 years ago

I followed the instructions (https://github.com/jekyller/jasper2#deployment), and I got the same problem.

The issue is in the "local generation" process. When you generate the site locally into the "../jasper2-pages/" (or "_site" if you comment out "destination:" ) all if the links resolve to "http://localhost:4000/..." For example:

<link rel="shortcut icon" href="http://localhost:4000/assets/images/favicon.png" type="image/png" />
    <link rel="canonical" href="http://localhost:4000/" />

https://github.com/NAU-Datascience/NAU-Datascience.github.io/blob/master/_site/index.html

Solution:

add baseurl: https://nau-datascience.github.io into the _config.yml file and then run JEKYLL_ENV=production bundle exec jekyll serve

kmcconnell commented 6 years ago

I realized why we don't have an issue with this. We are using default properties in _config.yml. For our site, we set baseurl: / and url: https://makanal.eu. We actually removed the production_url and source_url properties.

When you use bundle exec jekyll serve, Jekyll writes the files with http://localhost:4000. Otherwise, when you run bundle exec jekyll build, Jekyll writes the files with the value of site.url. This is just the default behavior of Jekyll.

This required editing _includes/floating-header.html and layouts/post.html as well to update them to use site.url instead of site.production_url.

Here's the commit where we implemented that change: https://github.com/makanaleu/makanaleu/commit/0081bdb1450119af0f1cdbf29b1e88e7ff9063b9#diff-aeb42283af8ef8e9da40ededd3ae2ab2

I wasn't sure what the impact would be for other users, so didn't suggest it as a change.

BedirT commented 6 years ago

I'm going to go mad! So... after doing what you said @VictorStepanov do I still add only the _site part to repo ?? Or how do I do it... I tried adding baseurl, only thing it does is mess up things more 😞

kmcconnell commented 6 years ago

@BedirT Based on your repo, you have conflicting baseurl properties in _config.yml.

You have baseurl: / and baseurl: https://nau-datascience.github.io.

I think your production_url property needs to also be https://nau-datascience.github.io.

BedirT commented 6 years ago

@kmcconnell 😪 no luck.. sorry to be annoying, but assume that I am dumb. Did I miss something again ? It only gets worse..

VictorStepanov commented 6 years ago

You are almost there! Don't give up! 😄👍

I think you are missing a '/' between https://nau-datascience.github.io and <some content path>

example: https://nau-datascience.github.ioassets/images/blog-cover.jpg

If you add the missing slash baseurl: https://nau-datascience.github.io/

it should start working: https://nau-datascience.github.io/assets/images/blog-cover.jpg

BedirT commented 6 years ago

HELL YEAH I LOVE YOU GUYS 😄 finally it works. Special thanks to @VictorStepanov and @kmcconnell

techlanka commented 6 years ago

@bedirt what was the fix.pls explain.