Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 84 additions & 18 deletions website/client/.vitepress/config/configShard.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { visualizer } from 'rollup-plugin-visualizer';
import { type ManifestOptions, VitePWA } from 'vite-plugin-pwa';
import { defineConfig } from 'vitepress';
import llmstxt from 'vitepress-plugin-llms';
import { configDeSearch } from './configDe';
import { configEsSearch } from './configEs';
import { configHiSearch } from './configHi';
Expand All @@ -15,13 +16,71 @@ import { configViSearch } from './configVi';
import { configZhCnSearch } from './configZhCn';
import { configZhTwSearch } from './configZhTw';

// Site Metadata
const siteName = 'Repomix';
const siteUrl = 'https://repomix.com';
const siteDescription = 'Pack your codebase into AI-friendly formats';
const ogImageUrl = `${siteUrl}/images/og-image-large.png`;
const githubUrl = 'https://github.com/yamadashy/repomix';
const npmUrl = 'https://www.npmjs.com/package/repomix';

const googleAnalyticsTag = 'G-7PTT4PLC69';

// JSON-LD Structured Data
const jsonLd = {
'@context': 'https://schema.org',
'@graph': [
{
'@type': 'WebSite',
name: siteName,
url: siteUrl,
description: siteDescription,
},
{
'@type': 'SoftwareApplication',
name: siteName,
description:
'A tool that packs your entire repository into a single, AI-friendly file for use with Large Language Models (LLMs) like ChatGPT, Claude, Gemini, and more.',
url: siteUrl,
applicationCategory: 'DeveloperApplication',
operatingSystem: 'Windows, macOS, Linux',
offers: {
'@type': 'Offer',
price: '0',
priceCurrency: 'USD',
},
license: 'https://opensource.org/licenses/MIT',
isAccessibleForFree: true,
installUrl: npmUrl,
downloadUrl: npmUrl,
softwareRequirements: 'Node.js 20.0.0 or higher',
image: `${siteUrl}/images/repomix-logo.svg`,
screenshot: ogImageUrl,
author: {
'@type': 'Person',
name: 'Kazuki Yamada',
url: 'https://github.com/yamadashy',
},
sameAs: [githubUrl, npmUrl],
featureList: [
'AI-optimized output formats (XML, Markdown, JSON, Plain Text)',
'Token counting for LLM context limits',
'Git-aware file processing',
'Security-focused with Secretlint integration',
'Remote repository processing',
'MCP Server integration',
'Code compression with Tree-sitter',
'Custom instructions support',
],
},
],
};
Comment on lines +29 to +77
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There are several hardcoded and duplicated values in the jsonLd object and throughout this file. To improve maintainability and ensure consistency, it's a good practice to define these values as constants and reuse them. This will make future updates easier and less error-prone.

For example, values like the site name, URL, GitHub repository, and author information are used in multiple places (jsonLd, manifest, themeConfig, llmstxt plugin).

I suggest extracting these into constants. You can then use these constants in other parts of the file as well to reduce duplication.

// Site metadata
const siteName = 'Repomix';
const siteUrl = 'https://repomix.com';
const siteDescription = 'Pack your codebase into AI-friendly formats';
const longDescription = 'A tool that packs your entire repository into a single, AI-friendly file for use with Large Language Models (LLMs) like ChatGPT, Claude, Gemini, and more.';
const githubUrl = 'https://github.com/yamadashy/repomix';
const npmUrl = 'https://www.npmjs.com/package/repomix';
const authorName = 'Kazuki Yamada';
const authorUrl = 'https://github.com/yamadashy';

// JSON-LD Structured Data
const jsonLd = {
  '@context': 'https://schema.org',
  '@graph': [
    {
      '@type': 'WebSite',
      name: siteName,
      url: siteUrl,
      description: siteDescription,
    },
    {
      '@type': 'SoftwareApplication',
      name: siteName,
      description: longDescription,
      url: siteUrl,
      applicationCategory: 'DeveloperApplication',
      operatingSystem: 'Windows, macOS, Linux',
      offers: {
        '@type': 'Offer',
        price: '0',
        priceCurrency: 'USD',
      },
      license: 'https://opensource.org/licenses/MIT',
      isAccessibleForFree: true,
      installUrl: npmUrl,
      downloadUrl: npmUrl,
      softwareRequirements: 'Node.js 20.0.0 or higher',
      image: `${siteUrl}/images/repomix-logo.svg`,
      screenshot: `${siteUrl}/images/og-image-large.png`,
      author: {
        '@type': 'Person',
        name: authorName,
        url: authorUrl,
      },
      sameAs: [githubUrl, npmUrl],
      featureList: [
        'AI-optimized output formats (XML, Markdown, JSON, Plain Text)',
        'Token counting for LLM context limits',
        'Git-aware file processing',
        'Security-focused with Secretlint integration',
        'Remote repository processing',
        'MCP Server integration',
        'Code compression with Tree-sitter',
        'Custom instructions support',
      ],
    },
  ],
};


// PWA Manifest Configuration
const manifest: Partial<ManifestOptions> = {
name: 'Repomix',
short_name: 'Repomix',
description: 'Pack your codebase into AI-friendly formats',
name: siteName,
short_name: siteName,
description: siteDescription,
theme_color: '#f97316',
background_color: '#ffffff',
display: 'standalone',
Expand All @@ -46,7 +105,7 @@ const manifest: Partial<ManifestOptions> = {
};

export const configShard = defineConfig({
title: 'Repomix',
title: siteName,

srcDir: 'src',

Expand All @@ -60,7 +119,7 @@ export const configShard = defineConfig({
metaChunk: true,

sitemap: {
hostname: 'https://repomix.com/',
hostname: `${siteUrl}/`,
},

// Shared configuration
Expand Down Expand Up @@ -89,7 +148,7 @@ export const configShard = defineConfig({
socialLinks: [
{ icon: 'x', link: 'https://x.com/repomix_ai' },
{ icon: 'discord', link: 'https://discord.gg/wNYzTwZFku' },
{ icon: 'github', link: 'https://github.com/yamadashy/repomix' },
{ icon: 'github', link: githubUrl },
],
footer: {
message: 'Released under the MIT License.',
Expand All @@ -101,29 +160,32 @@ export const configShard = defineConfig({
},

head: [
// JSON-LD Structured Data
['script', { type: 'application/ld+json' }, JSON.stringify(jsonLd)],

// Favicon
['link', { rel: 'icon', href: '/images/repomix-logo.svg' }],

// OGP
['meta', { property: 'og:type', content: 'website' }],
['meta', { property: 'og:title', content: 'Repomix' }],
['meta', { property: 'og:site_name', content: 'Repomix' }],
['meta', { property: 'og:image', content: 'https://repomix.com/images/og-image-large.png' }],
['meta', { property: 'og:url', content: 'https://repomix.com' }],
['meta', { property: 'og:description', content: 'Pack your codebase into AI-friendly formats' }],
['meta', { property: 'og:title', content: siteName }],
['meta', { property: 'og:site_name', content: siteName }],
['meta', { property: 'og:image', content: ogImageUrl }],
['meta', { property: 'og:url', content: siteUrl }],
['meta', { property: 'og:description', content: siteDescription }],
['meta', { name: 'twitter:card', content: 'summary_large_image' }],
['meta', { property: 'twitter:domain', content: 'https://repomix.com' }],
['meta', { property: 'twitter:url', content: 'https://repomix.com' }],
['meta', { name: 'twitter:title', content: 'Repomix' }],
['meta', { name: 'twitter:description', content: 'Pack your codebase into AI-friendly formats' }],
['meta', { name: 'twitter:image', content: 'https://repomix.com/images/og-image-large.png' }],
['meta', { name: 'thumbnail', content: 'https://repomix.com/images/og-image-large.png' }],
['meta', { property: 'twitter:domain', content: 'repomix.com' }],
['meta', { property: 'twitter:url', content: siteUrl }],
['meta', { name: 'twitter:title', content: siteName }],
['meta', { name: 'twitter:description', content: siteDescription }],
['meta', { name: 'twitter:image', content: ogImageUrl }],
['meta', { name: 'thumbnail', content: ogImageUrl }],

// PWA
['meta', { name: 'theme-color', content: '#f97316' }],
['meta', { name: 'apple-mobile-web-app-capable', content: 'yes' }],
['meta', { name: 'apple-mobile-web-app-status-bar-style', content: 'black' }],
['meta', { name: 'apple-mobile-web-app-title', content: 'Repomix' }],
['meta', { name: 'apple-mobile-web-app-title', content: siteName }],
['link', { rel: 'apple-touch-icon', href: '/images/pwa/repomix-192x192.png' }],
['link', { rel: 'mask-icon', href: '/images/repomix-logo.svg', color: '#f97316' }],

Expand Down Expand Up @@ -160,6 +222,10 @@ export const configShard = defineConfig({
},
},
plugins: [
...llmstxt({
workDir: 'en',
domain: siteUrl,
}),
VitePWA({
registerType: 'autoUpdate',
manifest,
Expand Down
Loading
Loading