如何处理 npm 包依赖的依赖?
dependencies、devDependencies 还是 peerDependencies? dependencies 用户在使用我的包时,会自动安装 b,但是其实不需要安装b。peerDependencies 要求用户的项目中安装了 b , devDependencies 在 npm i 时,不会自动,符合我的期望,但是我发现 npm 上很多开发者没有把依赖安装到 devDependencies,而是 dependencies...
1 回答952 阅读✓ 已解决
前言
官方的辅助函数 list_categories 根本不够用,只好自己用 categories 这个变量了。
由于没学过 node.js 所以只有瞎折腾一通。
我先用 console.log() 看了看 site.categories.data,它的内容是如下。
折腾一番,这个 object 是用 map() 来调用的。
输出目录标题
输出文章标题
post.title
string
post.date
post.updated
post.comments
boolean
post.layout
string
post.content
string
post.excerpt
string
post.more
string
post.source
string
post.full_source
string
post.path
url_for(post.path)
。string
post.permalink
string
post.prev
null
。string
ornull
post.next
null
。string
ornull
post.raw
post.photos
array
post.link
string