feat: rename plebchan to 5chan

This commit is contained in:
plebeius
2025-10-17 23:30:35 +02:00
parent e1f1f280cc
commit 1360dd8348
71 changed files with 316 additions and 316 deletions
+7 -7
View File
@@ -13,7 +13,7 @@ import CommentMedia from '../comment-media';
import styles from './markdown.module.css';
import { Link, useLocation, useParams } from 'react-router-dom';
import { canEmbed } from '../embed';
import { isPlebchanLink, transformPlebchanLinkToInternal, preprocessPlebchanPatterns } from '../../lib/utils/url-utils';
import { is5chanLink, transform5chanLinkToInternal, preprocess5chanPatterns } from '../../lib/utils/url-utils';
interface ContentLinkEmbedProps {
children: any;
@@ -159,9 +159,9 @@ const renderAnchorLink = (children: React.ReactNode, href: string) => {
return <span>{children}</span>;
}
// Check if this is a valid plebchan link that should be handled internally
if (isPlebchanLink(href)) {
const internalPath = transformPlebchanLinkToInternal(href);
// Check if this is a valid 5chan link that should be handled internally
if (is5chanLink(href)) {
const internalPath = transform5chanLinkToInternal(href);
if (internalPath) {
// Check if the link text should be replaced with the internal path
let shouldReplaceText = false;
@@ -182,7 +182,7 @@ const renderAnchorLink = (children: React.ReactNode, href: string) => {
return <Link to={internalPath}>{displayText}</Link>;
} else {
console.warn('Failed to transform plebchan link to internal path:', href);
console.warn('Failed to transform 5chan link to internal path:', href);
return <Link to={href}>{children}</Link>;
}
}
@@ -226,8 +226,8 @@ const Markdown = ({ content, title }: MarkdownProps) => {
const isInCatalogView = isCatalogView(useLocation().pathname, useParams());
// Preprocess content to convert plain text plebchan patterns to markdown links
const processedContent = preprocessPlebchanPatterns(content || '');
// Preprocess content to convert plain text 5chan patterns to markdown links
const processedContent = preprocess5chanPatterns(content || '');
return (
<span className={styles.markdown}>
@@ -22,21 +22,21 @@ const CheckForUpdates = () => {
const checkForUpdates = async () => {
try {
setLoading(true);
const packageRes = await fetch('https://raw.githubusercontent.com/plebbit/plebchan/master/package.json', { cache: 'no-cache' });
const packageRes = await fetch('https://raw.githubusercontent.com/plebbit/5chan/master/package.json', { cache: 'no-cache' });
const packageData = await packageRes.json();
let updateAvailable = false;
if (packageJson.version !== packageData.version) {
const newVersionText = t('new_stable_version', { newVersion: packageData.version, oldVersion: packageJson.version });
const updateActionText = isElectron
? t('download_latest_desktop', { link: 'https://github.com/plebbit/plebchan/releases/latest', interpolation: { escapeValue: false } })
? t('download_latest_desktop', { link: 'https://github.com/plebbit/5chan/releases/latest', interpolation: { escapeValue: false } })
: t('refresh_to_update');
alert(newVersionText + ' ' + updateActionText);
updateAvailable = true;
}
if (commitRef && commitRef.length > 0) {
const commitRes = await fetch('https://api.github.com/repos/plebbit/plebchan/commits?per_page=1&sha=development', { cache: 'no-cache' });
const commitRes = await fetch('https://api.github.com/repos/plebbit/5chan/commits?per_page=1&sha=development', { cache: 'no-cache' });
const commitData = await commitRes.json();
const latestCommitHash = commitData[0].sha;
@@ -52,7 +52,7 @@ const CheckForUpdates = () => {
if (!updateAvailable) {
alert(
commitRef
? `${t('latest_development_version', { commit: commitRef.slice(0, 7), link: 'https://plebchan.app/#/', interpolation: { escapeValue: false } })}`
? `${t('latest_development_version', { commit: commitRef.slice(0, 7), link: 'https://5chan.app/#/', interpolation: { escapeValue: false } })}`
: `${t('latest_stable_version', { version: packageJson.version })}`,
);
}
+1 -1
View File
@@ -109,7 +109,7 @@ const TopBarDesktop = () => {
)}
[
<span className={styles.temporaryButton}>
<a href='https://plebbit.github.io/docs/learn/clients/plebchan/create-a-board' target='_blank' rel='noopener noreferrer'>
<a href='https://plebbit.github.io/docs/learn/clients/5chan/create-a-board' target='_blank' rel='noopener noreferrer'>
{t('create_board')}
</a>
</span>
+1 -1
View File
@@ -10,7 +10,7 @@ const Version = () => {
return (
<>
<a
href={commitRef ? `https://github.com/plebbit/plebchan/commit/${commitRef}` : `https://github.com/plebbit/plebchan/releases/tag/v${version}`}
href={commitRef ? `https://github.com/plebbit/5chan/commit/${commitRef}` : `https://github.com/plebbit/5chan/releases/tag/v${version}`}
target='_blank'
rel='noopener noreferrer'
>