Skip to content

File naming for carousel content

Jared C Cunha edited this page Feb 26, 2019 · 2 revisions

Some content on the site has both a detail page and a carousel entry. For example, people and projects.

At the beginning of each file name, you will notice a four-digit number, and, at the time of writing this, in increments of 100 or so. This naming convention controls order in which items appear in the carousel. Files at the top of the list—in other words, with a lower four-digit number—appear further to the left (closer to the start) of carousel.

This naming convention was designed so that it would be easier to control the order of the carousel without requiring all other files to be renamed.

Example

Let's say we need to add a new person, Jane Doe, to the beginning of the carousel. The _people directory looks something like this:

_people/
   |- 0100_kasia-chimielinski.md
   |- 0200_david_holmes.md 
   |- 0300_vivian-graubard.md

Following the instructions for adding people, we would create a new file for Jane. So Jane's information appears first in the carousel, we would name her file 0090_jane-doe.md.

So now, the directory would be:

_people/
   |- 0090_jane-doe.md
   |- 0100_kasia-chimielinski.md
   |- 0200_david_holmes.md 
   |- 0300_vivian-graubard.md

Now lets say we want to swap Kasia and David. We can do this by only renaming David's file to something like 0095_david_holmes.md

_people/
   |- 0090_jane-doe.md
   |- 0095_david_holmes.md
   |- 0100_kasia-chimielinski.md
   |- 0300_vivian-graubard.md