小优化

This commit is contained in:
2026-08-23 15:25:39 +08:00
parent 0ffd045576
commit 2c1f08deb1
4 changed files with 53 additions and 12 deletions
+15
View File
@@ -164,6 +164,21 @@ trait ScriptsPart1c {
);
}
// Follow toggle: delegated [data-aksrt-follow] handler; the buttons render on
// user home / user center / single author bar and user cards anywhere.
// Depends on aksrt-runtime because aksrtData (REST root + nonce) is localized
// onto that handle and follow.js reads it at parse time.
$follow_js = get_template_directory() . '/assets/js/follow.js';
if (file_exists($follow_js)) {
wp_enqueue_script(
'aksrt-follow',
$base_uri . '/assets/js/follow.js',
['aksrt-notyf', 'aksrt-runtime'],
(string) filemtime($follow_js),
true
);
}
// Core modules (split from main.js) — register with AksrtFrontend
$core_modules = [
'aksrt-core-article' => 'article.js',