<p>The name of the file can be arbitrary but must have the <code>.lektorproject</code>
extension or Lektor will not be able to find it. When Lektor looks for a
project it looks upwards from the current folder until it finds a single
file with the <code>.lektorproject</code> extension and that's then the root of the project.</p>
<divclass="admonition admonition-info"><p>It's possible to build a Lektor project in the absence of a Project file,
but this usage is heavily discouraged. It exists primarily for quick
testing situations. But don't be confused if you encounter a Lektor project
that does not come with a corresponding project file.</p></div><h2id="config-sections">Config Sections</h2><p>Within the project file there are various configuration sections. The
following sections currently exist:</p>
<h3id="project"><code>[project]</code></h3><p>This section controls some basics about the project:</p>
<p><code>name</code></p>
<blockquote><p>This is the human readable name of the project. It's used in various
places where the system wants to show the context of the operations. For
instance the admin panel will display this to indicate which project is
being worked on.</p>
</blockquote>
<p><code>locale</code></p>
<blockquote><p>This is the default locale of the website. This defaults to <code>en_US</code> and
can be changed to many others. Most locales of the CLDR project are
supported. This information is for instance used to format dates.</p>
</blockquote>
<p><code>url</code></p>
<blockquote><p>This is the full URL of the website. If set this information can be used
to enable the <code>external</code> URL generation parameter. Lektor tries hard to
make websites work in a way where this information is not necessary but
some systems might need it. For instance sitemaps require full URLs and
not having them would be a violation of the specification.</p>
</blockquote>
<p><code>url_style</code></p>
<blockquote><p>This controls the style of generated URL references through the
<ahref="../../api/utils/url-to/"class="ref">url_to</a> function or filters. The default
value for this is <code>relative</code>. The following values are possible:</p>
<table>
<thead><tr>
<th>Value</th>
<th>Behavior</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>relative</code></td>
<td>URLs are generated relative to the currently active page.</td>
</tr>
<tr>
<td><code>absolute</code></td>
<td>URLs are generated absolute (relative to root page)</td>
</tr>
<tr>
<td><code>external</code></td>
<td>URLs are generated with the fully canonical URL (external).</td>
</tr>
</tbody>
</table>
<p>There are advantages and disadvantages to all styles. <code>relative</code> has the
benefit that it works without any configuration no matter where you deploy
to. The downside is that you cannot have a page appear on multiple paths
which for instance breaks custom error pages. <code>absolute</code> is useful for
situations where you have custom error pages and you generally know a bit
about the server you are deploying to. <code>external</code> generally makes not a lot
of sense as default setting but exists for consistency's sake.</p>
<p>For individual URLs that are generated with the <ahref="../../api/utils/url-to/"class="ref">url_to</a> function it's possible to override the
default URL style.</p>
</blockquote>
<p><code>path</code></p>
<blockquote><p>This setting can be used to configure a different path for the project
tree. This requires a bit of explanation:</p>
<p>If this is not set (which is the default) then Lektor will find the
content files right next to the project file. However in some situations
you might want to move a project file to a completely different location
for instance because you want to have settings in there that you do not
want to put into version control. In that case you can set the <code>path</code>
in the file to a path (absolute or relative to the project file) which
resolves to the project tree.</p>
<p>Note that if this setting is used some functionality in the desktop app
might no longer work (for instance opening <code>.lr</code> files with a double click).</p>
</blockquote>
<p><code>output_path</code></p>
<blockquote><p>Configure the build path for your project. By default, Lektor will detect a
proper location depeding on your operation system, only use this setting if
you want to set a custom path.
The path is relative to the project file, absolute paths are allowed but not
portable between distinct filesystems.</p>
</blockquote>
<p><code>excluded_assets</code></p>
<blockquote><p>A list of file names or Unix shell-style wildcards, separated by commas.
The wildcard syntax follows <ahref="https://docs.python.org/2/library/fnmatch.html">fnmatch</a>.</p>
<p>By default, filenames beginning with "_" or "." are not copied from the
<code>assets</code> directory to the output directory. Exclude <em>additional</em> files with
the <code>excluded_assets</code> option.</p>
</blockquote>
<p><code>included_assets</code></p>
<blockquote><p>A comma-separated list of file names or Unix shell-style wildcards, specifying
files that should be copied from the <code>assets</code> directory to the output
directory even if they begin with "_" or "." (the default exclusion patterns)
or match your custom <code>excluded_assets</code> pattern. The wildcard syntax follows
<h3id="alternatives.*]`"><code>[alternatives.*]</code></h3><p>This configures <ahref="../../content/alts/"class="ref">Alternatives</a>. It is repeated for
each intended alternative. The default behavior is that alternatives are
disabled.</p>
<p><code>name</code></p>
<blockquote><p>The human readable name for the alternative. The admin interface uses this.</p>
</blockquote>
<p><code>url_prefix</code></p>
<blockquote><p>A prefix that is added in front of all URLs to identify this alternative.</p>
</blockquote>
<p><code>url_suffix</code></p>
<blockquote><p>A suffix that is added behind all URLs to enable this alternative. This is
currently discouraged compared to the URL prefix as it might not yet work
in all situations properly.</p>
</blockquote>
<p><code>primary</code></p>
<blockquote><p>If this is set to <code>true</code> then the alternative is selected as primary. For
more information about this refer to the guide.</p>
</blockquote>
<p><code>locale</code></p>
<blockquote><p>This setting can override the global site locale for a specific alternative.</p>
<h3id="attachment-types"><code>[attachment_types]</code></h3><p>Lektor does some basic attachment type detection based on file extension. This is what powers the <code>this.attachments.images</code> and <code>this.attachments.videos</code> attributes for instance. If the built-in map does not cover your file extension you can extend it or add new attachment types on a project by project basis.</p>
Please enable JavaScript to view the <ahref="https://disqus.com/?ref_noscript"
rel="nofollow">comments powered by Disqus.</a>
</noscript>
</div>
</div>
</div>
</div>
</div>
<divclass="bottomsummary">
<divclass="container">
</div>
</div>
<footer>
<divclass="container">
<divclass="row">
<divclass="col-sm-4 icon-bar">
<ahref="https://github.com/lektor/lektor/"title="Lektor on GitHub"
><iclass="fa fa-github"></i></a>
<ahref="https://github.com/lektor/lektor/issues/"title="Report Issues for Lektor"
><iclass="fa fa-bug"></i></a>
<ahref="https://twitter.com/getlektor"title="Find Lektor on Twitter"
><iclass="fa fa-twitter"></i></a>
<ahref="https://gitter.im/lektor/lektor"title="Chat on Gitter"
><iclass="fa fa-comment"></i></a>
<ahref="https://github.com/lektor/lektor-website/tree/master/content/docs/project/file/contents.lr"title="View source for this page"><iclass="fa fa-code"></i></a>