Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

如何在右上角加个链接 #74

Answered by spencerwooo
tkfanswind asked this question in Q&A
Discussion options

You must be logged in to vote

之前想简单了,这部分功能后面准备从 config 文件里面抽离出去了,主要还是因为图标是按需引入的,没办法用一个 config 参数直接定义,至少现在看起来直接定义在 config 中的实现比较麻烦。因此,如果要添加自定义图标需要:

  • 引入图标:在 pages/_app.tsx 中引入(import)相应的图标并加入 library.add() 的参数中,并…

  • 加入导航栏:在 components/Navbar.tsx第 71 行 加入相应的 TSX 定义,比如:

    <a
      href="https://..."
      target="_blank"
      rel="noopener noreferrer"
      className="p-2 rounded hover:bg-gray-200 dark:text-white dark:hover:bg-gray-700"
    >
      <FontAwesomeIcon icon={['far', 'envelope']} size="lg" />
    </a>

当然,除了图标,加上文字之类的内容也是可以的。

Replies: 5 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@tkfanswind
Comment options

@tkfanswind
Comment options

@opoet
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by spencerwooo
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants