chaijs / chaijs.github.io

The chaijs.com website source code. Contributions welcome.
http://chaijs.github.io
49 stars 71 forks source link

Incorrect links in guide's sidebar #182

Closed igoradamenko closed 5 years ago

igoradamenko commented 5 years ago

Hi!

When I open guide page, click on any plus sign icon in sidebar and then try to click on any second-level link, I get nothing. The reason is the urls of this links — they are only anchors, without paths.

I think the bug is here: https://github.com/chaijs/chaijs.github.io/blob/2bed03a8dc3e722e68df4d6be31649086a50b40d/_layouts/guide.html#L26

But I can't be sure, because I couldn't build local version of this site -_-'

(I think you should add to the README information about the necessity of having bundler gem and Ruby env installed; otherwise it isn't so obvious to understand errors like make: bundle: No such file or directory)

keithamus commented 5 years ago

Thanks for the issue @igoradamenko! I've fixed the issue and also updated the docs to reflect the need for bundler.

Could you please expand on how you are unable to build the site? What happens with make if you bundle install beforehand?

igoradamenko commented 5 years ago

@keithamus, I'm just not a Ruby programmer, so I don't have enough experience with all these gems :-)

When I tried to run make, it failed, because I didn't have bundle. Right know when I'm trying to run bundle install, I'm getting this:

Fetching gem metadata from https://rubygems.org/...........
Following files may not be writable, so sudo is needed:
  /Library/Ruby/Gems/2.3.0
  /Library/Ruby/Gems/2.3.0/build_info
  /Library/Ruby/Gems/2.3.0/cache
  /Library/Ruby/Gems/2.3.0/doc
  /Library/Ruby/Gems/2.3.0/extensions
  /Library/Ruby/Gems/2.3.0/gems
  /Library/Ruby/Gems/2.3.0/specifications
Fetching concurrent-ruby 1.0.5

Your user account isn't allowed to install to the system RubyGems.
  You can cancel this installation and run:

      bundle install --path vendor/bundle

  to install the gems into ./vendor/bundle/, or you can enter your password
  and install the bundled gems to RubyGems using sudo.

  Password:

But when I'm rerunning it with --path vendor/bundle it installs everything without errors. I assume that it's fine, I just don't have proper ruby env, because I don't use it everyday.

However, when I'm trying to run make to run dev server, I'm getting this error:

...
+ chai@4.2.0
updated 1 package in 1.591s
Configuration file: /Users/dante/Projects/chaijs.github.io/_config.yml
            Source: /Users/dante/Projects/chaijs.github.io
       Destination: /Users/dante/Projects/chaijs.github.io/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
             Error: could not read file /Users/dante/Projects/chaijs.github.io/vendor/bundle/ruby/2.3.0/gems/jekyll-3.6.2/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb: Invalid date '<%= Time.now.strftime('%Y-%m-%d %H:%M:%S %z') %>': Document 'vendor/bundle/ruby/2.3.0/gems/jekyll-3.6.2/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb' does not have a valid date in the YAML front matter.
             ERROR: YOUR SITE COULD NOT BE BUILT:
                    ------------------------------------
                    Invalid date '<%= Time.now.strftime('%Y-%m-%d %H:%M:%S %z') %>': Document 'vendor/bundle/ruby/2.3.0/gems/jekyll-3.6.2/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb' does not have a valid date in the YAML front matter.
make: *** [docs-server] Error 1

I don't need to run dev server, because you've already fixed the error (oh, yes, now it works, thanks!), but if you think that the error above is not my fault and I can help to fix it in anyway, I will glad to help :-)

Also, just a note, I don't know why readme says that I need to run git submodule update --init, I don't see any submodules here.

keithamus commented 5 years ago

@igoradamenko you can run sudo bundle install which should allow Ruby to write to those folders, which then should stop the errors you're seeing. I've updated the docs to reflect this!

igoradamenko commented 5 years ago

@keithamus, I know, I just don't want to run using sudo things that I don't understand completely 👀

But thanks for updating docs! 🐨

keithamus commented 5 years ago

@igoradamenko if you dont want to run sudo, an alternative would be to use a localised ruby (the one you're using right now is the system ruby that ships with macos). You could either use homebrew to brew install ruby - or look at Ruby version managers like rvm or chruby. All of these options tend to install themselves into user folders and as such don't need sudo to write to them.