Skip to content

Commit ebe5e27

Browse files
authored
fix: remove filepaths when building (#1692)
1 parent e04edda commit ebe5e27

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

packages/client/pages/overview.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ onMounted(() => {
165165
<carbon:presentation-file />
166166
</IconButton>
167167
<IconButton
168-
v-if="route.meta?.slide"
168+
v-if="__DEV__ && route.meta?.slide"
169169
class="mr--3 op0 group-hover:op80"
170170
title="Open in editor"
171171
@click="openInEditor(`${route.meta.slide.filepath}:${route.meta.slide.start}`)"

packages/slidev/node/commands/shared.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ function escapeHtml(unsafe: unknown) {
3232
)
3333
}
3434

35-
export async function getIndexHtml({ entry, clientRoot, roots, data }: ResolvedSlidevOptions): Promise<string> {
35+
export async function getIndexHtml({ mode, entry, clientRoot, roots, data }: ResolvedSlidevOptions): Promise<string> {
3636
let main = await fs.readFile(join(clientRoot, 'index.html'), 'utf-8')
3737
let head = ''
3838
let body = ''
3939

4040
const { info, author, keywords } = data.headmatter
4141
head += [
4242
`<meta name="slidev:version" content="${version}">`,
43-
`<meta charset="slidev:entry" content="${slash(entry)}">`,
43+
mode === 'dev' && `<meta charset="slidev:entry" content="${slash(entry)}">`,
4444
`<link rel="icon" href="${data.config.favicon}">`,
4545
`<title>${getSlideTitle(data)}</title>`,
4646
info && `<meta name="description" content=${escapeHtml(info)}>`,

packages/slidev/node/vite/loaders.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ export function createSlidesLoader(
333333
slide: {
334334
...(${JSON.stringify(slideBase)}),
335335
frontmatter,
336-
filepath: ${JSON.stringify(slide.source.filepath)},
336+
filepath: ${JSON.stringify(mode === 'dev' ? slide.source.filepath : '')},
337337
start: ${JSON.stringify(slide.source.start)},
338338
id: ${pageNo},
339339
no: ${no},

0 commit comments

Comments
 (0)