Skip to content

How to Rename Rules

Tiago Araújo [SSW] edited this page Dec 4, 2023 · 6 revisions

Renaming SSW Rules and their URLs

Video: How to rename a rule

Video: How to rename an SSW Rule?

Step 1: Update the title text

  1. Change the title: field in the frontmatter

Step 2: Update the URI + Add the redirect from old URI

  1. Change the uri: field in the frontmatter
  2. Add the old URI to the redirects: list in the rule

For example, this rule was changed from:

Path: rules/accommodation---do-you-know-the-best-online-accommodation-websites/rule.md

---
type: rule
title: Accommodation - Do you know the best online accommodation websites?
guid: 8d59feea-03b4-4cfc-b26e-77b2655293d9
uri: accommodation---do-you-know-the-best-online-accommodation-websites
redirects: []
---

To:

Path: rules/the-best-accommodation-websites/rule.md

---
type: rule
title: Accommodation - Do you know the best online accommodation websites?
guid: 8d59feea-03b4-4cfc-b26e-77b2655293d9
uri: the-best-accommodation-websites
redirects: 
 - accommodation---do-you-know-the-best-online-accommodation-websites
---

Step 3: Rename the folder in GitHub

Rename the rule's folder to be the same as the new URI

  1. Open the rule in GitHub
  2. Click the 'Edit' button

Edit button in GitHub Figure: Open the Editor in GitHub

  1. Click the file name at the top of the editor
  2. Move the cursor to the start of this field

File name editor Figure: Place your cursor in the file editor

  1. Press 'backspace' on your keyboard to open the editor field for the folder name
  2. Change the folder name

Folder name editor Figure: Pressing 'backspace' will move the editor field to the folder

  1. Press '/' on your keyboard to navigate back to the file name
  2. Ensure the file name is the same as before (usually 'rule.md'

Changed folder name Figure: Press '/' and make sure the file name is correct

  1. Save your changes at the bottom of the page as you would with any other change

Step 4: Find and update rules' categories

To find all the categories that this rule is in, follow these steps:

  1. Navigate to the rule on ssw.com.au/rules

  2. Click on the category in the breadcrumb

  3. In the category, click the edit button in the top right. You will be navigated to the category file in GitHub

  4. Open the same file in your fork of the repository

  5. Click the edit pencil

  6. Find the old URI in the index and change it to the new one

  7. If there is more than one category in the breadcrumb like this in step 2, repeat steps 2 - 6 for each category

Next Step

See How to Create Rules

Clone this wiki locally