Skip to content

Plugin for lektor to get markdown content from a separate markdown file

License

Notifications You must be signed in to change notification settings

tealok-tech/lektor-markdown-from-file

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

markdown-from-file

This is a simple plugin to make it possible to put your markdown in a separate file within lektor.

Usage

First, change your model so that you are using the markdown-file field.

Original page.ini:

[fields.body]
label = Body
type = markdown

Update to look like this:

[fields.body]
label = Body
type = markdown-file
file = _contents.md

Next, put your Markdown content in a separate file called _contents.md. Your contents.lr file is likely to be very short and just contain metadata

contents.lr:

title: An example of markdown in a file
---
body:

_contents.md:

# Title

This is a Markdown file. Yay!

From there, build as normal.

FAQ

Does it have to be _contents.md?

No, you can configure it to anything you want in the page.ini (or whatever model config file you're using). Just remember that we are relying on the default pattern for the default exclusion pattern for attachments to avoid uploading the Markdown source on deployment.

About

Plugin for lektor to get markdown content from a separate markdown file

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages