Skip to content

Commit

Permalink
fix(theme-yun): layout gallery inject markdown content
Browse files Browse the repository at this point in the history
  • Loading branch information
YunYouJun committed Dec 18, 2024
1 parent 58cb6d7 commit 331f1d4
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 17 deletions.
3 changes: 1 addition & 2 deletions demo/yun/pages/albums/sunset.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ date: 2020-04-18 16:27:24
updated: 2020-04-18 16:27:24
layout: gallery
gallery_password: test
time_warning: false
photos:
- caption:
src: https://interactive-examples.mdn.mozilla.net/media/examples/elephant-660-480.jpg
Expand All @@ -29,5 +30,3 @@ photos:
---

- 测试密码:test

{{ frontmatter }}
3 changes: 2 additions & 1 deletion packages/valaxy-theme-press/components/ValaxyMain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ onContentUpdated(() => {
<slot name="main-header-after" />

<slot name="main-content">
<slot name="main-content-before" />

<ValaxyMd class="mx-auto w-full max-w-4xl" :frontmatter="frontmatter">
<h1 v-if="hasSidebar && !isHome && frontmatter.title" :id="frontmatter.title" tabindex="-1">
{{ localeTitle }}
Expand All @@ -69,7 +71,6 @@ onContentUpdated(() => {
<slot name="main-content-md" />
<slot />
</ValaxyMd>

<PressDocFooter v-if="!isHome" class="pb-8 max-w-4xl" w="full" m="auto" />

<slot name="main-content-after" />
Expand Down
4 changes: 3 additions & 1 deletion packages/valaxy-theme-yun/components/ValaxyMain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,16 @@ onContentUpdated(() => {
<slot name="main-header-after" />

<div p="x-4 b-8" class="sm:px-6 lg:px-12 xl:px-16" w="full">
<slot name="main-content-before" />

<slot name="main-content">
<!-- <Transition appear> -->
<ValaxyMd :frontmatter="frontmatter">
<YunAiExcerpt v-if="frontmatter.excerpt_type === 'ai' && frontmatter.excerpt" />
<YunMdTimeWarning />

<slot name="main-content-md" />
<slot />
<slot name="main-content-md" />
</ValaxyMd>
<!-- </Transition> -->
</slot>
Expand Down
24 changes: 11 additions & 13 deletions packages/valaxy-theme-yun/layouts/gallery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,17 @@ const photosLength = computed(() => photos.value.length || galleryRef.value?.pho
:page-title-class="frontmatter.pageTitleClass"
/>
</template>
<template #main-content>
<div text="center" class="yun-text-light" p="2">
{{ t('counter.photos', photosLength || 0) }}
</div>
<div class="page-action" text="center">
<a class="yun-icon-btn" :title="t('accessibility.back')" @click="() => router.back()">
<div i-ri-arrow-go-back-line />
</a>
</div>
<ValaxyGalleryDecrypt v-if="encryptedPhotos" ref="galleryRef" :encrypted-photos="encryptedPhotos" />
<YunGallery v-else :photos="photos" />
<RouterView />
</template>

<div text="center" class="yun-text-light" p="2">
{{ t('counter.photos', photosLength || 0) }}
</div>
<div class="page-action" text="center">
<a class="yun-icon-btn" :title="t('accessibility.back')" @click="() => router.back()">
<div i-ri-arrow-go-back-line />
</a>
</div>
<ValaxyGalleryDecrypt v-if="encryptedPhotos" ref="galleryRef" :encrypted-photos="encryptedPhotos" />
<YunGallery v-else :photos="photos" />
</component>
</RouterView>
</YunLayoutWrapper>
Expand Down
1 change: 1 addition & 0 deletions packages/valaxy/node/plugins/markdown/markdownToVue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export function generateSlots() {
'main-header',
'main-header-after',
'main-nav',
'main-content-before',
'main-content',
'main-content-after',
'main-nav-before',
Expand Down

1 comment on commit 331f1d4

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Published on https://yun.valaxy.site as production
🚀 Deployed on https://6762f07486601d09c236e250--valaxy.netlify.app

Please sign in to comment.