Skip to content

公开页面元数据 #23

@northword

Description

@northword

ref:

把页面的元数据暴露给 Zotero Connector,并在路由切换时强制 Zotero Connector 重新读取元数据。以方便用户将网站存到 Zotero (恢复 RSS 新开 issue 进行标记)。


Embedded Metadata 转换器:https://github.com/zotero/translators/blob/master/Embedded%20Metadata.js

可以嵌入页面的元数据有:

type?

我们也许可以对 wiki 设置 book 或 document,对 plugins/translators/styles 等页面保持 webpage。

但是没有直接的字段表明 type。og 协议倒是有 <meta name="type" content="website"> ,然而 z 似乎并没有读取,转换器仅从有无 isbn 判断是否为 book:

转换器获取 itemType 的逻辑:https://github.com/zotero/translators/blob/d0e7827d061329d9830675ef9effafe590f0b06d/Embedded%20Metadata.js#L306-L342

@jiaojiaodubai 关于条目类别这个,有什么建议吗?

官方文档其实也没有适配这些,识别出来的还是 webpage。

标题

填入 citation_title,用当前页面一级标题。

日期

citation_date 用页面创建时间

链接

<link rel=“canonical”> 保持最大兼容,而不是 citation_public_url

作者/贡献者

citation_author 直接填成社区?还是每个贡献者写一个(好像不大好实现,只能页面加载后进行dom操作好像,可以调研一下 vite 插件数据怎么共享出来)?

??

以及其他字段?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions