{"id":35546627,"url":"https://github.com/pickles2/px2-amp-convert","last_synced_at":"2026-01-04T06:03:49.017Z","repository":{"id":57041416,"uuid":"115314258","full_name":"pickles2/px2-amp-convert","owner":"pickles2","description":"Pickles 2 コンテンツを AMP に変換します。","archived":false,"fork":false,"pushed_at":"2020-10-17T14:06:37.000Z","size":128,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-19T08:52:11.186Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pickles2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-25T06:54:42.000Z","updated_at":"2020-10-17T14:06:41.000Z","dependencies_parsed_at":"2022-08-23T23:30:51.263Z","dependency_job_id":null,"html_url":"https://github.com/pickles2/px2-amp-convert","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/pickles2/px2-amp-convert","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pickles2%2Fpx2-amp-convert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pickles2%2Fpx2-amp-convert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pickles2%2Fpx2-amp-convert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pickles2%2Fpx2-amp-convert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pickles2","download_url":"https://codeload.github.com/pickles2/px2-amp-convert/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pickles2%2Fpx2-amp-convert/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28198673,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2026-01-04T02:00:06.065Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-04T06:02:15.311Z","updated_at":"2026-01-04T06:03:49.012Z","avatar_url":"https://github.com/pickles2.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pickles2/px2-amp-convert\nPickles 2 コンテンツを AMP に変換します。\n\n## 機能 - Function\n`pickles2/px2-amp-convert` は、Pickles 2 コンテンツを AMP に変換します。\n\n変換処理は [tomk79/amp-convert](https://packagist.org/packages/tomk79/amp-convert) に依存します。詳しくは [tomk79/amp-convert](https://packagist.org/packages/tomk79/amp-convert) の README を参照してください。\n\n\n## 導入手順 - Setup\n\n### 1. composer.json に pickles2/px2-amp-convert を追加\n\n```\n$ composer require pickles2/px2-amp-convert\n```\n\n\n### 2. config.php に、プラグインを設定\n\n設定ファイル config.php (通常は `./px-files/config.php`) を編集します。\n\n```php\n\u003c?php\n\t/* 中略 */\n\n\t// funcs: Before content\n\t$conf-\u003efuncs-\u003ebefore_content = [\n\t\t// AMP変換ユーティリティオブジェクトを生成する\n\t\t'tomk79\\pickles2\\ampConvert\\main::create_px_amp_convert_utils()',\n\t];\n\n\t/* 中略 */\n\n\t// processor\n\t$conf-\u003efuncs-\u003eprocessor-\u003ehtml = array(\n\n\t\t/* 中略 */\n\n\t\t// AMP変換\n\t\t'tomk79\\pickles2\\ampConvert\\main::exec()',\n\n\t\t/* 中略 */\n\n\t);\n```\n\nPickles 2 の設定をJSON形式で編集している方は、`config.json` の該当箇所に追加してください。\n\n### 3. モバイルUAでアクセス\n\nモバイルのユーザーエージェントに反応して自動的にAMPに変換されたコンテンツを表示します。\n\n\n## ユーティリティ - Utilities\n\n```php\n\u003c?php\n\n$utils = $px-\u003eamp_convert_utils;\n\nif(!is_object($utils)){\n\t// または\n\t$utils = new \\tomk79\\pickles2\\ampConvert\\utils( $px );\n}\n\n// パスの変換パターンを処理する\necho $utils-\u003erewrite_path('/a/b/c/test.html', '{$dirname}/{$filename}.{$ext}'); // '/a/b/c/test.html'\n\n// コールバックを使用する例\necho $utils-\u003erewrite_path('/a/b/c/test.html', function($path){\n\treturn $path.'.test';\n}); // '/a/b/c/test.html.test'\n\n```\n\n\n## 更新履歴 - Change log\n\n### pickles2/px2-amp-convert v0.3.0 (2020年10月17日)\n\n- Update libraries: `tomk79/amp-convert` to `~0.1`, `lullabot/amp` to `^2.0`\n\n### pickles2/px2-amp-convert v0.2.3 (2019年2月4日)\n\n- リソースの読み込み結果をキャッシュするようになった。繰り返し読み込むリソースが多い場合に、パブリッシュのパフォーマンスが改善する。\n\n### pickles2/px2-amp-convert v0.2.2 (2019年1月29日)\n\n- 相対パスで書かれた画像が `amp-img` 要素に置換されない事がある不具合を修正。\n- `//` から始まるリソースを扱えるようになった。\n\n### pickles2/px2-amp-convert v0.2.1 (2019年1月17日)\n\n- `\u003clink rel=\"stylesheet\"\u003e` のリンク先が、 dataスキーマだった場合、 URLだった場合、 `$conf-\u003epath_controot` の設定が `/` 以外だった場合に対応できなかった不具合を修正。\n\n### pickles2/px2-amp-convert v0.2.0 (2018年9月25日)\n\n- Pickles 2 グループに移管した。\n\n### tomk79/px2-amp-convert v0.1.1 (2018年3月9日)\n\n- Windowsで起きていた不具合を修正。\n\n### tomk79/px2-amp-convert v0.1.0 (2018年2月4日)\n\n- Initial release.\n\n\n## ライセンス - License\n\nMIT License\n\n\n## 作者 - Author\n\n- Tomoya Koyanagi \u003ctomk79@gmail.com\u003e\n- website: \u003chttps://www.pxt.jp/\u003e\n- Twitter: @tomk79 \u003chttps://twitter.com/tomk79/\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpickles2%2Fpx2-amp-convert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpickles2%2Fpx2-amp-convert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpickles2%2Fpx2-amp-convert/lists"}