Giter Club home page Giter Club logo

lektor-static-search's Introduction

lektor-static-search

This is under development

This is a plugin for Lektor that adds support for static search to projects. When enabled it can generate json files in the static-search/ folder automatically when the server (or build process) is run with the -f static-search flag.

This json files can be used with js libraries like Tipue search or Lurn.js.

Enabling the Plugin

To enable the plugin add this to your project file, run this command while sitting in your Lektor project directory:

lektor plugins add lektor-static-search

Configurations

There are some globals configurations:

configs/static-search.ini:

output_directory = static_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/static-search.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:

[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):

static_search/static_search_en.json:

[{"url": "/blog/example",
"text": "This is the blog Summary",
"title": "Blog Example",
"tags": ["example", "some_tag"]},

]

Usage

lektor build -f static-search

lektor-static-search's People

Contributors

rlaverde avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

lektor-static-search's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.