开发者

To use Wordpress themes in Rails apps?

Word开发者_运维知识库press themes are beautiful!

Is there any guideline to use Wordpress themes in a rails app? Even better, are there rails app templates which can use the Wordpress themes already?

Thanks!


Checkout the install_theme gem. I haven't it used it but it's supposed to make it easy to install other themes into a Rails app.


WordPress themes consist CSS, images, and templates that are mix of HTML and PHP (with the PHP invoked WordPress APIs). There's nothing for Rails that I know of that will deal directly with WordPress templates.

However, reusing CSS and images from WordPress with HTML that you generate from Rails instead of from WordPress is quite straightforward. If it's hard to tell what HTML will be generated from the .php bits, load the theme up in a scratch copy of WordPress, and view the source of the generated pages to see the generated structure. Then generate the same in Rails. That's about it (after you adjust paths for the .css and image locations).

One issue worth noting is giving credit for the theme. It's customary in WordPress to leave credits in the footer. It'd be good form to leave these in when you convert a theme to Rails.


Did not find an easy solution to this so I created a gem: https://github.com/lfender6445/theme_bandit

gem install theme_bandit

It's a work in progress, but the gem allows you to build a tiny rack application out of an existing live site. If nothing else, this will do a large portion of the setup work when converting an existing template to a ruby project (handling of assets like js, css, and conversion for template engines)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜