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.

File-based layouts

See original GitHub issue

A common MDsveX use case is to use it to render blog posts in Svelte Kit. When creating layouts for these pages, you have to dig into the MDsveX config to bind the layout to a specific file. This becomes more complex when you consider the case with multiple layouts, where each .svx file would have to specify its layout in the front matter.

Svelte Kit has engineered up a solution for regular page layouts, by using a specific file name $layout.svelte __layout.svelte to bind to the layout for that route. It would be great to have MDsveX implement something similar for its layouts. This would greatly simplify configuration for the most common use cases.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:4
  • Comments:21 (7 by maintainers)

github_iconTop GitHub Comments

6reactions
furudeancommented, Apr 27, 2021

That’s what I had in mind – it seems like an obvious compliment to Svelte Kit’s router. I’m open to other suggestions though!

3reactions
ngxingyucommented, May 9, 2021

Just discovered that the layout files for mdsvex doesn’t support typescript (It resulted in a ParseError: Unexpected token) but using javascript works perfectly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Understanding File Layouts - Oracle Help Center
File layouts work with hierarchical and nonhierarchical data, and they can handle files that combine data records with nondata (audit or control) records....
Read more >
NAEP Database - Data File Layouts
The data file layout is a printable file that lists the name, position, format, and description of each data variable on the corresponding ......
Read more >
File Layouts - Apache Hudi
The following describes the general file layout structure for Apache Hudi. Hudi organizes data tables into a directory structure under a base path...
Read more >
Layouts - Android Developers
A layout defines the visual structure for a user interface, such as the UI for an activity or app widget . You can...
Read more >
Record Layouts - Census Bureau
The record layout for the Census Tract to Military Area relationship file which is a nation-based tabular file. 2010 Census Urban Area Lists ......
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