From 3d85b0926a4f969bcf213409153bd6db814e2940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=AE=87?= <448766534@qq.com> Date: Mon, 20 Jan 2020 15:09:23 +0800 Subject: [PATCH] feat: Support image display fullscreen --- _config.yml | 3 + layout/_partial/after-footer.ejs | 50 ++++++++------- layout/_partial/viewer.ejs | 106 +++++++++++++++++++++++++++++++ 3 files changed, 135 insertions(+), 24 deletions(-) create mode 100644 layout/_partial/viewer.ejs diff --git a/_config.yml b/_config.yml index 2737c7a..11e0198 100644 --- a/_config.yml +++ b/_config.yml @@ -36,6 +36,9 @@ nav_text: # 文章页是否显示目录 toc: true +# 文章中的图片是否支持点击放大 +image_viewer: true + # https://github.com/willin/hexo-wordcount # 是否开启字数统计(关闭请设置enable为false) # 也可以单独在md文件里Front-matter设置`no_word_count: true`属性,来自定义关闭字数统计 diff --git a/layout/_partial/after-footer.ejs b/layout/_partial/after-footer.ejs index 0d3dec2..90fc783 100644 --- a/layout/_partial/after-footer.ejs +++ b/layout/_partial/after-footer.ejs @@ -3,28 +3,28 @@ <%- js('/js/lazyload.min') %> <%- js('/js/busuanzi-2.3.pure.min') %> <% if (theme.fancybox){ %> - <%- js('fancybox/jquery.fancybox.min') %> +<%- js('fancybox/jquery.fancybox.min') %> <% } %> <% if (theme.toc && is_post()){ %> - <%- js('/js/tocbot.min') %> - +<%- js('/js/tocbot.min') %> + <% } %> -<% if (theme.mathjax){ %> - <%- partial('mathjax') %> +<% if (theme.image_viewer){ %> +<%- partial('viewer') %> <% } %> - - - +<% if (theme.mathjax){ %> +<%- partial('mathjax') %> +<% } %> + + \ No newline at end of file diff --git a/layout/_partial/viewer.ejs b/layout/_partial/viewer.ejs new file mode 100644 index 0000000..745b61d --- /dev/null +++ b/layout/_partial/viewer.ejs @@ -0,0 +1,106 @@ + +
+ + + + + + + \ No newline at end of file