Comments (14)
暂时没有计划。可以具体说说你的需求~
from yuque-hexo.
是这样的,我们团队 在语雀 维护了不同的知识库。
但是现在hexo 只能同步一个知识库的内容,而现在想不同知识库的内容输出到hexo不同的分类下。
from yuque-hexo.
2.0 版本可以支持一下,可能会换一个仓库名字,以更好的支持扩展
from yuque-hexo.
这竟然是个小众需求吗?
from yuque-hexo.
@x-cold 哈哈,需求加一
from yuque-hexo.
需求+2
from yuque-hexo.
需求+3
from yuque-hexo.
需求+4
from yuque-hexo.
需求+5
from yuque-hexo.
需求+6
from yuque-hexo.
请问还会更新这个功能吗?我非常愿意为2.0版本贡献代码
from yuque-hexo.
需求+10086
from yuque-hexo.
需求 + 10087
from yuque-hexo.
我写了个简陋的脚本,可以解决这个问题,将该脚本加入你的构建过程中即可。
@x-cold
syncAllYuqueRepo.js
‘
多仓库肯定意味着多个缓存文件,所有缓存可以装在一个文件夹中。但需要先创建yuqueCache
文件夹不然会报错。
const FS = require('fs');
const spawn = require('cross-spawn');
const packageJson = require('./package.json')
// 扩展该列表即可实现多仓库同步
const yuqueConfigList = [
{
name: "仓库A",
postPath: "source/_posts/repoA",
cachePath: "yuqueCache/repoA.json",
repo: "仓库A的repo",
},
{
name: "仓库B",
postPath: "source/_posts/repoB",
cachePath: "yuqueCache/repoB.json",
repo: "仓库B的repo",
},
]
// 按照 yuqueConfigList 替换 yuqueConfig中的地址,仓库名,缓存地址。并逐个触发语雀文档同步。
for (const repo of yuqueConfigList) {
packageJson.yuqueConfig.postPath = repo.postPath
packageJson.yuqueConfig.cachePath = repo.cachePath
packageJson.yuqueConfig.repo = repo.repo
FS.writeFileSync('./package.json', JSON.stringify(packageJson, null, 2));
console.log('\n[sync]===>', repo.name, '<===[sync]');
spawn.sync('yarn', ['sync'], { stdio: 'inherit' })
}
package.json
"scripts": {
"sync": "yuque-hexo sync",
"clean:yuque": "rimraf yuqueCache/*",
"clean:yuque:linux": "rm -rf yuqueCache/*",
"build": "node syncAllYuqueRepo.js && hexo clean && hexo g -d",
"server": "node syncAllYuqueRepo.js && hexo clean && hexo g && hexo s",
},
...
"yuqueConfig": {
"postPath": "source/_posts/xxx",
"cachePath": "yuqueCache/yuque_xxx.json",
"mdNameFormat": "title",
"adapter": "hexo",
"concurrency": 5,
"baseUrl": "https://www.yuque.com/api/v2",
"login": "你的login",
"repo": "你的repo",
"token": "你的token"
}
from yuque-hexo.
Related Issues (20)
- 上传七牛云图床部分图片上次失败,无法准确定位到具体问题 HOT 1
- 用七牛云上传图片,但是图片损坏了,不知道那里出问题了 HOT 7
- 可以自动上传到又拍云 图床么 HOT 2
- 语雀图片转换失败 HOT 3
- 教程描述有待提升 HOT 5
- 请求添加自动分组功能 HOT 2
- 建议同步语雀文档的修改时间 HOT 4
- github actions的lastGeneratePath.log问题 HOT 6
- 最近发现自动上传到图床的图片大小都不正确,无法正常显示怎么排查? HOT 4
- 发现隔一段时间(一到两周)就部署失败,重置了yuque_token后正常 HOT 3
- 关于 adpater (hexo) is invalid. 的问题 HOT 11
- 自定义 front-matter 异常
- 语雀分享要会员了,可以出一个飞书的吗
- 是否可以保留hexo写博客的能力? HOT 2
- 图片替换失败
- yuque-hexo相关逻辑 HOT 1
- [WARNING] 检查图片信息时出错
- 现在没有会员咋设置token HOT 2
- 增加下载文件到 source/images 目录的支持 HOT 4
- use slug as permant_link title HOT 1
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 yuque-hexo.