Skip to content

Commit cbf19fc

Browse files
authored
Merge pull request #165
bump/v2.3.0-rc3
2 parents 1f9574f + dab57f8 commit cbf19fc

File tree

6 files changed

+38
-931
lines changed

6 files changed

+38
-931
lines changed

.yarn/install-state.gz

-1.66 MB
Binary file not shown.

.yarn/releases/yarn-4.1.1.cjs

-893
This file was deleted.

bun.lockb

29.3 KB
Binary file not shown.

package.json

+28-30
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,43 @@
11
{
22
"name": "gatsbyan",
33
"description": "My personal blog powered by Gatsby JS",
4-
"version": "2.2.0",
4+
"version": "2.3.0",
55
"author": "Ferry",
66
"dependencies": {
7-
"algoliasearch": "^4.22.1",
8-
"bootstrap": "^5.3.2",
9-
"date-fns": "^3.3.1",
10-
"gatsby": "^5.13.3",
7+
"algoliasearch": "^5.18.0",
8+
"bootstrap": "^5.3.3",
9+
"gatsby": "^5.14.1",
1110
"gatsby-plugin-algolia": "^1.0.3",
12-
"gatsby-plugin-catch-links": "^5.13.1",
11+
"gatsby-plugin-catch-links": "^5.14.0",
1312
"gatsby-plugin-google-analytics-data-reporting-api": "^2.0.1",
14-
"gatsby-plugin-google-gtag": "^5.13.1",
15-
"gatsby-plugin-image": "^3.13.1",
16-
"gatsby-plugin-manifest": "^5.13.1",
17-
"gatsby-plugin-offline": "^6.13.1",
13+
"gatsby-plugin-google-gtag": "^5.14.0",
14+
"gatsby-plugin-image": "^3.14.0",
15+
"gatsby-plugin-manifest": "^5.14.0",
16+
"gatsby-plugin-offline": "^6.14.0",
1817
"gatsby-plugin-purgecss": "^6.2.1",
19-
"gatsby-plugin-sharp": "^5.13.1",
20-
"gatsby-plugin-sitemap": "^6.13.1",
21-
"gatsby-remark-images-contentful": "^6.13.1",
22-
"gatsby-remark-link-on-headers": "^1.1.2",
23-
"gatsby-remark-prismjs": "^7.13.1",
24-
"gatsby-source-contentful": "^8.13.1",
25-
"gatsby-source-filesystem": "^5.13.1",
26-
"gatsby-transformer-remark": "^6.13.1",
27-
"gatsby-transformer-sharp": "^5.13.1",
18+
"gatsby-plugin-sharp": "^5.14.0",
19+
"gatsby-plugin-sitemap": "^6.14.0",
20+
"gatsby-remark-images-contentful": "^6.14.0",
21+
"gatsby-remark-link-on-headers": "^1.1.3",
22+
"gatsby-remark-prismjs": "^7.14.0",
23+
"gatsby-source-contentful": "^8.15.0",
24+
"gatsby-source-filesystem": "^5.14.0",
25+
"gatsby-transformer-remark": "^6.14.0",
26+
"gatsby-transformer-sharp": "^5.14.0",
2827
"medium-zoom": "^1.1.0",
2928
"prismjs": "^1.29.0",
30-
"react": "^18.2.0",
31-
"react-dom": "^18.2.0",
32-
"react-icons": "^5.0.1",
33-
"react-instantsearch": "^7.5.3"
29+
"react": "^18.3.1",
30+
"react-dom": "^18.3.1",
31+
"react-icons": "^5.4.0",
32+
"react-instantsearch": "^7.13.9"
3433
},
3534
"devDependencies": {
36-
"@types/node": "^20.11.8",
37-
"@types/react": "^18.2.48",
38-
"@types/react-dom": "^18.2.18",
39-
"dotenv": "^16.4.1",
40-
"prettier": "^3.2.4",
41-
"typescript": "^5.3.3",
42-
"yarn-upgrade-all": "^0.7.2"
35+
"@types/node": "^22.10.4",
36+
"@types/react": "^18.3.18",
37+
"@types/react-dom": "^18.3.5",
38+
"dotenv": "^16.4.7",
39+
"prettier": "^3.4.2",
40+
"typescript": "^5.7.2"
4341
},
4442
"keywords": [
4543
"gatsby",

src/templates/search-page.tsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55

66
import Layout from "../components/Layout.tsx";
77
import React from "react";
8-
import algoliasearch from "algoliasearch/lite";
8+
import { algoliasearch } from "algoliasearch";
99
import { Configure, InstantSearch, SearchBox } from "react-instantsearch";
1010
import Seo from "../components/Seo.tsx";
11-
import { SEARCH_COUNT } from "../utils/GatsbyanUtils.tsx";
1211
import { SearchClient } from "algoliasearch-helper/types/algoliasearch";
13-
import { MultipleQueriesQuery } from "@algolia/client-search";
1412
import { HeadProps, Slice } from "gatsby";
13+
import { SEARCH_COUNT } from "../utils/PagingUtils.tsx";
1514

1615
const SearchPage = () => {
1716
const algoliaClient = algoliasearch(
@@ -20,7 +19,7 @@ const SearchPage = () => {
2019
);
2120

2221
const searchClient: SearchClient = {
23-
search(queries: readonly MultipleQueriesQuery[]): Promise<any> {
22+
search(queries): Promise<any> {
2423
if (queries.every(({ params }: any) => !params.query)) {
2524
return Promise.resolve({
2625
results: queries.map(() => ({

src/utils/DateUtils.tsx

+7-4
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@ export const getPublishDate = (date: string) => formatToPattern(date, "MMMM do,
99
export const getPublishDateTime = (date: string) => formatToPattern(date, "eee. MMM do, yyyy hh:mm a");
1010
export const getDateYear = (date: string) => formatToPattern(date, "yyyy-MM-dd");
1111
export const getMonthYearDate = (date: string) => formatToPattern(date, "yyyy-MMMM");
12-
export const toNow = (date: string | Date) => formatDistanceToNow(date, { addSuffix: true });
13-
export const isAfterDate = (date1: string | Date, date2: string | Date) => isAfter(date1, date2);
14-
export const plusDays = (date: string | Date, day: number) => add(date, { days: day });
12+
export const toNow = (date: string | Date) =>
13+
formatDistanceToNow(typeof date === "string" ? new Date(date) : date, { addSuffix: true });
14+
export const isAfterDate = (date1: string | Date, date2: string | Date) =>
15+
isAfter(typeof date1 === "string" ? new Date(date1) : date1, typeof date2 === "string" ? new Date(date2) : date2);
16+
export const plusDays = (date: string | Date, day: number) =>
17+
add(typeof date === "string" ? new Date(date) : date, { days: day });
1518

1619
function formatToPattern(dateArg: string, formatString: string, timeZone: string = "Asia/Jakarta") {
1720
const date = new Date(dateArg);
1821
const zonedDate = date.toLocaleString("en-US", { timeZone: timeZone });
19-
return format(zonedDate, formatString);
22+
return format(new Date(zonedDate), formatString);
2023
}

0 commit comments

Comments
 (0)