Implementation Details
Quick Start
- Getting started with pets.txt is simple. Create a file on the root of your website called
pets.txt
. - The contents of the file is pretty simple with only a few requirements. See the example file below.
- Add a link reference in the header tags of your website,
<link rel="author" href="pets.txt" />
- Put a badge on your site with a link to the
pets.txt
file.
Example File
/* PETS */ name: Santa's Little Helper breed: Greyhound about: Loves chewing on newspapers. name: Scooby breed: Great Dane about: Kind of a scaredy cat! favorite treat: Scooby Snacks name: Morris breed: Tabby House Cat about: Once ran for president of the United States. [...]
Specification
Rules marked as must are required for your pets.txt
file to be compliant.
Rules with should are strongly recommended but not required.
File
- File must be a UTF-8 file called
pets.txt
- Filename must be in all lowercase
- File must be publically accessible
- File must end with a Unix line feed character (new line).
Contents
- File must contain a
/* PETS */
element as the first entry in the file. /* PETS */
should be proceeded by a Unix line feed character (new line).- Each pet block must be seperated a Unix line feed character (new line).
Pet Blocks
- Each pet block must contain a
name:
element as the first entry in the block along with a string value. - Key elements should begin with a tab character.
- All key elements must end with a
:
(colon) proceeded by a single UTF-8 space. - All key elements should have a non-empty value