Skip to content

Changing the date of an event

Sara Cope edited this page Jun 5, 2020 · 5 revisions

Changing the date of an event is not trivial, both for us as a team, and for users who may have already signed up for the event. Here are two things you can do to prevent this from happening:

  • make it clear with speakers that changing the date of an event is not easy
  • get an agreement of the date early
  • indicate that changing the date of an event harms the trust that the users put in us to offer high-quality events

That said, 💩 happens.

There are a few paths for changing the status of an event

  1. Change the date of the event
  2. Postpone the event, and update with a new date at a later time
  3. Delete the event from the site 😡 Never do this!

Change the date of an event

This assumes the event is currently live on https://digital.gov/events.

For this example — let's assume that the USWDS team could not hold their monthly April call on April 16, 2020 and they need to move it to May 7, 2020. They still intend to hold their May call on May 21. This example shows how to change an event date, and move it to a separate month.

So we will be changing

1. Find the event page in GitHub

You can do this in a number of ways.

  1. go to https://github.com/GSA/digitalgov.gov

  2. In the Code tab, scroll down to the list of files ad folders and navigate to content, then to events, then to the year 2020, then to the month 04, until you find the file for the event you want to change.

  3. Click to open the file for the event. Should looks like this image

2. Edit the filename and move the file

Let's first focus on editing the filename and putting it in the new location, organized by date.

  1. Click to "edit this file" image

Now you should see this. Here's where you'll edit the filename and move the file. image

And since we are moving this file to a new month, from content/events/2020/04/ to content/events/2020/05/, we are going to do that first.

(Note: if you are not changing the date to a new month, you do not need to move the file to a new folder)

  1. In the filename field, put the cursor at the start of the filename image

We'll start by moving the file up one folder to the content/events/2020/ folder

  1. with the cursor at the start of the filename, type ../. The file should be at content/events/2020/ folder.

  2. with the cursor still at the start of the filename, type 05/. The file should be at content/events/2020/05 folder.

NOTE: this file is not yet saved! Please proceed to the next step.

Edit the start and end date and time

Next, we will move on to editing the information in the front matter data for the event. This will change how the date/time appears on the event page.

  1. Click into the main document body and find the fields date: and end_date:. image

  2. Edit the date: and end_date: to reflect the new event date and time. The format for the date is year-mo-day hr:min:sec -0500

  • date:

    • old: date: 2020-04-16 14:30:00 -0500
    • new: date: 2020-05-07 14:30:00 -0500
  • end_date:

    • old: end_date: 2020-04-16 15:30:00 -0500
    • new: end_date: 2020-05-07 15:30:00 -0500

NOTE: this file is not yet saved! Please proceed to the next step.

Add a redirect

Since we're moving this page from one location to another, we need to let the site know which URLs should redirect to this page. More on adding redirects»

We are going to add in the redirect as the last field in the front matter, before the ---.

image

  1. Copy this code
aliases:
  - /2012/05/05/example-url

When redirecting multiple URLs, use multiple lines below aliases:, like:

aliases:
  - /2012/05/05/example-url
  - /2012/05/06/another-example-url

NOTE: There should be two spaces before the dash!

  1. Paste that code as the last field in the front matter, before the closing ---, like this:
# Primary Image (for social media)
primary_image: "uswds-2-illio-feature-image"

# Redirects
aliases:
  - /2012/05/05/example-url

# Make it better ♥
---

body copy goes here.....
  1. Next, get the URL of the page you want redirected to this page

In this example, it will be https://digital.gov/event/2020/04/16/uswds-monthly-call-april-2020/

  1. Remove the https://digital.gov from the URL. It should look like /event/2020/04/16/uswds-monthly-call-april-2020/

  2. replace the example URL in the code we pasted with this new path. It should now look like,

# Primary Image (for social media)
primary_image: "uswds-2-illio-feature-image"

# Redirects
aliases:
  - /event/2020/04/16/uswds-monthly-call-april-2020/

# Make it better ♥
---

body copy goes here.....

It should look like this: image

Commit the changes

Next, we will commit the file using both the subject and body text

  • Subject: "Changing event page date"
  • Body: You need to indicate the URL you are changing it from as well as the URL you are changing it to. Be verbose! This text

image

Create a pull request

Next, we will create a pull request that will create a preview and preset the changes to others on the team. The more you say in the pull request, the easier it will be for someone else on your team to figure out what they need to review and check. So do them a favor and explain the change in the body of the pull request. ❤️

Assign a reviewer

The last thing you should do is to assign a reviewer. This person will be responsible for checking your work. Best of luck!


Postpone the event, and update with a new date at a later time

🚧 _This functionality is in the works. Coming soon. _ 🚧

Change a post/page to draft by adding draft: true to the Frontmatter. Be sure to also redirect the page to something else so visitors don't get a 404 Page Not Found error.

Clone this wiki locally