-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add output_path option - Add 'model' prefix to model options - Generalice loading of options, and add defaults
- Loading branch information
Showing
2 changed files
with
68 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,16 +16,59 @@ git clone [email protected]:rlaverde/lektor-tipue-search.git | |
|
||
## Configurations | ||
|
||
You should add an entry for any model taht you want to be generated into de json file | ||
There are some globals configurations: | ||
|
||
`configs/tipue-search.ini:` | ||
|
||
[blog-post] | ||
title = title | ||
text = summary | ||
tags = tags | ||
output_directory = tipue_search | ||
|
||
|
||
Also you should add an entry for any model that you want to be generated into de json file (it should start by `model`) | ||
|
||
`configs/tipue-search.ini:` | ||
|
||
```ini | ||
[model.blog-post] | ||
title = title | ||
text = summary | ||
tags = tags | ||
``` | ||
|
||
The first part is the json key and the sepcond the model key, i.e the previous configuration correspod to a model: | ||
|
||
`models/blog-post.ini:` | ||
|
||
```ini | ||
[model] | ||
name = Blog Post | ||
|
||
[fields.title] | ||
label = Title | ||
type = string | ||
|
||
[fields.summary] | ||
label = Summary | ||
type = string | ||
|
||
fields.tags] | ||
label = Tags | ||
type = checkboxes | ||
choices = some_tag, another_tag | ||
``` | ||
|
||
and will generate a json file (for each alternative): | ||
|
||
`tipue_search/tipue_search_en.ini:` | ||
|
||
```json | ||
[{"url": "/blog/example", | ||
"text": "This is the blog Summary", | ||
"title": "Blog Example", | ||
"tags": ["example", "some_tag"]}, | ||
|
||
] | ||
``` | ||
|
||
## Usage | ||
|
||
```bash | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters