Home
Author Manual
Themes Guide
Development

fpm package File System Organization

Package
fpm organizes ftd files in “packages”. Any folder is a fpm package if it contains a valid FPM.ftd file.

FPM.ftd
Every package folder has a file FPM.ftd.

Package Name
Each package has a name. The name of the package can be either just foo.com or foo.com/bar. The former is usually the “account name”, eg the username or the org that owns that package, and the latter is a namespace package.

💡
Package Name
The name of package should be a valid URL (without the protocol part, we always assume https).

.build folder

fpm can be used as a static site generator, fpm build will convert all ftd, markdown files to html and store them in .build folder.

If you are using static site hosting solution, eg Github Pages, Vercel, Cloudflare Pages etc, the content of .build folder has to be uploaded to your static site host.

.build Is Ignore-able Folder
.build folder should be added to .gitignore if you are storing fpm package in a git repository.

.packages folder
If the package has a dependency on another package, the dependencies are downloaded and stored in .packages folder.

💡
.packages Is Ignore-able Folder
.packages folder should also be added to .gitignore.

.packages/<package-name.ftd> file

When a fpm package is translated, a source package needs information about all the translation packages, to show on the translation status page. But we do not need the entire content of the translation packages.

To avoid downloading entire package, we just download the FPM.ftd for the translation packages in this case.

.history folder

fpm is also a version control system and can be used instead of say git. History of all edits are kept in history tracking, and creates a snapshot of every file that is modified in .history folder.

You can create a new history snapshot by using fpm sync.

If this package uses fpm as the respository, .history folder is managed by the fpm server. If the package is stored in git repository, then fpm sync creates local snapshots.

But amitu!
Why Do We Need .history When We Using git?
fpm supports translation and ad-hoc tracking features.
These features require support for accessing historical versions of files.
Currently they are powered by snapshots stored in the .history folder.

.history/.latest.ftd file
This file keeps track of latest timestamp of all files in .history folder. It looks like this:

-- import: fpm

-- fpm.snapshot: FPM.ftd
timestamp: 1646494343706523000

-- fpm.snapshot: foo/index.ftd
timestamp: 1638625721072234000