jez / hpstr-theme

A Medium-like Octopress theme based on the HPSTR Jekyll theme.
GNU General Public License v3.0
63 stars 15 forks source link

HPSTR menu problems with new clone #4

Closed daveglim closed 10 years ago

daveglim commented 10 years ago

Hi, I seem to have some issues with the menubutton with your theme. If i do a rake install['hpstr'] in my local repo, then edit the various files, do a rake generate/preview, the menu appears normally. However, after checking in all the changes, if i clone the repo to a separate directory, do a rake generate/preview, the menu bar doesn't show up. This work model is important because i'm trying to deploy the site via Heroku, which doesn't appear to be able to install themes after the repo is pushed to their system.

There appears to be something special that rake install['hpstr'] does that enables the menu. I'm suspecting it changes something in the gitignore file which doesn't propagate with the git clone commands.

When I inspect the elements for the menu in my browser, i see the code present for the menu. However, the jquery eventslisteners for the menu appear to be missing. I'm not entirely familiar how the jquery events get tied to the class elements. I'm hoping you may have more insight into the issue

jez commented 10 years ago

Hmm, that's an interesting issue. If the Rakefile does end up being the problem, I'm afraid that I can't help much there. I find it odd that the Rakefile itself would mess with the gitignore though. You could certainly diff the two gitignores (i.e., before and after you clone it to a new repository) to see if something has indeed changed in the gitignore itself.

As far as the jQuery plugin goes, that's another unfortunate situation: when I ported this over from mmistake's HPSTR Jekyll Theme, I don't think I kept the source files for the jQuery plugin: I only kept the minimized script, as I wasn't planning on modifying them at all. Thus, I'd advise you to check that the file /javascripts/scripts.min.js is indeed getting loaded, because I'm pretty sure this is where those click events would get set up.

If this doesn't work, maybe try loading the actual dlmenu script itself, which i believe is jquery.dlmenu.js, found in the /assets/js directory of mmistake's original repo.

Sorry I couldn't be more helpful. Certainly let me know if you make any progress, or open up a pull request if you end up fixing some sort of bug.

daveglim commented 10 years ago

I think I found the problem. When running rake install['hpstr'] this seemed to be adding the modernizr script to the source/javascript/vendor directory. My gitignore file had vendor listed. This prevented the modernizr script from loading on a new clone of the model.

My workaround is to remove vendor from my gitignore file, but i'm not sure if thats breaking the standard methodology. I would think a vendor script should be a script which should have an external link source.

jez commented 10 years ago

Wow, props.

I definitely agree with you as far as loading from an external source. I guess I thought that's what I was doing: loading the external script and loading the local one if it failed. Apparently not, and I'll probably close that issue with the commit that loads those scripts from a CDN.

As far as why vendor/ would be in your gitignore, what's the reasoning behind this? It seems like a perfectly valid folder to be there in the first place, but I'm assuming you had a problem with it once?

Again, thanks for digging this up. I'll definitely add those scripts.