From 127b4b0707344168f5cd6d433408811c90b58d94 Mon Sep 17 00:00:00 2001 From: Alex Kingman Date: Thu, 10 Feb 2022 16:53:45 -0500 Subject: [PATCH 1/5] Removed tilde from asset paths --- .../advanced/include-static-assets/index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/learn/get-started/advanced/include-static-assets/index.html b/src/app/learn/get-started/advanced/include-static-assets/index.html index 6b927e63e..ef2fe8a0c 100644 --- a/src/app/learn/get-started/advanced/include-static-assets/index.html +++ b/src/app/learn/get-started/advanced/include-static-assets/index.html @@ -20,17 +20,17 @@
  • - On the file where you want to include the static asset, reference the static asset with ~/assets/ before the filename and path. + On the file where you want to include the static asset, reference the static asset with assets/ before the filename and path.

    - References to static assets must start with ~/assets/ for the SkyAppAssetsService to retrieve the assets from the src/assets folder because the filenames are updated at build time to include hashes that represent the content of the files. + References to static assets must start with assets/ for the SkyAppAssetsService to retrieve the assets from the src/assets folder because the filenames are updated at build time to include hashes that represent the content of the files.

    For example, you can display an image on a page.

    - Photo + Photo

    @@ -38,7 +38,7 @@

    @@ -71,7 +71,7 @@
  • - In the getUrl method, specify the path and file name for the static asset. Do not include the ~/assets prefix, and note that param is case-sensitive. + In the getUrl method, specify the path and file name for the static asset. Do not include the assets/ prefix, and note that param is case-sensitive.

    skyAppAssetsService.getUrl('json/example.json') From 90e2555db35046e27cc373f66e196ecad9795c99 Mon Sep 17 00:00:00 2001 From: Alex Kingman Date: Thu, 10 Feb 2022 16:56:00 -0500 Subject: [PATCH 2/5] using absolute --- .../advanced/include-static-assets/index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/learn/get-started/advanced/include-static-assets/index.html b/src/app/learn/get-started/advanced/include-static-assets/index.html index ef2fe8a0c..a7d59cf2b 100644 --- a/src/app/learn/get-started/advanced/include-static-assets/index.html +++ b/src/app/learn/get-started/advanced/include-static-assets/index.html @@ -20,17 +20,17 @@
  • - On the file where you want to include the static asset, reference the static asset with assets/ before the filename and path. + On the file where you want to include the static asset, reference the static asset with /assets/ before the filename and path.

    - References to static assets must start with assets/ for the SkyAppAssetsService to retrieve the assets from the src/assets folder because the filenames are updated at build time to include hashes that represent the content of the files. + References to static assets must start with /assets/ for the SkyAppAssetsService to retrieve the assets from the src/assets folder because the filenames are updated at build time to include hashes that represent the content of the files.

    For example, you can display an image on a page.

    - Photo + Photo

    @@ -38,7 +38,7 @@

    @@ -71,7 +71,7 @@
  • - In the getUrl method, specify the path and file name for the static asset. Do not include the assets/ prefix, and note that param is case-sensitive. + In the getUrl method, specify the path and file name for the static asset. Do not include the /assets prefix, and note that param is case-sensitive.

    skyAppAssetsService.getUrl('json/example.json') From da07551e80b91078df8071dc0c84ff17eba18833 Mon Sep 17 00:00:00 2001 From: Alex Kingman Date: Wed, 16 Feb 2022 23:21:38 -0500 Subject: [PATCH 3/5] updated to reflect document vs root-relative paths --- .../advanced/include-static-assets/index.html | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/src/app/learn/get-started/advanced/include-static-assets/index.html b/src/app/learn/get-started/advanced/include-static-assets/index.html index a7d59cf2b..fb44e4405 100644 --- a/src/app/learn/get-started/advanced/include-static-assets/index.html +++ b/src/app/learn/get-started/advanced/include-static-assets/index.html @@ -9,7 +9,7 @@ - Include a static asset on a page + Include a static asset from a component's template or style sheet
      @@ -20,10 +20,7 @@
    1. - On the file where you want to include the static asset, reference the static asset with /assets/ before the filename and path. -

      -

      - References to static assets must start with /assets/ for the SkyAppAssetsService to retrieve the assets from the src/assets folder because the filenames are updated at build time to include hashes that represent the content of the files. + On the file where you want to include the static asset, reference the static asset with a root-relative path /assets/img/example.jpg.

      For example, you can display an image on a page. @@ -48,6 +45,28 @@

    + + Include a static asset from a global style sheet + + +
      +
    1. +

      + On the style sheet where you want to include the static asset, reference the static asset with a document-relative path assets/img/example.jpg. +

      +

      + For example, you can display an image on a page. +

      + + .foo-global { + height: 500px; + width: 500px; + background-image: url(assets/img/example.jpeg); + } + +
    2. +
    + Retrieve a static asset with SkyAppAssetsService From db1cf51c6c6795e9bf6795b5b17fe8fb641f499c Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 17 Feb 2022 09:42:36 -0500 Subject: [PATCH 4/5] Update src/app/learn/get-started/advanced/include-static-assets/index.html Co-authored-by: John Lyons --- .../learn/get-started/advanced/include-static-assets/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/learn/get-started/advanced/include-static-assets/index.html b/src/app/learn/get-started/advanced/include-static-assets/index.html index fb44e4405..9a70f5210 100644 --- a/src/app/learn/get-started/advanced/include-static-assets/index.html +++ b/src/app/learn/get-started/advanced/include-static-assets/index.html @@ -20,7 +20,7 @@
  • - On the file where you want to include the static asset, reference the static asset with a root-relative path /assets/img/example.jpg. + On the file where you want to include the static asset, reference the static asset with a root-relative path, such as /assets/img/example.jpg.

    For example, you can display an image on a page. From de45338d88554031da20d287b8a6f6153f3f5330 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 17 Feb 2022 09:42:56 -0500 Subject: [PATCH 5/5] Update src/app/learn/get-started/advanced/include-static-assets/index.html Co-authored-by: John Lyons --- .../learn/get-started/advanced/include-static-assets/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/learn/get-started/advanced/include-static-assets/index.html b/src/app/learn/get-started/advanced/include-static-assets/index.html index 9a70f5210..6b8883e87 100644 --- a/src/app/learn/get-started/advanced/include-static-assets/index.html +++ b/src/app/learn/get-started/advanced/include-static-assets/index.html @@ -52,7 +52,7 @@

    1. - On the style sheet where you want to include the static asset, reference the static asset with a document-relative path assets/img/example.jpg. + On the style sheet where you want to include the static asset, reference the static asset with a document-relative path, such as assets/img/example.jpg.

      For example, you can display an image on a page.