diff options
Diffstat (limited to 'content/en/methods/resource/RelPermalink.md')
-rw-r--r-- | content/en/methods/resource/RelPermalink.md | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/content/en/methods/resource/RelPermalink.md b/content/en/methods/resource/RelPermalink.md new file mode 100644 index 000000000..2b96c35d7 --- /dev/null +++ b/content/en/methods/resource/RelPermalink.md @@ -0,0 +1,25 @@ +--- +title: RelPermalink +description: Publishes the given resource and returns its relative permalink. +categories: [] +keywords: [] +action: + related: + - methods/resource/Permalink + - methods/resource/Publish + - methods/resource/Key + returnType: string + signatures: [RESOURCE.RelPermalink] +--- + +The `Permalink` method on a `Resource` object writes the resource to the publish directory, typically `public`, and returns its [relative permalink]. + +[relative permalink]: /getting-started/glossary/#relative-permalink + +```go-html-template +{{ with resources.Get "images/a.jpg" }} + {{ .RelPermalink }} → /images/a.jpg +{{ end }} +``` + +{{% include "methods/resource/_common/global-page-remote-resources.md" %}} |