Skip to content

Commit

Permalink
Fix support for Slidev 0.48
Browse files Browse the repository at this point in the history
  • Loading branch information
MuTsunTsai committed Mar 16, 2024
1 parent bb88ba3 commit 77829d0
Show file tree
Hide file tree
Showing 5 changed files with 1,751 additions and 1,675 deletions.
8 changes: 5 additions & 3 deletions components/Frankfurt.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
<script setup lang="ts">
import { computed } from "vue";
import type { SlideInfoBase } from "@slidev/types";
const sections = computed(() => {
const result: [string, number[]][] = [];
let pages: number[] = [];
let title = "";
for(let i = 1; i < $slidev.nav.rawRoutes.length; i++) {
const route = $slidev.nav.rawRoutes[i];
const section = route.meta?.slide?.frontmatter?.section;
for(let i = 1; i < $slidev.nav.slides.length; i++) {
const slide = $slidev.nav.slides[i];
const section = (slide.meta?.slide as SlideInfoBase)?.frontmatter?.section;
if(section) {
if(pages.length > 0) result.push([title, pages]);
pages = [];
Expand Down
9 changes: 9 additions & 0 deletions components/slidev.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ declare global {

declare module 'vue' {
interface ComponentCustomProperties {
$slidev: UnwrapNestedRefs<SlidevContext>;
$renderContext: string;
}
}

declare module '@slidev/types' {
interface SlidevConfig {
infoLine?: boolean;
date?: string;
author?: string;
}
}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
"screenshot": "slidev export example.md --per-slide --format png --output screenshots"
},
"dependencies": {
"@slidev/types": "^0.43.14",
"@slidev/types": "^0.48.3",
"codemirror-theme-vars": "^0.1.2",
"prism-theme-vars": "^0.2.4",
"theme-vitesse": "^0.7.3"
"theme-vitesse": "^0.7.7"
},
"devDependencies": {
"@slidev/cli": "^0.43.14",
"playwright-chromium": "^1.39.0"
"@slidev/cli": "^0.48.3",
"playwright-chromium": "^1.42.1"
},
"//": "Learn more: https://sli.dev/themes/write-a-theme.html",
"slidev": {
Expand Down
Loading

0 comments on commit 77829d0

Please sign in to comment.