欢迎使用旧瓶装新酒的 Ruby on Rails Guides

https://guides.rubyonrails.org/ 最近进行了界面重新设计,我感觉是更傻逼了,所以用旧版的 UI 代码和最新版的 Markdown 文件自己搞了一个,网址是 https://rails-guides.xjtu.app/

git clone https://github.com/rails/rails
cp -r rails rails-old-guides-ui
cd rails-old-guides-ui
git checkout 9f01421d7d
rsync /f/rails/guides/source/ /f/rails-old-guides-ui/guides/source/ -av --delete --include="*.md" --exclude="*" 
rsync /f/rails/guides/source/documents.yaml /f/rails-old-guides-ui/guides/source/ -av
bundle
cd guides
RAILS_VERSION=`cd /f/rails && git show -s --format=%h`  rake guides:generate:html 
cfxjapp tunnel create rails-guides.xjtu.app                                                        :(
cfxjapp tunnel route dns rails-guides.xjtu.app rails-guides.xjtu.app                               :(

cat /etc/cf/rails-guides.xjtu.app.yml

tunnel: rails-guides.xjtu.app
credentials-file: /root/.cloudflared/ba1d6a75-f02e-4a9d-9090-6f7d3a24cc9c.json

ingress:
  - hostname: rails-guides.xjtu.app
    service: http://127.0.0.1:3003
  - service: http_status:404
git clone https://github.com/emikulic/darkhttpd
docker build -t darkhttpd .
docker run -p 127.0.0.1:3003:80 -v /srv/rails-guides/:/var/www/htdocs:ro --name darkhttpd-rails-guides  --restart=unless-stopped -d darkhttpd 
docker update --memory-swap "500m" --memory "500m" --cpuset-cpus "1" rails-guides-v7.2.0.beta1-9f01421d7d-with-latest-markdowns
start cf@rails-guides

更新:

cd /f/rails
git pull
cd /f/rails-old-guides-ui/guides
rm -r output
RAILS_VERSION=`cd /f/rails && git show -s --format=%h`  rake guides:generate:html
rsync /f/rails-old-guides-ui/guides/output/ mnz:/srv/rails-guides/ -av --delete      
ssh mnz chmod -R 755 /srv/rails-guides
ssh mnz docker restart darkhttpd-rails-guides
2 Likes