Browse Source

加上mtb_preview变量

moshaorui 1 month ago
parent
commit
441063a999
1 changed files with 2 additions and 0 deletions
  1. 2 0
      app/Services/LiquidRenderer.php

+ 2 - 0
app/Services/LiquidRenderer.php

@@ -145,6 +145,7 @@ class LiquidRenderer
      */
     private static function getGlobalConfig(): array
     {
+        $preview = isset($_GET['mtb-preview']) ? intval($_GET['mtb-preview']) : 0;
         return [
             'site_title' => config('app.name'),
             'image_base_url' => config('liquid.image_base_url'),
@@ -154,6 +155,7 @@ class LiquidRenderer
             'menus_header'=>app('menus_header'),
             'menus_footer'=>app('menus_footer'),
             'current_url'=>app('current_url'),
+            'mtb_preview' => $preview,
         ];
     }
 }