#如何将 Rails 应用程序部署到 VPS 上
如果已经在 VPS 上假设好了 Rails 生产环境,接下来就可以将部署应用程序了。
###需要用到的工具
| --- | |
| :verbose: true | |
| :bulk_threshold: 1000 | |
| install: --no-ri --no-rdoc --env-shebang | |
| :source: | |
| - http://rubygems.org | |
| - http://gemcutter.org | |
| - http://gems.rubyforge.org/ | |
| - http://gems.github.com | |
| :benchmark: false |
#如何将 Rails 应用程序部署到 VPS 上
如果已经在 VPS 上假设好了 Rails 生产环境,接下来就可以将部署应用程序了。
###需要用到的工具
#link 没有 charset 属性
相信不少人都见过下面的 link 代码片段:
<link rel="stylesheet" href="stylesheet.css" type="text/css" charset="utf-8" />其中比较陌生的是 charset 属性。在 [HTML 4.01 的规范文档中][1]有这样的记述:
| /** | |
| * jQuery.HTML5 placeholder - Placeholder plugin for input fields | |
| * Written by Ludo Helder (ludo DOT helder AT gmail DOT com) | |
| * Licensed under the WTFPL (http://sam.zoy.org/wtfpl/). | |
| * Date: 2010/11/18 | |
| * | |
| * @author Ludo Helder | |
| * @version 1.0.1 | |
| * | |
| **/ |
| 站点 | html lang | 编码 | 字体定义 |
|---|---|---|---|
| 无 | utf-8 | font-family: arial,sans-serif; font-size: small; |
|
| 百度 | 无 | gb2312 | font: 12px arial; |
| 必应 | en | utf-8 | font-family: Arial,Sans-Serif; font-size: small; |
| MSN中文网 | 无 | utf-8 | font-family: Tahoma, 宋体, sans-serif; |
| 搜狐 | zh-CN | GBK | font: 12px '宋体'; |
| 搜狐微博 | 无 | GBK | font: normal 12px/1.667 Tahoma,Arial,"宋体b8b\4f53",sans-serif; |
| 新浪 | 无 | gb2312 | font: 12px "SimSun","宋体","Arial Narrow"; |
| <?php | |
| add_action('after_setup_theme', 'ac_theme_setup'); | |
| function ac_theme_setup(){ | |
| // 自定义导航菜单 | |
| register_nav_menu('top', '顶部菜单'); | |
| } | |
| ?> |
| <?php | |
| /** | |
| * Add Links to WP3.3+ New Toolbar | |
| * | |
| */ | |
| add_action('admin_bar_menu', 'add_toolbar_items', 100); | |
| function add_toolbar_items($admin_bar) { | |
| // Top level menu | |
| $admin_bar->add_menu( array( | |
| 'id' => 'my-item', |
| /* | |
| Prince - Fonts stylesheet | |
| http://www.princexml.com | |
| */ | |
| /* standard "serif" font family */ | |
| @font-face { | |
| font-family: serif; | |
| src: local("Arial Unicode MS") /* last resort font */ |
| require 'fileutils' | |
| # Usage: rake duokanify file=path/to/sample.epub | |
| desc 'Adds dtb:depth to ncx file in an ePub' | |
| task :duokanify do | |
| unless ENV['file'] | |
| abort("ERROR: Please provide the ePub file path!\nexit") | |
| end | |
| unless ENV['file'].end_with?('.epub') |
| require 'json' | |
| class String | |
| def camelize | |
| string = self | |
| string.split('_').map(&:capitalize).join('') | |
| end | |
| end | |
| module PandocFilter |