NavBarTitle.vue 702 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <script setup lang="ts">
  2. import { withBase, useData } from 'vitepress'
  3. const { site, theme, localePath } = useData()
  4. </script>
  5. <template>
  6. <a
  7. class="nav-bar-title"
  8. :href="localePath"
  9. :aria-label="`${site.title}, back to home`"
  10. >
  11. <img
  12. v-if="theme.logo"
  13. class="logo"
  14. :src="withBase(theme.logo)"
  15. alt="Logo"
  16. />
  17. {{ site.title }}
  18. </a>
  19. </template>
  20. <style scoped>
  21. .nav-bar-title {
  22. font-size: 1.3rem;
  23. font-weight: 600;
  24. color: var(--c-text);
  25. display: flex;
  26. justify-content: center;
  27. align-items: center;
  28. }
  29. .nav-bar-title:hover {
  30. text-decoration: none;
  31. }
  32. .logo {
  33. margin-right: 0.75rem;
  34. height: 1.3rem;
  35. vertical-align: bottom;
  36. }
  37. </style>