npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hexo-obsidian-block-ref-cover

v0.1.3

Published

A Hexo plugin to convert Obsidian block references into permalinks for Hexo blogs

Downloads

23

Readme

hexo-obsidian-block-ref-cover

A Hexo plugin to convert Obsidian block references into permalinks for Hexo blogs.

基于 Hexo 的 permalinks, 将 Obsidian 的块引用语法转为 Hexo 链接.

This module allows you to easily use the block reference syntax of Obsidian to render Hexo.

这个模块可以让你轻松使用 hexo 渲染 Obsidian 的块引用语法.

  • [[file]] [[file|text]]
  • [[file#title]] [[file#title|text]]
  • [[file#^id]] [[file#^id|text]]
  • [[#title]] [[#title|text]]
  • [[#^id]] [[#^id|text]]

Installation

npm install hexo-obsidian-block-ref-cover --save

Usage

You need config permalinks in _config.yml.

需在 _config.yml 中配置 permalinks.

# in _config.yml
permalink: p/:year/:month/:day/:hour/:minute/:second/

# or with hexo-abbrlink
permalink: :author/:abbrlink/    
permalink_defaults:
  author: jasper
abbrlink:
  alg: crc32  # crc16(default) and crc32
  rep: hex    # dec(default) and hex
pretty_urls:
  trailing_index: true 
  trailing_html: true 

More Details

Obsidian block reference syntax can be divided into the following types:

Obsidian 块引用语法可以分为下面几种:

  • [[file]] [[file|text]]
  • [[file#title]] [[file#title|text]]
  • [[file#^id]] [[file#^id|text]]
  • [[#title]] [[#title|text]]
  • [[#^id]] [[#^id|text]]

When converting to Hexo links, file will be replaced by permalinks; and title will be replaced by #title in the url.

在转换为 Hexo 链接时, file 会被替换为 permalinks; 而 title 在 url 中会替换为 #title.

The most troublesome thing is the processing of ^id. Here, the entire ^id is replaced with a span tag at the original text, so that #^id can be treated as a normal title.

比较麻烦的是 ^id 的处理, 这里在原文处将 ^id 整个替换为了 span 标签,这样就能将 #^id 当作普通 title 处理了.

There is also a special case where the reference is to this article, which leads to no file field, and the file name of this file is obtained through post.source, and other processing is the same.

还有一种特殊情况是引用本文,导致没有 file 字段,通过 post.source 取到本文件的文件名, 其他处理流程相同.

Thanks

This module is forked from hexo-filter-titlebased-link, thanks to the original author.

本模块 fork 自 hexo-filter-titlebased-link,感谢原作者.

Related Hexo Plugins

License

MIT