As this is my first post here, let me start by introducing myself;
My name is Steven, I’m a graphic designer and photographer from Belgium and once in a while I need to create a small business or personal website.
In the past I have created a couple of websites based on the good old Roots version 7.
I am starting a new personal web project as we speak and I am moving to Sage for the very first time…
I’ve bought the “Theme Development With Sage” book to get me started.
So,… I am new to Sage, Gulp and Bower but I’ve been reading and exploring for a few days now and I am pretty close to get it all working. Except for enqueuing additional JS files…
My Sage project is running on a MAMP environment (I know some of you guys don’t like MAMP, but that’s already complicated and challenging enough for me )
This is what I’ve got so far:
Installed Node.js
Ran the NPM, Bower & Gulp commands (Gulp created the dist/ directory)
I need to add an additional JS file. This is a JS file I’ve been using for an older project and it will be useful in this project too. I created a new file in assets/scripts called custom.js and changed assets/manifest.json accordingly:
I have tried adding a new enqueue for the custom.js file by adding the following to setup.php: wp_enqueue_script('customjs', \asset_path('scripts/custom.js'), ['jquery'], null, true);
Unfortunately this doesn’t work for me.
If I am putting this enqueue on the bottom of setup.php, I get a blank screen and Firebug gives me : "NetworkError: 500 Internal Server Error.
Could someone please tell me what I am doing wrong?
Thank you in advance!
Steven
I am running gulp watch all the time while developing.
Do I have to run gulp again because I just created this new file? Doesn’t gulp watch takes creation of new files into account?
I have used your enqueue code above and custom.js does appear in my dist/ directory now indeed!
Hi guys,
I want to thank you again for your amazing work and support!
Thanks to the Roots theme, thanks to all contributors! Thank you @ben, @smutek, @kalenjohnson@Foxaii for your help with different topics!
My first Sage website is now online: http://www.ciclostudio.com and I am very proud of it since I basically started from scratch, without theme development skills and limited PHP skills
Thanks @smutek! Adaptive images is the last thing I’d like to add to this project.
I’m looking into this approach: https://github.com/verlok/picturePolyfill
After that, I will definitely make another
Hi @Twansparant, thanks for your constructive feedback!
I have tested and weighed the pros and cons of a “navbar-fixed” and decided not to go for it.
I do see the advantage of a fixed menu in terms of usability (ease of access) but the primary focus for this website is the actual content and photo’s. Providing high quality (large-size) images to our visitors. A fixed menu took up too much space accrding to my test experience. This is also why I have decided to add the menu to the footer.
I guess this could be a never-ending debate, but I do appreciate your feedback
Thanks for mentioning respimage! I’ll do some more research on this.