From db39681f558787bb13fe6a19f752190f9fe0b8ff Mon Sep 17 00:00:00 2001 From: Ourai Lin Date: Fri, 7 Apr 2023 11:56:03 +0800 Subject: [PATCH] chore(hexo): reduce default layouts --- src/hexo/themes/lime/layout/_ksio/layouts/hack.ejs | 4 ++++ src/hexo/themes/lime/layout/index.ejs | 2 +- src/hexo/themes/lime/layout/page.ejs | 1 - src/hexo/themes/lime/layout/post.ejs | 1 - 4 files changed, 5 insertions(+), 3 deletions(-) delete mode 100644 src/hexo/themes/lime/layout/page.ejs delete mode 100644 src/hexo/themes/lime/layout/post.ejs diff --git a/src/hexo/themes/lime/layout/_ksio/layouts/hack.ejs b/src/hexo/themes/lime/layout/_ksio/layouts/hack.ejs index 3577715..b9ea07b 100644 --- a/src/hexo/themes/lime/layout/_ksio/layouts/hack.ejs +++ b/src/hexo/themes/lime/layout/_ksio/layouts/hack.ejs @@ -1,6 +1,10 @@ <% const layoutParts = (page.layout || '').split('/') %> <% if (layoutParts.length > 1) { %> <%- partial(layoutParts[0] === 'ksio' ? `_ksio/layouts/${layoutParts.slice(1).join('/')}` : layoutParts.join('/')) %> +<% } else if (is_home()) { %> + <%- partial('_ksio/layouts/index') %> +<% } else if (is_post()) { %> + <%- partial('_ksio/layouts/post') %> <% } else { %> <%- partial('_ksio/layouts/page') %> <% } %> diff --git a/src/hexo/themes/lime/layout/index.ejs b/src/hexo/themes/lime/layout/index.ejs index 6a8bf20..c9951a6 100644 --- a/src/hexo/themes/lime/layout/index.ejs +++ b/src/hexo/themes/lime/layout/index.ejs @@ -1 +1 @@ -<%- partial('_ksio/layouts/index') %> +<%- partial('_ksio/layouts/hack') %> diff --git a/src/hexo/themes/lime/layout/page.ejs b/src/hexo/themes/lime/layout/page.ejs deleted file mode 100644 index c9951a6..0000000 --- a/src/hexo/themes/lime/layout/page.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('_ksio/layouts/hack') %> diff --git a/src/hexo/themes/lime/layout/post.ejs b/src/hexo/themes/lime/layout/post.ejs deleted file mode 100644 index 3b2e38f..0000000 --- a/src/hexo/themes/lime/layout/post.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('_ksio/layouts/post') %>