website: host pdf version to website

Fix #73
This commit is contained in:
Changkun Ou
2019-07-19 13:59:11 +02:00
parent ff2dc605ad
commit 20f6a75ed4
7 changed files with 14 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
DOCKER_ENV=changkun/modern-cpp-tutorial:build-env DOCKER_ENV=changkun/modern-cpp-tutorial:build-env
LANGS = zh-cn en-us LANGS = zh-cn en-us
ALL_BUILDS = pdf website ALL_BUILDS = website pdf
# dep # dep
@@ -9,6 +9,8 @@ all: $(ALL_BUILDS)
pdf: $(LANGS) pdf: $(LANGS)
$(LANGS): $(LANGS):
cd pdf/$@ && make && make clean cd pdf/$@ && make && make clean
mkdir -p website/public/modern-cpp/pdf
mv pdf/$@/modern-cpp-tutorial.pdf website/public/modern-cpp/pdf/modern-cpp-tutorial-$@.pdf
website: website:
cd website && make cd website && make

View File

@@ -22,7 +22,7 @@
你可以选择以下几种阅读方式: 你可以选择以下几种阅读方式:
1. [GitHub 在线](./book/zh-cn/toc.md) 1. [GitHub 在线](./book/zh-cn/toc.md)
2. [PDF 文档](./pdf/zh-cn/modern-cpp-tutorial.pdf) 2. [PDF 文档](https://changkun.de/modern-cpp/modern-cpp-tutorial-zh-cn.pdf)
3. [网站](https://changkun.de/modern-cpp/) 3. [网站](https://changkun.de/modern-cpp/)
## 相关代码 ## 相关代码

View File

@@ -25,7 +25,7 @@ In addition, The author would like to encourage that readers should be able to u
You can choose from the following reading methods: You can choose from the following reading methods:
- [GitHub Online](./book/en-us/toc.md) - [GitHub Online](./book/en-us/toc.md)
- [PDF document](./pdf/en-us/modern-cpp-tutorial.pdf) - [PDF document](https://changkun.de/modern-cpp/modern-cpp-tutorial-en-us.pdf)
- [Website](https://changkun.de/modern-cpp) - [Website](https://changkun.de/modern-cpp)
## Code ## Code

Binary file not shown.

Binary file not shown.

View File

@@ -21,7 +21,8 @@
</h1> </h1>
<h2>第二版</h2> <h2>第二版</h2>
<p> <p>
<a class="button white" href="<%- url_for("/modern-cpp/zh-cn/00-preface/") %>">🇨🇳 立即阅读</a> <a class="button white" href="<%- url_for("/modern-cpp/zh-cn/00-preface/") %>">🇨🇳 在线阅读</a>
<a class="button download" href="<%- url_for("/modern-cpp/pdf/modern-cpp-tutorial-zh-cn.pdf") %>">🇨🇳 下载</a>
</p> </p>
</div> </div>
</div> </div>
@@ -38,7 +39,8 @@
</h1> </h1>
<h2>Second Edition</h2> <h2>Second Edition</h2>
<p> <p>
<a class="button white" href="<%- url_for("/modern-cpp/en-us/00-preface/") %>">🇬🇧 Read Now</a> <a class="button white" href="<%- url_for("/modern-cpp/en-us/00-preface/") %>">🇬🇧 Read Online</a>
<a class="button download" href="<%- url_for("/modern-cpp/en-us/00-preface/") %>">🇬🇧 Download</a>
</p> </p>
</div> </div>
</div> </div>

View File

@@ -56,9 +56,13 @@ a.button
transition: all .15s ease transition: all .15s ease
box-sizing: border-box box-sizing: border-box
border: 1px solid lighten($theme, 8%) border: 1px solid lighten($theme, 8%)
width: 200px;
&.white &.white
background-color: #fff background-color: #fff
color: $theme color: $theme
&.download
background-color: $theme
color: #fff
a.button:hover a.button:hover
background-color: $theme background-color: $theme
color: #fff color: #fff