Skip to content

Commit

Permalink
see #12: support english website
Browse files Browse the repository at this point in the history
  • Loading branch information
changkun committed Jul 9, 2019
1 parent 7c88f42 commit ba034ec
Show file tree
Hide file tree
Showing 19 changed files with 3,953 additions and 54 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ pdf/zh-cn/*.md

website/db.json
website/public/*
website/src/modern-cpp/book/*
website/src/modern-cpp/zh-cn/*
website/src/modern-cpp/en-us/*
website/src/modern-cpp/exercises
website/src/modern-cpp/code
website/src/modern-cpp/assets/cover-2nd-en.png
website/src/modern-cpp/assets/cover-2nd.png
website/src/modern-cpp/assets/qq-group.png
website/src/modern-cpp/assets/figures/*
2 changes: 1 addition & 1 deletion README-zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# 《高速上手 C++11/14/17/20》

[![](https://img.shields.io/badge/language-English-blue.svg?style=flat-square)](./README.md) [![](https://img.shields.io/badge/language-简体中文-red.svg?style=flat-square)](./README-zh-cn.md) [![](https://img.shields.io/badge/€-donate-ff69b4.svg?style=flat-square)](./DONATE.md) [![](https://img.shields.io/badge/chat-community-667ed5.svg?style=flat-square)](./COMMUNITY.md)
[![](https://img.shields.io/badge/language-English-blue.svg?style=flat-square)](./README.md) [![](https://img.shields.io/badge/language-简体中文-red.svg?style=flat-square)](./README-zh-cn.md) [![](https://img.shields.io/badge/€-donate-ff69b4.svg?style=flat-square)](./assets/DONATE.md) [![](https://img.shields.io/badge/chat-community-667ed5.svg?style=flat-square)](./assets/COMMUNITY.md)

## 本书目的

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# C++11/14/17/20 On the Fly

[![](https://img.shields.io/badge/language-English-blue.svg?style=flat-square)](./README.md) [![](https://img.shields.io/badge/language-简体中文-red.svg?style=flat-square)](./README-zh-cn.md) [![](https://img.shields.io/badge/€-donate-ff69b4.svg?style=flat-square)](./DONATE.md) [![](https://img.shields.io/badge/chat-community-667ed5.svg?style=flat-square)](./COMMUNITY.md)
[![](https://img.shields.io/badge/language-English-blue.svg?style=flat-square)](./README.md) [![](https://img.shields.io/badge/language-简体中文-red.svg?style=flat-square)](./README-zh-cn.md) [![](https://img.shields.io/badge/€-donate-ff69b4.svg?style=flat-square)](./assets/DONATE.md) [![](https://img.shields.io/badge/chat-community-667ed5.svg?style=flat-square)](./assets/COMMUNITY.md)

## Purpose

Expand Down
12 changes: 9 additions & 3 deletions COMMUNITY.md → assets/COMMUNITY.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
# Community
---
title: 社区
type: about
order: 2
---

## Community

The book offers a telegram chat group, feel free to join if you are interested:

[![](https://img.shields.io/badge/chat-telegram-blue.svg?style=popout-square&logo=telegram)](https://t.me/joinchat/FEeulBM5OVYzuDI4phQ9Mg)

# 交流
## 交流

本书有以下读者 QQ 交流群,有兴趣的读者可以加入,加群需正确回答加群密码:

![](./assets/qq-group.png)
![](../assets/qq-group.png)

> 提示: `bW9kZXJuLWNwcC10dXRvcmlhbC1naXRodWI=`
6 changes: 3 additions & 3 deletions DONATE.md → assets/DONATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ type: about
order: 1
---

# Donate
## Donate

I would love if you support me to make the book better:

[![](https://img.shields.io/badge/donate-PayPal-104098.svg?style=popout-square&logo=PayPal)](https://www.paypal.me/ouchangkun/4.99eur)

# 资助
## 资助

如果你认为本书对你起到了帮助,并希望赞助作者,可以通过下面的二维码给予支持:

|微信|支付宝|
|:--:|:--:|
|![](./assets/wechat.jpg) | ![](./assets/alipay.jpg)|
|![](../assets/wechat.jpg) | ![](../assets/alipay.jpg)|

18 changes: 13 additions & 5 deletions website/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,28 @@ all: clean
node install.js
python3 filter.py
cp ../assets/cover-2nd.png ./src/modern-cpp/assets/cover-2nd.png
cp ../assets/cover-2nd-en.png ./src/modern-cpp/assets/cover-2nd-en.png
cp ../assets/alipay.jpg ./src/modern-cpp/assets/alipay.jpg
cp ../assets/wechat.jpg ./src/modern-cpp/assets/wechat.jpg
cp ../DONATE.md ./src/modern-cpp/about/
cp ../assets/qq-group.png ./src/modern-cpp/assets/qq-group.png
cp ../assets/DONATE.md ./src/modern-cpp/about/
cp ../assets/COMMUNITY.md ./src/modern-cpp/about/
cp -r ../assets/figures ./src/modern-cpp/assets/figures
cp -r ../exercises ./src/modern-cpp/book/
cp -r ../code ./src/modern-cpp/book/
cp -r ../exercises ./src/modern-cpp/
cp -r ../code ./src/modern-cpp/
hexo generate
mv public/index.html public/modern-cpp/index.html
s: all
node_modules/serve/bin/serve.js ./public
clean:
rm -rf ./src/modern-cpp/assets/cover-2nd.png
rm -rf ./src/modern-cpp/assets/figures
rm -rf public db.json src/modern-cpp/book
rm -rf public db.json src/modern-cpp/zh-cn
rm -rf public db.json src/modern-cpp/en-us
rm -rf ./src/modern-cpp/assets/alipay.jpg
rm -rf ./src/modern-cpp/assets/wechat.jpg
rm -rf ./src/modern-cpp/about/donate.md
rm -rf ./src/modern-cpp/about/DONATE.md
rm -rf ./src/modern-cpp/about/COMMUNITY.md
rm -rf ./src/modern-cpp/code
rm -rf ./src/modern-cpp/exercises

8 changes: 5 additions & 3 deletions website/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@
import re

source_dir = [
'../book/zh-cn/'
'../book/zh-cn/',
'../book/en-us/'
]

destination_dir = [
'./src/modern-cpp/book/'
'./src/modern-cpp/zh-cn/',
'./src/modern-cpp/en-us/'
]

chapters = ['00-preface.md', '01-intro.md', '02-usability.md', '03-runtime.md', '04-containers.md', '05-pointers.md', '06-regex.md', '07-thread.md', '08-filesystem.md', '09-others.md', '10-cpp20.md', 'appendix1.md', 'appendix2.md']

ignores = ['TOC', '返回目录', '许可', 'license']
ignores = ['TOC', '返回目录', '许可', 'license', 'Table of Content', 'License']

for index, source in enumerate(source_dir):
for chapter in chapters:
Expand Down
Loading

0 comments on commit ba034ec

Please sign in to comment.