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:
@@ -1,7 +1,11 @@
|
||||
<div class="sidebar">
|
||||
<div class="sidebar-inner-index">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
@@ -17,17 +21,38 @@
|
||||
</h1>
|
||||
<h2>第二版</h2>
|
||||
<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>
|
||||
</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">
|
||||
<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="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>
|
||||
<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>
|
||||
@@ -3,7 +3,11 @@
|
||||
<% } else { %>
|
||||
<div class="sidebar">
|
||||
<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>
|
||||
</div>
|
||||
<% } %>
|
||||
@@ -17,13 +21,28 @@
|
||||
<span style="float: right;"><a href="<%- url_for(page.path) %>"><%- page.title %></a> →</span>
|
||||
<% }) %>
|
||||
</div>
|
||||
<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>
|
||||
|
||||
<% if (page.type == 'book-en-us') { %>
|
||||
<div class="footer">
|
||||
<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>
|
||||
<p>
|
||||
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>
|
||||
|
||||
@@ -1,9 +1,18 @@
|
||||
<div id="header">
|
||||
<a id="logo" href="<%- url_for("/modern-cpp/") %>">
|
||||
<img src="<%- url_for("/modern-cpp/assets/cover-2nd.png") %>">
|
||||
<span>高速上手 C++ 11/14/17/20</span><sup class="beta">beta</sup>
|
||||
<% if (page.type == 'book-en-us') { %>
|
||||
<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>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<a class="nav-link">资源</a><span class="arrow"></span>
|
||||
<ul class="nav-dropdown">
|
||||
<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 -->
|
||||
<!-- <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>
|
||||
@@ -16,28 +16,28 @@
|
||||
<ul class="nav-dropdown">
|
||||
<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/community.html") %>" >社区</a></li>
|
||||
<li><a class="nav-link" href="<%- url_for("/modern-cpp/about/copyright.html") %>" >版权声明</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</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">
|
||||
<a class="nav-link" href="https://github.com/changkun/modern-cpp-tutorial">GitHub</a>
|
||||
</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-inner">
|
||||
<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>
|
||||
<div class="list">
|
||||
<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 === 'book-zh-cn'
|
||||
@@ -15,7 +32,8 @@
|
||||
: type === 'about'
|
||||
? '关于'
|
||||
: (type.charAt(0).toUpperCase() + type.slice(1))
|
||||
%>
|
||||
%>
|
||||
<% } %>
|
||||
</h2>
|
||||
<%- partial('partials/toc', { type: type }) %>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
<div class="sidebar blog">
|
||||
<div class="sidebar-inner">
|
||||
<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>
|
||||
<div class="list">
|
||||
<ul style="padding: 0;">
|
||||
|
||||
Reference in New Issue
Block a user