mirror of
https://github.com/changkun/modern-cpp-tutorial.git
synced 2025-12-17 12:44:40 +03:00
see #12: support english website
This commit is contained in:
7
.gitignore
vendored
7
.gitignore
vendored
@@ -36,6 +36,11 @@ pdf/zh-cn/*.md
|
|||||||
|
|
||||||
website/db.json
|
website/db.json
|
||||||
website/public/*
|
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/cover-2nd.png
|
||||||
|
website/src/modern-cpp/assets/qq-group.png
|
||||||
website/src/modern-cpp/assets/figures/*
|
website/src/modern-cpp/assets/figures/*
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# 《高速上手 C++11/14/17/20》
|
# 《高速上手 C++11/14/17/20》
|
||||||
|
|
||||||
[](./README.md) [](./README-zh-cn.md) [](./DONATE.md) [](./COMMUNITY.md)
|
[](./README.md) [](./README-zh-cn.md) [](./assets/donate.md) [](./assets/community.md)
|
||||||
|
|
||||||
## 本书目的
|
## 本书目的
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# C++11/14/17/20 On the Fly
|
# C++11/14/17/20 On the Fly
|
||||||
|
|
||||||
[](./README.md) [](./README-zh-cn.md) [](./DONATE.md) [](./COMMUNITY.md)
|
[](./README.md) [](./README-zh-cn.md) [](./assets/donate.md) [](./assets/community.md)
|
||||||
|
|
||||||
## Purpose
|
## Purpose
|
||||||
|
|
||||||
|
|||||||
@@ -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:
|
The book offers a telegram chat group, feel free to join if you are interested:
|
||||||
|
|
||||||
[](https://t.me/joinchat/FEeulBM5OVYzuDI4phQ9Mg)
|
[](https://t.me/joinchat/FEeulBM5OVYzuDI4phQ9Mg)
|
||||||
|
|
||||||
# 交流
|
## 交流
|
||||||
|
|
||||||
本书有以下读者 QQ 交流群,有兴趣的读者可以加入,加群需正确回答加群密码:
|
本书有以下读者 QQ 交流群,有兴趣的读者可以加入,加群需正确回答加群密码:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
> 提示: `bW9kZXJuLWNwcC10dXRvcmlhbC1naXRodWI=`
|
> 提示: `bW9kZXJuLWNwcC10dXRvcmlhbC1naXRodWI=`
|
||||||
@@ -4,17 +4,17 @@ type: about
|
|||||||
order: 1
|
order: 1
|
||||||
---
|
---
|
||||||
|
|
||||||
# Donate
|
## Donate
|
||||||
|
|
||||||
I would love if you support me to make the book better:
|
I would love if you support me to make the book better:
|
||||||
|
|
||||||
[](https://www.paypal.me/ouchangkun/4.99eur)
|
[](https://www.paypal.me/ouchangkun/4.99eur)
|
||||||
|
|
||||||
# 资助
|
## 资助
|
||||||
|
|
||||||
如果你认为本书对你起到了帮助,并希望赞助作者,可以通过下面的二维码给予支持:
|
如果你认为本书对你起到了帮助,并希望赞助作者,可以通过下面的二维码给予支持:
|
||||||
|
|
||||||
|微信|支付宝|
|
|微信|支付宝|
|
||||||
|:--:|:--:|
|
|:--:|:--:|
|
||||||
| | |
|
| | |
|
||||||
|
|
||||||
@@ -2,12 +2,15 @@ all: clean
|
|||||||
node install.js
|
node install.js
|
||||||
python3 filter.py
|
python3 filter.py
|
||||||
cp ../assets/cover-2nd.png ./src/modern-cpp/assets/cover-2nd.png
|
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/alipay.jpg ./src/modern-cpp/assets/alipay.jpg
|
||||||
cp ../assets/wechat.jpg ./src/modern-cpp/assets/wechat.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 ../assets/figures ./src/modern-cpp/assets/figures
|
||||||
cp -r ../exercises ./src/modern-cpp/book/
|
cp -r ../exercises ./src/modern-cpp/
|
||||||
cp -r ../code ./src/modern-cpp/book/
|
cp -r ../code ./src/modern-cpp/
|
||||||
hexo generate
|
hexo generate
|
||||||
mv public/index.html public/modern-cpp/index.html
|
mv public/index.html public/modern-cpp/index.html
|
||||||
s: all
|
s: all
|
||||||
@@ -15,7 +18,12 @@ s: all
|
|||||||
clean:
|
clean:
|
||||||
rm -rf ./src/modern-cpp/assets/cover-2nd.png
|
rm -rf ./src/modern-cpp/assets/cover-2nd.png
|
||||||
rm -rf ./src/modern-cpp/assets/figures
|
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/alipay.jpg
|
||||||
rm -rf ./src/modern-cpp/assets/wechat.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
|
||||||
|
|
||||||
@@ -4,16 +4,18 @@ import os
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
source_dir = [
|
source_dir = [
|
||||||
'../book/zh-cn/'
|
'../book/zh-cn/',
|
||||||
|
'../book/en-us/'
|
||||||
]
|
]
|
||||||
|
|
||||||
destination_dir = [
|
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']
|
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 index, source in enumerate(source_dir):
|
||||||
for chapter in chapters:
|
for chapter in chapters:
|
||||||
|
|||||||
3764
website/package-lock.json
generated
Normal file
3764
website/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@
|
|||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"hexo": {
|
"hexo": {
|
||||||
"version": "3.8.0"
|
"version": "3.9.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"hexo-generator-index": "^0.2.1",
|
"hexo-generator-index": "^0.2.1",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: 版权声明
|
title: 版权声明
|
||||||
type: about
|
type: about
|
||||||
order: 2
|
order: 3
|
||||||
---
|
---
|
||||||
|
|
||||||
<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/"><img alt="知识共享许可协议" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-nd/4.0/80x15.png" /></a>
|
<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/"><img alt="知识共享许可协议" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-nd/4.0/80x15.png" /></a>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
site_description: "现代 C++ | 高速上手 C++ 11/14/17/20"
|
site_description: "Modern C++ | C++ 11/14/17/20 On the Fly | 现代 C++ | 高速上手 C++11/14/17/20"
|
||||||
google_analytics:
|
google_analytics:
|
||||||
root_domain: changkun.de/modern-cpp
|
root_domain: changkun.de/modern-cpp
|
||||||
moderncpp_version: 2.0.0
|
moderncpp_version: 2.0.0
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
<div class="sidebar">
|
<div class="sidebar">
|
||||||
<div class="sidebar-inner-index">
|
<div class="sidebar-inner-index">
|
||||||
<ul class="main-menu">
|
<ul class="main-menu">
|
||||||
<%- partial('partials/main_menu', { context: 'sidebar' }) %>
|
<% if (page.type == 'book-en-us') { %>
|
||||||
|
<%- partial('partials/main_menu_en', { context: 'nav' }) %>
|
||||||
|
<% } else {%>
|
||||||
|
<%- partial('partials/main_menu', { context: 'nav' }) %>
|
||||||
|
<% } %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -17,17 +21,38 @@
|
|||||||
</h1>
|
</h1>
|
||||||
<h2>第二版</h2>
|
<h2>第二版</h2>
|
||||||
<p>
|
<p>
|
||||||
<a class="button white" href="<%- url_for("/modern-cpp/book/00-preface/") %>">立即阅读</a>
|
<a class="button white" href="<%- url_for("/modern-cpp/zh-cn/00-preface/") %>">🇨🇳 立即阅读</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="hero">
|
||||||
|
<div class="inner">
|
||||||
|
<div class="left">
|
||||||
|
<img class="hero-logo" src="<%- url_for("/modern-cpp/assets/cover-2nd-en.png") %>">
|
||||||
|
</div><div class="right">
|
||||||
|
<h4>Changkun Ou</h4>
|
||||||
|
<h1>
|
||||||
|
C++ 11/14/17/20<br>On the Fly
|
||||||
|
</h1>
|
||||||
|
<h2>Second Edition</h2>
|
||||||
|
<p>
|
||||||
|
<a class="button white" href="<%- url_for("/modern-cpp/en-us/00-preface/") %>">🇬🇧 Read Now</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="footer">
|
<div id="footer">
|
||||||
<p>
|
<p>
|
||||||
<a href="https://changkun.de">欧长坤</a> © 2016-<%- new Date().getFullYear() %> 版权所有,
|
<a href="https://changkun.de">欧长坤</a> © 2016-<%- new Date().getFullYear() %> 版权所有,
|
||||||
采用<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/">知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议许可</a>,代码使用 <a href="https://opensource.org/licenses/MIT" target="_blank">MIT</a> 协议开源。</a>
|
采用<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/">知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议许可</a>,代码使用 <a href="https://opensource.org/licenses/MIT" target="_blank">MIT</a> 协议开源。</a>
|
||||||
</p>
|
</p>
|
||||||
|
<p>
|
||||||
|
<a href="https://changkun.de">Changkun Ou</a> © 2016-<%- new Date().getFullYear() %>.
|
||||||
|
The book is licensed under <a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/">Creative Commons Attribution-NonCommercial-NoDerivatives 4.0</a>, code is open sourced under the <a href="https://opensource.org/licenses/MIT" target="_blank">MIT</a> License. </a>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<script src="https://cdn.rawgit.com/wnda/pivot/master/pivot.js"></script>
|
<script src="https://cdn.rawgit.com/wnda/pivot/master/pivot.js"></script>
|
||||||
<script>pivot.init({ selector: ".hero-logo", shine: true, shadow: true, scale: true});</script>
|
<script>pivot.init({ selector: ".hero-logo", shine: true, shadow: true, scale: true});</script>
|
||||||
@@ -3,7 +3,11 @@
|
|||||||
<% } else { %>
|
<% } else { %>
|
||||||
<div class="sidebar">
|
<div class="sidebar">
|
||||||
<ul class="main-menu">
|
<ul class="main-menu">
|
||||||
<%- partial('partials/main_menu', { context: 'sidebar' }) %>
|
<% if (page.type == 'book-en-us') { %>
|
||||||
|
<%- partial('partials/main_menu_en', { context: 'nav' }) %>
|
||||||
|
<% } else {%>
|
||||||
|
<%- partial('partials/main_menu', { context: 'nav' }) %>
|
||||||
|
<% } %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<% } %>
|
<% } %>
|
||||||
@@ -17,13 +21,28 @@
|
|||||||
<span style="float: right;"><a href="<%- url_for(page.path) %>"><%- page.title %></a> →</span>
|
<span style="float: right;"><a href="<%- url_for(page.path) %>"><%- page.title %></a> →</span>
|
||||||
<% }) %>
|
<% }) %>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer">
|
|
||||||
<p>
|
<% if (page.type == 'book-en-us') { %>
|
||||||
<a href="https://changkun.de">欧长坤</a> © 2016-<%- new Date().getFullYear() %> 版权所有,
|
<div class="footer">
|
||||||
采用<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/">知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议许可</a>,代码使用 <a href="https://opensource.org/licenses/MIT" target="_blank">MIT</a> 协议开源。</a>
|
<p>
|
||||||
</p>
|
<a href="https://changkun.de">Changkun Ou</a> © 2016-<%- new Date().getFullYear() %>.
|
||||||
<p>
|
The book is licensed under <a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/">Creative Commons Attribution-NonCommercial-NoDerivatives 4.0</a>, code is open sourced under the <a href="https://opensource.org/licenses/MIT" target="_blank">MIT</a> License. </a>
|
||||||
如果你认为本书对你起到了帮助,可以<a href="/modern-cpp/about/donate.html">资助作者</a>。
|
</p>
|
||||||
</p>
|
<p>
|
||||||
</div>
|
If you like the book, you could <a href="/modern-cpp/about/donate.html">donate the author</a>.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<% } else {%>
|
||||||
|
<div class="footer">
|
||||||
|
<p>
|
||||||
|
<a href="https://changkun.de">欧长坤</a> © 2016-<%- new Date().getFullYear() %> 版权所有,
|
||||||
|
采用<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/">知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议许可</a>,代码使用 <a href="https://opensource.org/licenses/MIT" target="_blank">MIT</a> 协议开源。</a>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
如果你认为本书对你起到了帮助,可以<a href="/modern-cpp/about/donate.html">资助作者</a>。
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<% } %>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,9 +1,18 @@
|
|||||||
<div id="header">
|
<div id="header">
|
||||||
<a id="logo" href="<%- url_for("/modern-cpp/") %>">
|
<a id="logo" href="<%- url_for("/modern-cpp/") %>">
|
||||||
<img src="<%- url_for("/modern-cpp/assets/cover-2nd.png") %>">
|
<% if (page.type == 'book-en-us') { %>
|
||||||
<span>高速上手 C++ 11/14/17/20</span><sup class="beta">beta</sup>
|
<img src="<%- url_for("/modern-cpp/assets/cover-2nd-en.png") %>">
|
||||||
|
<span>C++ 11/14/17/20 On the Fly</span><sup class="beta">beta</sup>
|
||||||
|
<% } else {%>
|
||||||
|
<img src="<%- url_for("/modern-cpp/assets/cover-2nd.png") %>">
|
||||||
|
<span>高速上手 C++ 11/14/17/20</span><sup class="beta">beta</sup>
|
||||||
|
<% } %>
|
||||||
</a>
|
</a>
|
||||||
<ul id="nav">
|
<ul id="nav">
|
||||||
<%- partial('partials/main_menu', { context: 'nav' }) %>
|
<% if (page.type == 'book-en-us') { %>
|
||||||
|
<%- partial('partials/main_menu_en', { context: 'nav' }) %>
|
||||||
|
<% } else {%>
|
||||||
|
<%- partial('partials/main_menu', { context: 'nav' }) %>
|
||||||
|
<% } %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<a class="nav-link">资源</a><span class="arrow"></span>
|
<a class="nav-link">资源</a><span class="arrow"></span>
|
||||||
<ul class="nav-dropdown">
|
<ul class="nav-dropdown">
|
||||||
<li><ul>
|
<li><ul>
|
||||||
<li><a class="nav-link" href="<%- url_for("/modern-cpp/book/00-preface/") %>" >正文</a></li>
|
<li><a class="nav-link" href="<%- url_for("/modern-cpp/zh-cn/00-preface/") %>" >正文</a></li>
|
||||||
<!-- TODO -->
|
<!-- TODO -->
|
||||||
<!-- <li><a class="nav-link" href="<%- url_for("/modern-cpp/code/1/") %>" >代码</a></li>
|
<!-- <li><a class="nav-link" href="<%- url_for("/modern-cpp/code/1/") %>" >代码</a></li>
|
||||||
<li><a class="nav-link" href="<%- url_for("/modern-cpp/exercises/1/") %>" >习题</a></li>
|
<li><a class="nav-link" href="<%- url_for("/modern-cpp/exercises/1/") %>" >习题</a></li>
|
||||||
@@ -16,28 +16,28 @@
|
|||||||
<ul class="nav-dropdown">
|
<ul class="nav-dropdown">
|
||||||
<li><ul>
|
<li><ul>
|
||||||
<li><a class="nav-link" href="<%- url_for("/modern-cpp/about/donate.html") %>" >资助</a></li>
|
<li><a class="nav-link" href="<%- url_for("/modern-cpp/about/donate.html") %>" >资助</a></li>
|
||||||
|
<li><a class="nav-link" href="<%- url_for("/modern-cpp/about/community.html") %>" >社区</a></li>
|
||||||
<li><a class="nav-link" href="<%- url_for("/modern-cpp/about/copyright.html") %>" >版权声明</a></li>
|
<li><a class="nav-link" href="<%- url_for("/modern-cpp/about/copyright.html") %>" >版权声明</a></li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-dropdown-container language">
|
||||||
|
<a class="nav-link">
|
||||||
|
<span style="content: url(/modern-cpp/assets/lang/cn.svg); width: 15px; height: 15px; margin-right: 5px; vertical-align: middle; margin-bottom: 2px;"></span>
|
||||||
|
中文
|
||||||
|
</a><span class="arrow"></span>
|
||||||
|
<ul class="nav-dropdown">
|
||||||
|
<li><ul>
|
||||||
|
<li><a class="nav-link" target="_blank" href="/modern-cpp/en-us/00-preface/">
|
||||||
|
<span style="content: url(/modern-cpp/assets/lang/en.svg); width: 15px; height: 15px; margin-right: 5px; vertical-align: middle; margin-bottom: 2px;"></span>
|
||||||
|
English
|
||||||
|
</a></li>
|
||||||
|
</ul></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li class="nav-dropdown-container about">
|
<li class="nav-dropdown-container about">
|
||||||
<a class="nav-link" href="https://github.com/changkun/modern-cpp-tutorial">GitHub</a>
|
<a class="nav-link" href="https://github.com/changkun/modern-cpp-tutorial">GitHub</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="nav-dropdown-container language">
|
|
||||||
<a class="nav-link">
|
|
||||||
<span style="content: url(/modern-cpp/assets/lang/cn.svg); width: 15px; height: 15px; margin-right: 5px; vertical-align: middle; margin-bottom: 2px;"></span>
|
|
||||||
中文
|
|
||||||
</a>
|
|
||||||
<!-- TODO -->
|
|
||||||
<!-- <span class="arrow"></span>
|
|
||||||
<ul class="nav-dropdown">
|
|
||||||
<li>
|
|
||||||
<a class="nav-link" target="_blank">
|
|
||||||
<span style="content: url(/modern-cpp/assets/lang/en.svg); width: 15px; height: 15px; margin-right: 5px; vertical-align: middle; margin-bottom: 2px;"></span>
|
|
||||||
English (soon)
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul> -->
|
|
||||||
</li>
|
|
||||||
42
website/themes/moderncpp/layout/partials/main_menu_en.ejs
Normal file
42
website/themes/moderncpp/layout/partials/main_menu_en.ejs
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<li class="nav-dropdown-container resource">
|
||||||
|
<a class="nav-link">Resources</a><span class="arrow"></span>
|
||||||
|
<ul class="nav-dropdown">
|
||||||
|
<li><ul>
|
||||||
|
<li><a class="nav-link" href="<%- url_for("/modern-cpp/en-us/00-preface/") %>" >Book</a></li>
|
||||||
|
<!-- TODO -->
|
||||||
|
<!-- <li><a class="nav-link" href="<%- url_for("/modern-cpp/code/1/") %>" >Code</a></li>
|
||||||
|
<li><a class="nav-link" href="<%- url_for("/modern-cpp/exercises/1/") %>" >Exercise</a></li>
|
||||||
|
<li><a class="nav-link" href="<%- url_for("/modern-cpp/answers/1/") %>" >Answers</a></li> -->
|
||||||
|
</ul></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-dropdown-container about">
|
||||||
|
<a class="nav-link">About</a><span class="arrow"></span>
|
||||||
|
<ul class="nav-dropdown">
|
||||||
|
<li><ul>
|
||||||
|
<li><a class="nav-link" href="<%- url_for("/modern-cpp/about/donate.html") %>" >Donate</a></li>
|
||||||
|
<li><a class="nav-link" href="<%- url_for("/modern-cpp/about/community.html") %>" >Community</a></li>
|
||||||
|
<li><a class="nav-link" href="<%- url_for("/modern-cpp/about/copyright.html") %>" >Copyright</a></li>
|
||||||
|
</ul></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-dropdown-container language">
|
||||||
|
<a class="nav-link">
|
||||||
|
<span style="content: url(/modern-cpp/assets/lang/en.svg); width: 15px; height: 15px; margin-right: 5px; vertical-align: middle; margin-bottom: 2px;"></span>
|
||||||
|
English
|
||||||
|
</a><span class="arrow"></span>
|
||||||
|
<ul class="nav-dropdown">
|
||||||
|
<li><ul>
|
||||||
|
<li><a class="nav-link" target="_blank" href="/modern-cpp/zh-cn/00-preface/">
|
||||||
|
<span style="content: url(/modern-cpp/assets/lang/cn.svg); width: 15px; height: 15px; margin-right: 5px; vertical-align: middle; margin-bottom: 2px;"></span>
|
||||||
|
中文
|
||||||
|
</a></li>
|
||||||
|
</ul></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-dropdown-container about">
|
||||||
|
<a class="nav-link" href="https://github.com/changkun/modern-cpp-tutorial">GitHub</a>
|
||||||
|
</li>
|
||||||
@@ -1,11 +1,28 @@
|
|||||||
<div class="sidebar">
|
<div class="sidebar">
|
||||||
<div class="sidebar-inner">
|
<div class="sidebar-inner">
|
||||||
<ul class="main-menu">
|
<ul class="main-menu">
|
||||||
<%- partial('partials/main_menu', { context: 'sidebar' }) %>
|
<% if (page.type == 'book-en-us') { %>
|
||||||
|
<%- partial('partials/main_menu_en', { context: 'nav' }) %>
|
||||||
|
<% } else {%>
|
||||||
|
<%- partial('partials/main_menu', { context: 'nav' }) %>
|
||||||
|
<% } %>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="list">
|
<div class="list">
|
||||||
<h2>
|
<h2>
|
||||||
<%-
|
<% if (page.type == 'book-en-us') { %>
|
||||||
|
<%-
|
||||||
|
type === 'exercises'
|
||||||
|
? 'Exercises'
|
||||||
|
: type === 'book-zh-cn'
|
||||||
|
? 'Main'
|
||||||
|
: type === 'answers'
|
||||||
|
? 'Reference Answers'
|
||||||
|
: type === 'about'
|
||||||
|
? 'About'
|
||||||
|
: (type.charAt(0).toUpperCase() + type.slice(1))
|
||||||
|
%>
|
||||||
|
<% } else {%>
|
||||||
|
<%-
|
||||||
type === 'exercises'
|
type === 'exercises'
|
||||||
? '习题'
|
? '习题'
|
||||||
: type === 'book-zh-cn'
|
: type === 'book-zh-cn'
|
||||||
@@ -15,7 +32,8 @@
|
|||||||
: type === 'about'
|
: type === 'about'
|
||||||
? '关于'
|
? '关于'
|
||||||
: (type.charAt(0).toUpperCase() + type.slice(1))
|
: (type.charAt(0).toUpperCase() + type.slice(1))
|
||||||
%>
|
%>
|
||||||
|
<% } %>
|
||||||
</h2>
|
</h2>
|
||||||
<%- partial('partials/toc', { type: type }) %>
|
<%- partial('partials/toc', { type: type }) %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
<div class="sidebar blog">
|
<div class="sidebar blog">
|
||||||
<div class="sidebar-inner">
|
<div class="sidebar-inner">
|
||||||
<ul class="main-menu">
|
<ul class="main-menu">
|
||||||
<%- partial('partials/main_menu', { context: 'nav' }) %>
|
<% if (page.type == 'book-en-us') { %>
|
||||||
|
<%- partial('partials/main_menu_en', { context: 'nav' }) %>
|
||||||
|
<% } else {%>
|
||||||
|
<%- partial('partials/main_menu', { context: 'nav' }) %>
|
||||||
|
<% } %>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="list">
|
<div class="list">
|
||||||
<ul style="padding: 0;">
|
<ul style="padding: 0;">
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ body
|
|||||||
body
|
body
|
||||||
-webkit-text-size-adjust: none
|
-webkit-text-size-adjust: none
|
||||||
font-size: 14px
|
font-size: 14px
|
||||||
|
margin-bottom: 200px
|
||||||
.sidebar
|
.sidebar
|
||||||
display: block
|
display: block
|
||||||
#header
|
#header
|
||||||
@@ -127,7 +128,7 @@ body
|
|||||||
#mobile-bar
|
#mobile-bar
|
||||||
display: block
|
display: block
|
||||||
#hero
|
#hero
|
||||||
padding: 70px 40px 100px
|
padding: 70px 40px 50px
|
||||||
.hero-logo
|
.hero-logo
|
||||||
float: none
|
float: none
|
||||||
margin: 30px 0 30px
|
margin: 30px 0 30px
|
||||||
|
|||||||
Reference in New Issue
Block a user