The template by default matches the model name but it can be overridden on a per-page basis. So how is the model selected? Either explicitly in the contents. Lektor will select the default model based on trying things in this order:.
The template is always the name of the model with. So now it's time to talk about the content file. The content file is just a UTF-8 encoded text file with the. It can be edited with any text editor that supports UTF-8 as character encoding. This file consists of multiple data fields according to the model. The format is very simple:. Fields are separated by three dashes and follow the format key: value. For values with multiple lines it's recommended to insert two newlines after the key.
The format of each field is specific to how the model is configured. In your command prompt enter:. Lektor will ask you a few questions to get your project started. For the purposes of this tutorial, name your project Netlify-Lektor. You can change the settings to meet your needs. Lektor has a built-in server that allows you to see your work as you tweak things to your liking.
This launches an instance of your project at localhost Go ahead and open it up. Click the pencil in the upper right hand to launch the admin panel. In the left hand column, you will see the actions you can use to edit the page, as well as sub pages that you can navigate to and then edit as well. To see some of the things you can do with Lektor including changing text input fields , the Lektor team has created a basic video walkthrough to get you started. Next up you probably want to ensure that our versions of Python and Lektor match yours!
This will attempt to install lektor in your user's HOME. If you want a system-wide installation, try this instead:. Alternatively you can manually install the command line version with virtualenv if you know how that works. Note that this method is heavily discouraged for anything other than advanced use cases such as build servers. When we say this installation type is discouraged we mean it. The reason is that it encourages uses of Lektor which are entirely unsupported by us. Lektor actively manages virtualenvs for plugin installations in very specific ways and this might or might not work in your setup.
0コメント