is there any way to get the processed or raw strin...
# kobweb
c
is there any way to get the processed or raw string of markdown files content ? i'd love to get them just like this
Copy code
val markdownContent = ctx.markdown!!.frontMatter["content"]
or even better, if, I can have this:
Copy code
@Layout
@Composable
fun MarkdownLayout(content: (String) -> Unit)
beside this:
Copy code
@Layout
@Composable
fun MarkdownLayout(content: @Composable () -> Unit)
d
Since this was asked in the Discord as well, I'll copy answers here. (I probably won't keep the conversation in sync though past this point)
I don't think there's anything built in but you can access them during build time and e.g. generate a class for each md file containing the raw content https://kobweb.varabyte.com/docs/concepts/foundation/markdown#iterating-over-all-markdown-files https://kobweb.varabyte.com/docs/guides/generating-code
Yeah we intentionally don't expose the text because that would increase the size of the final site. I haven't tried but you might also be able to put the markdown files under the public directory (and change the markdown path root)? That way you could fetch the file dynamically from your server and avoid baking all that text into your output js