--- title: material主题使用攻略 date: 2017-02-15 19:59:16 tags: [hexo] categories: 随记 --- ## 安装[Material] ``` bash npm install hexo-meterial ``` 该方法会将主题下载到node_modules文件夹下,找到该文件后,将文件名改为material ### 启用[Material] 找到主题文件下的_config.template.yml 改成 _config.yml ## 更新[Material] ``` bash npm update hexo-material ``` 让后将文件复制到 Material 主题文件中 ## 配置主题 ### head * favicon: 网站的 favicon * high_res_favicon: 高清 favicon * apple_touch_icon: iOS 主屏按钮图标 * keywords: 网站关键词 ### url * rss: 设置生成的 rss 或 atom url * daily_pic: 设置 daily_pic 模块 点击时跳转的 url * logo: 设置 logo 点击时跳转的 url ### scheme * Paradox 默认 Scheme,是 Material 的最初样式。居中布局,图文并茂。 * Isolation Paradox 的至简样式,简洁明了。 ### uiux 用于设置主题 UI 与 UX。 * heme_color: 主题主要颜色。主题的大部分地方使用此颜色。 * theme_sub_color: 主题辅助颜色。 * hyperlink_color: 超链接颜色。 * button_color: 按钮颜色,例如 toTop 或 menu_button。 * android_chrome_color: 安卓 Chrome 浏览器的地址栏颜色。 * nprogress_color: 页面加载时顶部加载进度条的颜色。 * nprogress_buffer: 页面加载时顶部加载进度条的缓冲时间。 ### js_effect 用来控制 Material 主题中自带的多种 js 特性。 * fade: 页面加载时部分模块的渐显效果,默认为 true。 * smoothscroll: 页面平滑滚动特效,默认为 false。 ### reading entry_excerpt: 首页文章输出摘要的字符长度。默认为 80。 * entry_excerpt: 首页文章输出摘要的字符长度。默认为 80。 ### background 用于设置站点背景。 * purecolor: 填入颜色代码。则站点使用纯色背景。 * bgimg: 背景地址,默认调用 主题文件夹 -> source -> img 中的 bg.png。可更换此图片或者自己填入 url。 * bing: 用于启用“必应美图”的图片作为背景。 ### dropdown 用于设置 Paradox 侧边栏用户下拉菜单,默认为空。 ``` dropdown: page: link: "mailto: someone@example.com" icon: email divider: 设置成 true 后会在归档按钮底部增加一条分割线。 ``` ## 创建文章 ### 使用命令行 ``` hexo new