Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make extensions optional in frontmatter's layout: blah.liquid field #376

Closed
Geobert opened this issue Jan 28, 2018 · 6 comments
Closed

Make extensions optional in frontmatter's layout: blah.liquid field #376

Geobert opened this issue Jan 28, 2018 · 6 comments
Labels
question Uncertainty is involved

Comments

@Geobert
Copy link
Contributor

Geobert commented Jan 28, 2018

At the moment, .liquid extension is mandatory.

Is there any reason for this?

Again, converting from Jekyll where the layout are often .html and no extensions are specified in the front make the converted post failing.

Suggestion for the Liquid error message:
Caused by: Layout post can not be read (defined in "posts/2017-05-03-scary-pockets.html"): The system cannot find the file specified. (os error 2)

add quotes around the name of the layout:
Caused by: Layout "post" can not be read (defined in "posts/2017-05-03-scary-pockets.html"): The system cannot find the file specified. (os error 2)

It took me a while to spot the error here ^^'

@epage epage changed the title Can we drop the ".liquid" extension in layout? Make extensions optional in frontmatter's layout: blah.liquid field Jan 29, 2018
@epage
Copy link
Member

epage commented Jan 29, 2018

This looks like two separate issues

  • Required extension:
    • Besides conversion, what value do we gain by this?
    • Could we add extensions in the converter?
  • Error improvements: this seems reasonable

@Geobert
Copy link
Contributor Author

Geobert commented Jan 29, 2018

I'll ask the question the other way: why extension is mandatory?
Even outside the conversion scenario, using cobalt and having to type .liquid for all layouts field seems useless. Or am I missing something?

@epage
Copy link
Member

epage commented Jan 29, 2018

  • What would be the desired behavior? Do we create a hard coded list of supported extensions and try them all? Do we use template_extensions? Do we just enumerate the directory, dropping extensions from every file?
  • Maybe its just me but there is a certain level of appeal to explicitness
  • Not having to do all of that is easier to document, validate, and avoids yet another performance papercut.

@Geobert
Copy link
Contributor Author

Geobert commented Jan 29, 2018

Not having to do all of that is easier to document, validate, and avoids yet another performance papercut.

hm fair enough :)

Let's add extension into the converter then, but I need to make my though clear on the subject, because Jekyll's theme uses .html as extension. I'll do this when I'll tackle the theme conversion subject

@epage
Copy link
Member

epage commented Mar 4, 2018

With #388, we are no eagerly loading all layouts. One way to improve the error messages is to use an ngram crate to find typos.

@epage
Copy link
Member

epage commented Aug 31, 2018

For errors, I created cobalt-org/liquid-rust#184

For migration, I created cobalt-org/cobalt-migrate-jekyll#1

@epage epage closed this as completed Aug 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Uncertainty is involved
Projects
None yet
Development

No branches or pull requests

2 participants