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

Docs next #858

Merged
merged 52 commits into from
Jan 20, 2020
Merged
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
b678c82
Update installation.md
photong Nov 21, 2019
9603032
Update cli-usage.md
photong Nov 21, 2019
86200f2
Update installation.md
photong Nov 21, 2019
9750098
Update directory-structure.md
photong Nov 21, 2019
44ce379
Update configuration.md
photong Nov 21, 2019
1251dee
Update overview.md
photong Nov 21, 2019
751bea3
Update section.md
photong Nov 21, 2019
6327c75
Update page.md
photong Nov 21, 2019
3c379d3
Update section.md
photong Nov 22, 2019
d20eb8c
Update configuration.md
photong Nov 22, 2019
19c511c
Update page.md
photong Nov 22, 2019
9cef2ca
Update section.md
photong Nov 22, 2019
80fa637
Update page.md
photong Nov 22, 2019
b9ba051
Update shortcodes.md
photong Nov 22, 2019
91a1f31
Update linking.md
photong Nov 22, 2019
e5087bd
Update table-of-contents.md
photong Nov 22, 2019
8af696d
Update syntax-highlighting.md
photong Nov 22, 2019
e4bb3a8
Update taxonomies.md
photong Nov 22, 2019
785deb7
Update search.md
photong Nov 22, 2019
d63008d
Update sass.md
photong Nov 22, 2019
614099d
Update index.md
photong Nov 22, 2019
f568f92
Update multilingual.md
photong Nov 22, 2019
02f6633
Update overview.md
photong Nov 22, 2019
eaf7771
Update pages-sections.md
photong Nov 22, 2019
4a0e67a
Update pagination.md
photong Nov 22, 2019
b1739fb
Update taxonomies.md
photong Nov 22, 2019
70a48e7
Update rss.md
photong Nov 22, 2019
30ea9e8
Update sitemap.md
photong Nov 22, 2019
d3ac9a2
Update robots.md
photong Nov 22, 2019
a1ec03d
Update 404.md
photong Nov 22, 2019
a7036c0
Update archive.md
photong Nov 22, 2019
623df7d
Update overview.md
photong Nov 22, 2019
73146d0
Update installing-and-using-themes.md
photong Nov 22, 2019
6e3e8e3
Update creating-a-theme.md
photong Nov 22, 2019
60ab8f7
Update netlify.md
photong Nov 22, 2019
dcd16e6
Update github-pages.md
photong Nov 22, 2019
eca7a04
Update gitlab-pages.md
photong Nov 22, 2019
e0dd168
Updates.
photong Nov 27, 2019
7dfab02
Merge branch 'next' into docs-next
photong Nov 27, 2019
7bb482b
Skip link checking for URL with prefix in config (#846)
TjeuKayim Nov 25, 2019
7850603
Fix some doc changes
Keats Nov 26, 2019
0c2147f
Section extra -> SitemapEntry (#850)
stanistan Nov 26, 2019
358c1c8
Update deps
Keats Nov 26, 2019
a7b2591
Remove tutorial link.
photong Nov 27, 2019
9f27c60
Update overview.md
photong Nov 27, 2019
7aebe9a
Update page.md
photong Nov 27, 2019
264cd71
Update section.md
photong Nov 27, 2019
070c206
Update netlify.md
photong Nov 27, 2019
c59312d
Update overview.md
photong Nov 27, 2019
417ed4a
Change some wording.
photong Nov 28, 2019
34e24fd
Merge branch 'docs-next' of https://github.com/photong/zola into docs…
photong Nov 28, 2019
35bdcfb
Update overview.md
photong Nov 28, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update linking.md
photong authored Nov 22, 2019
commit 91a1f31e9a1f6e239d40edc9d428554e5a164b31
23 changes: 13 additions & 10 deletions docs/content/documentation/content/linking.md
Original file line number Diff line number Diff line change
@@ -4,9 +4,9 @@ weight = 50
+++

## Heading id and anchor insertion
While rendering the markdown content, a unique id will automatically be assigned to each heading. This id is created
by converting the heading text to a [slug](https://en.wikipedia.org/wiki/Semantic_URL#Slug), appending numbers at the end
if the slug already exists for that article. For example:
While rendering the Markdown content, a unique id will automatically be assigned to each heading. This id is created
by converting the heading text to a [slug](https://en.wikipedia.org/wiki/Semantic_URL#Slug), and appending numbers at
the end if the slug already exists for that article. For example:

```md
# Something exciting! <- something-exciting
@@ -22,23 +22,26 @@ You can also manually specify an id with a `{#…}` suffix on the heading line:
# Something manual! {#manual}
```

This is useful for making deep links robust, either proactively (so that you can later change the text of a heading without breaking links to it) or retroactively (keeping the slug of the old header text, when changing the text). It can also be useful for migration of existing sites with different header id schemes, so that you can keep deep links working.
This is useful for making deep links robust, either proactively (so that you can later change the text of a heading
without breaking links to it) or retroactively (keeping the slug of the old header text when changing the text). It
can also be useful for migration of existing sites with different header id schemes, so that you can keep deep
links working.

## Anchor insertion
It is possible to have Zola automatically insert anchor links next to the heading, as you can see on the site you are currently
reading if you hover a title.
It is possible to have Zola automatically insert anchor links next to the heading, as you can see on this site
if you hover a title.

This option is set at the section level: the `insert_anchor_links` variable on the
[Section front-matter page](@/documentation/content/section.md#front-matter).
[section front matter page](@/documentation/content/section.md#front-matter).

The default template is very basic and will need CSS tweaks in your project to look decent.
If you want to change the anchor template, it can easily be overwritten by
creating a `anchor-link.html` file in the `templates` directory which gets an `id` variable.
If you want to change the anchor template, it can be easily overwritten by
creating an `anchor-link.html` file in the `templates` directory, which gets an `id` variable.

## Internal links
Linking to other pages and their headings is so common that Zola adds a
special syntax to Markdown links to handle them: start the link with `@/` and point to the `.md` file you want
to link to. The path to the file starts from the `content` directory.

For example, linking to a file located at `content/pages/about.md` would be `[my link](@/pages/about.md)`.
You can still link to an anchor directly: `[my link](@/pages/about.md#example)` will work as expected.
You can still link to an anchor directly; `[my link](@/pages/about.md#example)` will work as expected.