Giter Site home page Giter Site logo

eve0803 / cnblogs-theme-silence Goto Github PK

View Code? Open in Web Editor NEW

This project forked from esofar/cnblogs-theme-silence

0.0 2.0 0.0 355 KB

:fire: 一款专注于阅读的博客园主题

Home Page: https://www.cnblogs.com/esofar

License: MIT License

JavaScript 35.81% CSS 64.19%

cnblogs-theme-silence's Introduction

PC

Silence

Cnblogs GitHub issues GitHub license

介绍

Silence 是一款界面简洁、运行高效的博客园主题,主要面向于经常混迹博客园的朋友。

简单概括其几个主要特点:

  • 专注阅读、精致漂亮的 UI;
  • 事无巨细的部署文档;
  • 兼容移动端浏览器;
  • 源码结构清晰、易扩展。

安装

开始之前请确保你有一个正常的博客园账号并已经成功申请开通JS权限。

Step1:主题下载

通过下面git命令克隆到本地,或者直接下载zip到本地并解压。

git clone https://github.com/esofar/cnblogs-theme-silence.git

进入dist目录,获取发布文件silence.min.csssilence.min.js

Step2:上传博客园

进入博客园『管理』-『文件』,将silence.min.js文件上传到自己的博客。获取上传后的URL地址,然后使用<script>标签生成一个脚本引用。参考示例:

<script src="https://blog-static.cnblogs.com/files/esofar/silence.min.js"></script>

进入『博客园』-『管理』-『设置』,将上面生成的引用复制到「博客侧边栏公告」文本域中。

最后处理样式文件,使用记事本工具打开silence.min.css文件,复制其所有代码到「页面定制CSS代码」文本域中即可。

Step3:开始使用

进入『博客园』-『管理』-『设置』,将下面代码复制并追加到「博客侧边栏公告」文本域中。

<script type="text/javascript">
    $.silence();
</script>

该主题新增了三个自动化模块:博客目录、博客签名、支持赞赏,并且支持参数配置,由于可能会稍微影响页面加载速度,默认不启用。如需开启请修改上述代码。参考示例:

<script type="text/javascript">
    $.silence({
        catalog: {
            enable: true,
            move: true,
            index: true,
            level1: 'h2',
            level2: 'h3',
            level3: 'h4',
        },
        signature: {
            enable: true,
            author: 'Esofar',
            home: 'https://esofar.cn',
            license: '署名 4.0 国际',
            link: 'https://creativecommons.org/licenses/by/4.0'
        },
        reward: {
            enable: true,
            title: '感谢您的支持,我会继续努力',
            wechat: 'https://images.cnblogs.com/cnblogs_com/esofar/972540/o_wechat.png',
            alipay: 'https://images.cnblogs.com/cnblogs_com/esofar/972540/o_alipay.png',
        }
    });
</script>

配置项说明详见下表:

模块 属性 说明 类型 默认值
catalog enable 是否启用 Boolean false
move 是否允许拖拽 Boolean true
index 是否显示索引 Boolean true
level1 一级标题 String h2
level2 二级标题 String h3
level3 三级标题 String h4
signature enable 是否启用 Boolean false
author 作者显示名称 String 当前博客用户名
home 作者主页 String https://www.cnblogs.com
license 许可证名称 String 署名 4.0 国际
link 许可证链接 String https://creativecommons.org/licenses/by/4.0
reward enable 是否启用 Boolean false
title 标题 String null
wechat 微信二维码 String null
alipay 支付宝二维码 String null

Step4:其他配置

要使主题正常使用,还需要在修改博客园的一些其他配置项。

  • 进入『博客园』-『管理』-『设置』,在「标题」文本域中设置博客标题,不支持子标题。

  • 进入『博客园』-『管理』-『设置』,在「博客皮肤」处选择博客园官方标准模板Custom,并且把「禁用模板默认CSS」复选框取消勾选。

  • 进入『博客园』-『管理』-『选项』,在「控件显示设置」需要勾选的模块有:随笔分类、公告、博客园链接、阅读排行榜、我的标签、首页链接、RSS订阅、推荐排行榜、联系,其他模块取消勾选(可选)。

至此,Silence 主题就已经安装完成,赶快打开博客看看效果吧!

更新日志

v1.0.1

  • 赞赏按钮不显示时,适当调整其外层DOM元素宽度。
  • 修复首页随笔分隔符样式不统一的问题。

v1.0.2

  • 修复侧边栏我的标签、随笔分类因标题过长导致换行问题。
  • 修复博客目录因标题过长导致换行问题。
  • 优化评论区分页样式效果。
  • 设置博客赞赏模块二维码固定宽高。
  • 优化阅读模式、新增收缩标题栏效果。

v1.0.3

  • 更换全局字体。
  • 优化标签列表页面部分样式。
  • 优化侧边栏以及博客头部样式。

v1.0.4

  • 优化阅读、正常模式切换效果。
  • 修复移动端部分样式存在的问题。

v1.0.5

  • 调整全局字体样式。
  • 调整博文引用样式。
  • 调整博文行内代码样式。

v1.0.6

  • 调整博客、博文标题左侧边距。
  • 设置首页侧边栏、主体DOM元素默认最小高度。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.