vitepress icon indicating copy to clipboard operation
vitepress copied to clipboard

Empty Layout option

Open darkmasta opened this issue 2 years ago • 4 comments

Is your feature request related to a problem? Please describe.

I want to create a landing page for a documentation and I dont any layout option. How can I create a landing that points to a Vue component directly?

Describe the solution you'd like

---
layout: none
---

<Landing />
 
<script setup>
import Landing from "./components/Landing.vue"

</script>

Describe alternatives you've considered

No response

Additional context

No response

Validations

darkmasta avatar Aug 01 '22 08:08 darkmasta

layout: page ?

brc-dd avatar Aug 01 '22 08:08 brc-dd

I dont want header too. layout: page brings header to top.

darkmasta avatar Aug 01 '22 08:08 darkmasta

I dont want header too. layout: page brings header to top.

Ah, okay! We should probably add some option to hide nav and footer as well (PRs are welcome). For now you can do something like this inside your Landing component:

<script setup>
import { onMounted, onUnmounted } from 'vue'
onMounted(() => {
  document.body.classList.add('no-nav')
})
onUnmounted(() => {
  document.body.classList.remove('no-nav')
})
</script>

<style>
.no-nav .VPNav {
  display: none;
}
</style>

brc-dd avatar Aug 01 '22 09:08 brc-dd

I understand strict layout options in inner docs but landing should be very customizable. Just for landing this feature request is kinda needful.

darkmasta avatar Aug 01 '22 09:08 darkmasta