Naming & paths cheat sheet

Naming conventions

  • all lowercase

    • All files & folder must us only lowercase characters.

    • This includes extensions, like .jpg, .png, etc.

    • The only exceptions are README.md, LICENSE & CNAME.

  • Nospaces

    • No spaces allowed anywhere in file & folder names.

    • Be careful their are spaces hidden at the end, after the extension.

    • Use a dash (-) to separate words.

  • Only letters, numbers & dashes

    • Use dashes (-) to separate words, e.g. super-duper.html.

    • The only exception is the dot (.) before extensions.

    • Underscores (_) are also acceptable.

  • Good examples

    • index.html — all lowercase.

    • t-rex.png — no spaces, dashes separating words.

    • dragon-1.jpg — only letters, numbers & dashes.

  • Bad examples

    • Index.html — capital letters used.

    • t rex.png — space in filename.

    • dragon’s egg.jpg — apostrophe is a non-standard character.

  • Be careful

    • dragon.JPG — some programs like to use uppercase extensions—change them to lowercase.

    • full-site.tar.gz — multiple extensions are okay.

    • _archive — underscores are fine, but try to avoid them.

Paths & folders

  • ./ or nothing

    • Start in the same location.

    • ./about.html or about.html

  • ../

    • Go out of a folder.

    • Can be chained: ../../.

    • ../index.html

  • /

    • Start at the root of the computer or the root of the domain.

    • /index.html or /Dropbox/image.jpg

  • //

    • Start immediately after the protocol, replace the domain.

    • //github.com

  • https://

    • Start at the top level of the Internet, replace everything.

    • https://github.com

  • ~/

    • Start in your home folder.

    • Doesn’t work on the web.

    • ~/Desktop/todo.txt