Comments (3)
文件名不作为category
_post/Programming/Python/排序.md
你提到的这个例子,会生成标签
categories:
- Programming
- Python
文件名不作为category应该更符合大众需求吧
关于空分类
类似以下的例子,也可以不生成[]
作为category。这个应该影响不大
INFO Generated: categories [] for post [C++常数优化]
关于hexo s的无限循环
是,hexo s的时候会有问题。我也不知道为什么。
所以我就一直不用hexo s,直接hexo d。
囧o(╯□╰)o
欢迎PR
from hexo-auto-category.
我不是说文件名要作为category
我也不会把文件名作为category
其实我的重点在于,你的以下代码
var categories = data.slug.split('/');
有问题。
- 正常情况下,它解析了
_post/Programming/Python/排序.md
后,category会变成["Programming","Python","排序"],然后在接下来的代码中,用前2个元素(去掉最后一个)来生成标签:
categories:
- Programming
- Python
- 然而在我这里generator的时候,categories变成了
["Programming-Python-排序"]
,然后你再用它生成category,就是空的:
categories: []
就会长成这样。。。。。
您还是有时间修复一下这个Bug吧
还有那个hexo s
的Bug。。。不用hexo s
我很难受的。。。
from hexo-auto-category.
哦,你说的这种情况,我没遇到过。是data.slug
获取的问题吗?
console.log(data.slug) // Programming/Python/排序
console.log(data.source) // _post/Programming/Python/排序.md
var categories = data.slug.split('/'); // 正常
你那里的 data.slug
解析出来不是这个值吗?可能是hexo版本问题,保险起见 可以采用data.source
hexo s 遇到的问题
我暂时也没找到原因,o(╯□╰)o
from hexo-auto-category.
Related Issues (20)
- How do I create files in subdirectories? HOT 4
- 报错TypeError: tmpPost.categories.join is not a function HOT 6
- _Post.md 可以指定生成分类目录需要几层吗? HOT 1
- 如果能在hexo new 的时候源文件也能归档就好了
- 在应用该插件的工程中遇到了tmppPost.categories不是个函数这个问题。 HOT 1
- 文章标题解析不成功 HOT 2
- join is not a function HOT 11
- 这个问题请看一下,装了这个hexo-auto-category插件,clean了之后 hexo g的时候就会报错,卸载这个插件之后就没事 HOT 3
- 这真是一个很好👍插件,有问题请教下,不甚感激! HOT 5
- 您好,npm是否可以重新发布一下 HOT 3
- 存在以下问题:INFO Generated: categories [null] for post HOT 13
- 希望能添加一个自动根据文件标题添加title的功能? HOT 3
- 重命名文件夹文章内容丢失 HOT 3
- 在已经有文章的文件夹改名字会清除原来的文章 HOT 1
- 编译时 categories 分类内容会被清空 HOT 1
- 通过Github Action自动部署时没有起作用 HOT 2
- 求助:希望博客链接不带有分类层级
- 能否检测_config.yml中的category_map,将生成的英文category缩略名转化为它对应的中文分类全名?
- 关于categories为空的问题
- 文件夹更名后文章内容被清空
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hexo-auto-category.