Skip to content

Commit a086620

Browse files
authored
Merge pull request #11922 from ethereum/deprecateOldContentDir
[HOTFIX] Deprecate OLD_CONTENT_DIR
2 parents 31f98a4 + 9792e24 commit a086620

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

src/hooks/useClientSideGitHubContributors.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useEffect, useState } from "react"
44

55
import type { Author, FileContributorsState } from "@/lib/types"
66

7-
import { GITHUB_COMMITS_URL, OLD_CONTENT_DIR } from "@/lib/constants"
7+
import { CONTENT_DIR,GITHUB_COMMITS_URL } from "@/lib/constants"
88

99
export const gitHubAuthHeaders = {
1010
headers: new Headers({
@@ -17,8 +17,7 @@ const fetchGitHubContributors = async (
1717
relativePath: string,
1818
): Promise<FileContributorsState> => {
1919
const url = new URL(GITHUB_COMMITS_URL)
20-
// TODO: OLD_CONTENT_DIR -> CONTENT_DIR for production
21-
const filePath = join(OLD_CONTENT_DIR, relativePath, "index.md")
20+
const filePath = join(CONTENT_DIR, relativePath, "index.md")
2221
url.searchParams.set("path", filePath)
2322

2423
try {

src/hooks/useClientSideGitHubLastEdit.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import { useRouter } from "next/router"
66
import type { Lang, LastUpdatedState } from "@/lib/types"
77

88
import {
9+
CONTENT_DIR,
910
DEFAULT_LOCALE,
1011
GITHUB_COMMITS_URL,
11-
OLD_CONTENT_DIR,
1212
} from "@/lib/constants"
1313

1414
import { gitHubAuthHeaders } from "@/hooks/useClientSideGitHubContributors"
@@ -18,12 +18,11 @@ const fetchGitHubLastEdit = async (
1818
locale?: Lang
1919
): Promise<LastUpdatedState> => {
2020
const url = new URL(GITHUB_COMMITS_URL)
21-
// TODO: OLD_CONTENT_DIR -> CONTENT_DIR for production
2221
const localePath =
2322
locale && locale !== DEFAULT_LOCALE
2423
? join("translations", locale, relativePath)
2524
: relativePath
26-
const filePath = join(OLD_CONTENT_DIR, localePath, "index.md")
25+
const filePath = join(CONTENT_DIR, localePath, "index.md")
2726
url.searchParams.set("path", filePath)
2827

2928
try {

src/lib/constants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { ReportsModel } from "@crowdin/crowdin-api-client"
22

33
import i18nConfig from "../../i18n.config.json"
44

5-
export const OLD_CONTENT_DIR = "src/content"
65
export const CONTENT_DIR = "public/content"
76
export const TRANSLATIONS_DIR = "public/content/translations"
87
export const TRANSLATED_IMAGES_DIR = "/content/translations"

0 commit comments

Comments
 (0)