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

添加内部链接支持 #198

Open
andyhsia020 opened this issue May 18, 2022 · 2 comments
Open

添加内部链接支持 #198

andyhsia020 opened this issue May 18, 2022 · 2 comments
Labels
feature New feature or request
Milestone

Comments

@andyhsia020
Copy link

菜单/多级菜单下,如果使用内部链接的格式‘/page/xxx’,点击以后只是url栏变了地址,但是没有跳转到相关页面。
外部链接的方式没有这个问题,也就是'https://domain.com/page/xxx'。如果可以改进就最好了。

@chengyongru
Copy link

额,我研究了一下
tlink.js

hexo.extend.filter.register("after_post_render", (data) => {
  const re = /_posts\/(.*).md/g;

  data.content = data.content.replace(re, function (str1, str2) {
      str2 = str2.replace(/\//g, "%2F")
      return str2
  })
  return data
});

放在根目录下的scripts文件夹就好了

@auroral-bot
Copy link

auroral-bot bot commented Sep 4, 2023

This issue is stale because it has been open for 30 days with no activity.

@auroral-bot auroral-bot bot added the stale label Sep 4, 2023
@bennyxguo bennyxguo added feature New feature or request and removed stale labels Sep 12, 2023
@bennyxguo bennyxguo changed the title 内部链接无法自动跳转 添加内部链接支持 Sep 12, 2023
@bennyxguo bennyxguo added this to the v2.6.0 milestone Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants