We recently suffered from asset pipeline performance issues. In order to boost deploying, we decide to switch to capistrano-local-precompile strategy.
However, local asset compiling in Rails 4 is blazing fast, but in Rails 3 is not.
And much nightmare is if we can skip compiling prcoess if assets weren't changed when we compiling at remote, but we need to compile asset everytime if we choose to compile locally.
So we comes out this crazy idea: How about running Rails 4 asset pipeline in Rails 3 project.
Here is how:
1. modify Gemfile
group :assets do
gem 'sprockets', '2.2.2.backport2'
gem 'sprockets-rails', :require => 'sprockets/railtie', :git => "git@github.com:logdown/sprockets-rails.git"
gem 'sass-rails', '~> 4.0.1', :git => "git@github.com:logdown/sass-rails.git"
gem "compass-rails", "~> 1.1.2", :git => "git@github.com:logdown/compass-rails.git"
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
end
2. edit config/enviorments/production.rb
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = true
# Compress JavaScripts and CSS
config.assets.compress = true
# Generate digests for assets URLs
config.assets.digest = true
config.assets.js_compressor = :uglifier
config.assets.css_compressor = :sass
3. change config/deploy.rb
You should install capistrano-local-precompile
first, and override precompile command. It's d because the precompile machism in different versions are different.
set :precompile_cmd, "bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile"
Behinde the scene
Basically we are doing serveral things:
- make
sprockets-rails
edge running withsprockets
2.2 - make
sass-rails
edge running under rails 3 - make
compass-rails
edge running with rails 4 strategy
to resolve asset_paths, SASS resolver issue...etc.
Warning
Before doing this, make sure you really understand what your are doing. And it exists many different between sprockets 1 & 2.
Recently, we implement a major features in CodeMirror while building Logdown editors.
That's Codemirror Composition Mod.
The original problem in CodeMirror is when users are using IME to input CJK words in edit area, people can't rechoose the word due to keyboard event.
Our team solve this issue by using Composition Event API to bypass keyboard event. If you are interested in implementation detail. Here is the article : 用 Composition Event 改進 CodeMirror 對輸入法的支援
Plugin: https://github.com/zhusee2/codemirror-composition-mod
Demo: Logdown editors.
Hi, Thanks everyone who trying Logdown in these past two months.
Logdown have Premium plan ( $49.99 USD /yr , ~$4.2 USD /month) now.
With Premium plan, you can get custom domains, multi blogs / collaborators, almost unlimited photo uploading, 24/7 supports and among other new features.
We are working hard to deliver more and more features. This month we have shipped 6+ beautiful themes , and continue to make more.
In order to thank our early users, we decide to give you half price discount.
By upgrading to Beta Plan
, you can continue upgrading to "Premium plan" with half price (which is $24.95 USD/year, ~$2.1 USD/month).
The Beta plan will sunset at 9/13, besure to upgrade you account as soon as possible.
Thanks
Hi, everyone
We are proud to announce Logdown has Custome Themes
!!
You can enable this feature from Blog > Settings > Themes
http://logdown.com/account/blogs/your_blog/themes
Currently Logdown has three pre-configed themes, and we are also provide Custom HTML
option.
We will release more themes next follwing weeks. Stay tuned!
API Documents
API documents are aviable at http://github.com/logdown/themes-guide
Submit your theme
Our theme repo is at http://github.com/logdown/themes .
If you want to submit a new theme, please fork this repo and submit a pull request. After reviewing thme source codes, we will merge them as soon as possible!
Thanks for your support!
- See also Chinese version: Logdown 現在支援 Custom Theme 了!
If you hit any problems, please don't hesitate to tell us.
Follow latest news of Logdown
- Logdown Official Blog
- Twitter:@logdowninc
- Support Email: support@lgodown.com
Tired of default Logdown logo ?
Logdown now support Custom Opengraph Image
for each blog. Just go to Blog > Settings
to change your default image.
Then you can past blog link on Facebook with your own og:image
Hi, we are happy to announce Logdown has more than 300+ themes. ( Blog background )
You can enable this feature from Blog > Settings > Themes
http://logdown.com/account/blogs/your_blog/themes
If you hit any problems, please don't hesitate to tell us.
Follow latest news of Logdown
- Logdown Official Blog
- Twitter:@logdowninc
- Support Email: logdown@rocodev.com
Hello, Xanga Users!
We now support importing from Xanga.
Step1 : export wordpressWXR.zip
Just go your archives page on Xanga, and download wordpressWXR.zip
.
http://www.xanga.com/private/archives.aspx
Step2 : Import to Logdown
And go to your blog importing page, choose Wordpress
to import.
Everything will be all set.
If you hit any problems, please don't hesitate to tell us.
Follow latest news of Logdown
- Logdown Official Blog
- Twitter:@logdowninc
- Support Email: logdown@rocodev.com
This week, we also enable several features to get better SEO: Sitemap & Site Verification
Sitemap
http://yourblog.com/robots.txt now will display your sitemap url. And the sitemap will be updated every 12 hours.
# See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
#
# To ban all spiders from the entire site uncomment the next two lines:
# User-Agent: *
# Disallow: /
Sitemap: http://blog.xdite.net/sitemaps/xdite-ld.xml.gz
Support Google Webmaster Tool
If you want to install Google Webmaster to diagnose you blog, we also provide google site verification.
This option is at Your Blog >> Setting
If you hit any problems, please don't hesitate to tell us.
We are very proud to announce these two powerful features
Multiple blog
You can create more than one blog in Logdown. Free user can have 2
, Beta have 5
, and Premium have 7
Location: Settings >> Blog >> New Blog
Collaborators
Logdown also allows multple collaborators, you can ask friends to join you blog :)
Location : Your Blog >> Collaborators
Enjoy!
This week, we are releasing "Blogger Importing" feature
Please go to Your Blog >> Settings >> Importers
to try out.
If you hit any problems, please don't hesitate to tell us.
Thanks for your supporting.