{"id":37770771,"url":"https://github.com/liginc/wp-starter-theme","last_synced_at":"2026-01-16T14:52:36.439Z","repository":{"id":193222165,"uuid":"688252690","full_name":"liginc/wp-starter-theme","owner":"liginc","description":"wordpress starter theme by wp-env \u0026 vite","archived":false,"fork":false,"pushed_at":"2024-11-27T07:28:42.000Z","size":16003,"stargazers_count":13,"open_issues_count":8,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-27T08:27:08.187Z","etag":null,"topics":["development-environment","vite","wordpress","wordpress-theme","wp-env"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liginc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-07T01:11:32.000Z","updated_at":"2024-11-27T07:28:46.000Z","dependencies_parsed_at":"2023-10-16T18:49:10.217Z","dependency_job_id":"cc6f89d7-7123-4630-9230-668dae7c2aca","html_url":"https://github.com/liginc/wp-starter-theme","commit_stats":null,"previous_names":["liginc/wp-starter-theme"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/liginc/wp-starter-theme","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liginc%2Fwp-starter-theme","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liginc%2Fwp-starter-theme/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liginc%2Fwp-starter-theme/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liginc%2Fwp-starter-theme/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liginc","download_url":"https://codeload.github.com/liginc/wp-starter-theme/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liginc%2Fwp-starter-theme/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["development-environment","vite","wordpress","wordpress-theme","wp-env"],"created_at":"2026-01-16T14:52:36.352Z","updated_at":"2026-01-16T14:52:36.420Z","avatar_url":"https://github.com/liginc.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wp-starter-theme\n\n## 🛜 WP Environment\n\n本テンプレートはWordPressのアップデートが常に行われていくこと、運用が第三者になる可能性を考慮して互換性に特化したものになっています。\u003cbr\u003e\nそのため`functions`のカスタムは最小限に留めて、必要な機能はプラグインに任せる方針になっています。\n\nWordPressは常に最新のバージョンを取得する設定になっています。プロジェクト開始時に `.wp-env.json` を編集してWordPressとプラグインのバージョンを固定することを推奨しています。\n\n- WP ver latest\n- PHP ver 8.1\n\n## 🔧 WP Plugins\n\n本番またはテストサーバーでは下記のプラグインをインストールすることを推奨しています。\n\n- https://ja.wordpress.org/plugins/webp-converter-for-media/\n- https://ja.wordpress.org/plugins/all-in-one-wp-security-and-firewall/\n- https://ja.wordpress.org/plugins/autoptimize/\n\n## 💰 Paid Plugins\n\n下記の有料のプラグインを使用したい場合は運用者に連絡をしてください。リンクがダウンロードできるようになるので `/plugins`配下に設置してください。\n\n- [advanced-custom-fields-pro](https://bitbucket.org/lig-admin/lig-wordpress-plugins/src/master/admin-columns-pro/)\n- [all-in-one-wp-migration-unlimited-extension](https://bitbucket.org/lig-admin/lig-wordpress-plugins/src/master/all-in-one-wp-migration-unlimited-extension/)\n\n## 🐶 Usage Environment\n\n- [Docker Desktop](https://hub.docker.com/editions/community/docker-ce-desktop-mac/)\n- Node.js \u003e= 18\n\n## 😌 Local Environment Setup\n\n1. package install\n\n```bash\nnpm ci or npm install\n```\n\n2. wp start up \u0026 db import\n\n```bash\nnpm run wp:setup\n```\n\n3. frontend build start\n\n```bash\nnpm run dev\n```\n\nopen \u003chttp://localhost:3030/\u003e\n\n- wp login\n\nopen \u003chttp://localhost:3030/wp-admin\u003e\n\n```bash\nuser : admin\npassword : password\n```\n\n## 💻 Production Upload\n\n```bash\nnpm run build\n```\n\nアップロードの際は`/dist`以下をアップロードしてください。\n\n## 🏠 Browser Sync\n\nこのプロジェクトでは、Viteサーバーのネットワークアクセスのために .wp-env.json ファイルで VITE_SERVER を指定しています。\n\n```json\n\"VITE_SERVER\": \"http://0.0.0.0:3000\"\n```\nデフォルトでは 0.0.0.0 が指定されており、ローカルネットワーク上の他のデバイスからアクセスすることが可能です。\n\nネットワーク経由でのアクセスが必要な場合、`npm run dev`を実行した際にNetwork部分に表示されるIPアドレスをVITE_SERVERの値に一時的に変更する必要があります。\n例えば、IP アドレスが 100.00.0.000 の場合は以下のように設定します。\n\n```json\n\"VITE_SERVER\": \"http://100.00.0.000:3000\"\n```\n\n※.wp-env.json は Git 管理されているため、ネットワークアクセスのための変更はコミットしないようにしてください。\u003cbr /\u003e暫定的な変更として行い、変更が不要になったら元に戻すか、変更を破棄してください。\n\nVITE_SERVERの値を反映するために以下のコマンドを実行します。\n\n```bash\nnpm run wp:restart\n```\n\nBrowserSyncを利用して複数デバイス間での同期を実現しています。起動後は3030番でアクセスできます。\n\nopen \u003chttp://100.00.0.000:3030/\u003e\n\n## 😺 Grid System\n\n案件によっては60分割のグリッドシステムによってデザインされています。\u003cbr\u003e\nスタイリングがしやすいように補助的な役割を担う機能が既に用意されています。\n\n- D キー押下でグリッドラインの表示/非表示が切り替わります。\n- グリッドラインが表示されるのは開発モードの時のみです。\n\n## 😻 Styling\n\nクラスの命名については基本的に BEM を採用しています。\n\n- ネスト機能の多用は可読性と検索性が落ちるので控えるようにしてください。\n\n```scss\n// NG\n.hoge {\n  \u0026__title {\n    color: black;\n  }\n}\n\n// OK\n.hoge__title {\n  color: black;\n}\n```\n\n固定値か相対値でコーディングするかはプロジェクトやデザインによって変わってくるので、最初に協議するようにしてください。\n\n- 相対値を使用する場合は`vw`関数を使用するようにしてください。\n\n```scss\n.hoge {\n  font-size: vw(16);\n}\n```\n\n- グリッドの値を参照したい場合は`rem`関数を使用するようにしてください。\n\n```scss\n.hoge {\n  width: rem(1); // 1グリッド\n}\n```\n\n## 🌙 How to reference images from Css\n\n$base-dir は設定をするとCSSでローカルと本番で異なる参照をすることができます。\n\n```scss\nbackground-image: url($base-dir + \"assets/images/icon-blank.svg\");\n```\n\n## 😎 Svg Sprite\n\n```php\n\u003c?= get_svg_sprite('logo', 'LIG') ?\u003e\n```\n\n## 👟 Image\n\n画像最適化用に`picture.php`を用意しています。こちらを使用すると`.avif`または`.webp`で画像が配信されます。\n\n```php\n\u003c?php get_template_part(\"./parts/picture\", null, [\n  \"images\" =\u003e [\n    \"src\" =\u003e \"sample-01.jpg\",\n    \"width\" =\u003e \"1280\",\n    \"height\" =\u003e \"600\",\n    \"alt\" =\u003e \"\",\n  ],\n]); ?\u003e\n```\n\n## 🍰 Assets\n\nローカル環境ではVITEの開発サーバー、本番環境ではテーマのルートを参照する必要があるため基本的に`vite-config.php`の関数を使用してAssetsにアクセスしてください。\n\n```php\n\u003cimg src=\"\u003c?= vite_src_images('sample-01.jpg') ?\u003e\" decoding=\"async\" width=\"1280\" height=\"800\" alt=\"\"\u003e\n```\n\n```php\n\u003cimg src=\"\u003c?= vite_src_images('icon-blank.svg') ?\u003e\" decoding=\"async\" width=\"30\" height=\"30\" alt=\"\"\u003e\n```\n\n## ✋ Lint\n\n```bash\nnpm run lint:check\n```\n\n```bash\nnpm run lint:fix\n```\n\nLint はプリコミット時に必ず実行されます。以下の vscode プラグインをインストールすると vscode 保存時にも Lint を実行することができるので便利です。\n\n- [prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)\n- [markuplint](https://marketplace.visualstudio.com/items?itemName=yusukehirao.vscode-markuplint)\n- [stylelint](https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint)\n- [eslint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)\n\n## 👉 Git Flow\n\n開発段階では基本的にfeatureブランチを作成して、mainにマージしてください。CICDが実装されている場合 main ブランチにマージすると自動デプロイの処理が実行されるので誤って本番サーバーにアップしないように注意してください。\n\n## 👀 Document\n\n- [wp-env](https://ja.wordpress.org/team/handbook/block-editor/reference-guides/packages/packages-env/)\n- [vite](https://ja.vitejs.dev/)\n\n## 🚨 Trouble Shoot\n\n- All-in-One WP Migrationでローカル環境のデータベースをエクスポートしてテストサイトにインポートした際に、テーマファイルが「src」になる\n\nテーマは通常、Git管理され、CI/CDを通じてデプロイされるため、All-in-One WP Migrationのエクスポートに含めないことを推奨しています。\u003cbr\u003eデータベースのバックアップや移行が主な目的であれば、All-in-One WP Migrationでデータベースのみをエクスポートし、インポートすることが推奨されます。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliginc%2Fwp-starter-theme","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliginc%2Fwp-starter-theme","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliginc%2Fwp-starter-theme/lists"}