mirror of
https://github.com/changkun/modern-cpp-tutorial.git
synced 2025-12-17 12:44:40 +03:00
resolve #5, 使用 hexo 编译网站
This commit is contained in:
33
website/themes/moderncpp/layout/index.ejs
Executable file
33
website/themes/moderncpp/layout/index.ejs
Executable file
@@ -0,0 +1,33 @@
|
||||
<div class="sidebar">
|
||||
<div class="sidebar-inner-index">
|
||||
<ul class="main-menu">
|
||||
<%- partial('partials/main_menu', { context: 'sidebar' }) %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="hero">
|
||||
<div class="inner">
|
||||
<div class="left">
|
||||
<img class="hero-logo" src="<%- url_for("/modern-cpp/images/cover-2nd.png") %>">
|
||||
</div><div class="right">
|
||||
<h4>欧长坤 著</h4>
|
||||
<h1>
|
||||
高速上手<br>C++ 11/14/17
|
||||
</h1>
|
||||
<h2>第二版</h2>
|
||||
<p>
|
||||
<a class="button white" href="<%- url_for("/modern-cpp/book/00-preface/") %>">立即阅读</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>
|
||||
</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>
|
||||
52
website/themes/moderncpp/layout/layout.ejs
Executable file
52
website/themes/moderncpp/layout/layout.ejs
Executable file
@@ -0,0 +1,52 @@
|
||||
<% var isIndex = page.path === 'index.html' %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title><%- page.title ? page.title + ' — ' : '' %>changkun.de</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="description" content="<%- theme.site_description %>">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
|
||||
<meta name="msapplication-TileColor" content="#ec9325">
|
||||
<meta name="theme-color" content="#ec8364">
|
||||
|
||||
<link href='//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600|Roboto Mono' rel='stylesheet' type='text/css'>
|
||||
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
|
||||
|
||||
<!-- main page styles -->
|
||||
<%- css(isIndex ? 'modern-cpp/css/index' : 'modern-cpp/css/page') %>
|
||||
|
||||
<!-- this needs to be loaded before guide's inline scripts -->
|
||||
<script src="<%- url_for("/modern-cpp/js/vue.min.js") %>"></script>
|
||||
<script>window.PAGE_TYPE = "<%- page.type %>"</script>
|
||||
|
||||
</head>
|
||||
<body class="<%- isIndex ? '' : 'docs' -%>">
|
||||
<div id="mobile-bar" data-bg-text="高速上手 C++ 11/14/17" <%- isIndex ? 'class="top"' : '' %>>
|
||||
<a class="menu-button"></a>
|
||||
<a class="logo" href="/modern-cpp/"></a>
|
||||
</div>
|
||||
<%- partial('partials/header') %>
|
||||
<% if (!isIndex) { %>
|
||||
<div id="main" class="fix-sidebar">
|
||||
<%- body %>
|
||||
</div>
|
||||
<% } else { %>
|
||||
<%- body %>
|
||||
<% } %>
|
||||
<script src="<%- url_for("/modern-cpp/js/smooth-scroll.min.js") %>"></script>
|
||||
|
||||
<!-- main custom script for sidebars, version selects etc. -->
|
||||
<script src="<%- url_for("/modern-cpp/js/css.escape.js") %>"></script>
|
||||
<script src="<%- url_for("/modern-cpp/js/common.js") %>"></script>
|
||||
|
||||
<!-- fastclick -->
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/fastclick/1.0.6/fastclick.min.js"></script>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
FastClick.attach(document.body)
|
||||
}, false)
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
26
website/themes/moderncpp/layout/page.ejs
Executable file
26
website/themes/moderncpp/layout/page.ejs
Executable file
@@ -0,0 +1,26 @@
|
||||
<% if (page.type) { %>
|
||||
<%- partial('partials/sidebar', { type: page.type, index: page.index }) %>
|
||||
<% } else { %>
|
||||
<div class="sidebar">
|
||||
<ul class="main-menu">
|
||||
<%- partial('partials/main_menu', { context: 'sidebar' }) %>
|
||||
</ul>
|
||||
</div>
|
||||
<% } %>
|
||||
<div class="content <%- page.type ? page.type + ' with-sidebar' : '' %> <%- page.type ? page.path.replace(/.+\//, '').replace('.html', '') + '-guide' : '' %>">
|
||||
<%- page.content %>
|
||||
<div class="guide-links">
|
||||
<% site.pages.find({ type: page.type, order: page.order - 1 }).each(function (page) { %>
|
||||
<span>← <a href="<%- url_for(page.path) %>"><%- page.title %></a></span>
|
||||
<% }) %>
|
||||
<% site.pages.find({ type: page.type, order: page.order + 1 }).each(function (page) { %>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
9
website/themes/moderncpp/layout/partials/header.ejs
Executable file
9
website/themes/moderncpp/layout/partials/header.ejs
Executable file
@@ -0,0 +1,9 @@
|
||||
<div id="header">
|
||||
<a id="logo" href="<%- url_for("/modern-cpp/") %>">
|
||||
<img src="<%- url_for("/modern-cpp/images/cover-2nd.png") %>">
|
||||
<span>高速上手 C++ 11/14/17</span><sup class="beta">beta</sup>
|
||||
</a>
|
||||
<ul id="nav">
|
||||
<%- partial('partials/main_menu', { context: 'nav' }) %>
|
||||
</ul>
|
||||
</div>
|
||||
38
website/themes/moderncpp/layout/partials/main_menu.ejs
Executable file
38
website/themes/moderncpp/layout/partials/main_menu.ejs
Executable file
@@ -0,0 +1,38 @@
|
||||
<li class="nav-dropdown-container resource">
|
||||
<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>
|
||||
<!-- 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>
|
||||
<li><a class="nav-link" href="<%- url_for("/modern-cpp/answers/1/") %>" >答案</a></li> -->
|
||||
</ul></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="nav-dropdown-container about">
|
||||
<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/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/images/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/images/lang/en.svg); width: 15px; height: 15px; margin-right: 5px; vertical-align: middle; margin-bottom: 2px;"></span>
|
||||
English (soon)
|
||||
</a>
|
||||
</li>
|
||||
</ul> -->
|
||||
</li>
|
||||
23
website/themes/moderncpp/layout/partials/sidebar.ejs
Executable file
23
website/themes/moderncpp/layout/partials/sidebar.ejs
Executable file
@@ -0,0 +1,23 @@
|
||||
<div class="sidebar">
|
||||
<div class="sidebar-inner">
|
||||
<ul class="main-menu">
|
||||
<%- partial('partials/main_menu', { context: 'sidebar' }) %>
|
||||
</ul>
|
||||
<div class="list">
|
||||
<h2>
|
||||
<%-
|
||||
type === 'exercises'
|
||||
? '习题'
|
||||
: type === 'book-zh-cn'
|
||||
? '正文'
|
||||
: type === 'answers'
|
||||
? '参考答案'
|
||||
: type === 'about'
|
||||
? '关于'
|
||||
: (type.charAt(0).toUpperCase() + type.slice(1))
|
||||
%>
|
||||
</h2>
|
||||
<%- partial('partials/toc', { type: type }) %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
7
website/themes/moderncpp/layout/partials/toc.ejs
Executable file
7
website/themes/moderncpp/layout/partials/toc.ejs
Executable file
@@ -0,0 +1,7 @@
|
||||
<ul class="menu-root">
|
||||
<% site.pages.find({type: type}).sort('order').each(function (p) { %>
|
||||
<li>
|
||||
<a href="<%- url_for(p.path) %>" class="sidebar-link<%- page.title === p.title ? ' current' : '' %><%- p.is_new ? ' new' : '' %>"><%- p.title %></a>
|
||||
</li>
|
||||
<% }) %>
|
||||
</ul>
|
||||
21
website/themes/moderncpp/layout/post.ejs
Executable file
21
website/themes/moderncpp/layout/post.ejs
Executable file
@@ -0,0 +1,21 @@
|
||||
<div class="sidebar blog">
|
||||
<div class="sidebar-inner">
|
||||
<ul class="main-menu">
|
||||
<%- partial('partials/main_menu', { context: 'nav' }) %>
|
||||
</ul>
|
||||
<div class="list">
|
||||
<ul style="padding: 0;">
|
||||
<% site.posts.sort('date', -1).limit(10).each(function (post) { %>
|
||||
<li>
|
||||
<a href="/<%- post.path %>" class="sidebar-link<%- page.title === post.title ? ' current' : '' %>"><%- post.title %></a>
|
||||
</li>
|
||||
<% }) %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content with-sidebar post">
|
||||
<h1><%- page.title %></h1>
|
||||
<h4><%- page.date.format('MMM D[,] YYYY') %></h4>
|
||||
<%- page.content %>
|
||||
</div>
|
||||
Reference in New Issue
Block a user