Skip to content

Commit

Permalink
feat(hexo): hack dynamic page layout
Browse files Browse the repository at this point in the history
  • Loading branch information
ourai committed Apr 6, 2023
1 parent fda6658 commit 70023e9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/hexo/themes/lime/layout/_ksio/layouts/hack.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<% if (page.layout && page.layout.split('/')[0] === 'ksio') { %>
<%- partial(`_ksio/layouts/${page.layout.split('/').slice(1).join('/')}`) %>
<% } else { %>
<%- partial('_ksio/layouts/page') %>
<% } %>
1 change: 1 addition & 0 deletions src/hexo/themes/lime/layout/_ksio/layouts/post.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<%- partial('_ksio/layouts/page') %>
2 changes: 1 addition & 1 deletion src/hexo/themes/lime/layout/page.ejs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<%- partial('_ksio/layouts/page') %>
<%- partial('_ksio/layouts/hack') %>
2 changes: 1 addition & 1 deletion src/hexo/themes/lime/layout/post.ejs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<%- partial('_ksio/layouts/page') %>
<%- partial('_ksio/layouts/post') %>

0 comments on commit 70023e9

Please sign in to comment.