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.

Importing a .svx file in another .svx file overwrites frontmatter data

See original GitHub issue

I am trying to use one .svx page as a component in another one, but then the frontmatter data defined in the imported one (even if it doesn’t have any) removes any frontmatter data defined in the page that imports it. What should I do to properly import a svx file in another?

Using Sapper v0.28.0, MDsveX v0.8.6, Svelte v3.24, and Rollup v2.18.2

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
aabounegmcommented, Sep 2, 2020

Yes, that fixed it! Thank you very much. Your help and response time is highly appreciated! 😄

1reaction
aabounegmcommented, Sep 1, 2020

Wow, that was extremely helpful. Thanks for taking the time and effort to explain all of this! I tried to go with the last of the options you mentioned since it’s the most relevant (as having layout: false in the md file defeats the purpose of wanting to remove the frontmatter from it, and adding layout: docs in all other files is not really feasible), but it didn’t work. All I did was remove the frontmatter from CHANGELOG.md and make the layout option an object exactly as you suggested:

layout: {
  docs: './src/mdsvex/layout.svelte'
}

but then it doesn’t get applied anywhere, except if I explicitly specify layout: docs in the frontmatter of the svx files. I tried other options for the layout name (like src, routes, components, …), but they all only work if I explicitly specify the layout in the svx and not through the folder name. Is this exactly how you tested it? You can see exactly what I have on this branch: https://github.com/illright/attractions/tree/docs/hotfix/styles Again, I’m very grateful for your dedication to trying it on my app 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Contents of .svx files: How do I? - Survex
This data demonstrates a number of useful features of Survex: Legs can be measured either way round, which allows the use of techniques...
Read more >
MDsveX - Adding Interactivity with Svelte Components in ...
The Svelte component code should be saved in a .svx file to be recognized as a mdsvex file – that default choice can...
Read more >
rollup-plugin-mdsvex-pages - npm package - Snyk
mdsvex-pages will automatically generate svelte-spa-router routes and convert the markdown files into parseable svelte files to be bundled.
Read more >
mdsvex docs!
Combine svelte and markdown in the same file. ... Using mdsvex with other things ... and tell the Svelte plugin or loader to...
Read more >
Obsidian Plugin Stats
Focus file explorer on chosen folder and its files and subdirectories, while hiding all the other elements. favorite. share.
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