-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
update dependencies Grunt and Bootstrap - set active class… #2
update dependencies Grunt and Bootstrap - set active class… #2
Conversation
…t-item ISO link in template ISO javaScript
package.json
Outdated
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/morganfeeney/bootstrap-patterns" | ||
"url": "git+https://github.com/morganfeeney/bootstrap-patterns.git" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't seen this before +git
, what does it do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I don't know, copy & paste thing from other repo. I will remove it in a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, i've spent a bit of time looking at the changes, I spotted a few things, if you don't have time just let me know and I'll pick them up ;)
There are a few outdated utility spacing classes used in the header that need to be updated, see example:
You can see the same alignment issue in the footer too.
I notice in the nav, the word navbar is out of alignment with the content:
Any idea why?
src/html/partials/footer-scripts.njk
Outdated
@@ -3,12 +3,12 @@ | |||
<script type="text/javascript" src="../node_modules/bootstrap/dist/js/bootstrap.js"></script> | |||
<script src="http://localhost:35729/livereload.js"></script> | |||
<script type="text/javascript"> | |||
var url = window.location; | |||
// var url = window.location; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the point to this, I originally wanted some dynamic way to do this which is why I opted for the JS at that time. For example if the name of the file changes then you might have to also change the page id etc.
However... from a learning point of view I think it's far better to show people how to add an active class using Nunjucks 👍.
@atelierbram You can go ahead and remove the JS rather than comment it out, ok?
Morgan,
Next couple of days I don't have much time, maybe I can make some time on thursday to do this right. I'm not deeply invested in Bootstrap, and the repo is using an alpha version for the next release of Bootstrap, so I don't know ... Personally I wouldn't mind waiting for the official release of Bootstrap 4 to fix those outdated classes, for there might be more that needs to be changed with that release.
|
I'm gonna merge this in, and fix the classes myself. If BS updates then... well it's not exactly a big job to correct. Thanks for the effort. |
Great - thanks; you're welcome |
In this PR I updated the dependencies for Grunt, and others as well in
package.json
because after NPM first install running thegrunt
command Grunt wouldn't run and generates an error. Bootstraps navbar needed some additional (updated) markup too with the new version.I opted for setting an active class on the nav's list-items (like in Bootstrap) ISO on the link in the templates ISO in javaScript. Using the comparison operator
==
here within an if-statement. This works when the values of the two variablespage_id
(in this example fromhtml/templates/page1.html
) andmenu_item
from the for-loop inhtml/components/nav.njk
match, ... and because of the way these templates render:In
html/templates/page1.html
:In
html/components/nav.njk
: