How to config vuepress to your project.
- create
.vuepressfolder. - Create
config.jsfile - Add below snippet in
config.js.
| function isLeapYear(year: number) { | |
| return new Date(year, 1, 29).getDate() === 29 | |
| } | |
| export default isLeapYear |
| <img | |
| src={this.props.img_url} | |
| alt={this.props.img_alt} | |
| onError={(e) => { | |
| e.target.onerror = null | |
| e.target.src = '/img/error-image.png' | |
| }} | |
| /> |
| window.testVar = null; | |
| function waitForCondition (variable) { | |
| function waitFor(result) { | |
| if (result) { | |
| return result; | |
| } | |
| return new Promise((resolve) => setTimeout(resolve, 100)) | |
| .then(() => Promise.resolve(window[variable])) | |
| .then((res) => waitFor(res)); |
| window.Clipboard = (function(window, document, navigator) { | |
| var textArea, | |
| copy; | |
| function isOS() { | |
| return navigator.userAgent.match(/ipad|iphone/i); | |
| } | |
| function createTextArea(text) { | |
| textArea = document.createElement('textArea'); |
| /* | |
| This .scss loop will create "margin helpers" and "padding helpers" for use in your web projects. | |
| It will generate several classes such as: | |
| .m-r-10 which gives margin-right 10 pixels. | |
| .m-r-15 gives MARGIN to the RIGHT 15 pixels. | |
| .m-t-15 gives MARGIN to the TOP 15 pixels and so on. | |
| .p-b-5 gives PADDING to the BOTTOM of 5 pixels | |
| .p-l-40 gives PADDING to the LEFT of 40 pixels |
| import React, { Component } from 'react' | |
| import { Router, Route, Link, IndexRoute, hashHistory, browserHistory, DefaultRoute, IndexLink } from 'react-router' | |
| class App extends Component { | |
| render () { | |
| return ( | |
| <Router history={hashHistory}> | |
| <Route path='/' component={Container}> | |
| <IndexRoute component={Home} /> | |
| <Route path='/address' component={Address}> |
| import React, { Component } from 'react' | |
| import { Router, Route, Link, IndexRoute, hashHistory, browserHistory, DefaultRoute } from 'react-router' | |
| class App extends Component { | |
| render () { | |
| return ( | |
| <Router history={hashHistory}> | |
| <Route path='/' component={Container}> | |
| <IndexRoute component={Home} /> | |
| <Route path='address' component={Address} /> |
| " Make IE Better Compatible " | |
| <!--[if IE]> | |
| <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> | |
| <![endif]--> | |
| ====================================================== | |
| IE6 Only | |
| ================== | |
| _selector {...} |
一路过来也部署过3、4个Rails App了,其中也使用过mina等远程部署项目,但每次去部署新的App还是会遇到一些大大小小问题。最近和几个朋友正在做一个应用,在部署的过程中又被自己坑了~所以今天准备总结一下,方便自己未来的部署之路,也方便Rails新手学习使用。
#####环境说明 因为Linux的发型版太多,所以不能一一举例,经过自己的实践体验,发现Ubuntu可以更轻松的部署您的Rails App(个人看法,曾经在Centos下部署,遇到了好多坑)。所以该博文将基于以下的部署环境。