File tree Expand file tree Collapse file tree 4 files changed +18
-23
lines changed Expand file tree Collapse file tree 4 files changed +18
-23
lines changed Original file line number Diff line number Diff line change 1
- ---
2
- import { CONFIG_SERVER } from ' @/config/server' ;
3
-
4
- const isProd = CONFIG_SERVER .NODE_ENV === ' production' ;
5
-
6
- // component just for debugging responsive styles
7
- ---
8
-
9
- {
10
- ! isProd && (
11
- <div class = " fixed top-24 right-4 z-50 flex size-8 p-3 items-center justify-center rounded-full text-base-100 bg-content text-sm font-mono" >
12
- <div class = " block xs:hidden" >2xs</div >
13
- <div class = " hidden xs:block sm:hidden" >xs</div >
14
- <div class = " hidden sm:block md:hidden" >sm</div >
15
- <div class = " hidden md:block lg:hidden" >md</div >
16
- <div class = " hidden lg:block xl:hidden" >lg</div >
17
- <div class = " hidden xl:block 2xl:hidden" >xl</div >
18
- <div class = " hidden 2xl:block" >2xl</div >
19
- </div >
20
- )
21
- }
1
+ <div
2
+ class =" fixed top-24 right-4 z-50 flex size-8 p-3 items-center justify-center rounded-full text-base-100 bg-content text-sm font-mono"
3
+ >
4
+ <div class =" block xs:hidden" >2xs</div >
5
+ <div class =" hidden xs:block sm:hidden" >xs</div >
6
+ <div class =" hidden sm:block md:hidden" >sm</div >
7
+ <div class =" hidden md:block lg:hidden" >md</div >
8
+ <div class =" hidden lg:block xl:hidden" >lg</div >
9
+ <div class =" hidden xl:block 2xl:hidden" >xl</div >
10
+ <div class =" hidden 2xl:block" >2xl</div >
11
+ </div >
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import Footer from '@/components/Footer.astro';
6
6
import Header from ' @/components/Header.astro' ;
7
7
import ScrollToTop from ' @/components/react/ScrollToTop' ;
8
8
import Breakpoints from ' @/components/utils/breakpoints.astro' ;
9
+ import { isProd } from ' @/utils/environment' ;
9
10
10
11
import type { BaseHeadProps } from ' @/components/BaseHead.astro' ;
11
12
@@ -27,6 +28,6 @@ const { metadata } = Astro.props as BaseProps;
27
28
<Icon name =" mdi:arrow-up-thin" class =" h-10 w-10 text-content hover:text-links-hover" />
28
29
</ScrollToTop >
29
30
30
- <Breakpoints />
31
+ { ! isProd && <Breakpoints />}
31
32
</body >
32
33
</html >
Original file line number Diff line number Diff line change 1
1
import { getCollection } from 'astro:content' ;
2
2
3
+ import { isProd } from '@/utils/environment' ;
3
4
import { isPreviewMode } from '@/utils/preview' ;
4
5
5
6
import type { CollectionEntry , CollectionKey } from 'astro:content' ;
@@ -24,7 +25,7 @@ export const getAllEntries = async <T extends CollectionKey>(
24
25
const { skipSort = false , includeDrafts = isPreviewMode ( ) } = options ?? { } ;
25
26
26
27
const entries = await getCollection < T > ( collectionName , ( { data } ) => {
27
- const isProdAndDraft = import . meta . env . PROD && data . draft ;
28
+ const isProdAndDraft = isProd && data . draft ;
28
29
return ! isProdAndDraft || includeDrafts ;
29
30
} ) ;
30
31
Original file line number Diff line number Diff line change
1
+ import { CONFIG_SERVER } from '@/config/server' ;
2
+
3
+ export const isProd = CONFIG_SERVER . NODE_ENV === 'production' ;
You can’t perform that action at this time.
0 commit comments