Skip to content

Commit cf7437f

Browse files
Update for preview release
1 parent 0cc83b3 commit cf7437f

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

articles/static-web-apps/snippets.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,19 @@ ms.author: cshoe
1111

1212
# Snippets in Azure Static Web Apps (preview)
1313

14-
Azure Static Web Apps allows you to inject custom code into the `head` or `body` elements at runtime. These pieces of code are known as "snippets".
14+
Azure Static Web Apps allows you to inject custom code into the `head` or `body` elements at runtime. These pieces of code are known as *snippets*.
15+
16+
Snippets give you the flexibility to add code to every page in your site in a single place, all without modifying the core codebase.
1517

1618
Common use cases of snippets include:
1719

1820
- Analytics scripts
1921
- Common scripts
2022
- Global UI elements
2123

24+
> [!NOTE]
25+
> Some front-end frameworks may overwrite your snippet code. Test your snippets before applying them to a production environment.
26+
2227
## Add a snippet
2328

2429
1. Go to your static web app in the Azure portal.
@@ -27,17 +32,24 @@ Common use cases of snippets include:
2732

2833
1. Select the **Snippets** tab.
2934

35+
1. Select the **Add** button.
36+
3037
1. Enter the following settings in the Snippets window:
3138

3239
| Setting | Value | Comments |
33-
|---|---|--|
34-
| Location | Select which element as the destination for your code. | |
40+
|---|---|---|
41+
| Location | Select which HTML page element you want your code injected into. | |
3542
| Name | Enter a snippet name. | |
36-
| Insertion location | Select whether you want to **Prepend** or **Append** your code to the selected element. | Prepend means your code appears directly after the open tag of the element. Append means your code appears directly before the close tag of the element. |
37-
| Environment | Select the environment(s) you want to target. | If you select **Select environment** then you can choose a selection of environments to target. |
43+
| Insertion location | Select whether you want to **Prepend** or **Append** your code to the selected element. | *Prepend* means your code appears directly after the open tag of the element. *Append* means your code appears directly before the close tag of the element. |
44+
| Environment | Select the environment(s) you want to target. | If you pick **Select environment**, then you can choose from different environments to target. |
3845

3946
1. Enter your code in the text box.
4047

4148
1. Select **OK** to close the window.
4249

4350
1. Select **Save** to commit your changes.
51+
52+
## Next steps
53+
54+
> [!div class="nextstepaction"]
55+
> [Split traffic](./traffic-splitting.md)

0 commit comments

Comments
 (0)