From 1c3e1a88ec961807824535e2146816c2d5b4558d Mon Sep 17 00:00:00 2001 From: Wedge Jarrad Date: Wed, 5 Jun 2024 18:21:53 -0700 Subject: [PATCH 1/3] Add examples for creating download links Fixes #17734 Relates #13940 #6069 Signed-off-by: Wedge Jarrad --- docs/features/techdocs/how-to-guides.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/features/techdocs/how-to-guides.md b/docs/features/techdocs/how-to-guides.md index e47af8d1d7..d58b05b4da 100644 --- a/docs/features/techdocs/how-to-guides.md +++ b/docs/features/techdocs/how-to-guides.md @@ -874,3 +874,23 @@ metadata: TechDocs supports using the [mkdocs-redirects](https://github.com/mkdocs/mkdocs-redirects/tree/master) plugin to create a redirect map for any TechDocs site. This allows broken links from renamed or moved pages in your site to be redirected to their specified replacement. TechDocs will notify the user that the page they are trying to access is no longer maintained. Then, they will be redirected. External site redirects are not supported. If an external redirect is provided, the user will instead be redirected to the index page of the documentation site. + +## Create download links for static assets + +You may want to make files available for download by your users such as PDF +documents, images, or code templates. Download links for files included in your +docs directory can be made by adding `{: download }` after a markdown link. + +``` +[Link text](./img/foo.jpg){: download } +``` + +The user's browser will download the file as `download.jpg` when the link is +clicked. + +Specify a file name to control the name the file will be given when it is +downloaded: + +``` +[Link text](./img/foo.jpg){: download="foo.jpg" } +``` From ef7aee789197c659f33389cd551771cbebf4a2db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 27 Sep 2024 14:24:41 +0200 Subject: [PATCH 2/3] Update docs/features/techdocs/how-to-guides.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- docs/features/techdocs/how-to-guides.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/techdocs/how-to-guides.md b/docs/features/techdocs/how-to-guides.md index d58b05b4da..cc0dac23e9 100644 --- a/docs/features/techdocs/how-to-guides.md +++ b/docs/features/techdocs/how-to-guides.md @@ -882,7 +882,7 @@ documents, images, or code templates. Download links for files included in your docs directory can be made by adding `{: download }` after a markdown link. ``` -[Link text](./img/foo.jpg){: download } +[Link text](https://example.com/foo.jpg){: download } ``` The user's browser will download the file as `download.jpg` when the link is From d5240d303a076cdc9cbfd2b8d10542d6eb1f1805 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 27 Sep 2024 14:24:47 +0200 Subject: [PATCH 3/3] Update docs/features/techdocs/how-to-guides.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- docs/features/techdocs/how-to-guides.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/techdocs/how-to-guides.md b/docs/features/techdocs/how-to-guides.md index cc0dac23e9..9c5109cd9c 100644 --- a/docs/features/techdocs/how-to-guides.md +++ b/docs/features/techdocs/how-to-guides.md @@ -892,5 +892,5 @@ Specify a file name to control the name the file will be given when it is downloaded: ``` -[Link text](./img/foo.jpg){: download="foo.jpg" } +[Link text](https://example.com/foo.jpg){: download="foo.jpg" } ```