定制 justbetter/statamic-partytown 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

justbetter/statamic-partytown

最新稳定版本:0.0.2

Composer 安装命令:

composer require justbetter/statamic-partytown

包简介

README 文档

README

Scripts like GTM have a massive negative impact on performance and pagespeed, to remedy this scripts like Partytown have been made. Which allows you to keep your analytics but reclaim some of the performance.

Pagespeed Scores

Installation

Load Partytown in on your head

If you're using antlers you should add the following to your head

<head>
    ...
    {{ partial:if_exists src="statamic-partytown::head" }}
    ...
</head>

and in case of blade you can include it using the following

<head>
    ...
    @include('statamic-partytown::head')
    ...
</head>

Optional

If you want to manage and add scripts to the page with partytown outside of your own built templates you can publish the Partytown Settings global:

php artisan vendor:publish --provider="JustBetter\StatamicPartytown\ServiceProvider" --tag=statamic-content

To speed up Partytown communication even more you can configure Atomics simply by adding a few headers.

Usage

Partytown is running by default if you are running your site on https.

To use Partytown simply change the scripts you want to run in partytown from <script type="text/javascript"> or <script> into <script type="text/partytown>

And they will be executed within Partytown.

If you've published the statamic global you can also paste your script snippets into the config and enable partytown for the snippet.

Additional domains and CORS

Not all domains support partytown due to their CORS settings (https://partytown.builder.io/proxying-requests) This package comes with a proxy for these domains which by default has some domains already added (see: config/statamic/partytown.php) If you notice more domains giving CORS errors you can add them to the config or in a comma seperated list in your .env under GTM_PARTYTOWN_DOMAIN_WHITELIST.

Custom config

The partytown configuration is available in window.partytown so you can change the configuration by updating the configuration within <script></script> tags.

See: https://partytown.builder.io/configuration

统计信息

  • 总下载量: 982
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 4
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-05-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固