fix toc & update theme

i18n
xaoxuu 6 years ago
parent 18637d2629
commit 7cc68beb03
  1. 234
      README.md
  2. 124
      _config.yml
  3. 2
      layout/_partial/archive.ejs
  4. 20
      layout/_partial/footer.ejs
  5. 5
      layout/_partial/head.ejs
  6. 29
      layout/_partial/header.ejs
  7. 30
      layout/_partial/scripts.ejs
  8. 23
      layout/_partial/side.ejs
  9. 33
      layout/_widget/about.ejs
  10. 29
      layout/_widget/author.ejs
  11. 20
      layout/_widget/categories.ejs
  12. 13
      layout/_widget/contacts.ejs
  13. 32
      layout/_widget/links.ejs
  14. 8
      layout/_widget/music.ejs
  15. 24
      layout/_widget/tagcloud.ejs
  16. 11
      source/js/app.js
  17. 5
      source/less/_base.less
  18. 7
      source/less/_defines.less
  19. 9
      source/less/_footer.less
  20. 4
      source/less/_header.less
  21. 6
      source/less/_toc.less
  22. 11
      source/less/_widget.less

@ -57,50 +57,36 @@ npm i -S hexo-generator-search hexo-generator-feed hexo-renderer-less hexo-autop
## 主题配置
`themes/material-x/_config.yml` 中的这部分内容复制到博客主目录的 `_config.yml` 文件中:
```yml
# >> copy_start 请把这一段复制到博客主目录的【_config.yml】中 ↓↓↓↓↓↓↓↓ ↓↓↓↓↓↓↓↓
{中间这部分是要复制的内容}
# >> copy_end 到这里为止,下面的就不要复制了。 ↑↑↑↑↑↑↑↑ ↑↑↑↑↑↑↑↑
...
```
复制到博客主目录的 `_config.yml` 文件之后根据自己的需要填写和修改。这样做的好处是:更新主题的时候你修改过的配置就不会被覆盖了。
`themes/material-x/_config.yml` 中的**所有**内容复制到博客主目录的 `_config.yml` 文件中,然后根据自己的需要填写和修改。这样做的好处是:更新主题的时候你修改过的配置就不会被覆盖了。
> 以下这些配置如果没有特殊说明,都指的是博客主目录的 `_config.yml` 文件。
### 导航栏
你可以 `materialx:` 下面找到类似这一段,把它改为你需要的:
你可以找到类似这一段,把它改为你需要的:
```yaml
materialx:
# 导航栏
nav_menu:
- name: 主页
slug: about
fa: home
url: /
- name: 项目
slug: projects
fa: cube
url: https://xaoxuu.com/proj
- name: 博客
slug: home
fa: rss
url: /
- name: 归档
slug: archives
fa: archive
url: /archives
# 导航栏
nav_menu:
- name: 主页
slug: about
icon: fa-home
url: /
- name: 项目
slug: projects
icon: fa-cube
url: https://xaoxuu.com/proj
- name: 博客
slug: home
icon: fa-rss
url: /
- name: 归档
slug: archives
icon: fa-archive
url: /archives
```
其中 `fa``font-awesome` 图标名,你要显示什么图标,去 [font-awesome](https://fontawesome.com/icons?d=gallery) 找就可以了。
其中 icon`font-awesome` 图标名,你要显示什么图标,去 [font-awesome](https://fontawesome.com/icons?d=gallery) 找就可以了。
@ -108,27 +94,55 @@ materialx:
右边的小窗口,可以根据需要显示。
#### 头像
```yaml
# 右边的小窗口,不想显示哪一项的注释掉对应的即可
widgets:
# 博主信息,显示个人头像、格言、社交信息等
author:
enable: true
avatar: # 头像,如果config中已经设置avatar了,这里可以不用写
title: # 博客名、头衔等等,居中显示
motto: 永远不要忘了自己是谁,因为这个世界就不会。 # 格言座右铭等等
social: true # 是否显示社交信息
# 显示文章分类
categories: true
# 显示文章标签
tagcloud: true
# 显示网易云歌单id
musicid: 746319661
# 显示友链
links:
- name: xaoxuu
url: https://xaoxuu.com
# 显示目录(在文章中设置toc:false可以隐藏单篇文章的目录)
toc: true
```
如果你没有设置头像,将会显示默认头像。
```yaml
avatar: "https://xaoxuu.com/assets/img/avatar.jpg" # 如果没有设置头像 url 将会显示默认头像。
# 主题配置
materialx:
widgets:
- avatar # 把这一项注释掉就不显示头像了
#### 博主(头像/头衔/格言/社交信息)
```yaml
# 右边的小窗口,不想显示哪一项的注释掉对应的即可
widgets:
# 博主信息,显示个人头像、格言、社交信息等
author:
enable: true
avatar: # 头像,如果config中已经设置avatar了,这里可以不用写
title: # 博客名、头衔等等,居中显示
motto: 永远不要忘了自己是谁,因为这个世界就不会。 # 格言座右铭等等
social: true # 是否显示社交信息(内容同页脚的社交信息)
```
#### 分类
```yaml
# 主题配置
materialx:
widgets:
- categories # 把这一项注释掉就不显示了
# 右边的小窗口,不想显示哪一项的注释掉对应的即可
widgets:
...
# 显示文章分类
categories: true
```
@ -136,10 +150,11 @@ materialx:
#### 标签
```yaml
# 主题配置
materialx:
widgets:
- tagcloud # 把这一项注释掉就不显示了
# 右边的小窗口,不想显示哪一项的注释掉对应的即可
widgets:
...
# 显示文章标签
tagcloud: true
```
@ -147,46 +162,37 @@ materialx:
#### 网易云音乐歌单
```yaml
# 主题配置
materialx:
widgets:
- music # 把这一项注释掉就不显示了
# 网易云音乐歌单id
widgets_musicid: 746319661
# 右边的小窗口,不想显示哪一项的注释掉对应的即可
widgets:
...
# 显示网易云歌单id
musicid: 746319661
```
#### 联系信息
#### 友链
```yaml
# 主题配置
materialx:
widgets:
- contacts # 把这一项注释掉就不显示了
# 右边的联系信息小窗口
widgets_contacts:
- name: GitHub
desc: xaoxuu
url: https://github.com/xaoxuu
- name: 10086
desc: 测试打电话
url: tel:10086
# 右边的小窗口,不想显示哪一项的注释掉对应的即可
widgets:
...
# 显示友链
links:
- name: xaoxuu
url: https://xaoxuu.com
```
#### 友链
#### 显示目录(TOC)
```yaml
# 主题配置
materialx:
widgets:
- links # 把这一项注释掉就不显示了
# 侧边栏的友链
widgets_links:
- name: xaoxuu
url: https://xaoxuu.com
# 右边的小窗口,不想显示哪一项的注释掉对应的即可
widgets:
...
# 显示目录(在文章中设置toc:false可以隐藏单篇文章的目录)
toc: true
```
@ -202,7 +208,7 @@ recommended_posts:
server: https://api.truelaurel.com # 后端推荐服务器地址
timeoutInMillis: 10000 # 服务时长,超过此时长,则使用离线推荐模式
excludePattern: []
titleHtml: <h3>推荐文章</h3> #自定义标题
titleHtml: <h4>推荐文章</h4> #自定义标题
internalLinks: 3 # 内部文章数量
externalLinks: 2 # 外部文章数量
fixedNumber: false
@ -257,21 +263,45 @@ valine:
### 页脚
```yaml
# 主题配置
materialx:
# 页脚
footer_social:
- slug: envelope
# 页脚社交信息
social:
- icon: fa-envelope
url: mailto:me@xaoxuu.com
- slug: github
- icon: fa-github
url: https://github.com/xaoxuu
- slug: instagram
- icon: fa-instagram
url: https://www.instagram.com/xaoxuu
- icon: fa-google-plus
url:
- icon: fa-twitter
url: https://twitter.com/xaoxuu
- icon: fa-music
url: https://music.163.com/#/user/home?id=63035382
- icon: fa-rss
url: atom
- icon: fa-telegram
url:
- icon: fa-vimeo
url:
- icon: fa-gitlab
url:
- icon: fa-linkedin
url:
- icon: fa-snapchat
url:
- slug: google-plus
- icon: fa-steam
url:
- slug: twitter
- icon: fa-spotify
url:
- slug: music
- icon: fa-tumblr
url:
- icon: fa-youtube
url:
- icon: fa-weibo
url:
- icon: fa-weixin
url:
- icon: fa-qq
url:
```
@ -308,18 +338,33 @@ mathjax: true
## 主题色和其他样式
打开 `themes/material-x/source/less/_defines.less` 这个文件,修改下面这些内容为你需要的即可:
找到 `themes/material-x/source/less/_defines.less` 这个文件。
### 如果你比较懒,可以只修改整体的主题色:
```yaml
// 自定义主题色 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
// 定义颜色
// 如果你比较懒,就只改这两行就可以了:
@theme-base-main: #EEE;
@theme-base-tint: @ax-red;
// 如果你想更深层次DIY,可以更改下面这些:
...
// 自定义主题色 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
```
### 如果你想更深层次DIY,可以修改下面这些:
```yaml
// 自定义主题色 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
// 如果你比较懒,就只改这两行就可以了:
...
// 如果你想更深层次DIY,可以更改下面这些:
// 网页背景
@theme-bg-main: #EFEFEF;
// 导航栏背景
@theme-bg-nav-header: #FFF;
@theme-bg-nav-header: #EFEFEF;
// 卡片标题背景
@theme-bg-card-header: #E3E3E3;
// 按钮背景
@ -330,7 +375,7 @@ mathjax: true
@theme-bg-code: @theme-base-tint;
// 代码块的背景色
@theme-bg-code-block: #F5F5F5;
// 引用的颜色分类、归档的 hover 时颜色
// 引用的颜色以及分类、归档的 hover 时颜色
@theme-bg-quote: @theme-base-tint;
// 标题文字颜色(h1/h2)
@ -343,6 +388,7 @@ mathjax: true
@theme-text-in-header: @dark;
// 正文文字颜色
@theme-text-main: @dark;
// 自定义主题色 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
```

@ -1,56 +1,84 @@
# >> copy_start 请把这一段复制到博客主目录的【_config.yml】中 ↓↓↓↓↓↓↓↓ ↓↓↓↓↓↓↓↓
# >> 主题配置 ---------------------------------------------------------------------
# 导航栏
nav_menu:
- name: 主页
slug: about
icon: fa-home
url: /
- name: 项目
slug: projects
icon: fa-cube
url: https://xaoxuu.com/proj
- name: 博客
slug: home
icon: fa-rss
url: /
- name: 归档
slug: archives
icon: fa-archive
url: /archives
# 主题配置
materialx:
# 导航栏
nav_menu:
- name: 主页
slug: about
fa: home
url: /
- name: 项目
slug: projects
fa: cube
url: https://xaoxuu.com/proj
- name: 博客
slug: home
fa: rss
url: /
- name: 归档
slug: archives
fa: archive
url: /archives
# 右边的小窗口
widgets:
- about # 显示个人头像、格言、社交信息等,如果注释掉这一行就不显示
- categories # 显示分类
- tagcloud # 显示tags
- music # 显示自己的网易云歌单
- links # 显示友链
- toc # 显示目录
widgets_about:
title:
motto: 永远不要忘了自己是谁,因为这个世界就不会。
social: true
# 网易云音乐歌单id
widgets_musicid:
# 侧边栏的友链
widgets_links:
# 右边的小窗口,不想显示哪一项的注释掉对应的即可
widgets:
# 博主信息,显示个人头像、格言、社交信息等
author:
enable: true
avatar: # 头像,如果config中已经设置avatar了,这里可以不用写
title: # 博客名、头衔等等,居中显示
motto: 永远不要忘了自己是谁,因为这个世界就不会。 # 格言座右铭等等
social: true # 是否显示社交信息(内容同页脚的社交信息)
# 显示文章分类
categories: true
# 显示文章标签
tagcloud: true
# 显示网易云歌单id
musicid: 746319661
# 显示友链
links:
- name: xaoxuu
url: https://xaoxuu.com
# 页脚
footer_social:
- slug: envelope
# 显示目录(在文章中设置toc:false可以隐藏单篇文章的目录)
toc: true
# 页脚社交信息
social:
- icon: fa-envelope
url: mailto:me@xaoxuu.com
- slug: github
- icon: fa-github
url: https://github.com/xaoxuu
- slug: instagram
- icon: fa-instagram
url:
- icon: fa-google-plus
url:
- icon: fa-twitter
url:
- icon: fa-music
url: https://music.163.com/#/user/home?id=63035382
- icon: fa-rss
url: atom
- icon: fa-telegram
url:
- icon: fa-vimeo
url:
- icon: fa-gitlab
url:
- icon: fa-linkedin
url:
- slug: google-plus
- icon: fa-snapchat
url:
- slug: twitter
- icon: fa-steam
url:
- slug: music
- icon: fa-spotify
url:
- icon: fa-tumblr
url:
- icon: fa-youtube
url:
- icon: fa-weibo
url:
- icon: fa-weixin
url:
- icon: fa-qq
url:
@ -65,12 +93,9 @@ recommended_posts:
externalLinks: 2 # 外部文章数量
fixedNumber: false
# >> copy_end 到这里为止,下面的就不要复制了。 ↑↑↑↑↑↑↑↑ ↑↑↑↑↑↑↑↑
# Search
nav_search:
search:
enable: true
service: hexo
# google
@ -90,3 +115,4 @@ nav_search:
# Less
less:
compress: true
# >> 主题配置 ---------------------------------------------------------------------

@ -13,7 +13,7 @@
<% } %>
<section class="post-list">
<% if(!config.materialx){ %>
<% if(!config.nav_menu){ %>
<div class='post-wrapper'>
<article class="post revealno-title">
<section class="meta">

@ -1,20 +1,18 @@
<footer id="footer" class="clearfix">
<div class="social-wrapper">
<% (config.materialx && config.materialx.footer_social && (config.materialx.footer_social||[]) || (theme.materialx.footer_social||[])).forEach(function(value){ %>
<% if (value.url && value.slug) { %>
<a href="<%= value.url %>" class="social <%= value.slug %> flat-box"
target="_blank" rel="external">
<i class="fa fa-<%= value.slug %> fa-fw"></i>
</a>
<%}%>
<%})%>
</div>
<% if (config.social) { %>
<div class="social-wrapper">
<% (config.social||[]).forEach(function(value){ %>
<% if (value.url && value.icon) { %>
<a href="<%= value.url %>" class="social fa <%= value.icon %> flat-box" target="_blank" rel="external"></a>
<%}%>
<%})%>
</div>
<%}%>
<br>
<div>博客内容遵循 <a target="_blank" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh" class="licenses">知识共享 署名 - 非商业性 - 相同方式共享 4.0 国际协议</a></div>
<div>本站使用 <a href="https://github.com/xaoxuu/hexo-theme-material-x" target="_blank" class="codename">Material-X</a> 作为主题,
总访问量为 <span id="busuanzi_value_site_pv"><i class="fa fa-spinner fa-spin fa-fw" aria-hidden="true"></i></span> 次。
</div>
</footer>
<!-- 根据页面mathjax变量决定是否加载MathJax数学公式js -->
<% if (page.mathjax){ %>

@ -25,11 +25,6 @@
<%- favicon_tag(config.favicon) %>
<%- feed_tag(config.feed.path, {title: config.title}) %>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<%- open_graph({
twitter_id: theme.twitter,
google_plus: theme.google_plus,
fb_admins: theme.fb_admins,
fb_app_id: theme.fb_app_id}) %>
<link rel="shortcut icon" href="<%= config.shortcut_icon %>" />
<link rel="icon" href="<%= config.favicon %>" />

@ -8,19 +8,20 @@
<div class='menu'>
<ul class='h-list'>
<% (config.materialx && config.materialx.nav_menu && (config.materialx.nav_menu||[]) || (theme.materialx.nav_menu||[])).forEach(function(value){ %>
<li>
<a class='flat-box nav-<%=value.slug%>' href='<%=url_for(value.url)%>'>
<i class="fa fa-<%=value.fa%> fa-fw"></i>
<%=value.name%>
</a>
</li>
<%})%>
<% if (config.nav_menu) { %>
<% (config.nav_menu || []).forEach(function(value){ %>
<li>
<a class='flat-box nav-<%=value.slug%> fa <%=value.icon%>' href='<%=url_for(value.url)%>'>
<%=value.name%>
</a>
</li>
<%})%>
<% } %>
</ul>
<div class='underline'></div>
</div>
<% if (theme.nav_search.enable === true) { %>
<% if (config.search.enable === true) { %>
<div class="m_search">
<form name="searchform" class="form u-search-form">
<input type="text" class="input u-search-input" placeholder="Search" />
@ -29,7 +30,7 @@
</div>
<% } %>
<ul class='switcher h-list'>
<% if (theme.nav_search.enable === true) { %>
<% if (config.search.enable === true) { %>
<li class='s-search'><a href='javascript:void(0)'><i class="fa fa-search fa-fw"></i></span></a></li>
<% } %>
<li class='s-menu'><a href='javascript:void(0)'><i class="fa fa-navicon fa-fw"></i></a></li>
@ -52,12 +53,14 @@
<aside class="menu-phone">
<div class="header"><%=config.title%></div>
<nav>
<% (config.materialx && config.materialx.nav_menu && (config.materialx.nav_menu||[]) || (theme.materialx.nav_menu||[])).forEach(function(value, key) {
<% if (config.nav_menu) { %>
<% (config.nav_menu || []).forEach(function(value, key) {
if (value.url && value.slug && value.name) { %>
<a href="<%= url_for(value.url) %>" class="nav-<%= value.slug %> nav">
<i class="fa fa-<%=value.fa%>"></i>
<a href="<%= url_for(value.url) %>" class="nav-<%= value.slug %> fa <%=value.icon%> nav flat-box">
<%= value.name %>
</a>
<% } }); %>
<% } %>
</nav>
</aside>

@ -6,20 +6,22 @@
<%- js('js/jquery.fitvids.js') %>
<script>
var GOOGLE_CUSTOM_SEARCH_API_KEY = "<%- theme.nav_search.google_api_key %>";
var GOOGLE_CUSTOM_SEARCH_ENGINE_ID = "<%- theme.nav_search.google_engine_id %>";
var ALGOLIA_API_KEY = "<%- theme.nav_search.algolia_api_key %>";
var ALGOLIA_APP_ID = "<%- theme.nav_search.algolia_app_id %>";
var ALGOLIA_INDEX_NAME = "<%- theme.nav_search.algolia_index_name %>";
var AZURE_SERVICE_NAME = "<%- theme.nav_search.azure_service_name %>";
var AZURE_INDEX_NAME = "<%- theme.nav_search.azure_index_name %>";
var AZURE_QUERY_KEY = "<%- theme.nav_search.azure_query_key %>";
var BAIDU_API_ID = "<%- theme.nav_search.baidu_api_id %>";
var SEARCH_SERVICE = "<%- theme.nav_search.service %>";
var ROOT = "<%- config.root %>"||"/";
if(!ROOT.endsWith('/'))ROOT += '/';
</script>
<% if (config.search && config.search.enable) { %>
<script>
var GOOGLE_CUSTOM_SEARCH_API_KEY = "<%- config.search.google_api_key %>";
var GOOGLE_CUSTOM_SEARCH_ENGINE_ID = "<%- config.search.google_engine_id %>";
var ALGOLIA_API_KEY = "<%- config.search.algolia_api_key %>";
var ALGOLIA_APP_ID = "<%- config.search.algolia_app_id %>";
var ALGOLIA_INDEX_NAME = "<%- config.search.algolia_index_name %>";
var AZURE_SERVICE_NAME = "<%- config.search.azure_service_name %>";
var AZURE_INDEX_NAME = "<%- config.search.azure_index_name %>";
var AZURE_QUERY_KEY = "<%- config.search.azure_query_key %>";
var BAIDU_API_ID = "<%- config.search.baidu_api_id %>";
var SEARCH_SERVICE = "<%- config.search.service%>" || "hexo";
var ROOT = "<%- config.root %>"||"/";
if(!ROOT.endsWith('/'))ROOT += '/';
</script>
<% } %>
<%- js('js/search.js') %>
<%- js('js/app.js') %>

@ -1,3 +1,20 @@
<% (config.materialx && config.materialx.widgets && (config.materialx.widgets||[]) || (theme.materialx.widgets||[])).forEach(function(name){ %>
<%- partial('../_widget/'+name) %>
<% }) %>
<% if (config.widgets){ %>
<% if (config.widgets.author){ %>
<%- partial('../_widget/author') %>
<% } %>
<% if (config.widgets.categories){ %>
<%- partial('../_widget/categories') %>
<% } %>
<% if (config.widgets.tagcloud){ %>
<%- partial('../_widget/tagcloud') %>
<% } %>
<% if (config.widgets.musicid){ %>
<%- partial('../_widget/music') %>
<% } %>
<% if (config.widgets.links){ %>
<%- partial('../_widget/links') %>
<% } %>
<% if (config.widgets.toc){ %>
<%- partial('../_widget/toc') %>
<% } %>
<% } %>

@ -1,33 +0,0 @@
<section class='m_widget about'>
<div class='header'>
<% if(config.avatar) { %>
<img class='avatar' src='<%= url_for(config.avatar) %>' />
<% } else { %>
<img class='avatar waves-image' src='https://xaoxuu.com/assets/img/avatar.jpg' />
<%} %>
</div>
<div class='content'>
<% if (config.materialx && (config.materialx.widgets_about.title)){ %>
<h2><%= config.materialx.widgets_about.title %></h2>
<% } %>
<div>
<i class="fa fa-quote-left fa-3x fa-pull-left" aria-hidden="true"></i>
<% if (config.materialx && (config.materialx.widgets_about.motto)){ %>
<%= config.materialx.widgets_about.motto %>
<% } %>
</div>
</div>
<% if (config.materialx && config.materialx.widgets_about.social){ %>
<div class="social-wrapper">
<% (config.materialx && config.materialx.footer_social && (config.materialx.footer_social||[]) || (theme.materialx.footer_social||[])).forEach(function(value){ %>
<% if (value.url && value.slug) { %>
<a href="<%= value.url %>" class="social <%= value.slug %>"
target="_blank" rel="external">
<i class="fa fa-<%= value.slug %> fa-fw"></i>
</a>
<%}%>
<%})%>
</div>
<% } %>
</section>

@ -0,0 +1,29 @@
<% if(config.widgets.author.enable != false) { %>
<section class='m_widget author'>
<% if(config.widgets.author.avatar || config.avatar) { %>
<div class='header'>
<img class='avatar' src='<%= url_for(config.widgets.author.avatar || config.avatar) %>' />
</div>
<%} %>
<div class='content'>
<% if (config.widgets.author.title){ %>
<h2><%= config.widgets.author.title %></h2>
<% } %>
<% if (config.widgets.author.motto){ %>
<div>
<i class="fa fa-quote-left fa-3x fa-pull-left" aria-hidden="true"></i>
<%= config.widgets.author.motto %>
</div>
<% } %>
</div>
<% if (config.widgets.author.social){ %>
<div class="social-wrapper">
<% (config.social||[]).forEach(function(value){ %>
<% if (value.url && value.icon) { %>
<a href="<%= value.url %>" class="social flat-box" target="_blank" rel="external"><i class="social fa <%= value.icon %>" aria-hidden="true"></i></a>
<%}%>
<%})%>
</div>
<% } %>
</section>
<% } %>

@ -1,12 +1,12 @@
<section class='m_widget categories'>
<div class='header'><i class="fa fa-sitemap fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;分类</div>
<div class='content'>
<% if (site.categories.length){ %>
<ul class="entry">
<% site.categories.sort('name').each(function(item){ %>
<li><a class="flat-box" href="<%= url_for(item.path) %>"><div class='name'><%= item.name %></div><div class='badge'><%= item.posts.length %></div></a></li>
<% }); %>
</ul>
<% } %>
</div>
<div class='header'><i class="fa fa-sitemap fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;分类</div>
<div class='content'>
<% if (site.categories.length){ %>
<ul class="entry">
<% site.categories.sort('name').each(function(item){ %>
<li><a class="flat-box" href="<%= url_for(item.path) %>"><div class='name'><%= item.name %></div><div class='badge'><%= item.posts.length %></div></a></li>
<% }); %>
</ul>
<% } %>
</div>
</section>

@ -1,13 +0,0 @@
<section class='m_widget contacts'>
<div class='header'><i class="fa fa-id-card fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;联系</div>
<div class='content'>
<ul class="entry">
<% ((config.materialx && (config.materialx.widgets_contacts||[])) || (theme.materialx.widgets_contacts||[])).forEach(function(item){ %>
<li><a class="flat-box" target="_blank" rel="external nofollow noopener noreferrer" href="<%= url_for(item.url) %>">
<div class='name'><%= item.name %></div>
<div class='badge'><%= item.desc %></div>
</a></li>
<% }) %>
</ul>
</div>
</section>

@ -1,17 +1,15 @@
<% if (config.materialx && (config.materialx.widgets_links)){ %>
<section class='m_widget links'>
<div class='header'><i class="fa fa-link fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;友链</div>
<div class='content'>
<ul class="entry" id="links">
<% (config.materialx && (config.materialx.widgets_links||[])).forEach(function(item){ %>
<li><a class="flat-box" target="_blank" rel="external nofollow noopener noreferrer" href="<%= url_for(item.url) %>">
<div class='name'>
<i class="fa fa-user-circle-o" aria-hidden="true"></i>
&nbsp;&nbsp;<%= item.name %>
</div>
</a></li>
<% }) %>
</ul>
</div>
</section>
<% } %>
<section class='m_widget links'>
<div class='header'><i class="fa fa-link fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;友链</div>
<div class='content'>
<ul class="entry" id="links">
<% (config.widgets.links||[]).forEach(function(item){ %>
<li><a class="flat-box" target="_blank" rel="external nofollow noopener noreferrer" href="<%= url_for(item.url) %>">
<div class='name'>
<i class="fa fa-user-circle-o" aria-hidden="true"></i>
&nbsp;&nbsp;<%= item.name %>
</div>
</a></li>
<% }) %>
</ul>
</div>
</section>

@ -1,8 +1,6 @@
<% if (config.materialx && config.materialx.widgets_musicid){ %>
<section class='m_widget music'>
<section class='m_widget music'>
<div class='header'><i class="fa fa-music fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;音乐</div>
<div class='content'>
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=100% height=450 src="//music.163.com/outchain/player?type=0&id=<%= config.materialx.widgets_musicid %>&auto=0&height=450"></iframe>
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=100% height=450 src="//music.163.com/outchain/player?type=0&id=<%= config.widgets.musicid %>&auto=0&height=450"></iframe>
</div>
</section>
<% } %>
</section>

@ -1,14 +1,14 @@
<% if (site.tags.length){ %>
<section class="m_widget tagcloud">
<div class="header"><i class="fa fa-tags fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;标签</div>
<div class='content'>
<%- tagcloud(site.tags, {
min_font: 14,
max_font: 24,
color: true,
start_color: '#999',
end_color: '#555',
}) %>
</div>
</section>
<section class="m_widget tagcloud">
<div class="header"><i class="fa fa-tags fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;标签</div>
<div class='content'>
<%- tagcloud(site.tags, {
min_font: 14,
max_font: 24,
color: true,
start_color: '#999',
end_color: '#555',
}) %>
</div>
</section>
<% } %>

@ -132,13 +132,20 @@ var customSearch;
function setTocToggle() {
const $toc = $('.toc-wrapper');
if ($toc.length === 0) return;
$toc.click((e) => { e.stopPropagation(); $toc.addClass('active'); });
$toc.click((e) => {
e.stopPropagation();
$toc.addClass('active');
});
$(document).click(() => $toc.removeClass('active'));
$toc.on('click', 'a', (e) => {
e.preventDefault();
e.stopPropagation();
scrolltoElement(e.target.tagName.toLowerCase === 'a' ? e.target : e.target.parentElement);
if (e.target.tagName === 'A') {
scrolltoElement(e.target);
} else if (e.target.tagName === 'SPAN') {
scrolltoElement(e.target.parentElement);
}
});
const liElements = Array.from($toc.find('li a'));

@ -317,8 +317,11 @@ li {
ul.h-list {
display: flex;
align-items: center;
height: 100%;
&>li {
flex: none;
// flex: none;
height: 100%;
justify-content: center;
}
}

@ -66,10 +66,11 @@
// 自定义主题色 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
// 定义颜色
// 如果你比较懒,就只改这两行就可以了:
@theme-base-main: #EEE;
@theme-base-tint: @ax-red;
// 如果你想更深层次DIY,可以更改下面这些:
// 网页背景
@theme-bg-main: #EFEFEF;
// 导航栏背景
@ -84,7 +85,7 @@
@theme-bg-code: @theme-base-tint;
// 代码块的背景色
@theme-bg-code-block: #F5F5F5;
// 引用的颜色分类、归档的 hover 时颜色
// 引用的颜色以及分类、归档的 hover 时颜色
@theme-bg-quote: @theme-base-tint;
// 标题文字颜色(h1/h2)
@ -98,8 +99,6 @@
// 正文文字颜色
@theme-text-main: @dark;
// 自定义主题色 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@box-shadow-card-raised: 0 2px 4px 0px rgba(0, 0, 0, 0.12), 0 4px 8px 0 rgba(0, 0, 0, 0.12), 0 8px 16px 0px rgba(0, 0, 0, 0.12), 0 16px 32px 0px rgba(0, 0, 0, 0.12);

@ -17,7 +17,9 @@
text-decoration: underline;
}
.social-wrapper {
// padding-top: 20px;
display: flex;
justify-content: center;
flex-wrap: wrap;
}
a {
color: fade(@theme-text-main, 70%);
@ -29,12 +31,13 @@
position: relative;
display: inline-block;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
width: 32px;
height: 32px;
padding: 4px 2px;
margin: 4px;
border-radius: 100px;
background: darken(@theme-bg-main, 5%);
&:hover {
background: darken(@theme-bg-main, 20%);
color: @theme-text-highlight;

@ -23,6 +23,8 @@
// padding: 0 @gap;
&, a{
.txt-ellipsis;
height: @header-height;
line-height: @header-height;
color: @theme-text-in-header;
}
&:extend(.z-depth-nav);
@ -229,6 +231,8 @@
nav {
padding: @gap/2 0px;
.nav {
height: @item-height;
line-height: @item-height;
position: relative;
display: block;
color: @black;

@ -15,7 +15,11 @@
// margin-right:0;
// width: @side-width;
}
.header{
position: sticky;
width: 100%;
top: 0;
}
@media(max-width: @on-phone){
width: 100% - 0.5 * @gap;
top: @header-height + @gap;

@ -67,7 +67,7 @@
}
}
}
.m_widget.about{
.m_widget.author{
.enable-trans();
h2{
text-align: center;
@ -104,6 +104,7 @@
.social-wrapper{
display: flex;
justify-content: center;
flex-wrap: wrap;
padding-top: 0;
padding-bottom: @gap/2;
a {
@ -113,15 +114,13 @@
color: @theme-text-highlight;
}
&.social {
position: relative;
display: inline-block;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
width: 32px;
height: 32px;
padding: 4px 2px;
margin: 4px;
border-radius: 100px;
background: darken(@theme-bg-card, 5%);
&:hover {
background: darken(@theme-bg-card, 20%);
color: @theme-text-highlight;

Loading…
Cancel
Save