Created by
LOGO
Home
Author Manual
Themes Guide
Development

How Versioning Works

FPM uses fallback based file tracking technique to implement versioning.

Versioning Happens At Project Level

Currently a package will either implement versioning or it will not.

If a project implements versioning, the top level of the project there would be version folders.

Normal layout looks like this:

Project Without Versioning
- package-folder
  - FPM.ftd
  - index.ftd
  - foo.ftd
For a project with versioning enabled:
Project With Versioning (foo.com package’s content)
- package-folder
  - FPM.ftd
  - v0/
  - v1/
    - foo.ftd
  - v2/
  - index.ftd
  - foo.ftd

There are documents like foo.ftd and index.ftd lies outside any versioned folder (v1 and v2). These documents become the part of all the versions unless any versioned folder contains the document with same id. This results in overriding of the document and that version and all preceding version would take the overridden document.

Notice that foo.ftd exists in v1 folder, this implies that v1 has other edition of foo.ftd and all the preceding versions (v0) would take this edition of foo.ftd.

The file structure would look like this

File structure
- package-folder
 - v0
   - index.ftd (from package root directory)
   - foo.ftd (from v1)
 - v1
   - index.ftd (from package root directory)
   - foo.ftd (from v1)
 - v2
   - index.ftd (from package root directory)
   - foo.ftd (from package root directory)

Not include the document till a particular version

Not include foo.ftd till v1
- package-folder
  - FPM.ftd
  - v0/
  - v1/
    - foo.ftd.delete
  - v2/
  - index.ftd
  - foo.ftd

Notice that foo.ftd.delete is added in the v1. This result in not including the foo.ftd for v1 version and all the preceding versions v0.

The file structure would look like this:

File structure
- package-folder
 - v0
   - index.ftd (from package root directory)
 - v1
   - index.ftd (from package root directory)
 - v2
   - index.ftd (from package root directory)
   - foo.ftd (from package root directory)

Include a document till a particular version

Include foo.ftd till v1
- package-folder
  - FPM.ftd
  - v0/
  - v1/
    - foo.ftd
  - v2/
  - index.ftd

Notice that foo.ftd is added in the v1. This result in including the foo.ftd for v1 version and all the preceding versions v0. And since it’s not part of package root directory, so it’s not part of all succeeding versions v2

The file structure would look like this:

File structure
- package-folder
 - v0
   - index.ftd (from package root directory)
   - foo.ftd (from v1)
 - v1
   - index.ftd (from package root directory)
   - foo.ftd (from v1)
 - v2
   - index.ftd (from package root directory)

fpm.package
fpm.package includes one more field versioned of boolean type with default value as false. Set this field to true to enable versioning.

-- fpm.package: <package-name>
versioned: true

Versioning FPM.ftd
No FPM versioning. All versions will use same dependencies etc.

Package URLs
If foo.com implements versioning, and have content as shown above, we will have URLs for each version, eg foo.com/v1/ (corresponding to index.ftd), foo.com/v1/foo/, foo.com/v2/andfoo.com/v2/foo/(even though there is nofoo.ftdinv2` folder).

Top level URLs

Further the latest version’s content would be reflected on top level, so we have foo.com/ and foo.com/foo/.

Top level URLs would use latest version as the canonical URL. NOT SURE ABOUT IT.

base URL

All urls in markdown etc should use only be partial urls, so eg if index.ftd is talking about foo.com/foo/ it should link to it using foo/.

If the project was foo.com/bar, the base URL is /bar/, and full URLs of the files mentioned above would be foo.com/bar/v1/, foo.com/bar/v1/foo/ and so on, so when linking we index.ftd will continue to use foo/ as path, and base URL would be set to /bar/v1/ etc, based on which file being built.

Version Dropdown
Version dropdown will show all versions. Latest version would be linked against the version number, eg foo.com/v2/ not foo.com/ even though the two have same content.

FPM Variables
To assist themes with versioning we have the following fpm variables:

ftd.toc-item list fpm.versions
All version prefixes, eg v1, v2, and so on. The link will point to the current document’s URL in that version. If the current document is not present in that version the link is not set.