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

How to do a post frontmatter prop mapping step? #675

Open
L0laapk3 opened this issue Dec 1, 2024 · 0 comments
Open

How to do a post frontmatter prop mapping step? #675

L0laapk3 opened this issue Dec 1, 2024 · 0 comments

Comments

@L0laapk3
Copy link

L0laapk3 commented Dec 1, 2024

My goal is to perform some additional server-side parsing on the props. So far I have this working 'solution', which required hacking in an export for default_frontmatter:

svelte.config.js

const config = {
	preprocess: [
		mdsvex({
			frontmatter: {
				type: 'yaml',
				marker: '-',
				parse: function(value, messages) {
					let result = default_frontmatter(value, messages);
					result = propMap(result); // the magic
					return propMap(result);
				}
			},
		}),
	]
}

How do I achieve something like this without having to patch mdsvex?

@github-project-automation github-project-automation bot moved this to Triage + Refine in mdsvex Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Triage + Refine
Development

No branches or pull requests

1 participant