import{_ as a}from"./chunks/PageInfo.vue_vue_type_script_setup_true_lang.250b3e56.js";import{_ as n,o as i,c as l,H as o,k as e,a as t,Q as r}from"./chunks/framework.b7580407.js";import"./chunks/commonjsHelpers.725317a4.js";const j=JSON.parse('{"title":"File Name Conventions","description":"","frontmatter":{},"headers":[],"relativePath":"development/file-naming-convention.md","filePath":"development/file-naming-convention.md","lastUpdated":1712254434000}'),p={name:"development/file-naming-convention.md"},c=e("h1",{id:"file-name-conventions",tabindex:"-1"},[t("File Name Conventions "),e("a",{class:"header-anchor",href:"#file-name-conventions","aria-label":'Permalink to "File Name Conventions"'},"")],-1),d=r(`
A collection of guidelines for writing file names used in web projects.
Right:
file-name-with-dashes.en.min.htmlfile-name-with-dashes.en.min.htmlAvoid using non-alphanumeric characters in file names, such as: '*' ':' '\\' '/' '<' '>' '|' '"' '!' '?' '[' ']' ';' '=' '+' '&' '£' '$' '€' '%' or ','. These characters can have special meaning in programming languages or can cause problems with different operating systems.
We should always consider URLs as case-sensitive according to W3.org. Therefore, use lowercase to reduces errors when typing URLs.
Sections should be written in this order:
Possible combinations
description-01-20150102-palm-1.0b-draft.en.min.js /* extreme combination */
description.min.js
description.en.html
description-01.jpg
description-02.jpg
description-1024x768_2x.jpg
description-desk_2x.jpgdescription-01-20150102-palm-1.0b-draft.en.min.js /* extreme combination */
description.min.js
description.en.html
description-01.jpg
description-02.jpg
description-1024x768_2x.jpg
description-desk_2x.jpgDon't be afraid to write long informative file names. Few people type a file name manually and most operating systems support 255 characters. But only add information that makes it easy for users and developers to recognize files from one another at a glance. For the description use information such as:
Give your images detailed, informative filenames The filename can give Google clues about the subject matter of the image. Try to make your filename a good description of the subject matter of the image. For example, my-new-black-kitten.jpg is a lot more informative than IMG00023.JPG. Descriptive filenames can also be useful to users: If we're unable to find suitable text in the page on which we found the image, we'll use the filename as the image's snippet in our search results. - Google, 2015, Image publishing guidelines
Sometimes you want to include the name of a person in the file name, e.g. the author or the person in the photo.
Right:
bvandebiezen.jpg
shoogenhout.jpg
a-very-long-description-with-name-bvdb.jpg
asmith.jpg
adamsmith.jpg
adamsmith2.jpgbvandebiezen.jpg
shoogenhout.jpg
a-very-long-description-with-name-bvdb.jpg
asmith.jpg
adamsmith.jpg
adamsmith2.jpgRight:
description-01.jpg
description-02.jpg
description-03.jpg
description-04.jpg
01-description.jpg
02-description.jpg
03-description.jpg
04-description.jpgdescription-01.jpg
description-02.jpg
description-03.jpg
description-04.jpg
01-description.jpg
02-description.jpg
03-description.jpg
04-description.jpgRight:
description-20150401.php
description-201504.php
description-2015.php
description-2000--2010.phpdescription-20150401.php
description-201504.php
description-2015.php
description-2000--2010.phpSee 'ISO 8601' for further reading.
Modifiers are inspired by Apple iOS naming conventions. There are some differences. Apple uses '@'as a delimiter for the section indicating higher resolution images, for example '@2x' for retina images. Because '@' is a reserved character and can create problems, we use Bourbon's convention: an underscore. Also, Apple uses a tilde (~) as a delimiter for a section indicating specific devices. Because also a tilde can create problems, we suggest to simply use a dash.
1) target device or media query, (2) size, (3) pixel density.-) as delimiter.-) as delimiter._) as delimiter, for example '_2x' or '_3x'.w' for width or 'h' for height directly after the the amount of pixels.w' or 'h' and separate the width and height with an 'x'.max' (maximum) after the amount of pixels.Right:
description_2x.jpg
description-lap.jpg
description-desk.jpg
description-lap_2x.jpg
description-palm-1024w_2x.jpg
description-iphone5-568h_2x.jpg
description-palm-1024x768_2x.jpg
description-40max.jpgdescription_2x.jpg
description-lap.jpg
description-desk.jpg
description-lap_2x.jpg
description-palm-1024w_2x.jpg
description-iphone5-568h_2x.jpg
description-palm-1024x768_2x.jpg
description-40max.jpg-) as delimiter..) to separate point releases.2.0' instead of '2'.a' (alpha), 'b' (beta), 'rc1' (release candidate 1) can be added without delimiters.Right:
description-0.5.js
description-1.0b.js
description-1.0rc1.jsdescription-0.5.js
description-1.0b.js
description-1.0rc1.jsdraft' and 'published'.Right:
description-draft.mddescription-draft.mdRight:
description.nl.txt
description.en.txtdescription.nl.txt
description.en.txt.) to separate the condition from the rest of the file name..) as a delimiter for different conditions.Right:
description.min.js
description.custom1234.min.jsdescription.min.js
description.custom1234.min.jsIt is not preferred to keep file names in it's original format if it doesn't match your file name conventions. But in some cases it is easier to keep the file name untouched. Sometimes you want to easily replace a file with a newer one from the original source in the future.
`,56);function h(m,u,b,g,f,y){const s=a;return i(),l("div",null,[c,o(s,{readTime:"7",words:"1.2k"}),d])}const x=n(p,[["render",h]]);export{j as __pageData,x as default};