refactor viewtranstion config option from disableViewTransitions default: false to useViewTransitions with default:true

This commit is contained in:
Adam Matthiesen 2024-03-12 14:46:09 -07:00
parent f535a4720f
commit c1e6e7ede2
3 changed files with 5 additions and 5 deletions

View File

@ -54,7 +54,7 @@ export default defineConfig({
astroHashnode({ astroHashnode({
hashnodeURL: 'astroplayground.hashnode.dev', // Your hashnode URL hashnodeURL: 'astroplayground.hashnode.dev', // Your hashnode URL
landingPage: true, // Lets you disable the default landing page! landingPage: true, // Lets you disable the default landing page!
disableViewTransitions: false, // Lets you disable the Default included ViewTransitions. useViewTransitions: true, // Lets you enable/disable the default included ViewTransitions.
layoutComponent: './src/layouts/YourLayout.astro' // Lets you change the default Layout.astro being used by the Integration Pages. layoutComponent: './src/layouts/YourLayout.astro' // Lets you change the default Layout.astro being used by the Integration Pages.
verbose: false // Change to Verbose console output verbose: false // Change to Verbose console output
}) })

View File

@ -9,7 +9,7 @@ import type { AstroHashnodeLayoutProps } from '../proptypes/layouttypes'
import { ViewTransitions } from 'astro:transitions'; import { ViewTransitions } from 'astro:transitions';
import config from "virtual:astro-hashnode/config"; import config from "virtual:astro-hashnode/config";
const useTranstions:boolean = !config.disableViewTransitions; const useTranstions = config.useViewTransitions;
const pubData = await getPublication(); const pubData = await getPublication();

View File

@ -16,11 +16,11 @@ export const optionsSchema = z.object({
*/ */
landingPage: z.boolean().default(true), landingPage: z.boolean().default(true),
/** /**
* Allows the user to disable the Astro ViewTransitions component. * Allows the user to enable/disable the Astro ViewTransitions component.
* @default false * @default true
* @see https://docs.astro.build/en/guides/view-transitions/ for more information about ViewTransitions * @see https://docs.astro.build/en/guides/view-transitions/ for more information about ViewTransitions
*/ */
disableViewTransitions: z.boolean().default(false), useViewTransitions: z.boolean().default(true),
/** /**
* Allows the user to change the layout component used for Astro-Hashnode pages. * Allows the user to change the layout component used for Astro-Hashnode pages.
*/ */