Using CodeKit 2 with Wordpress/Bootstrap via Bower - bower

This may be a really dumb question but I've been searching the interwebs and haven't really found much helpful information. I have CodeKit 2 and I want to use Wordpress and Bootstrap in a project. I've never used Bower before but it looks really cool and I thought I'd give it a shot with CodeKit. I installed Wordpress, JQuery, and Bootstrap through the assets tab in my project and they installed into bower_components. In the video from Bryan Jones showing off Bower, he says not to move anything out of that folder or CodeKit won't see it as an asset anymore.
So my question is: how do I go about building my project from here? Obviously I don't want to have to run from the bower_components folder to do everything. In the Bower docs it says the easiest way is to just statically link the components you want. But I don't really understand how that would work with Wordpress and it seems like there'd be a better way to do it with CodeKit.
Thanks for the help!

There is no need to use Bower to manage wordpress, since wordpress can update itself very easily.
I think the best approach to building a WP site with Codekit is described in this tutorial: Use CodeKit 2.0 for Local WordPress Development.
Basically:
setup wordpress locally, any way you like, and use MAMP or AMPPS to serve the site.
drag your theme folder into Codekit - the theme is the project.
In the Browser Refreshing section of your project settings, use the external server option. Paste in the local URL for your new WP site.

Here's an article with some details.
Basically you just need to install bootstrap.less and variables.less in your /less folder, and then point your #import commands to your /bower_components folder. While you technically are running things out of /bower_components, after it's set up, you'll never know the difference.

The most useful thing about having wordpress connected to Bower is that you can just get the files downloaded quickly without having to grab the latest zip.
It makes sense to move the wordpress files to the top level, or where ever you are used to putting them.

Related

How to deploy angulardart 5.2 properly for production?

on the angulardart official website, I can not find any docs related to production deployment. I prefer command line way, so far I find out I can do webdev build to generate a build/ directory. But there are still some more questions:
I want to clarify what files I should deploy to the production server. I think they should be favicon.ico, index.html, main.dart.js, styles.css 4 files, right?
Why does it generate .build.manifest, .packages, packages/? two files and one directory which contains many directories and files. They are just confusing me. This is for production. Why do I ever want to have those files? Should I write a deploy script to simply auto-remove them?
It seems the generated main.dart.js is a minimized js file. But why are there many useless newlines in it? How to get rid of those useless newlines properly by using angulardart way? I can do that with gulp, but I don't want to use gulp if dart can handle this.
How to minimize html and css files properly by using angulardart way? for example, index.html and styles.css. Again, I can do that with gulp, but I don't want to use gulp if dart can handle this.
Thank you very much for your help.
Here you can find some of official doc :
https://webdev.dartlang.org/angular/guide/deployment

Importing Node Modules in to Rails

I'm working with Jasmine. I spotted this handy looking library: https://github.com/JamieMason/Jasmine-Matchers and I thought its collection of customer matchers would help me a lot.
Problem is, it's loaded with files common to Node applications, such as JSHint, Grunt, travis.yml etc
The project I'm working on, that would love these matchers, is a Rails application. I've tried dropping them into my assets/javascripts and requiring in application.js, but obviously, life isn't that simple.
What is the correct way to install these files, and integrate them with Jasmine in a Rails context? Is Bower the tool for the job? If so, what's the right procedure to adding JS dependencies/integrating them off the bat?
Author of Jasmine-Matchers here, the only file you need to load into your test environment is this one https://github.com/JamieMason/Jasmine-Matchers/blob/master/dist/jasmine-matchers.js.
The other files are part of the development repo, I'll open an issue to have those excluded from npm/bower packages to save confusion.
You should be able to copy that file to your assets/javascripts directory, then embed it after Jasmine but before your tests.
Please comment if I've missed anything out here.
I was also trying to use Node modules inside my Rails application and the easiest way I found to achieve it was through browserify-rails gem.
The installation is pretty straightforward, just follow the getting started section and everything should be working. :-)

Theming a rails app via plugin or engine

What's the best way to go about this? I've tried a bunch of different things but can't quite get the hooks in right. Tons of googling and I can't get it.
I can get everything working right but I cannot seem to override the child apps views/layouts/application.html.erb ... I need to copy over all assets with the gem and have the plugin/engine/gem/whatever's application.html.erb pull from those assets. Help please?
Jquery-UI has a whole spiel on theming, which also allows it to be dynamic across several different themes. Check out http://jqueryui.com/themeroller/
Dont forget about Bootstrap from Twitter. You can just install these and mention the file_name in your layouts and you are good to go.
In fact, in most cases, you can also just copy them in your assets folders and you are ready to go.

Can a Rails app and a Jekyll blog live together?

I have a Rails app and I want to add a blog feature; my idea is to use Jekyll which is a great blog tool, I just need to figure out if it's possible to use http://my.app.com/blog as a url (knowing that Jekyll will run its own server process with its own url).
Does anybody know of a way to accomplish this? It'd be great to be able to do so. Best regards!
... just need to figure out if it's possible to use http://my.app.com/blog
as a url (knowing that Jekyll will run its own server process with its own url).
While jekyll's web server works, it will be probably easier, simpler and safer to use your rails app's webserver for serving all pages.
The simplest way of doing what you want is hooking a jekyll invocation to your server's git repository, so jekyll's static content is added automatically to your rails app's public/blog/ directory every time there is a push.
Create a symbolink link called public/blog inside your app's public folder. Make it point to the generated _site folder of your jekyll repository.
On the git repository that controls the contents of the jekyll blog, add a post-receive hook that does the following:
#!/bin/sh
rm -rf _site
jekyll
Those are the basic steps. You might have to configure the read permissions properly, ignore the /blog/ link if you are using an SCM (like you should) and automate the link creation if you are using Capistrano or Vlad for deploying.
There are other alternatives, like using a real folder instead of a symbolic link and having jekyll generate stuff directly there, but I feel the one I'm presenting is the cleanest.
Would you be using nginx to reverse-proxy the Rails app? If so, you should be able to just carve out an exception so /blog is served directly by nginx instead of forwarded to Rails.
Check out this gem: https://github.com/zbruhnke/bloggy
And this blog post about it: https://blog.engineyard.com/2012/introducing-bloggy-a-simple-way-to-add-a-jekyll-blog-to-any-rails-application
I had the same problem a few weeks ago. If you really have to use Jekyll, I think the best solution is to use the already mentioned Bloggy gem.
However, I wasn't satisfied with this solution, because you still have to duplicate or synchronize a lot of things like templates, routes, stylesheets, and so on. So I decided to implement my own simple Jekyll-like blog functionality in Rails.
You can find my article describing the implementation here: Create a simple Jekyll-like blog in your Rails 4 app.

Multiple Rails forks with separate designs and layouts

I have a Rails project that is basically a simple web app for a membership-based organization. We've open sourced the code on Github for the web app so that others can use it, but have a licensed design/layout that the original organization is going to use. This layout cannot be open sourced. I was wondering if others have run into the situation where you have an open-source Rails app with a non-OS design.
My initial thought is to put app/views in .gitignore, and to have anyone forking the code add their own views directory, perhaps including an app/views_default directory with a web-app-theme layout or something else to get people running. Is this the best option (realizing that there are other files such as JavaScript, CSS, etc that come with the layout that must also be ignored).
Does anyone have some good thoughts or pointers on this?
Hoopla - svn:externals for Git.
Instead of git:ignore, you can push the non-open-source stuff somewhere else, and your open-source code on github. Use hoopla to manage the externals.
http://6brand.com/git-svn-externals-rails-plugins.html
Rails Theme_Support plugin: http://github.com/aussiegeek/theme_support (There are forks as well). You can create a theme directory with multiple themes, and load the theme programmatically in ApplicationController. This would allow anyone to use the application, and simply supply their own theme in the themes directory, and would allow the project to have a "default" theme which would serve as an example.

Resources