Linking

Capturing Life & Tech

  • 主页
  • 随笔
  • 关于我
所有文章 外链

Linking

Capturing Life & Tech

  • 主页
  • 随笔
  • 关于我

博客建立过程记录

阅读数:次 2015-11-30
字数统计: 2.8k字   |   阅读时长≈ 12分

目前为止,博客大部分功能已经实现。可以正常运行。
前后大概用了三天时间。
头痛
熟悉git命令,github,hexo+NexT theme等。

待解决问题:

1.百度统计短信无法接受,造成无法加入此功能
短信系统故障问题,延迟太久。暂时无法解决。
2.二级页面的头像问题
我在站点source/下各个文件夹中加入images/avatar.jpg,成功在二级页面显示头像。因为generate把source下的文件渲染到public下,可以观察到相似性。
3.外链,RSS
问题已经解决。但是RSS的运用还是不清楚。知乎上一篇文章很好。RSS可以节省精力。
RSS 的正确打开方式是什么呢?
4.cnzz统计底部位置,是否有必要放置。
感觉没有必要,访问量不多。先放着吧。
5.删除测试文档

time: 2015/11/30 12:30 am

hexo d之后首页只显示最新博客

有时候还会缺失谋篇。看到的有关解答是hexo clean,hexo generate两次,再hexo deploy
有时候有用,有时没效果。
暂时先这样了。
test文件也保留,纪念下吧。

草稿的发布流程是什么

可能写好的东西不想立刻发布,先存草稿呢。
新建:hexo new draft filename
发布:hexo publish filename

time: 2015/11/30 16:30 pm

关于文章中文乱码的问题

发现只要是new的时候用中文名称,后面再写文章的时候就能够正常显示中文,可能是框架的设置吧。

后来发现是文件编码问题,改成utf-8编码格式就行了。
感谢社区的大神回复,还是应该多混社区、多交流。

所以跟我一开始在mkd编辑器里编辑同步预览,再复制过来没有编码问题。
所以以后都可以在mkd中写好,设好效果再复制过来。

文章目录方法

无意中发现了右侧边栏建立文章目录的方法就是如上,加三-。

分类和标签计数bug

暂时只能靠clean,generate多试两次了,碰运气不是事。总结原因,寻求解决之道。

time:2015/11/30 20:10 pm

文章首页摘录的长度

三种方式:
1.手动在合适位置+ 。这种方法更“因地制宜”
2.在文章开头的front-matter添加description,并提供文章摘录。
这种应该是有必要单独写一个简介时才用。
3.自动形成。在主题配置文件中添加:

auto_excerpt:
  enable: true
  length: 150
默认截取长度150字符.

可以设置一个默认的长度,有时候可能自己忘记手动添加呢。
然后根据需要在文章中自己再根据情况截断。

右侧站点概览头像bug

具体单个文章右侧边栏,头像不能显示,渲染过程中是怎么样在2015/11/30这些文件夹中加入images/avatar.jpg的呢?还没有弄清楚渲染机制。

二级页面的站点概览头像问题还未解决。

感人啊,用了在线链接http://7xosdw.com1.z0.glb.clouddn.com/avatar.jpg
将sidebar.swig文件里的class="site-author-image"的*/src="{/{theme.avatar or url_for(theme. images) + '/avatar.jpg' }}*"替换成src="http://7xosdw.com1.z0.glb.clouddn.com/avatar.jpg"。
这真的是被逼的啊。经过反复折腾,换回原来的写法,还真是可以了。应该是在theme里的default_avatar.jpg生效了。
这里不能用swig语法写记录,否则会遇到找不到url_for的问题。
什么时候有空研究一下swig语法。
theme.avatar是站点还是主题啊。
time: 2015/11/30 21:45

多说评论分享里的underfined

部分显示,应该是另外一部分没有写进主题里吧。
多说分享自定义图标

加入百度地图

1.在百度地图开发者工具中,申请秘钥,生成地图。
2.嵌入到about的markdown中,用到的是swig语法

1
2
3
{% raw %}
yourcord(这里我嵌入了完整的HTML代码,包括js)
{% endraw %}

如果想直接用HTML写的话就可以这样了。

time: 2015/12/13 21:52 aielab


首页不显示二级页面显示sidebar

theme-config设置sidebar:post

time: 2015/12/16 14:15 aielab

搞疯的了,一个文件的编码出现了问题,导致generate失败。

1
Template render error: Error: Unable to call `url_for`, which is undefined or falsey

在多个编辑器之间切换时不要随改变编码。
后来发现不是编码问题,是本文档里有一个swig的url_for,导致了模板解析错误。

time: 2015/12/16 18:34 aielab

利用git解决多pc端同步的问题

已实现在osc上的备份,下一步是在笔记本上下载同步(业已实现)。

二级目录的文章目录里怎么显示二级,如1.1,1.1.1

目前用===,---实现一二级目录的显示,够用了。

微信头像大小控制

七牛图床可以在链接后加参数/filename.jpg?imageView/2/w/333/q/77,以此来限制图片的大小,也可以用HTML嵌入div等方法。

2016/01/05 11:46 AHAU_LIBRARY

百度地图自适应

百度地图的大小,在手机里的显示位置控制。自适应问题。

没有过多的处理,只是用width=80这样限制了一下宽度。

背景-蜂巢

在footer.swig or header.swig中加入canvas-nest.

首页渲染出问题

首页部分文章无法显示,分页首页才1篇。在归档中能看到全部。

这就是用别人的框架的后遗症。不知道哪里出了问题。

time: 2016/02/26 12:06 #aielab

在mac上重新部署出问题

问题描述:

1
2
3
4
5
6
7
8
9
10
11
Error: EACCES: permission denied, access '/usr/local/lib/node_modules/hexo-cli/node_modules/lru-cache'
npm ERR! { Error: EACCES: permission denied, access '/usr/local/lib/node_modules/hexo-cli/node_modules/lru-cache'
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules/hexo-cli/node_modules/lru-cache' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/linking/blo/npm-debug.log

尝试方法1:npm i hexo-cli -g ,重新全局安装hexo,无效
尝试方法2:给node_modules/文件夹授权;sudo chown -R $USER /usr/local/lib/node_modules以及sudo chown -R $(whoami) ~/.npm;
这两个都无效,而且引发了新的问题;
尝试方法3:考虑卸载node,重新用nvm来安装node
描述

1
2
Permissions you used when installing Node will be required when doing things like writing in your npm directory (npm link, npm install -g, etc.).
You probably ran node installation with root permissions, that's why the global package installation is asking you to be root.

安装node时用了权限,那用到相关的安装操作时都会要求使用root权限。
NVM:

1
2
3
4
5
6
7
8
9
Don't hack with permissions, install node the right way.
On a development machine, you should not install and run node with root permissions, otherwise things like npm link, npm install -g will need the same permissions.

NVM (Node Version Manager) allows you to install Node without root permissions and also allows you to install many versions of Node to play easily with them.. Perfect for development.

* Uninstall Node (root permission will probably be required). This might help you.
* Then install NVM following instructions on this page.
* Install Node via NVM: nvm install node
Now npm link, npm install -g will no longer require you to be root.

最终是按照这个方法比较好的安装node,重新在Mac上跑hexo;
但是这个过程中遇到很多坑:列一下
1.重新安装了git,使用usr/bin/目录下的,因为系统默认的是xcode或者预装版本,不是最新;但手动安装最新版在usr中;由于我使用的是zsh终端,所以就偷懒了,用下面的方法指定alias别名:

1
alias git=/usr/local/bin/git

现在使用的git就是最新版本了。
2.unable to resolve host xxx
无法解析域名吧。我做了两件事,第一件事是在dns服务器中加入8.8.8.8;第二件事是把这些常用的域名加入到hosts中,就在github上搜了一个项目,镜像地址.把最近的更新全部加入自己的hosts中,当然,替换之前别忘了备份哦。
好吧,装好了nvm还要装node ,再hexo;希望顺利吧。
#20161130

安装错误

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
~ npm install -g hexo-cli
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/hexo-cli/node_modules/chokidar/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: shasum check failed for /var/folders/cj/4j5y0lc159v1r742jjmj79280000gn/T/npm-5246-f2829530/registry.npmjs.org/fsevents/-/fsevents-1.0.15.tgz
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Expected: fa63f590f3c2ad91275e4972a6cea545fb0aae44
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Actual: 95d129ce7f5ac79eb397f797ce0fd4488350ddf4
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: From: https://registry.npmjs.org/fsevents/-/fsevents-1.0.15.tgz
npm ERR! Darwin 15.6.0
npm ERR! argv "/Users/linking/.nvm/versions/node/v7.2.0/bin/node" "/Users/linking/.nvm/versions/node/v7.2.0/bin/npm" "install" "-g" "hexo-cli"
npm ERR! node v7.2.0
npm ERR! npm v3.10.9

npm ERR! shasum check failed for /var/folders/cj/4j5y0lc159v1r742jjmj79280000gn/T/npm-5246-f2829530/registry.npmjs.org/bunyan/-/bunyan-1.8.5.tgz
npm ERR! Expected: 0d619e83005fb89070f5f47982fc1bf00600878a
npm ERR! Actual: ad816c34cef4a6887577282781bfdc800d8d2784
npm ERR! From: https://registry.npmjs.org/bunyan/-/bunyan-1.8.5.tgz
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR! /Users/linking/npm-debug.log

解决之法:
用sudo权限跑了,成功安装;另外一个因素就是网速,最好在网速好的时候安装;

加上cnzz-umeng统计

20170329

加上访问数统计

20170329

node_modules缺少

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{ Error: Cannot find module './build/Debug/DTraceProviderBindings'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/linking/.nvm/versions/node/v7.2.0/lib/node_modules/hexo-cli/node_modules/dtrace-provider/dtrace-provider.js:17:23)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/linking/.nvm/versions/node/v7.2.0/lib/node_modules/hexo-cli/node_modules/bunyan/lib/bunyan.js:79:18)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32) code: 'MODULE_NOT_FOUND' }

暂未解决,目前不影响使用;但不够优雅,等我什么时候有心情再解决吧。

20180815 更新

再次遇到同类问题

1
Error: Cannot find module 'highlight.js/lib/languages/hy'

分析原因是因为,升级了node和npm,导致原来版本不一致,需要重新编译。

在GitHub上找到解决方法,总结之就是升级版本,卸载重装hexo-cli,删除node_modules文件夹,重新npm install

1
2
3
4
5
6
7
8
9
10
# 1. uninstall hexo-cli globally
$ npm uninstall -g hexo-cli
# 2. then reinstall it
$ npm install -g hexo-cli
# Till this step, when I went to my hexo blog folder and ran hexo server, dtrace-provider was still complaining. So I decided to remove all the node_modules and reinstall.

# 3. under your hexo blog folder (where you have node_modules, public, scaffolds, source and others), remove node_modules
$ rm -rf node_modules
# 4. then reinstall them all
$ npm install

具体请查看 tea3:hexo-related-popular-posts

litia主题的文章截取不显示

more>>效果需要在文章中的合适位置手动写 「 」

TypeError [ERR_INVALID_ARG_TYPE]: The “mode“ argument must be integer. Received an instance of

node 版本过高,hexo 版本过低,导致依赖的库出错

  • 解决:node切回老版本即可
1
nvm use 11.14

240808 update

  • Mac reinstall system
  • Mac reinstall hexo with new node version
  • del unused files, thin is better
  • 本文作者: Linking
  • 本文链接: https://linking.fun/2015/11/30/博客建立过程记录/
  • 版权声明: 版权所有,转载请注明出处!
  • blog
  • cs
  • cs

扫一扫,分享到微信

MarkDown使用说明书
科比撰文宣布赛季后退役
  1. 1. 目前为止,博客大部分功能已经实现。可以正常运行。前后大概用了三天时间。头痛熟悉git命令,github,hexo+NexT theme等。待解决问题:
  2. 2. hexo d之后首页只显示最新博客
  3. 3. 草稿的发布流程是什么
  4. 4. 关于文章中文乱码的问题
  5. 5. 文章目录方法
  6. 6. 分类和标签计数bug
  7. 7. 文章首页摘录的长度
  8. 8. 右侧站点概览头像bug
  9. 9. 多说评论分享里的underfined
  10. 10. 加入百度地图
  11. 11. 首页不显示二级页面显示sidebar
  12. 12. 利用git解决多pc端同步的问题
  13. 13. 二级目录的文章目录里怎么显示二级,如1.1,1.1.1
  14. 14. 微信头像大小控制
  15. 15. 百度地图自适应
  16. 16. 背景-蜂巢
  17. 17. 首页渲染出问题
  18. 18. 在mac上重新部署出问题
  19. 19. 安装错误
  20. 20. 加上cnzz-umeng统计
  21. 21. 加上访问数统计
  22. 22. node_modules缺少
  23. 23. litia主题的文章截取不显示
  24. 24. TypeError [ERR_INVALID_ARG_TYPE]: The “mode“ argument must be integer. Received an instance of
  25. 25. 240808 update
© 2015-2026 Linking
GitHub:hexo-theme-yilia-plus by Litten
本站总访问量次 | 本站访客数人
  • 所有文章
  • 外链

tag:

  • weather
  • 需求
  • essay
  • basketball
  • olympic
  • nginx
  • APPScan
  • SQl盲注
  • xss
  • Ajax
  • ajax
  • ai
  • agent
  • openclaw
  • ccf
  • Nginx
  • HTML5
  • html5
  • hmtl5
  • sse
  • JavaScriptCore
  • Oracle
  • operation
  • Linux
  • deploy
  • Mac Office
  • markdown
  • ListView
  • GridView
  • MySQL
  • 慢查询
  • mongodb
  • 转置
  • thought
  • network
  • ubuntu
  • NetworkManager
  • RFKill
  • Netplan
  • avatar
  • cocoa
  • blog
  • Gitalk
  • container
  • macvlan
  • docker
  • oracle
  • cookie
  • patch
  • gitea
  • git
  • iOS
  • https
  • 多线程
  • bundle
  • 兼容性
  • HTTP
  • 绘图
  • cs
  • java
  • 效率
  • 快捷键
  • route
  • nodejs
  • pip
  • arcgis
  • arcgis 建模
  • 标识
  • redis
  • read
  • bookList
  • running
  • showdoc
  • disk
  • unit-test
  • D.Wade
  • thoughts
  • duoduo
  • Python
  • python
  • tomcat
  • 读书节
  • session
  • jdk
  • war
  • 加班
  • Android onclick事件监听
  • 正则
  • 手机品牌匹配
  • ntp
  • OpenLayers
  • Geoserver
  • wechat
  • 微信公众号
  • 爬虫
  • WeChat
  • 张靓颖
  • 动漫
  • vpn
  • PPT
  • MarkDown
  • plan
  • 朱赟
  • 极客时间专栏
  • 极客邦
  • 模块化
  • MVC
  • excel
  • NBA
  • kobe
  • team
  • crawler
  • 进度条
  • ssl
  • book
  • anti-stealing-link
  • Agentic Engineering
  • Vibe Coding
  • Software 3.0
  • Andrej Karpathy
  • LLM
  • Programming

    缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    3、在根目录_config.yml里添加配置:

      jsonContent:
        meta: false
        pages: false
        posts:
          title: true
          date: true
          path: true
          text: false
          raw: false
          content: false
          slug: false
          updated: false
          comments: false
          link: false
          permalink: false
          excerpt: false
          categories: false
          tags: true
    

  • GitHub Trending
  • OpenAI ChatGPT
  • Gitee码云
  • 简书
  • CSDN