| 1 |
--- |
| 2 |
title: RelPermalink |
| 3 |
description: Returns the relative permalink of the given resource, publishing it in the process. |
| 4 |
categories: [] |
| 5 |
keywords: [] |
| 6 |
params: |
| 7 |
functions_and_methods: |
| 8 |
returnType: string |
| 9 |
signatures: [RESOURCE.RelPermalink] |
| 10 |
--- |
| 11 |
|
| 12 |
{{% include "/_common/methods/resource/global-page-remote-resources.md" %}} |
| 13 |
|
| 14 |
The `Permalink` method on a `Resource` object writes the resource to the publish directory, typically `public`, and returns its [relative permalink](g). |
| 15 |
|
| 16 |
```go-html-template |
| 17 |
{{ with resources.Get "images/a.jpg" }} |
| 18 |
{{ .RelPermalink }} → /images/a.jpg |
| 19 |
{{ end }} |
| 20 |
``` |