diff --git a/app/Services/ResourceArticlePresentation.php b/app/Services/ResourceArticlePresentation.php new file mode 100644 index 00000000..9612ce96 --- /dev/null +++ b/app/Services/ResourceArticlePresentation.php @@ -0,0 +1,19 @@ +]*>.*?

(?:\s*]*>\s*

)*~si', static function (array $match): string { + $text = html_entity_decode(strip_tags($match[0]), ENT_QUOTES | ENT_HTML5, 'UTF-8'); + $text = preg_replace('/\s+/u', '', $text); + if (preg_match('/点击加入我们的(?:tg|telegram)频道|点击关注我们的github仓库/iu', $text)) return ''; + return $match[0]; + }, $html); + } +} diff --git a/config/community.php b/config/community.php new file mode 100644 index 00000000..e4c103fa --- /dev/null +++ b/config/community.php @@ -0,0 +1,5 @@ + env('COMMUNITY_TELEGRAM_URL', 'https://t.me/clashfreenode'), +]; diff --git a/resources/views/components/nav-bar.blade.php b/resources/views/components/nav-bar.blade.php index 2280ef15..0d417aaf 100644 --- a/resources/views/components/nav-bar.blade.php +++ b/resources/views/components/nav-bar.blade.php @@ -13,6 +13,7 @@ class="d-none logo-dark nc-no-lazy" id="sidebarCollapse" aria-label="打开导航菜单" aria-controls="mobile-navigation" aria-expanded="false"> +
@include('components.telegram-link')