jekyllt / jasper

Full-featured Jekyll port of Ghost's default theme Casper 👻
https://jekyller.github.io/jasper/
MIT License
581 stars 348 forks source link

Author pages and tag pages returns 404 #16

Open alan-yeh opened 8 years ago

alan-yeh commented 8 years ago

Nice theme! There is a problem in my blog. I had changed the 'categories' and 'tags' in my markdown posts and it works well in local server but not in pages.github.com. I wander if there is any mistake I made.

biomadeira commented 8 years ago

Hi @Poi-Son,

The problem you get is because for security reasons, Github doesn't run the plugins (under _plugins/) for authors/tags page when deploying with Github Pages. As explained in deployment, for getting it to work:

1) you need to generate your site locally (more details below) and push the resulting HTML to a Github repository; or

2) built the site with travis-ci (with goodies from jekyll-travis) automatically pushing the generated _site/ files to your gh-pages branch. This later approach is the one I am currently using to generate the live demo.

For option 1) simply clone this repository (master branch), and then run jekyll serve inside the directory. Upload the resulting _site/ contents to your repository (master branch if uploading as your personal page (username.github.io) or gh-pages branch if uploading as a project page (as for the demo).

For option 2) you will need to set up travis-ci for your personal fork. Briefly all you need then is to change your details in _config.yml so that you can push to your github repo. You will also need to generate a secure key to add to your .travis.yml (you can find more info on how to do it in that file). Also make sure you read the documentation from jekyll-travis. This approach has clear advantages in that you simply push changes to your files and all the html files are generated for you. Also you get to know if everything is still fine with your site builds. Don't hesitate to contact me if you still have any issues (see below about issue tracking).

Let me know if this is clear to you, otherwise I will give it another shot...

Cheers

alan-yeh commented 8 years ago

Thanks for your answer. I'm new in jekyll. I am trying to solve this problem in another way although I'm not sure whether it works. Best with you.

hungdh0x5e commented 8 years ago

I have same problem, i follow option 1, but not change :(, plz help me. My site: http://hungdh.me/

biomadeira commented 8 years ago

@hungdh0x5e I went looking for your jasper fork and I guess the problem is that you pushed the contents of the master branch instead of the contents of the _site/ folder. The contents of the folder should look like what you see for the jasper demo here https://github.com/biomadeira/jasper/tree/gh-pages

Let me know if this helps.

farmanp commented 8 years ago

@biomadeira I'm also getting this error too. It was originally working, but I've deleted the repo three times to get it to work again and it's no good.

biomadeira commented 8 years ago

Sorry @hungdh0x5e and @farmanp

Can you check whether the links in https://github.com/biomadeira/jasper/blob/master/_includes/navigation.html#L12 are pointing the your username/nickname and the same for the tags you use?

Cheers

hungdh0x5e commented 8 years ago

@biomadeira Thanks for your answer, it's working.

itumel commented 7 years ago

Hi @biomadeira I also have the same problem as @alan-yeh and @hungdh0x5e

I am also using Option 1 as a personal page. My source files are at https://github.com/itumel/itumel.github.io

My demo is http://abeginnersguidetohackathons.com

I have checked that navigation.html points towards my username/nickname and the same for tags.

If you click on author on my site you get 404.html.

I am new to Jekyll. Please help.

biomadeira commented 7 years ago

@itumel Sorry to hear that you are getting some problems.

Not sure if you fixed some already, but your author page http://abeginnersguidetohackathons.com/author/sharon/ seems to be working fine. As for the tags I am not sure why you have product and preparation tags in the navigation, whereas you only seem to have posts about introduction. This later tag seems to be working fine...

itumel commented 7 years ago

Hi @biomadeira

Yes I managed to fix the problem. I followed the advice on Option 1 to the letter by pushing to remote server only the contents of the /_site/ folder instead of the entire jekyll project.

I am still writing the articles for product and preparation.

Thank you.

jordant97 commented 6 years ago

@biomadeira Please help me with clearer instruction on option 2, from what I understand:

  1. Gem install travis
  2. Travis encrypt github_username, github_email and travis_ci_api_key (Is this right? Or is it supposed to come from github)
  3. Add the key into travis.yml
  4. In config.yml, configure the following settings username: github_username repo: repo_name branch: master relative_source: (Not really sure what this should be) destination: (Not really sure what this should be, is it supposed to be gh-pages?) production_url: https://datcjordan.github.io/testingforestry/ source_url: https://github.com/datcjordan/testingforestry/
  5. When you push to your github, travis ci will install all the plugins and push the _site folder to gh-pages

But I am having some problem with Travis CI. This is the error I have received: 1.39s$ bundle exec rake site:deploy --quiet Cloning into '../jasper-pages'... Switched to branch 'master' Your branch is up to date with 'origin/master'. error: pathspec 'gh-pages' did not match any file(s) known to git. rake aborted! Command failed with status (1): [git checkout gh-pages...] /home/travis/build/[secure]/testingForestry/Rakefile:61:inblock (3 levels) in <top (required)>' /home/travis/build/[secure]/testingForestry/Rakefile:61:in chdir' /home/travis/build/[secure]/testingForestry/Rakefile:61:inblock (2 levels) in <top (required)>' /home/travis/.rvm/gems/ruby-2.4.2/gems/rake-12.3.1/exe/rake:27:in <top (required)>' /home/travis/.rvm/gems/ruby-2.4.2/bin/ruby_executable_hooks:15:ineval' /home/travis/.rvm/gems/ruby-2.4.2/bin/ruby_executable_hooks:15:in <main>' Tasks: TOP => site:deploy (See full trace by running task with --trace) The command "bundle exec rake site:deploy --quiet" exited with 1. cache.2 store build cache $ bundle clean Cleaning all the gems on your system is dangerous! If you're sure you want to remove every system gem not in this bundle, runbundle clean --force. 0.01s 1.81snothing changed, not updating cache Done. Your build exited with 1.

datamadness commented 6 years ago

Hello @biomadeira, Thanks for your work on Japer2. I love it and would like to use it. Unfortunately, I am currently unable to generate author and tags. I followed your option 1 and the problem is that even the folders "author" and "tag" are not generated in the site content (only about and assets folders are generated in _site).

Could you point me to what I might be doing wrong?

If I try to uncomment author permalink in _config.yml, I get: jekyll 3.6.2 | Error: The URL template doesn't have author keys. Check your permalink template!

I have tested it on both your fork without any changes and my version where I modified _data/author names so it matches author in the post.

Thanks, your help is much appreciated.

zkf85 commented 6 years ago

Hi I'm still having this problem, after following your instruction, which is, just push contents in the _site/ folder to my github.io repo, but the problem's still there. Could you please help?

biomadeira commented 3 years ago

@zkf85 I think you need to play with the baseurl. There is a difference when running a project-based site (e.g. jekyller.github.io/jasper/) and a personal site (e.g. username.github.io/). Could you try that?