<% if (page.type) { %>
  <%- partial('partials/sidebar', { type: page.type, index: page.index }) %>
<% } else { %>
  <div class="sidebar">
    <ul class="main-menu">
        <% if (page.type == 'book-en-us') { %>
          <%- partial('partials/main_menu_en', { context: 'nav' }) %>
        <% } else {%>
          <%- partial('partials/main_menu', { context: 'nav' }) %>
        <% } %>
    </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>

  <% if (page.type == 'book-en-us') { %>
    <div class="footer">
        <p>
          <a href="https://changkun.de">Changkun Ou</a> &copy; 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> &copy; 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>
