게시물 광고 배치 조정

This commit is contained in:
2026-06-05 16:32:29 +09:00
parent cc9e5949fa
commit 629ef8c4c6
16 changed files with 129 additions and 31 deletions

View File

@@ -7,6 +7,13 @@ defineProps({
})
const { isDarkMode, toggleTheme } = useThemeMode()
const route = useRoute()
const { data: siteSettings } = await useFetch('/api/site-settings', {
default: () => ({
adPostSidebarCode: ''
})
})
const { data: tags } = await useFetch('/api/tags', {
default: () => []
@@ -22,6 +29,7 @@ const { data: navigation } = await useFetch('/api/navigation', {
/** 저자 영역 공개 여부 */
const showAuthorSection = false
const isPostDetailRoute = computed(() => route.path.startsWith('/post/'))
const STORAGE_KEY = 'sori-primary-nav-expanded'
@@ -193,6 +201,13 @@ onMounted(() => {
</div>
</div>
</div>
<SiteAdSlot
v-if="isPostDetailRoute"
class="left-sidebar__post-ad-slot site-sidebar-section px-5 py-5 pr-3 max-lg:hidden xl:pl-0"
:code="siteSettings?.adPostSidebarCode"
location="post-sidebar-left"
/>
</div>
<footer class="left-sidebar__footer flex shrink-0 flex-wrap items-center justify-between gap-x-3 gap-y-2 px-4 py-4 text-xs sm:px-5">

View File

@@ -39,6 +39,7 @@ const recommendedSites = computed(() => {
return list.filter((x) => x?.isVisible !== false)
})
const isPostDetailRoute = computed(() => route.path.startsWith('/post/'))
const sidebarAdCode = computed(() => isPostDetailRoute.value ? '' : siteSettings.value?.adSidebarCode)
const postTocItems = computed(() => Array.isArray(postToc.value) ? postToc.value : [])
const followLinks = computed(() => getVisibleSocialLinks(siteSettings.value?.socialLinks || []))
@@ -489,7 +490,7 @@ watch([postTocItems, () => route.fullPath], async () => {
<SiteAdSlot
class="right-sidebar__ad-slot site-sidebar-section py-5 pl-5 pr-0 max-lg:px-0"
:code="siteSettings?.adSidebarCode"
:code="sidebarAdCode"
location="sidebar"
/>
</div>