Skip to content

Commit

Permalink
chore(hexo): move partials into folder _ksio
Browse files Browse the repository at this point in the history
  • Loading branch information
ourai committed Mar 29, 2023
1 parent b5682d4 commit 9f64bea
Show file tree
Hide file tree
Showing 16 changed files with 25 additions and 25 deletions.
3 changes: 1 addition & 2 deletions src/hexo/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ timezone: Asia/Shanghai
## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'
url: http:https://example.com
root: /lime/
permalink: :year/:month/:day/:title/
permalink: posts/:title/
permalink_defaults:
pretty_urls:
trailing_index: false # Set to false to remove trailing 'index.html' from permalinks
Expand Down Expand Up @@ -130,7 +130,6 @@ theme_config:
navbar:
placement: right
footer:
partial: footer.html
links:
- text: OOSS
url: https://oss.ourai.ws/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<% if (_inc_nav.children) { %>
<li class="dropdown">
<a class="dropdown-toggle" href="javascript:void(0);" data-toggle="dropdown"><%= _inc_nav.text %> <span class="caret"></span></a>
<ul class="dropdown-menu"><%- partial('_components/nav-list', { navs: _inc_nav.children }) %></ul>
<ul class="dropdown-menu"><%- partial('_ksio/components/nav-list', { navs: _inc_nav.children }) %></ul>
</li>
<% } else { %>
<li><%- partial('_components/link', { link: _inc_nav, utm: `utm_source=${theme.meta.url}&utm_medium=common-header`, wrap: false }) %></li>
<li><%- partial('_ksio/components/link', { link: _inc_nav, utm: `utm_source=${theme.meta.url}&utm_medium=common-header`, wrap: false }) %></li>
<% } %>
<% }) %>
10 changes: 10 additions & 0 deletions src/hexo/themes/lime/layout/_ksio/layouts/index.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<%- partial(theme.header && theme.header.partial || '_ksio/partials/header') %>
<main class="Page-content" style="height: 100%;">
<div style="height: calc(100% - 271px); display: flex; align-items: center; justify-content: center; text-align: center;">
<div>
<h1 style="margin-top: 0; margin-bottom: .3em; font-size: 10rem; font-weight: 700;"><%= config.title %></h1>
<p style="margin-bottom: 0; font-size: 2.5rem;"><%= config.subtitle || config.description %></p>
</div>
</div>
</main>
<%- partial(theme.footer && theme.footer.partial || '_ksio/partials/footer') %>
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<% if (theme.footer && (theme.footer.links || []).length > 0) { %>
<!-- Important links -->
<nav class="Footer-navs">
<ul><% theme.footer.links.forEach(link => { %><li><%- partial('_components/link', { link, utm: utm_params, wrap: true }) %></li><% }) %></ul>
<ul><% theme.footer.links.forEach(link => { %><li><%- partial('_ksio/components/link', { link, utm: utm_params, wrap: true }) %></li><% }) %></ul>
</nav>
<% } %>
<% if (theme.copyright) { %>
<!-- Copyright -->
<div class="Footer-copyright">
<p><%- partial('_components/copyright', { utm: utm_params }) %></p>
<p><%- partial('_ksio/components/copyright', { utm: utm_params }) %></p>
<% if (theme.copyright.provider !== false) { %><p>本站主题 <a href="https://ourai.github.io/lime/?<%= utm_params %>" target="_blank" rel="external ">Lime</a><a href="https://linxoid.com/ourai/?<%= utm_params %>" target="_blank" rel="external ">欧雷</a> 提供</p><% } %>
<% if (theme.copyright.fragments) { %><%- theme.copyright.fragments %><% } %>
</div>
Expand Down
5 changes: 5 additions & 0 deletions src/hexo/themes/lime/layout/_ksio/partials/head.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<meta charset="UTF-8">
<%- partial('_ksio/partials/meta/seo') %>
<%- partial('_ksio/partials/meta/render') %>
<%- partial('_ksio/partials/meta/feed') %>
<%- partial('_ksio/partials/meta/brand') %>
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
</button>
<% } %>
<% if (theme.brand && theme.brand.parent) { %>
<div class="navbar-brand"><%- partial('_components/brand-link', { className: '' }) %></div>
<div class="navbar-brand"><%- partial('_ksio/components/brand-link', { className: '' }) %></div>
<% } else { %>
<%- partial('_components/brand-link', { className: 'navbar-brand' }) %>
<%- partial('_ksio/components/brand-link', { className: 'navbar-brand' }) %>
<% } %>
</div>
<!-- Nav menus -->
<nav class="Page-navs navbar-collapse collapse">
<ul class="nav navbar-nav<% if (theme.header && theme.header.navbar && theme.header.navbar.placement == 'right') { %> navbar-right<% } %>">
<%- partial('_components/nav-list', { navs: ((theme.header && theme.header.navs) || []) }) %>
<%- partial('_ksio/components/nav-list', { navs: ((theme.header && theme.header.navs) || []) }) %>
</ul>
</nav>
</div>
Expand Down
5 changes: 0 additions & 5 deletions src/hexo/themes/lime/layout/_partials/head.ejs

This file was deleted.

11 changes: 1 addition & 10 deletions src/hexo/themes/lime/layout/index.ejs
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
<%- partial('_partials/header') %>
<main class="Page-content" style="height: 100%;">
<div style="height: calc(100% - 271px); display: flex; align-items: center; justify-content: center; text-align: center;">
<div>
<h1 style="margin-top: 0; margin-bottom: .3em; font-size: 10rem; font-weight: 700;"><%= config.title %></h1>
<p style="margin-bottom: 0; font-size: 2.5rem;"><%= config.subtitle || config.description %></p>
</div>
</div>
</main>
<%- partial('_partials/footer') %>
<%- partial('_ksio/layouts/index') %>
2 changes: 1 addition & 1 deletion src/hexo/themes/lime/layout/layout.ejs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="<%= config.language %>" dir="ltr">
<head>
<%- partial('_partials/head') %>
<%- partial('_ksio/partials/head') %>
<%- css('stylesheets/global') %>
<% if (page.__index) { %>
<!--%- css('stylesheets/pages/home') %-->
Expand Down

0 comments on commit 9f64bea

Please sign in to comment.