-
Notifications
You must be signed in to change notification settings - Fork 196
How to Rename Rules
Video: How to rename an SSW Rule?
- Change the
title:field in the frontmatter
- Change the
uri:field in the frontmatter - Add the old URI to the
redirects:list in the rule
For example, this rule was changed from:
Path: public/uploads/rules/accommodation---do-you-know-the-best-online-accommodation-websites/rule.mdx
---
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: public/uploads/rules/the-best-accommodation-websites/rule.mdx
---
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
---Rename the rule's folder to be the same as the new URI
- Open the rule in GitHub
- Click the 'Edit' button
Figure: Open the Editor in GitHub
- Click the file name at the top of the editor
- Move the cursor to the start of this field
Figure: Place your cursor in the file editor
- Press 'backspace' on your keyboard to open the editor field for the folder name
- Change the folder name
Figure: Pressing 'backspace' will move the editor field to the folder
- Press '/' on your keyboard to navigate back to the file name
- Ensure the file name is the same as before (usually 'rule.mdx')
Figure: Press '/' and make sure the file name is correct
- Save your changes at the bottom of the page as you would with any other change
To find all the categories that this rule is in, follow these steps:
- Navigate to the rule on ssw.com.au/rules
- Click on the category in the breadcrumb
-
In the category, click the github button in the top right. You will be navigated to the category file in GitHub
-
Open the same file in your fork of the repository
-
Click the edit pencil
-
Find the old URI in the
indexand change it to the new one -
If there is more than one category in the breadcrumb like this in step 2, repeat steps 2 - 6 for each category
-
Search the repository for the old URI and update every other match, such as other rules'
related:entries and image paths (/uploads/rules/<old-uri>/...). When you're done, the only match left is theredirects:entry from Step 2:git grep -n "<old-uri>"
Merging your pull request does not deploy the whole site. The new URL shows up soon after merge, but the redirect from the old URL only starts working after the next production deploy of SSW.Rules. Until then, the old URL keeps showing the old version of the rule.
Production deploys run automatically every day at 06:00 UTC (4pm AEST, 5pm AEDT). If the old URL needs to redirect sooner, run the deploy yourself (needs write access to SSW.Rules):
-
Open Actions | Scheduled Production Deploy in SSW.Rules
-
Click Run workflow | Run workflow
Or, from a terminal:
gh workflow run scheduled-production-deploy.yml -R SSWConsulting/SSW.Rules
-
Wait for the Deploy Application to Azure Web App (Container) run it starts to finish (about 40 minutes)
-
Open the old URL and check that it redirects to the new one
If you can't run the deploy, say so in your pull request so the reviewer knows the old URL won't redirect until the next daily deploy.
SSW.Rules#2722 tracks removing the need for this step.
- How to Create Rules
- How to Edit Rules
- How to Rename Rules
- How to Add and Edit Categories and Top Categories
- How to Rename Categories
- Creating your Fork (One time setup)
- Merging Your Fork
- Updating your fork
- Using Markdown
- Editing MDX Components (in GitHub)