AnVIL Portal
  • Creating Content
  • Editing an Existing Page
  • Creating a New Page
  • Using Images
  • Adding YouTube Videos
  • Creating Links
  • Creating Events
  • Creating News Items
  • Adding a New Publication

Creating Links in Markdown

Markdown syntax for a hyperlink is square brackets followed by parentheses. The square brackets hold the text, the parentheses hold the link.

[Link text Here](https://link-url-here.org)

For internal links (links to other AnVIL portal pages) we need to follow a few rules:

  1. Use the "relative path" to the page omitting the protocol and domain name. For example use /guides/content/creating-links instead of https://anvilproject.org/guides/content/creating-links.
  2. For the link address use the path of the page in the site regardless of the location of the file in the repository.
  3. Do not use the .md suffix.
  4. Don't forget to start the path with a forward slash: /.

Putting this all together an internal link looks like:

[An Internal Link](/guides/content/editing-an-existing-page)

This renders as: An Internal Link

Linking to an Internal Page Heading

It is possible to link directly to any outline heading on an internal page as the page headings each have an anchor.

You can find out the link to a page heading by clicking on link icon that appears when you hover over a heading. After you click on the link symbol, the url to that heading will be in your browsers address bar. Copy the link and strip off the method and domain to make a relative url.

Link Icon
Figure 1: Hovering over a page heading to reveal the 'copy to clipboard' link for the internal anchor.

Then use the path to create a link like so:

[An Internal Link to a Section Heading](/guides/content/editing-an-existing-page#modifying-front-matter)

This renders like:

An Internal Link to a Section Heading

The markdown for external links is the same for internal links except we use the full url.

[This is an external link to genome.gov](https://www.genome.gov/)

This displays as:

This is an external link to genome.gov


Help us make these docs great!
All AnVIL docs are open source. See something that’s wrong or unclear? Submit a pull request.
Make a contribution