staging #16
@@ -2,13 +2,11 @@ import { Metadata } from 'next'
|
||||
import { notFound } from 'next/navigation'
|
||||
import { Link } from '@/src/i18n/navigation'
|
||||
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 { ReadingProgress } from '@/components/blog/reading-progress'
|
||||
import { StickyFooter } from '@/components/blog/sticky-footer'
|
||||
import MarkdownRenderer from '@/components/blog/markdown-renderer'
|
||||
import { setRequestLocale } from 'next-intl/server'
|
||||
import { routing } from '@/src/i18n/routing'
|
||||
|
||||
export async function generateStaticParams() {
|
||||
const locales = ['en', 'ro']
|
||||
|
||||
@@ -4,8 +4,6 @@ import { Link } from '@/src/i18n/navigation'
|
||||
import { getAllTags, getPostsByTag, getTagInfo, getRelatedTags } from '@/lib/tags'
|
||||
import { TagList } from '@/components/blog/tag-list'
|
||||
import { formatDate } from '@/lib/utils'
|
||||
import { setRequestLocale } from 'next-intl/server'
|
||||
import { routing } from '@/src/i18n/routing'
|
||||
|
||||
export async function generateStaticParams() {
|
||||
const tags = await getAllTags()
|
||||
|
||||
@@ -6,10 +6,10 @@ interface CodeBlockProps {
|
||||
code: string
|
||||
language: 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 handleCopy = async () => {
|
||||
|
||||
@@ -15,7 +15,7 @@ interface MarkdownRendererProps {
|
||||
}
|
||||
|
||||
export default function MarkdownRenderer({ content, className = '' }: MarkdownRendererProps) {
|
||||
const locale = useLocale()
|
||||
const _locale = useLocale()
|
||||
return (
|
||||
<div className={`prose prose-invert prose-zinc max-w-none ${className}`}>
|
||||
<ReactMarkdown
|
||||
|
||||
@@ -12,7 +12,7 @@ export default [
|
||||
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'warn',
|
||||
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
|
||||
{ argsIgnorePattern: '^_|node', varsIgnorePattern: '^_' },
|
||||
],
|
||||
'no-console': ['warn', { allow: ['warn', 'error'] }],
|
||||
},
|
||||
@@ -26,6 +26,7 @@ export default [
|
||||
'dist/',
|
||||
'.cache/',
|
||||
'*.config.js',
|
||||
'next.config.analyzer.js',
|
||||
'public/',
|
||||
'coverage/',
|
||||
],
|
||||
|
||||
11
fix.js
11
fix.js
@@ -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'))
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
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() {
|
||||
const missingVars: string[] = []
|
||||
|
||||
@@ -85,7 +85,7 @@ async function copyAndRewritePath(node: ImageNode, options: Options): Promise<vo
|
||||
node.url = publicUrl + queryParams
|
||||
return
|
||||
}
|
||||
} catch (error) {
|
||||
} catch {
|
||||
// Stat failed, proceed with copy
|
||||
}
|
||||
|
||||
|
||||
2
next-env.d.ts
vendored
2
next-env.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
/// <reference types="next" />
|
||||
/// <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
|
||||
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
||||
|
||||
1
types/translations.d.ts
vendored
1
types/translations.d.ts
vendored
@@ -1,5 +1,6 @@
|
||||
type Messages = typeof import('../messages/en.json')
|
||||
|
||||
declare global {
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
interface IntlMessages extends Messages {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user