在 Obsidian 中创建和使用链接
Obsidian 链接
![](/data/attachment/album/202401/27/095314xdbbtbjek22bbm8r.jpg)



> 
> Obsidian 知识库工具的真正威力在于链接。学习使用它。
> 
> 
> 


Obsidian 的最大卖点之一是其强大的文档链接和可视化。Obsidian 提供了多种链接文档和图像的方法。我们将逐一介绍。


你将在 Obsidian 中看到三种内部链接方法：


* 拖放方式（简单但有限）
* 使用 Markdown 链接
* 使用维基链接（广泛且强大）


我还将分享一些有关使用图表和反向链接的技巧。让我们来看看它。



> 
> ✋ **非自由和开源软件警告！** Obsidian 不是开源软件，我们知道这一事实。然而，它是一种在编码人员（包括开源开发人员）中非常流行的工具。这就是我们介绍它的原因。
> 
> 
> 


### 方法 1：通过拖放链接


是的，这是最简单的链接。转到要在其中创建链接的文档。现在，在左侧边栏上，展开该特定文件夹，其中包含目标注释。


要创建链接，只需将此目标文件拖放到你希望链接显示的位置即可。


![通过拖放添加链接](/data/attachment/album/202401/27/095339jggrbpgpo15w61si.gif)


你可以稍后更改链接文本。


### 方法 2：使用 Markdown 链接


由于 Obsidian 使用 Markdown 作为其核心，因此可以通过输入传统的 Markdown 命令进行链接。


比方说，你必须在 “Markdown Advanced” 页面中创建一个指向 “Markdown Checklist” 页面的链接。首先，你需要记下要链接到的文件的位置。


然后，只需添加这一行：



```
[链接文本]（文件的相对路径）

```

或者，如果你有要链接的文件，并且想要提供系统中的绝对路径，请使用：



```
[链接文本](file://绝对路径)

```

![使用绝对路径链接](/data/attachment/album/202401/27/095339hsiyseu2wxsywuxo.png)



> 
> ? 如果你 [使用 Markdown 链接](https://itsfoss.com/markdown-links/)，请确保文件和文件夹的名称中没有空格，因为这在某些情况下可能会引起一些麻烦。
> 
> 
> 


### 方法 3：使用紧凑型维基链接来链接页面


Obsidian 支持使用 <ruby> <a href="https://en.wikipedia.org/wiki/Help:Link">  维基链接 </a> <rt>  Wikilink </rt></ruby> 来链接页面的直观方式。它们是紧凑的链接并且是交互式链接。默认情况下，此功能处于打开状态。


如果你想知道，是的，它与维基百科有关。他们用它来内部链接他们的维基页面。


#### 添加内部注释的链接


要创建链接，只需输入 `[[`。这将启动一个交互式对话框，你可以在其中搜索要链接的文档。


![添加交互式维基链接](/data/attachment/album/202401/27/095339n1er1q0tgecc1zie.gif)



> 
> ? 你可以使用 [[link|要显示的文本]]使自定义文本显示在维基链接上。例如 [[notes/hello.md|这是 Hello 文件的链接]]
> 
> 
> 


#### 添加图像文件


此外，你可以使用此链接方法添加其他文件，例如图像，但在使用 `[[` 搜索之前需要添加 `!` 符号。请看下图以了解其实际效果。


![使用维基链接添加图像](/data/attachment/album/202401/27/095340v88jn11h8te3ybh7.gif)


#### 添加内部标题链接


有一种方法可以在同一页面的各个标题之间创建内部链接。为此，首先输入 `[[`，然后使用 Markdown 标题语法和要链接的特定标题的名称。


例如，如果你打算链接到文档中的第六个标题（2 级标题），请使用：



```
[[##Paragraph Six

```

这将显示在交互式选择中。


![链接到标题](/data/attachment/album/202401/27/095340hqzlb4h9xavnb2kb.gif)



> 
> ? 你可以将鼠标悬停在链接上时按 CTRL 键来进行预览。
> 
> 
> 


#### 添加指向文本块的链接


Obsidian 允许你创建指向文档中特定文本块的链接。为此，首先，转到要添加链接的块的最末尾。


现在，使用 `^` 符号向该块添加唯一标识符。


![向块添加唯一标识符](/data/attachment/album/202401/27/095340do0kkfwd0of7ggdi.png)


现在，你可以通过输入 `[[^` 来添加到此部分的链接。这将自动提示你可用的块。选择一项并按回车键。


![添加链接到块](/data/attachment/album/202401/27/095340vwjgg19hsg3rgjjj.gif)


#### 维基链接的问题


有时，如果你想要纯 Markdown 文档，并且专注于多个 Markdown 编辑器之间的互操作性，那么维基链接功能可能会产生问题。


由于这些在 Obsidian 内部工作，因此链接在其他编辑器上显示为损坏。在这种情况下，你可以关闭维基链接。一切都完美无缺，只是链接现在将以 Markdown 格式显示。


为此，首先选择左下角的设置按钮。


![点击设置](/data/attachment/album/202401/27/095341boljfvlmvvlflsjo.png)


现在，从 “<ruby> 文件和链接 <rt>  Files and Links </rt></ruby>” 选项卡关闭维基链接功能。


![关闭维基链接功能](/data/attachment/album/202401/27/095341yimdrmrnstirtar5.png)


#### 组织附件文件的提示


对于那些在 Obsidian 中附加许多文件的人，建议在每本书下为这些附件创建一个单独的文件夹。


现在，打开 “<ruby> 设置 <rt>  Settings </rt></ruby> > <ruby> 文件和链接 <rt>  Files and Links </rt></ruby>”。在这里，首先，你需要确保链接路径是相对于文件位置的。然后，将新附件的默认位置设置为 “<ruby> 当前文件夹下的子文件夹 <rt>  Subfolder under current folder </rt></ruby>”。现在，在下一个字段中指定 “<ruby> 附件 <rt>  Attachments </rt></ruby>”，即 “<ruby> 子文件夹名称 <rt>  Subfolder name </rt></ruby>”。


![设置附件文件夹位置](/data/attachment/album/202401/27/095341ifn3ibpjqpcqofmx.png)


就是这样。从现在开始，当你通过复制和粘贴放置任何附件时，它们将自动放置在该笔记文件夹内的“附件”文件夹中。新链接将在任何 Markdown 编辑器之间完美地互操作，因为路径现在是相对于文件位置的。



> 
> ? 即使此维基链接功能已关闭，你仍然可以使用 [[ 键以交互方式搜索和添加链接。变化是，现在链接不再是紧凑的，而是长 Markdown 链接。
> 
> 
> 


此外，你还可以打开 “<ruby> 自动更新内部链接 <rt>  Automatically Update Internal Links </rt></ruby>” 按钮，以确保在重命名文件时自动更新链接。


### 使用图表和反向链接


创建完链接后，就可以通过链接查看笔记之间的其他笔记之间的关系。单击侧面的图表视图按钮即可进入图表预览。


![Obsidian 中的图表视图](/data/attachment/album/202401/27/095342z3kalwsllwj1k4c9.png)


正如你所看到的，你将在一个整洁的图表上获得该注释的链接。如果你按空白选项卡上的图表视图，你将获得所有笔记及其关系。


![Notes Vault 示例的一些链接示例](/data/attachment/album/202401/27/095342ahphb5m5eed6poeh.png)


此外，每个笔记都有一 “传出链接” 和 “传入链接” 选项卡，你可以在其中跟踪相关链接。


![传出和传入链接](/data/attachment/album/202401/27/095343oqgwh4h84wym11zy.png)


### 总结


正如你所看到的，虽然在 Obsidian 中创建指向其他页面的内部链接很简单，但通过维基链接，你可以创建更加个性化和定制的知识库。


对于那些不喜欢 Obsidian 闭源性质的人来说，[Logseq](https://itsfoss.com/logseq/) 是一个不错的选择。


*（题图：DA/57173f4d-5548-471f-8d70-a48e3b5e964a）*




---


via: <https://itsfoss.com/obsidian-create-links/>


作者：[Sreenath](https://itsfoss.com/author/sreenath/) 选题：[lujun9972](https://github.com/lujun9972) 译者：[geekpi](https://github.com/geekpi) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
![Warp Terminal](/assets/images/warp-terminal.webp)


![Warp Terminal](/assets/images/warp-terminal.webp)

One of the best-selling points of Obsidian is its strong document interlinking and visualization. Obsidian provides several ways of linking documents and images. We will be taking a look at each of them.

You'll see three methods of internal linking in Obsidian:

- Drag and drop method (simple but limited)
- Using Markdown linking
- Using Wikilinks (extensive and powerful)

I'll also share some tips on using the graphs and backlinks. Let's see it.

**Obsidian is not open source software and we are aware of that fact. However, it is an immensely popular tool among coders, including open source developers. That's the reason we have covered it.**

**Non-FOSS Warning!**## Method 1: Link by drag and drop

Yes, this is the simplest linking. Go to the document where you want to create the link. Now, on the left sidebar, expand that particular folder, where you have the target note.

To create a link, just drag and drop this target file to the location you want the link to appear.

![Add the link to a note by dragginf and dropping that file to the destination file.](https://itsfoss.com/content/images/2023/12/link-by-drag-and-drop.gif)

You can change the link text later.

## Method 2: Link Using Markdown

Since Obsidian uses Markdown at its core, linking is possible, typing the traditional Markdown commands.

Let's say, you have to create a link to the “Markdown Checklist” page in “Markdown Advanced” page. First, you need to note the location of the file you want to link to.

Then, just add this line:

`[Link Text](relative path to the file)`


Or, if you have a file to link, and want to provide the absolute path in the system, use:

`[Link text](file://absolute path)`


![Link to a file in the local system, usig the absolute path](https://itsfoss.com/content/images/2023/12/linking-using-absolute-path.png)

[using Markdown linking](https://itsfoss.com/markdown-links/), make sure that the files and folders do not have space in their names, as this can cause some headache in some cases.

## Method 3: Link Pages using Compact Wikilinks

Obsidian supports an intuitive way of linking pages using [Wikilinks](https://en.wikipedia.org/wiki/Help:Link). They are compact links and are interactive to link. By default, this feature is on.

And if you are wondering, yes, it relates to Wikipedia. They use it for internal linking their wiki pages.

### Add link to an internal note

To create a link, just type `[[`

. This will start an interactive dialog, where you can search for the document that you want to link.

![Add links to pages interactively in Obsidian](https://itsfoss.com/content/images/2023/12/add-interactive-wikilinks.gif)

`[[link|Text to appear]]`

to make a custom text appear on a Wikilink. e.g. `[[notes/hello.md|This is a Link to the file Hello]]`

### Add an image file

Also, you can add other files like images using this linking method, but you need to add a `!`

symbol before searching using `[[`

. Look at the image below to see it in action.

![Add images attachments in Obsidian using Wikilinks](https://itsfoss.com/content/images/2023/12/add-image-using-wikilinks.gif)

### Add link to an internal heading

There is a method to create internal link between various headings of the same page. To do so, first type `[[`

and then, use the Markdown heading syntax and name of that particular heading that you want to link.

For example, if you intend to link to the Sixth heading, on your document, which is a level 2 heading, use:

```
[[##Paragraph Six
```


This will show that in the interactive to choose from.

![Link to a particular Heading](https://itsfoss.com/content/images/2023/12/Link-to-heading-1.gif)

### Add link to a block of text

Obsidian allows you to create links to particular blocks of text in a document. For this, first, go to the very end of the block that you want to add a link.

Now, add a unique identifier to this block, by using the `^`

symbol.

![Add a unique identifier to the end of the block that you want to link to](https://itsfoss.com/content/images/2023/12/Add-unique-identifier-to-a-block.png)

Now, you can add a link to this part by typing `[[^`

. This will automatically prompt you about the available blocks. Select one and press enter.

![Add link to a particular block of text.](https://itsfoss.com/content/images/2023/12/your-block-link.gif)

### Issues with Wikilinks

Sometimes, if you want pure Markdown documents, and are focussing on interoperability between multiple markdown editors, the Wikilinks feature may create issues.

Since these work inside Obsidian, the links appear broken on other editors. In such cases, you can turn off the Wikilinks. Everything works flawlessly, except that the links will now appear in Markdown format.

To do this, first select the settings button on the bottom left.

![Click on the settings button on the bottom left of Obsidian main window](https://itsfoss.com/content/images/2023/12/click-on-settings-button-in-obsidian.png)

Now, turn off the Wikilinks feature from the “Files and Links” tab.

![From the Files and Links tab in Obsidian Settings, turn off the Wikilinks feature using the toggle button.](https://itsfoss.com/content/images/2023/12/turn-off-the-wikilink-feature.png)

### Tip for organizing attachment Files

For those, who are attaching many files to the Obsidian notes, it is advised to create a separate folder for those attachments under each book.

Now, open the **Settings > Files and Links**. Here, first, you need to make sure the link path is relative to the file location. Then, set the default location for new attachments to "Subfolder under current folder". Now, specify the “Attachments” in the next field, that is "Subfolder name".

![Set the location of attachments subfolder as "attachments"](https://itsfoss.com/content/images/2023/12/set-attachment-folder-location-and-other-settings-1.png)

That's, it. From now on, when you place any attachments by copy and paste, they will be automatically placed in the “attachments” folder inside that notebook folder. And the new link will be perfectly interoperable between any Markdown editors, since the path is now relative to the file location.

`[[`

keys. The change will be that, now, the link will not be compact, but the long Markdown Link.Also, you can turn on the "Automatically Update Internal Links" button to make sure that, while renaming a file, the link is automatically updated.

## Using the Graph and Backlinks

Once you are done creating links, it's time to see the notes' relation between other notes via links. Click on the graph view button on the side to go to the graph preview.

![Graph view in Obsidian for the current note](https://itsfoss.com/content/images/2023/12/graph-view-in-obsidian.png)

As you can see, you will get the links to and from that note on a neat graph. If you press on the graph view on an empty tab, you will get all your notes and their relations.

![Some Links example of a sample Notes Vault](https://itsfoss.com/content/images/2023/12/part-of-a-graph-view.png)

Also, for each note, there is an outgoing link and an incoming link mentions tab, where you can follow the links associated.

![Outgoing and incoming links in Obsidian](https://itsfoss.com/content/images/2023/12/Links-out-and-in.png)

## Conclusion

As you can see, while it is simple to create internal links to other pages in Obsidian, with Wikilinks, you can create a more [personalized and customized knowledge base](https://itsfoss.com/open-source-second-brain-apps/).

[13 Useful Tips on Organizing Notes Better With ObsidianUtilize Obsidian knowledge tool more effectively with these helpful tips and tweaks.](https://itsfoss.com/obsidian-tips/)![](https://itsfoss.com/content/images/2024/02/tips-organizing-notes-obsidian.png)


![](https://itsfoss.com/content/images/2024/02/tips-organizing-notes-obsidian.png)

For those who do not like the closed source nature of Obsidian, [Logseq](https://itsfoss.com/logseq/) is a good alternative.

[Logseq: An Open Source Obsidian Alternative for Second BrainLogseq is a versatile knowledge platform with the support for Markdown and Org-mode. You can create tasks, manage notes, and do a lot more things with them.](https://itsfoss.com/logseq/)![](https://itsfoss.com/content/images/wordpress/2022/01/logseq.png)


![](https://itsfoss.com/content/images/wordpress/2022/01/logseq.png)