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

Automatically route & render markdown files #70

Closed
snellingio opened this issue Aug 8, 2023 · 1 comment
Closed

Automatically route & render markdown files #70

snellingio opened this issue Aug 8, 2023 · 1 comment

Comments

@snellingio
Copy link

Originally from a tweet: https://twitter.com/snellingio/status/1688646569157939201?s=20

Followed up with a pitch inside the internals discord.

Putting this here as a placeholder for a PR.

Currently: To render a markdown file, you need to wrap in a .blade.php. So, to render something like a post, or a terms of service, etc, you end up needing a blade file.

pages
└── terms-of-service.blade.php

And the content would look something like

<x-layouts.app title="Terms of Service">
<x-markdown>
# Terms of Service

[...]
</x-markdown>
</x-layouts.app>

What I really want to do is just have a markdown file.

pages
└── terms-of-service.md

And the content could use YAML front matter (as is the standard in other page / routing frameworks) to pass in blade options. The actual content would go into the $slot variable as one would expect.

---
component: x-layouts.app
title: Terms of Service
---

# Terms of Service

[...]

Unsure if it would be best named as component or layout but that's all I would really need to wrap it all up.

This has a lot of benefits, from cross-platform drag and drop, to editor preview rendering!

@driesvints driesvints changed the title Automatically route & render markdown files. Automatically route & render markdown files Aug 8, 2023
@driesvints
Copy link
Member

It seems you already sent in a PR so let's see how it goes 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants