.ftd
files to .html
files you can ship on Github Pages, Vercel etc.FPM.ftd
file in any folder:-- import: fpm -- fpm.package: fpm.dev zip: github.com/fifthtry/fpm.dev/archive/refs/heads/main.zip
fpm.dev
. Packages in FPM are named after the domain where they would be published. Every FPM package is a website.FPM.ftd
file:-- import: fpm -- fpm.package: fpm.dev zip: github.com/fifthtry/fpm.dev/archive/refs/heads/main.zip -- fpm.dependency: fifthtry.github.io/Forest-Theme as ft
Here fpm.dev
has a dependency on fifthtry.github.io/Forest-Theme
.
We have also used “alias” feature to bind the name of this dependency to ft
,
so FTD files can write -- import: ft
instead of having to use the full path,
e.g. -- import: fifthtry.github.io/Forest-Theme
.
An FPM package contains one or more “ftd modules”, and the modules export one or more “symbols”, eg records, variables, components and so on.
The set of modules and symbols exported by a package is called “package
interface” of that package. FPM lets one package declare that it is
“implementing” another package. All packages that implement a common package
are interchangeable without chaning any code, and only updating the dependency
in FPM.ftd
file.
-- import: fpm -- fpm.package: fpm.dev zip: github.com/fifthtry/fpm.dev/archive/refs/heads/main.zip language: English translation: hi.fpm.dev
Here we have declared that this package supports translation by adding the
language key. Also we have already got one “accepted translation”,
hi.fpm.dev
.
Once you have enabled translation, you can create a new fpm package, here
hi.fpm.dev
, and give it a FPM.ftd file:
-- import: fpm -- fpm.package: hi.fpm.dev zip: github.com/fifthtry/fpm.dev-hi/archive/refs/heads/main.zip language: hi translation-of: fpm.dev
This can be your entire package when you create a new translation. When you
build a translated FPM package, FPM is aware it is a translation, and it builds
all the files in the original, which if fpm.dev
, so you do not have to copy
any files.
FPM uses a fallback based logic, for every missing file, it builds the
corresponding file from original package. So say if index.ftd
is missing in
Hindi translation, because it is not yet translated, FPM will pick the
index.ftd
from the English/original version and hi.fpm.dev
will be a
“complete website”.
Once a file has been created in translation package, it can be in other of three states: a. file exists but has never been accepted, meaning translation has started but not yet finished, b. file is upto date with the original, and c. file was once up to date, but since then English version has changed.
In a and c we show a warning on the genrated pages so readers can see that either the translation is not complete or out of date, and we give quick option to switch to the English/original version. In case if things are out of date, we also show since how long is it out of date and what is the diff in the Enlish version from when Hindi version was last marked up to date, to current English version.
Checkout what is planned in Roadmap, and day to day updates in the Journal.
Github: github.com/FifthTry/fpm Discord: #fpm on FifthTry