fix/parameters-for-translations #15

Merged
raresj merged 4 commits from fix/parameters-for-translations into staging 2025-12-04 14:22:29 +00:00
10 changed files with 10 additions and 23 deletions
Showing only changes of commit bba507a7e8 - Show all commits

View File

@@ -2,13 +2,11 @@ import { Metadata } from 'next'
import { notFound } from 'next/navigation' import { notFound } from 'next/navigation'
import { Link } from '@/src/i18n/navigation' import { Link } from '@/src/i18n/navigation'
import { getAllPosts, getPostBySlug, getRelatedPosts } from '@/lib/markdown' import { getAllPosts, getPostBySlug, getRelatedPosts } from '@/lib/markdown'
import { formatDate, formatRelativeDate } from '@/lib/utils' import { formatDate } from '@/lib/utils'
import { TableOfContents } from '@/components/blog/table-of-contents' import { TableOfContents } from '@/components/blog/table-of-contents'
import { ReadingProgress } from '@/components/blog/reading-progress' import { ReadingProgress } from '@/components/blog/reading-progress'
import { StickyFooter } from '@/components/blog/sticky-footer' import { StickyFooter } from '@/components/blog/sticky-footer'
import MarkdownRenderer from '@/components/blog/markdown-renderer' import MarkdownRenderer from '@/components/blog/markdown-renderer'
import { setRequestLocale } from 'next-intl/server'
import { routing } from '@/src/i18n/routing'
export async function generateStaticParams() { export async function generateStaticParams() {
const locales = ['en', 'ro'] const locales = ['en', 'ro']

View File

@@ -4,8 +4,6 @@ import { Link } from '@/src/i18n/navigation'
import { getAllTags, getPostsByTag, getTagInfo, getRelatedTags } from '@/lib/tags' import { getAllTags, getPostsByTag, getTagInfo, getRelatedTags } from '@/lib/tags'
import { TagList } from '@/components/blog/tag-list' import { TagList } from '@/components/blog/tag-list'
import { formatDate } from '@/lib/utils' import { formatDate } from '@/lib/utils'
import { setRequestLocale } from 'next-intl/server'
import { routing } from '@/src/i18n/routing'
export async function generateStaticParams() { export async function generateStaticParams() {
const tags = await getAllTags() const tags = await getAllTags()

View File

@@ -6,10 +6,10 @@ interface CodeBlockProps {
code: string code: string
language: string language: string
filename?: string filename?: string
showLineNumbers?: boolean _showLineNumbers?: boolean
} }
export function CodeBlock({ code, language, filename, showLineNumbers = true }: CodeBlockProps) { export function CodeBlock({ code, language, filename, _showLineNumbers = true }: CodeBlockProps) {
const [copied, setCopied] = useState(false) const [copied, setCopied] = useState(false)
const handleCopy = async () => { const handleCopy = async () => {

View File

@@ -15,7 +15,7 @@ interface MarkdownRendererProps {
} }
export default function MarkdownRenderer({ content, className = '' }: MarkdownRendererProps) { export default function MarkdownRenderer({ content, className = '' }: MarkdownRendererProps) {
const locale = useLocale() const _locale = useLocale()
return ( return (
<div className={`prose prose-invert prose-zinc max-w-none ${className}`}> <div className={`prose prose-invert prose-zinc max-w-none ${className}`}>
<ReactMarkdown <ReactMarkdown

View File

@@ -12,7 +12,7 @@ export default [
'@typescript-eslint/explicit-module-boundary-types': 'off', '@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': [ '@typescript-eslint/no-unused-vars': [
'warn', 'warn',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' }, { argsIgnorePattern: '^_|node', varsIgnorePattern: '^_' },
], ],
'no-console': ['warn', { allow: ['warn', 'error'] }], 'no-console': ['warn', { allow: ['warn', 'error'] }],
}, },
@@ -26,6 +26,7 @@ export default [
'dist/', 'dist/',
'.cache/', '.cache/',
'*.config.js', '*.config.js',
'next.config.analyzer.js',
'public/', 'public/',
'coverage/', 'coverage/',
], ],

11
fix.js
View File

@@ -1,11 +0,0 @@
const fs = require('fs')
let content = fs.readFileSync('lib/remark-copy-images.ts', 'utf8')
const lines = content.split('\n')
for (let i = 0; i < lines.length; i++) {
if (lines[i].includes('replace')) {
console.log(`Line ${i + 1}:`, JSON.stringify(lines[i]))
lines[i] = lines[i].replace(/replace\(\/\\/g / g, 'replace(/\\/g')
console.log(`Fixed:`, JSON.stringify(lines[i]))
}
}
fs.writeFileSync('lib/remark-copy-images.ts', lines.join('\n'))

View File

@@ -5,7 +5,7 @@
const requiredEnvVars = ['NEXT_PUBLIC_SITE_URL', 'NODE_ENV'] as const const requiredEnvVars = ['NEXT_PUBLIC_SITE_URL', 'NODE_ENV'] as const
const optionalEnvVars = ['PORT', 'HOSTNAME', 'NEXT_PUBLIC_GA_ID'] as const const _optionalEnvVars = ['PORT', 'HOSTNAME', 'NEXT_PUBLIC_GA_ID'] as const
export function validateEnvironment() { export function validateEnvironment() {
const missingVars: string[] = [] const missingVars: string[] = []

View File

@@ -85,7 +85,7 @@ async function copyAndRewritePath(node: ImageNode, options: Options): Promise<vo
node.url = publicUrl + queryParams node.url = publicUrl + queryParams
return return
} }
} catch (error) { } catch {
// Stat failed, proceed with copy // Stat failed, proceed with copy
} }

2
next-env.d.ts vendored
View File

@@ -1,6 +1,6 @@
/// <reference types="next" /> /// <reference types="next" />
/// <reference types="next/image-types/global" /> /// <reference types="next/image-types/global" />
import "./.next/dev/types/routes.d.ts"; import "./.next/types/routes.d.ts";
// NOTE: This file should not be edited // NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information. // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

View File

@@ -1,5 +1,6 @@
type Messages = typeof import('../messages/en.json') type Messages = typeof import('../messages/en.json')
declare global { declare global {
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface IntlMessages extends Messages {} interface IntlMessages extends Messages {}
} }