mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2025-09-15 12:58:48 +08:00
1. 更改手機頁面的menu和toc的顯示方式和顯示特效(ipad也能看TOC) 3. 可設置複製時,内容自動加上版權信息 4. 可修改tag的top_img 5. 可修改category的top_img 6. 可修改valine的背景 7. archives頁UI優化 8. ICP增加icon #37 9. 可設置主頁top_img的高度 10. 可設置主頁site-info的位置 11. category頁和tag頁的UI可以設置與主頁UI一樣 #31 12. 主頁subtitle可設置多個句子(不再限制2個) #37 13. 設置menu時,頭尾添加空格不受影響 14. 調整post頁的佈局 15. 书签添加icon 16. 公告icon效果 17. 首頁歸檔模塊,可設置數量限制,會顯示'查看更多'按鈕 18. 右下角按鈕調整。 19. 修复文章cover隨機图片生成,同一篇文章,不同地方的cover顯示不一样的bug 20. 修復gitalk語言設置無效的bug #35 21. 修復post頁面,當沒有設置word count時,閲讀量前有'|" 22. 修复sub-menu在safari的显示问题 23. 修复tags页评论居中问题 24. 修复header a hover 白色问题 25. 修復夜間模式下footer的顔色bug 26. 修復英文語言下,書簽英文顯示不完整的問題
124 lines
5.2 KiB
Plaintext
124 lines
5.2 KiB
Plaintext
- var without_index = url.replace('index.html', '')
|
|
- var without_html = without_index.replace('.html', '')
|
|
- var photo_check = is_post() ? page.cover || theme.avatar : theme.avatar
|
|
- var photo_link = url_check (photo_check) ? photo_check : config.url + photo_check
|
|
|
|
meta(http-equiv="x-dns-prefetch-control" content="on")
|
|
if theme.canonical
|
|
link(rel="canonical" href=without_html)
|
|
|
|
if theme.twitter_meta
|
|
meta(name="twitter:card" content="summary_large_image")
|
|
meta(name="twitter:title" content=pageTitle_no_include_blog_name)
|
|
meta(name="twitter:description" content=pageDescription)
|
|
meta(name="twitter:image" content=photo_link)
|
|
|
|
if theme.Open_Graph_meta
|
|
if is_post()
|
|
meta(property="og:type" content="article")
|
|
else
|
|
meta(property="og:type" content="website")
|
|
|
|
meta(property="og:title" content=pageTitle_no_include_blog_name)
|
|
meta(property="og:url" content=without_html)
|
|
meta(property="og:site_name" content=config.title)
|
|
meta(property="og:description" content=pageDescription)
|
|
meta(property="og:image" content=photo_link)
|
|
|
|
if theme.disable_baidu_transformation
|
|
meta(http-equiv="Cache-Control" content="no-transform")
|
|
meta(http-equiv="Cache-Control" content="no-siteapp")
|
|
|
|
if is_post()
|
|
if(page.prev)
|
|
link(rel="prev" title=page.prev.title href=url_for(page.prev.permalink) )
|
|
if(page.next)
|
|
link(rel="next" title=page.next.title href=url_for(page.next.permalink) )
|
|
|
|
|
|
if theme.algolia_search.enable
|
|
link(rel="dns-prefetch" href="https://cdn.jsdelivr.net")
|
|
link(rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/instantsearch.js@2.1.1/dist/instantsearch.min.css")
|
|
script(src="https://cdn.jsdelivr.net/npm/instantsearch.js@2.1.1/dist/instantsearch.min.js" defer)
|
|
|
|
if (theme.gitment && theme.gitment.enable)
|
|
link(rel="dns-prefetch" href="https://unpkg.com")
|
|
link(rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/gitment/style/default.min.css")
|
|
script(src="https://cdn.jsdelivr.net/npm/gitment/dist/gitment.browser.min.js")
|
|
script(src="https://cdn.jsdelivr.net/npm/blueimp-md5@2.10.0/js/md5.min.js")
|
|
if (theme.gitalk && theme.gitalk.enable)
|
|
link(rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/gitalk/dist/gitalk.min.css")
|
|
if(theme.gitalk.js)
|
|
script(src=theme.gitalk.js)
|
|
else
|
|
script(src="https://cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.min.js")
|
|
script(src="https://cdn.jsdelivr.net/npm/blueimp-md5@2.10.0/js/md5.min.js")
|
|
|
|
|
|
|
|
if (theme.pwa && theme.pwa.enable)
|
|
link(rel="manifest" href=theme.pwa.manifest)
|
|
if(theme.pwa.theme_color)
|
|
meta(name="theme-color" content=theme.pwa.theme_color)
|
|
if(theme.pwa.theme_color)
|
|
meta(name="msapplication-TileColor" content=theme.pwa.theme_color)
|
|
if(theme.pwa.apple_touch_icon)
|
|
link(rel="apple-touch-icon" sizes="180x180" href=theme.pwa.apple_touch_icon)
|
|
if(theme.pwa.favicon_32_32)
|
|
link(rel="icon" type="image/png" sizes="32x32" href=theme.pwa.favicon_32_32)
|
|
if(theme.pwa.favicon_16_16)
|
|
link(rel="icon" type="image/png" sizes="16x16" href=theme.pwa.favicon_16_16)
|
|
if(theme.pwa.mask_icon)
|
|
link(rel="mask-icon" href=theme.pwa.mask_icon color="#5bbad5")
|
|
|
|
|
|
if theme.baidu_analytics
|
|
link(rel="dns-prefetch" href="https://hm.baidu.com")
|
|
script.
|
|
var _hmt = _hmt || [];
|
|
(function() {
|
|
var hm = document.createElement("script");
|
|
hm.src = "https://hm.baidu.com/hm.js?!{theme.baidu_analytics}";
|
|
var s = document.getElementsByTagName("script")[0];
|
|
s.parentNode.insertBefore(hm, s);
|
|
})();
|
|
if theme.google_analytics
|
|
link(rel="dns-prefetch" href="https://www.google-analytics.com")
|
|
script.
|
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
|
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
|
|
|
ga('create', '!{theme.google_analytics}', 'auto');
|
|
ga('send', 'pageview');
|
|
|
|
if theme.google_site_verification
|
|
meta(name="google-site-verification" content=theme.google_site_verification)
|
|
|
|
if theme.bing_site_verification
|
|
meta(name="msvalidate.01" content=theme.bing_site_verification)
|
|
|
|
if theme.baidu_site_verification
|
|
meta(name="baidu-site-verification" content=theme.baidu_site_verification)
|
|
|
|
if theme.qihu_site_verification
|
|
meta(name="360-site-verification" content=theme.qihu_site_verification)
|
|
|
|
|
|
- var preload_archive_img = theme.archive_img ||theme.top_img || config.top_img
|
|
- var preload_tag_img = theme.tag_img ||theme.top_img || config.top_img
|
|
- var preload_category_img = theme.category_img ||theme.top_img || config.top_img
|
|
- var preload_img = page.top_img || theme.top_img || config.top_img
|
|
|
|
if (is_archive() && preload_archive_img)
|
|
link(rel="preload" href=url_for(preload_archive_img) as="image" )
|
|
else if (is_tag() && preload_tag_img)
|
|
link(rel="preload" href=url_for(preload_tag_img) as="image" )
|
|
else if (is_category() && preload_category_img)
|
|
link(rel="preload" href=url_for(preload_category_img) as="image" )
|
|
else if (!is_post() && preload_img)
|
|
link(rel="preload" href=url_for(preload_img) as="image" )
|
|
|
|
if theme.blog_title_font.font_link
|
|
link(rel='stylesheet', href=url_for(theme.blog_title_font.font_link)) |