lektor / lektor

The lektor static file content management system

Home Page:https://www.getlektor.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Project.id can collide for projects with the same tree, but different project files

dairiki opened this issue · comments

Currently, Project.id is a hash that depends only on Project.tree (the path to the directory that contains the project source: the content, templates, models, assets, and other directories).

The id is used to construct the default output path and (hashed with other bits) the package cache path.

A given project source tree can be built with different project files (.lektorproject files). In that case, a different default output path should be used for each (project file, project tree) combination. This is not currently done.

The Project.id should probably depend on at least Project.project_file as well as Project.tree.

It should possibly include Project.themes and/or Project.name as well, since it is possible — programmatically, at least — to construct projects which vary in those attributes.
The CLI appears to always set themes from the project file settings, and gets name either from the project file or by DWIMming it from the basename of the project file or the project tree. So perhaps basing the id only on tree and project_file is sufficient?