# FancyBox is a tool that offers a nice and elegant way to add zooming functionality for images. # For more information: https://fancyapps.com/fancybox fancybox:
更改為 fancybox: true ,重新 hexo clean, hexo s 就可以了
圖片太透明
到 hexo\themes\next\source\css\_colors.styl 找到以下代碼
1 2 3 4 5 6 7
img { opacity: .75;
&:hover { opacity: .9; } }
將反白代碼全部刪掉就好
主選單設置
新增自訂頁面
在根目錄 (hexo 資料夾) 打上以下指令
1
hexo new page "頁面名稱(網址用)"
例如我就新增了
1
hexo new page about
存放位置與頁面資訊
有別於文章與草稿有各自不同的目錄存放,頁面檔案是獨立存放於一個目錄中的,像是我剛剛建立了 about 頁面,頁面存放位置於 hexo\source\about 內,而檔案名稱為 index.md。
<script type="text/javascript"> var alltags = document.getElementsByClassName('tag-cloud-tags'); var tags = alltags[0].getElementsByTagName('a'); for (var i = tags.length - 1; i >= 0; i--) { var golden_ratio = 0.618033988749895; var s = 0.5; var v = 0.999; var h = golden_ratio + Math.random()*0.8 - 0.5; var h_i = parseInt(h * 6); var f = h * 6 - h_i; var p = v * (1 - s); var q = v * (1 - f * s); var t = v * (1 - (1 - f) * s); var r, g, b; switch (h_i) { case0: r = v; g = t; b = p; break; case1: r = q; g = v; b = p; break; case2: r = p; g = v; b = t; break; case3 : r = p; g = q; b = v; break; case4: r = t; g = p; b = v; break; case5: r = v; g = p; b = q; break; default: r = 1; g = 1; b = 1; } tags[i].style.background = "rgba("+parseInt(r*255)+","+parseInt(g*255)+","+parseInt(b*255)+","+0.5+")"; } </script>
接下來因為 hexo-generator-searchdb 這個套件是針對 NexT 優化出的,所以就可以找得到相關的設置在 hexo\themes\next\_config.yml
1 2 3 4 5 6 7 8 9 10 11 12 13
# Local Search # Dependencies: https://github.com/theme-next/hexo-generator-searchdb local_search: enable:false # If auto, trigger search by changing input. # If manual, trigger search by pressing enter key or search button. trigger:auto # Show top n results per article, show all results by setting to -1 top_n_per_article:1 # Unescape html strings to the readable one. unescape:false # Preload the search data when the page loads. preload:false
只需要將 enable 改成 true 就可以讓自己網站資源搜尋功能囉。
閱讀進度條
頂部或是底部有個進度條,隨著你的閱讀進度進行滑動。
在 hexo\themes\next\_config.yml 找到以下這段語法:
1 2 3 4 5 6 7
# Reading progress bar reading_progress: enable:false # Available values: top | bottom position:top color:"#37c6c0" height:3px
enable:設定是否開啟進度條,開啟則設定 true
position:設定進度條在頂部還是底部顯示
color:進度條背景顏色
height:進度條高度
將 enable: true 即可
回到頂部按鈕
在 hexo\themes\next\_config.yml 找到以下這段語法:
1 2 3 4 5 6
back2top: enable:true # Back to top in sidebar. sidebar:false # Scroll percent label in b2t button. scrollpercent:false
codeblock: # Code Highlight theme # Available values: normal | night | night eighties | night blue | night bright | solarized | solarized dark | galactic # See: https://github.com/chriskempson/tomorrow-theme highlight_theme:normal # Add copy button on codeblock copy_button: enable:false # Show text copy result. show_result:false # Available values: default | flat | mac style:
將 highlight_theme: normal 改成 highlight_theme: night bright
加上數學式
在 hexo\themes\next\_config.yml 中:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
# Math Formulas Render Support math: # Default (true) will load mathjax / katex script on demand. # That is it only render those page which has `mathjax: true` in Front-matter. # If you set it to false, it will load mathjax / katex srcipt EVERY PAGE. per_page:true
# hexo-renderer-pandoc (or hexo-renderer-kramed) requi#FC4E4E for full MathJax support. mathjax: enable:true # See: https://mhchem.github.io/MathJax-mhchem/ mhchem:false
# hexo-renderer-markdown-it-plus (or hexo-renderer-markdown-it with markdown-it-katex plugin) requi#FC4E4E for full Katex support. katex: enable:false # See: https://github.com/KaTeX/KaTeX/tree/master/contrib/copy-tex copy_tex:false
# Sidebar Avatar avatar: # Replace the default image and set the url here. url: # If true, the avatar will be dispalyed in circle. rounded:false # If true, the avatar will be rotated with the cursor. rotated:false
# Sidebar Avatar avatar: # Replace the default image and set the url here. url:/images/coffee.jpg # If true, the avatar will be dispalyed in circle. rounded:true # If true, the avatar will be rotated with the cursor. rotated:false
# Valine # For more information: https://valine.js.org, https://github.com/xCss/Valine valine: enable:true appid:# 填你的 AppId appkey:# 填你的 AppKey notify:false# Mail notifier verify:false# Verification code placeholder:Justgogo# Comment box placeholder avatar:mm# Gravatar style guest_info:nick,mail,link# Custom comment header pageSize:10# Pagination size language:# Language, available values: en, zh-cn visitor:false# Article reading statistic comment_count:true# If false, comment count will only be displayed in post page, not in home page recordIP:false# Whether to record the commenter IP serverURLs:# 填你的 Request 域名第一欄,記得前面要加 https:// #post_meta_order: 0
# Note tag (bs-callout) note: # Note tag style values: # - simple bs-callout old alert style. Default. # - modern bs-callout new (v2-v3) alert style. # - flat flat callout style with background, like on Mozilla or StackOverflow. # - disabled disable all CSS styles import of note tag. style:flat icons:true # Offset lighter of background in % for modern and flat styles (modern: -12 | 12; flat: -18 | 6). # Offset also applied to label tag variables. This option can work with disabled note tag. light_bg_offset:0