Skip to content

Commit 20f6a75

Browse files
committed
website: host pdf version to website
Fix changkun#73
1 parent ff2dc60 commit 20f6a75

File tree

7 files changed

+14
-6
lines changed

7 files changed

+14
-6
lines changed

β€ŽMakefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
DOCKER_ENV=changkun/modern-cpp-tutorial:build-env
22
LANGS = zh-cn en-us
3-
ALL_BUILDS = pdf website
3+
ALL_BUILDS = website pdf
44

55
# dep
66

@@ -9,6 +9,8 @@ all: $(ALL_BUILDS)
99
pdf: $(LANGS)
1010
$(LANGS):
1111
cd pdf/$@ && make && make clean
12+
mkdir -p website/public/modern-cpp/pdf
13+
mv pdf/$@/modern-cpp-tutorial.pdf website/public/modern-cpp/pdf/modern-cpp-tutorial-$@.pdf
1214

1315
website:
1416
cd website && make

β€ŽREADME-zh-cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
你可δ»₯选择δ»₯δΈ‹ε‡ η§ι˜…θ―»ζ–ΉεΌοΌš
2323

2424
1. [GitHub 在线](./book/zh-cn/toc.md)
25-
2. [PDF ζ–‡ζ‘£](./pdf/zh-cn/modern-cpp-tutorial.pdf)
25+
2. [PDF ζ–‡ζ‘£](https://changkun.de/modern-cpp/modern-cpp-tutorial-zh-cn.pdf)
2626
3. [网站](https://changkun.de/modern-cpp/)
2727

2828
## 相关代码

β€ŽREADME.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ In addition, The author would like to encourage that readers should be able to u
2525
You can choose from the following reading methods:
2626

2727
- [GitHub Online](./book/en-us/toc.md)
28-
- [PDF document](./pdf/en-us/modern-cpp-tutorial.pdf)
28+
- [PDF document](https://changkun.de/modern-cpp/modern-cpp-tutorial-en-us.pdf)
2929
- [Website](https://changkun.de/modern-cpp)
3030

3131
## Code

β€Žpdf/en-us/modern-cpp-tutorial.pdf

-1.59 MB
Binary file not shown.

β€Žpdf/zh-cn/modern-cpp-tutorial.pdf

-2.42 MB
Binary file not shown.

β€Žwebsite/themes/moderncpp/layout/index.ejs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
</h1>
2222
<h2>η¬¬δΊŒη‰ˆ</h2>
2323
<p>
24-
<a class="button white" href="<%- url_for("/modern-cpp/zh-cn/00-preface/") %>">πŸ‡¨πŸ‡³ η«‹ε³ι˜…θ―»</a>
24+
<a class="button white" href="<%- url_for("/modern-cpp/zh-cn/00-preface/") %>">πŸ‡¨πŸ‡³ εœ¨ηΊΏι˜…θ―»</a>
25+
<a class="button download" href="<%- url_for("/modern-cpp/pdf/modern-cpp-tutorial-zh-cn.pdf") %>">πŸ‡¨πŸ‡³ δΈ‹θ½½</a>
2526
</p>
2627
</div>
2728
</div>
@@ -38,7 +39,8 @@
3839
</h1>
3940
<h2>Second Edition</h2>
4041
<p>
41-
<a class="button white" href="<%- url_for("/modern-cpp/en-us/00-preface/") %>">πŸ‡¬πŸ‡§ Read Now</a>
42+
<a class="button white" href="<%- url_for("/modern-cpp/en-us/00-preface/") %>">πŸ‡¬πŸ‡§ Read Online</a>
43+
<a class="button download" href="<%- url_for("/modern-cpp/en-us/00-preface/") %>">πŸ‡¬πŸ‡§ Download</a>
4244
</p>
4345
</div>
4446
</div>

β€Žwebsite/themes/moderncpp/source/modern-cpp/css/_common.styl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,16 @@ a.button
5656
transition: all .15s ease
5757
box-sizing: border-box
5858
border: 1px solid lighten($theme, 8%)
59+
width: 200px;
5960
&.white
6061
background-color: #fff
6162
color: $theme
62-
a.button:hover
63+
&.download
6364
background-color: $theme
6465
color: #fff
66+
a.button:hover
67+
background-color: $theme
68+
color: #fff
6569

6670
.highlight
6771
overflow-x: auto

0 commit comments

Comments
Β (0)