Skip to content

Commit 4207553

Browse files
added general rules (#26434)
1 parent 15a98ad commit 4207553

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.windsurf/rules/general-rules.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
trigger: always_on
3+
---
4+
5+
# General rules
6+
7+
## Partial files location
8+
9+
- The partial files used in the docs are located in src/content/partials/
10+
11+
## Partial files variables
12+
13+
- Some partial files have variables to account for the fact that the partials are reused in different places and even products.
14+
- Some partials also have JSX fragments. These pieces of code are conditionally rendered in the pages where the specific variable (magic word as it's called sometimes) is present. An example of these conditionally rendered pieces of code is:
15+
16+
{ props.magicWord === "hardware" && (
17+
  <>
18+
    <p>You need to purchase <a href="https://www.cloudflare.com/magic-wan">{props.productOriginalName}</a> before you can purchase and use the {props.productName}. The {props.productName} can function as your primary edge device for your network, or be deployed in-line with existing network gear.</p>
19+
  </>
20+
)
21+
}
22+
23+
This code would only be rendered if the page has a magicWord variable set to "hardware".
24+
25+
## General guidance
26+
27+
- Do not make any changes to content without showing me what you want to change and asking if I agree to the changes.
28+
- Do not use HTML for ordered lists.
29+
- When you use JSX fragments to conditionally render a block of code, always use the props variable to account for the fact that the partials are reused in different places and even products.
30+
- When you use JSX fragments to conditionally render a block of code, be aware that you will probably need to use the <Markdown /> component to properly render content that is not a single sentence.
31+
- Only use the <Markdown /> component in JSX conditionals, and only if needed.
32+
- Do not duplicate content when creating ternary or binary conditions.
33+
- When adding a variable to a link, use HTML instead of Markdown.
34+
- Whenever something is not clear, ask the user for more input.

0 commit comments

Comments
 (0)