Use getRelativeLink
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
---
|
||||
import { Icon } from 'astro-icon';
|
||||
import { getPermalink } from '~/utils/permalinks';
|
||||
import { getRelativeLink } from '~/utils/permalinks';
|
||||
const { prevUrl, nextUrl, prevText = 'Newer posts', nextText = 'Older posts' } = Astro.props;
|
||||
---
|
||||
|
||||
@ -9,8 +9,8 @@ const { prevUrl, nextUrl, prevText = 'Newer posts', nextText = 'Older posts' } =
|
||||
<div class="container flex">
|
||||
<div class="flex flex-row mx-auto container justify-between">
|
||||
<a
|
||||
href={getPermalink(prevUrl, 'raw')}
|
||||
class={`btn px-2 font-medium text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white shadow-none mr-2
|
||||
href={getRelativeLink(prevUrl)}
|
||||
class={`btn px-3 font-medium text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white border-none mr-2
|
||||
${!prevUrl ? 'invisible' : ''}`}
|
||||
>
|
||||
<div class="flex flex-row align-middle">
|
||||
@ -19,8 +19,8 @@ const { prevUrl, nextUrl, prevText = 'Newer posts', nextText = 'Older posts' } =
|
||||
</div>
|
||||
</a>
|
||||
<a
|
||||
href={getPermalink(nextUrl, 'raw')}
|
||||
class={`btn px-2 font-medium text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white shadow-none ${
|
||||
href={getRelativeLink(nextUrl)}
|
||||
class={`btn px-3 font-medium text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white border-none ${
|
||||
!nextUrl ? 'invisible' : ''
|
||||
}`}
|
||||
>
|
||||
|
Reference in New Issue
Block a user