fix: apply tag removal and source stripping to root-level plugin files

The deploy workflow reads from the repo root (admin/, includes/, public/),
not the peptide-news-plugin/ subdirectory. Applied the same changes:
- Removed Tag component and tag rendering from ArticleCard
- Removed all tag-related CSS (variables, styles, skeleton, responsive)
- Added strip_source_suffix() to REST API for cleaning source names
  from titles/summaries with case-insensitive and domain-based matching

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Terence Ong
2026-04-08 10:26:43 +07:00
parent 8cc43e3618
commit 672cdacd60
3 changed files with 79 additions and 109 deletions

View File

@@ -148,17 +148,6 @@ function trackClick(articleId) {
/* ── Components ─────────────────────────────────────────────────────── */
/**
* Single keyword tag pill.
*/
const Tag = memo(function Tag({
label
}) {
return /*#__PURE__*/React.createElement("span", {
className: "pn-tag"
}, label);
});
/**
* Single article card.
*/
@@ -166,8 +155,6 @@ const ArticleCard = memo(function ArticleCard({
article
}) {
const summary = decodeEntities(article.ai_summary || article.excerpt || '');
const tagSource = article.tags || article.categories || '';
const tags = tagSource ? tagSource.split(',').map(t => t.trim()).filter(Boolean).slice(0, 5) : [];
const handleClick = useCallback(() => {
trackClick(article.id);
}, [article.id]);
@@ -196,14 +183,7 @@ const ArticleCard = memo(function ArticleCard({
className: "pn-article-excerpt"
}, summary), article.author && /*#__PURE__*/React.createElement("span", {
className: "pn-author"
}, article.author), tags.length > 0 && /*#__PURE__*/React.createElement("div", {
className: "pn-tags",
role: "list",
"aria-label": "Keywords"
}, tags.map(tag => /*#__PURE__*/React.createElement(Tag, {
key: tag,
label: tag
}))));
}, article.author));
});
/**
@@ -229,15 +209,7 @@ function LoadingSkeleton({
className: "pn-skeleton-line pn-skeleton-excerpt"
}), /*#__PURE__*/React.createElement("div", {
className: "pn-skeleton-line pn-skeleton-excerpt-short"
}), /*#__PURE__*/React.createElement("div", {
className: "pn-skeleton-tags"
}, /*#__PURE__*/React.createElement("div", {
className: "pn-skeleton-tag"
}), /*#__PURE__*/React.createElement("div", {
className: "pn-skeleton-tag"
}), /*#__PURE__*/React.createElement("div", {
className: "pn-skeleton-tag"
})))));
}))));
}
/**