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.

[bug]Markdown file with specified layout will render extra text.

See original GitHub issue

Bug report

Markdown file with specified layout will render extra text.

1、Add a new page like pages/test.md

Hello World

<route lang="yaml">
meta:
  layout: home
</route>

2、Can avoid by adding a hidden class:

Hello World

<route lang="yaml" class="hidden">
meta:
  layout: home
</route>

Reproduction repo

vitesse-md-with-layout

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
hannoerucommented, Feb 17, 2021

With vite-plugin-md v0.5.0, now you can write route custom block inside markdown file!!

markdown:

# Hello World

<route lang="yaml">
meta:
  layout: home
</route>
1reaction
hannoerucommented, Feb 16, 2021

You can’t just write custom block to markdown file because it will transform into <template>/* here */</template>, there is a option in vite-plugin-pages call extendRoute, which can add some custom meta using:

// vite.config.js plugin
Pages({
  extendRoute: (route) => {
    if (route.component.endsWith('pages/test.md')) {
      route.meta.layout = 'home'
    }
  }
})
Read more comments on GitHub >

github_iconTop Results From Across the Web

[Bug] Markdown Preview does not load/render ... - GitHub
In the Markdown file, at the preview, the tables are not rendered/loaded. In the HTML file, at the previw, they are rendered/loaded. I'll...
Read more >
Layouts and Rendering in Rails - Ruby on Rails Guides
You can render the default view for a Rails template, or a specific template, or a file, or inline code, or nothing at...
Read more >
Rendering Process | Jekyll • Simple, blog-aware, static sites
Since this stage is determined by the file's extension, Markdown or Sass inside a .html file will remain untouched. Populating the layouts. By...
Read more >
How to Render Plain Text Templates in Ruby on Rails
This controller action will now render our robots.text.erb file regardless of the format requested. We specify layout: false to avoid ...
Read more >
Customizing Book Output - Quarto
This article covers customizing the output of book projects, including how to tailor the styles and appearance of books in each supported output...
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