slidevjs / slidev

Presentation Slides for Developers
https://sli.dev
MIT License
31.94k stars 1.26k forks source link

$frontmatter is an empty object #1725

Closed gureckis closed 1 day ago

gureckis commented 4 days ago

Describe the bug

When using the useSlideContext() composable the $frontmatter object is empty.

Minimal reproduction

<script setup>
import { ref, onMounted } from 'vue'
import { useSlideContext } from '@slidev/client'
const { $slidev, $frontmatter, $page } = useSlideContext()

console.log($frontmatter)
onMounted(() => {console.log($frontmatter)})
</script>

output is {} when it should contain information about the front matter for the current slide. See this discussion: https://github.com/slidevjs/slidev/discussions/1671#discussioncomment-9823797

Environment