Skip to content

Database format

The result of ortfo/db's build process is a database.json file. This file contains all of the projects that were processed.

Missing values

All fields described here are always present. If they are irrelevant or unknown, they are set to their zero value. Basically, numbers are 0, strings are "", arrays are [], and objects are {}.


There's currently a bug where objects are null instead of {}. This will be fixed in a future release. This is because Go's zero value of maps is nil instead of an empty map.


The database is a JSON-encoded object that map works' IDs to objects containing the following fields:

The ID of the work[1]. IDs of works are simply their folders' names, since those a guaranteed to be unique
The date at which the work was last built. Useful for caching purposes
A hash of the work's description file. Again, useful for caching purposes
See Metadata
An object that maps language codes (see Internationalization) to the work's content.
If you don't translate your descriptions to other languages, the single key in the object will be default.
true if the work was not fully built (e.g. if the build process was interrupted while processing that work), false otherwise


Contains data about the work that is not part of the description itself, such as the date of creation, etc.

Most of these fields are set by the user in the description file's front-matter.


Array of strings that are other IDs that point to this work. Useful to express redirections. For example, if a work with ID ortfo has ["ortfodb", "ortfomk"] as the aliases field, then going to ortfodb's page should redirect to ortfo's page


Date when the work was finished. Should be in the format YYYY-MM-DD


Date when the work was started. Should be in the format YYYY-MM-DD


Array of strings that represent the tags of the work.


(made with or using in the description file)

Array of strings that represent the technologies (in the very broad sense, this could be stuff like "oil paint" when the work is a painting, or "sveltekit" when it's a website) used to make the work.


Path, relative to the folder where the file is, to the work's thumbnail. Useful to determine which media content block to use as the work's thumbnail


Useful to express colors to use for that project. Might be filled automatically with Color extraction when not manually set by the user


(page background in the description file)

Path, relative to the folder where the file is, to the work's background image. Useful to determine which media content block to use as the work pages's background image, for example


Whether the project is considered a "Work in progress" or not


Whether the project is marked as private or not. Useful to hide works that are not ready to be shown yet, or to have "unlisted" works


Object that contains other metadata set by the user in the description file.


There's currently a bug that makes madeWith's actual value appear here as made_with. This will be fixed in a future release.



The works' title. This correspond's to the first-level header (# Like this) in the description file


Maps footnote references to their definitions. See Footnotes


A two-dimensional array that represents the layout of the work. Each element of the array is a string that represents a content block's ID.

See Layouts


Array of content blocks.

The ID of the block. IDs of blocks are generated by the compiler and are guaranteed to be unique per work
A human-readable unique identifier that can be used to create an anchor tag to that block. Might be empty
The position of that block in the file. Starts at 0.
paragraph when the block is a Paragraph block
media when the block is a Media block
link when the block is a Link block
other fields depend on type
See just below
Paragraph blocks
The HTML content of that paragraph. See Markdown for more information about how the markdown syntax is processed, and what markdown features are handled by ortfo/db.
Media blocks

TODO. See the go documentation for Media in the meantime.

Here are the attributes:

Alt               string                        `json:"alt"`
Caption           string                        `json:"caption"`
RelativeSource    FilePathInsidePortfolioFolder `json:"relativeSource"`
DistSource        FilePathInsideMediaRoot       `json:"distSource"`
ContentType       string                        `json:"contentType"`
Size              int                           `json:"size"` // in bytes
Dimensions        ImageDimensions               `json:"dimensions"`
Online            bool                          `json:"online"`
Duration          float64                       `json:"duration"` // in seconds
HasSound          bool                          `json:"hasSound"`
Colors            ColorPalette                  `json:"colors"`
Thumbnails        ThumbnailsMap                 `json:"thumbnails"`
ThumbnailsBuiltAt string                        `json:"thumbnailsBuiltAt"`
Attributes        MediaAttributes               `json:"attributes"`
Analyzed          bool                          `json:"analyzed"` // whether the media has been analyzed
The text of the link. May contain HTML.
The link's title, to be used as the title attribute of the <a> tag
The URL the link points to

Schema & type definitions

JSON Schema
See JSON Schemas
Type definitions
For Go code, see the package
For other languages, see Client libraries

  1. This is technically redundant, but useful when you only have a single object and need to get the ID of the work ↩︎