Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

建议:保存各个平台的标签和分类 #838

Closed
Achuan-2 opened this issue Oct 25, 2023 · 2 comments
Closed

建议:保存各个平台的标签和分类 #838

Achuan-2 opened this issue Oct 25, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@Achuan-2
Copy link

Achuan-2 commented Oct 25, 2023

以hexo为例,可以保存历史博客的标签和分类,当新的博客发表需要填写时,可以展示历史的标签和分类,一是方便,二是避免创建各种各样的标签和分类别名,比如之前已经创建了机器学习基础标签,后来又新建了机器学习入门等标签

@terwer
Copy link
Owner

terwer commented Oct 27, 2023

当前文档的元数据信息其实是有保存的,在自定义属性里。
某个平台所有文章的历史的标签和分类汇总目前倒是没保存。直接读取汇总可能性能较差。可以持久化到json里面,用[平台key]查询可能较好。具体实现我在想一想,看看怎么避免以后的扩展问题,最后找一个好点的方案。

暂定方案

  1. 使用 json 存储,文件名为 platform-metadata.json
  2. key 未平台 key,value 为汇总的元数据信息

例如

{
    "platform-metadata": "{\"metadata\":{\"gitlab_Gitlabvuepress\":{\"tags\":[\"siyuan-plugin-publisher\",\"文本处理\",\"标签生成\",\"中文标签\"],\"categories\":[\"临时博客\",\"siyuan-plugin-publisher\",\"开发工具\",\"编程开发\"],\"templates\":[]}}}"
}

整理一下,就是下面的数据

{
    "metadata": {
        "gitlab_Gitlabvuepress": {
            "tags": [
                "siyuan-plugin-publisher",
                "文本处理",
                "标签生成",
                "中文标签"
            ],
            "categories": [
                "临时博客",
                "siyuan-plugin-publisher",
                "开发工具",
                "编程开发"
            ],
            "templates": []
        }
    }
}

@terwer terwer added the enhancement New feature or request label Oct 27, 2023
@terwer terwer closed this as completed Oct 31, 2023
terwer added a commit that referenced this issue Oct 31, 2023
fix: #838 保存各个平台的标签和分类
@Achuan-2
Copy link
Author

Achuan-2 commented Nov 1, 2023

发现一个问题,使用hexo上传的时候,会自动加上该笔记的路径为分类,我实际上就打了”技术博客“标签
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants