question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

support alternative file formats for content, besides '.lr' (was: support Markdown with YAML Front Matter)

See original GitHub issue

There is a common, widely used data format for static site generators known as “Markdown with YAML Front Matter”. The contents.lr format is almost the same, with some key differences. If Lektor supported Markdown with YAML Front Matter, then all sorts of other tools like editors, syntax highlighters, translation tools, etc will automatically support the Lektor files. They could be called contents.md, for example.

This is a file from a Lektor site:

section: localization
---
section_id: localization
---
color: primary
---
_template: layout.html
---
title: Localization
---
subtitle: We want Tor to work for everyone in the world, which means our software must be translated into a lot of languages.
---
cta: Help us translate
---
key: 4
---
html: localization.html
---
body:

##Localization is how we reach a global community.

In order for Tor to work for everyone, it needs to speak everyone's languages.
Our volunteer translation team works hard to make this a reality, and we can always use more help.
Our current translation priorities are translating [Tor Browser](https://torpat.ch/locales), Tor Browser documentation, and the [Tor Project website](https://torpat.ch/tpo-locales), but there are many other documents that we could use help translating as well.

In Markdown with YAML Front Matter, it would look like this:

---
section: localization
section_id: localization
color: primary
_template: layout.html
title: Localization
subtitle: We want Tor to work for everyone in the world, which means our software must be translated into a lot of languages.
cta: Help us translate
key: 4
html: localization.html
---

##Localization is how we reach a global community.

In order for Tor to work for everyone, it needs to speak everyone's languages.
Our volunteer translation team works hard to make this a reality, and we can always use more help.
Our current translation priorities are translating [Tor Browser](https://torpat.ch/locales), Tor Browser documentation, and the [Tor Project website](https://torpat.ch/tpo-locales), but there are many other documents that we could use help translating as well.

Here are some docs on the format:

And here are many libraries which support this format:

@uniqx

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:17 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
nixjdmcommented, Apr 20, 2020

move us away from the file format holy wars

Amen.

Seriously though, having a standardized entry point seems like a good refactor to me, and it might be inroads into implementing #477 and ingesting bulk content.

It’s also worth repeating I think that people can set their IDEs to a Markdown mode and immediately get syntax highlighting for their markdown fields in a .lr file. I’d bet that’s really the driver for a lot of people reading this. Go ahead and do this now if you’re one of those people. 🙂

0reactions
xlotlucommented, Apr 20, 2020

Seriously though, having a standardized entry point seems like a good refactor to me, and it might be inroads into implementing #477 and ingesting bulk content.

@nixjdm I think I want to give this a crack. If you have some pointers, they’re welcome.

It’s also worth repeating I think that people can set their IDEs to a Markdown mode and immediately get syntax highlighting for their markdown fields in a .lr file.

The point of editing them has also come up (#745). Tools that deal with md+fm obviously mess the lr up.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Support YAML front matter in Markdown files #207 - GitHub
YAML is often prepended to markdown files to provide structured metadata. This "front matter" pattern is commonly implemented by static site ...
Read more >
Front Matter - Hugo
Hugo supports four formats for front matter, each with their own identifying tokens. TOML: identified by opening and closing +++ . YAML: identified...
Read more >
formatting a markdown file scrambles the yaml frontmatter.
Here is a sample file before formatting. Before formatting. Here is the same file after formatting. (by pressing Alt + Ctrl + L...
Read more >
YAML front matter - Assemble.io
YFM is an optional section of valid YAML that is placed at the top of a page and is used for maintaining metadata...
Read more >
Front Matter | Jekyll • Simple, blog-aware, static sites
Any file that contains a YAML front matter block will be processed by Jekyll as a special file. The front matter must be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found