-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
108 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
cookbook: | ||
name: 食用手册 | ||
collection: guides | ||
toc: | ||
- text: 概述 | ||
collection: pages | ||
slug: guides | ||
- slug: getting-started | ||
- text: API | ||
collection: apis | ||
items: | ||
- site-config | ||
- page-config | ||
- html-reuse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<ul> | ||
<% let _inc_site_url = config.root || '/' %> | ||
<% if (_inc_site_url.slice(-1) === '/') { %> | ||
<% _inc_site_url = _inc_site_url.slice(0, -1) %> | ||
<% } %> | ||
<% items.forEach(_inc_item => { %> | ||
<li> | ||
<% const _inc_collection = _inc_item.collection || collection %> | ||
<% const _inc_docs = (site.data[`knosys/${repo}/${_inc_collection}`] || {}).items %> | ||
<% const _inc_url_parts = page.path.replace('/index.html', '').slice(1).split('/') %> | ||
<% if (_inc_item.items) { %> | ||
<span><%= _inc_item.text %></span> | ||
<%- partial('_ksio/components/doc-toc', { repo, items: _inc_item.items, collection: _inc_collection }) %> | ||
<% } else if (_inc_item.slug) { %> | ||
<% if (_inc_collection === 'pages') { %> | ||
<a<% if (_inc_item.slug === _inc_url_parts[1] && _inc_url_parts.length === 2) { %> class="is-selected"<% } %> href="<%= _inc_site_url %>/<%= _inc_item.slug %>/"><%= _inc_item.text %></a> | ||
<% } else { %> | ||
<a<% if (_inc_item.slug === _inc_url_parts.slice(-1)[0]) { %> class="is-selected"<% } %> href="<%= _inc_site_url %>/<%= _inc_collection %>/<%= _inc_item.slug %>/"><%= _inc_docs[_inc_item.slug].title %></a> | ||
<% } %> | ||
<% } else { %> | ||
<a<% if (_inc_item === _inc_url_parts.slice(-1)[0]) { %> class="is-selected"<% } %> href="<%= _inc_site_url %>/<%= _inc_collection %>/<%= _inc_item %>/"><%= _inc_docs[_inc_item].title %></a> | ||
<% } %> | ||
</li> | ||
<% }) %> | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<%- partial(theme.header && theme.header.partial || '_ksio/partials/header') %> | ||
<div class="Page-content"> | ||
<% const repo = site.data['local/repos'][page.repo] %> | ||
<% if (repo && repo.toc) { %> | ||
<aside class="Page-aside"> | ||
<div class="AsideBrand"><%- partial('_ksio/components/brand-link', { className: '' }) %></div> | ||
<nav class="AsideNav"><%- partial('_ksio/components/doc-toc', { repo: page.repo, items: repo.toc, collection: repo.collection }) %></nav> | ||
</aside> | ||
<% } %> | ||
<main class="Page-main"> | ||
<article class="Article container-fluid"> | ||
<header class="Article-header"> | ||
<%- partial('_ksio/slots/header') %> | ||
</header> | ||
<div class="Article-content col-md-9"><%- page.content %></div> | ||
<footer class="Article-footer col-md-3"><%- partial('_ksio/slots/footer') %></footer> | ||
</article> | ||
<%- partial(theme.footer && theme.footer.partial || '_ksio/partials/footer') %> | ||
</main> | ||
</div> | ||
<script>$('table').addClass('table table-bordered')</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
<% if (page.layout && page.layout.split('/')[0] === 'ksio') { %> | ||
<%- partial(`_ksio/layouts/${page.layout.split('/').slice(1).join('/')}`) %> | ||
<% const layoutParts = (page.layout || '').split('/') %> | ||
<% if (layoutParts.length > 1) { %> | ||
<%- partial(layoutParts[0] === 'ksio' ? `_ksio/layouts/${layoutParts.slice(1).join('/')}` : layoutParts.join('/')) %> | ||
<% } else { %> | ||
<%- partial('_ksio/layouts/page') %> | ||
<% } %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<footer class="Page-footer Footer"> | ||
<div class="<% if (site.data['local/repos'] && site.data['local/repos'][page.repo]) { %>container-fluid<% } else { %>container<% } %>"> | ||
<% const utm_params = `utm_source=${theme.meta.url}&utm_medium=common-footer` %> | ||
<div class="Footer-description"> | ||
<% if (theme.footer && (theme.footer.links || []).length > 0) { %> | ||
<nav class="Footer-navs"> | ||
<ul><% theme.footer.links.forEach(link => { %><li><%- partial('_ksio/components/link', { link, utm: utm_params, wrap: true }) %></li><% }) %></ul> | ||
</nav> | ||
<% } %> | ||
<div class="Footer-copyright"> | ||
<p><%- partial('_ksio/components/copyright', { utm: utm_params }) %></p> | ||
<p>由 <a href="https://linxoid.com/ourai/?<%= utm_params %>" target="_blank" rel="external ">欧雷</a> 用 ♥ 设计与开发</p> | ||
</div> | ||
<div class="Footer-licenses"> | ||
<p>本站通过 <a href="https://knosysio.github.io/?<%= utm_params %>" target="_blank" rel="external ">KnoSys</a> 借助 <a href="https://hexo.io/" target="_blank" rel="external ">Hexo</a> 生成</p> | ||
</div> | ||
</div> | ||
</div> | ||
</footer> |