desirae.js/ENTITY.md

63 lines
1.9 KiB
Markdown
Raw Permalink Normal View History

2015-01-23 09:52:41 +00:00
This is what an entity looks like:
```yml
# inherited from File Entity
path : My Posts/My-Old-Name.html
lastModifiedDate : 2015-07-04T13:56:01Z
createdDate : 2015-07-04T13:56:01Z
contents : '...' # whatever the file is
# inherited from Collection Entity
name : My-Old-Name.html
relativePath : My Posts
ext : .html
collection : posts
# inherited from Content Entity
frontmatter : '---\n...\n---' # frontmatter as a string
yml : {} # frontmatter, parsed
body : 'I think ...' # body, after frontmatter
# inherited from Normalized Entity
title : My Title # yml.title | titlize(entity.name)
slug : my-title # slugify(title)
slug_path : my-posts # slugifyPath(relativePath)
year : 2014
month : 07
day : 04
hour : 13
twelve_hour : 1
meridian : pm
minute : 22
categories : ['tech']
tags : ['http','url','website']
# includes index.html
relative_file : /posts/foo/index.html
# excludes index.html
2015-01-23 23:42:01 +00:00
relative_href : /posts/foo/
2015-01-23 09:52:41 +00:00
# actual url of this file, even if redirect
# excludes index.html
url : http://dev.example.com/posts/foo/
# the appropriate url, even in a redirect or duplicate
# excludes index.html
canonical_url : http://dev.example.com/posts/foo/
# production url, even in development (for disqus, etc)
# excludes index.html
production_url : http://example.com/posts/foo/
```
Note: The option `env.explicitIndexes` turns on `/index.html`. This option is automatically turned on when Dropbox is the host.
2015-01-23 22:01:02 +00:00
TODO
----
* path relative from / in the browser
* path relative from base_path on the file system