Publish FNA resource entrances, tutorials and quiet mode
This commit is contained in:
1 parent
c2539f380d
commit
d6a7d073ed
75 files changed
+1403
-158
No files matched your search
@@ -4,6 +4,7 @@
|
||||
use App\Models\Categories;
|
||||
use App\Services\Seo;
|
||||
use App\Services\ArticlesService;
|
||||
use App\Services\ResourcePages;
|
||||
use Illuminate\Http\Response;
|
||||
class SitemapController extends Controller
|
||||
{
|
||||
@@ -13,7 +14,12 @@ public function index(): Response
|
||||
$latest = app(ArticlesService::class)->getLatestFreeNodeSlug();
|
||||
$home = $latest ? $articles->firstWhere('sSlug',$latest) : null;
|
||||
$entries = $home ? [['url'=>Seo::url(),'modified'=>Seo::modified($home)]] : [];
|
||||
$latestId = app(ArticlesService::class)->getLatestResourceSlug('shadowrocketids');
|
||||
if ($latestId && ($idArticle = $articles->firstWhere('sSlug', $latestId))) {
|
||||
$entries[] = ['url'=>Seo::url(ResourcePages::entryPath('shadowrocketids')), 'modified'=>Seo::modified($idArticle)];
|
||||
}
|
||||
foreach (Categories::where('iStatus',1)->with('oParent')->orderBy('id')->get() as $category) {
|
||||
if (ResourcePages::supports($category->sSlug)) continue;
|
||||
if ($category->iParentId && (!$category->oParent || !$category->oParent->iStatus)) continue;
|
||||
$members = $articles->filter(fn($a)=>$a->iCategoryId === $category->id || ($category->iShowChildren && $a->oCategory->iParentId === $category->id));
|
||||
if ($members->isNotEmpty()) $entries[] = ['url'=>Seo::url(Seo::categoryPath($category)),'modified'=>null];
|
||||
|
||||
Reference in new issue
Block a user