File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -281,6 +281,15 @@ return [
281281];
282282```
283283
284+ ### Manipulating indexed pages
285+ A few helpers are available for manipulating pages :
286+
287+ ### Page Method
288+ If you'd like to know if a page is indexed in the sitemap, you can use ` $page->isIndexible() ` (returns a ` bool ` ).
289+
290+ ### Site Method
291+ To get all indexed pages according to your settings, you can use : ` $site->indexedPages() ` (returns a ` Kirby\Cms\Collection ` of pages).
292+
284293## Credits
285294
286295This is partly based on an older version of the meta plugin, that I had initially
Original file line number Diff line number Diff line change 11<?php
22
33use FabianMichael \Meta \PageMeta ;
4+ use FabianMichael \Meta \SiteMap ;
45
56return [
67 'meta ' => function (?string $ languageCode = null ) {
78 return PageMeta::of ($ this , $ languageCode );
89 },
10+
11+ 'isIndexible ' => function (){
12+ return Sitemap::isPageIndexible ( $ this );
13+ },
914];
Original file line number Diff line number Diff line change 1717 return '<span data-theme="notice" class="k-meta-warning-box"> ' . $ text . '</span> ' ;
1818 }
1919 },
20+ 'indexedPages ' => function () {
21+ return kirby ()->site ()->index ()->filterBy ('isIndexible ' , '== ' , true );
22+ },
2023];
You can’t perform that action at this time.
0 commit comments