iissnan / hexo-theme-next

Elegant theme for Hexo.
http://notes.iissnan.com
MIT License
15.88k stars 3.62k forks source link

设置menu在新页面打开链接 #846

Closed pod4g closed 5 years ago

pod4g commented 8 years ago

我在menu上添加了一个新的菜单项,叫pod4g,当点击时,跳转到我的github地址。请问如何在新窗口中跳转到该地址?也就是说指定a标签为target="_blank"

next-menu-set

mrfeiii commented 8 years ago

同问

wghglory commented 7 years ago

+1

yzgqy commented 7 years ago

+1

ivan-nginx commented 7 years ago

@pod4g dont understand u, write in English if not solved. If solved, close it please.

wghglory commented 7 years ago

He wants to add a new item called "pod4g" in the navigation bar. And when clicking that item, the browser should open a new tab for it instead of loading the page directly. It's like using <a href="#" target="_blank">new item</a>

ivan-nginx commented 7 years ago

@wghglory alright, thanks for translate! This is already backloged for Next feature, but:

  1. For now may use extlink tag wich may open links in new winows, but it's work with BASE64 encrypt/decrypt format.
  2. Also may use external Hexo plugins like hexo-autonofollow.
yanickxia commented 6 years ago

@ivan-nginx is it solved? what's extlink , can you give us a explain?

ivan-nginx commented 6 years ago

@yannxia Added extlinks on sidebar author links in NexT v6.0.4 release in this pull.

Now i work under standart links in sidebar author links with target="_blank" & noopener attributes. Need to refactor some things.

yanickxia commented 6 years ago

@ivan-nginx it's cool, thanks for your help..

for example

menu:
  home: / || home
  about: /about/ || user
  #categories: /categories/ || th
  archives: /archives/ || archive
  wiki: http://wiki.yannxia.top/ || wikipedia-w

most of time, we want to open a new tab for http://wiki.yannxia.top/ , I hope this could help you

ivan-nginx commented 6 years ago

I understand what needed. Need more time to refactor some API.

baoang commented 6 years ago

In my case, if I set

wiki: https://wiki.yannxia.top | | wikipeida

The real link would be https://mydomain.tld/wiki.yannxia.top

It seems that setting another link with http or https prefix is not working.

stevenjoezhang commented 5 years ago

It has been fixed in https://github.com/theme-next/hexo-theme-next/pull/476 Try NexT v6.x : https://github.com/theme-next/hexo-theme-next