File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,12 @@ public static function RegistMetadata($content){
63
63
ContentsDatabase::UnregistTag ($ content ->Path ());
64
64
ContentsDatabase::UnregistLatest ($ content ->Path ());
65
65
66
+ ContentsDatabase::NotifyContentsChange ($ content ->UpdatedAtTimestamp ());
67
+
68
+ if (in_array ('noindex ' , $ content ->Tags (), true )){
69
+ return ;
70
+ }
71
+
66
72
$ shouldAddLatest = true ;
67
73
foreach ($ content ->Tags () as $ tag ){
68
74
ContentsDatabase::RegistTag ($ content ->Path (), $ tag );
@@ -75,7 +81,6 @@ public static function RegistMetadata($content){
75
81
if ($ shouldAddLatest ){
76
82
ContentsDatabase::RegistLatest ($ content ->Path (), $ content ->UpdatedAtTimestamp ());
77
83
}
78
- ContentsDatabase::NotifyContentsChange ($ content ->UpdatedAtTimestamp ());
79
84
}
80
85
81
86
/**
@@ -96,6 +101,11 @@ public static function LoadRelatedIndex($contentPath) {
96
101
97
102
public static function RegistIndex ($ content ){
98
103
SearchEngine \Indexer::UnregistIndex ($ content ->Path ());
104
+
105
+ if (in_array ('noindex ' , $ content ->Tags (), true )){
106
+ return ;
107
+ }
108
+
99
109
SearchEngine \Indexer::RegistIndex ($ content ->Path (), $ content ->Title ());
100
110
if (($ parent = $ content ->Parent ()) !== false ) {
101
111
SearchEngine \Indexer::RegistIndex ($ content ->Path (), $ parent ->Title ());
You can’t perform that action at this time.
0 commit comments