greenpeace/planet4-child-theme-nordic
Composer 安装命令:
composer require greenpeace/planet4-child-theme-nordic
包简介
Planet4 Child theme for GP Nordic
README 文档
README
c# Greenpeace Planet 4 Nordic Child Theme
The Planet 4 Nordic Child Theme is a child theme built for the Planet 4 project. It customizes the parent theme by adding unique features and styles specific to the Nordic region. This child theme customisez the Planet4 Master Theme following this Design System.
Table of Contents
Prerequisites
Make sure you have the following tools installed on your machine:
- Node.js (v16 recommended)
- npm (comes with Node.js)
- Composer (for PHP dependencies and coding standards)
- WordPress setup (parent theme and WordPress installation)
Installation
To install and set up the theme locally, follow these steps:
-
Clone the repository:
git clone https://github.com/greenpeace/planet4-child-theme-nordic.git
-
Navigate to the theme directory:
cd planet4-nordic-child-theme -
Install the npm dependencies:
Run
npm installto install all necessary Node.js packages:npm install
-
Install Composer dependencies:
Run
composer installto install PHP dependencies (like coding standards):composer install
-
Activate the theme:
- Upload the child theme to your WordPress
/wp-content/themesdirectory. - Activate the theme from the WordPress admin dashboard (
Appearance > Themes).
- Upload the child theme to your WordPress
Usage
Once installed, the theme can be customized and extended as per the needs of the Nordic campaign. The child theme inherits most of its functionality from the parent theme, but you can add custom styles, templates, and features as needed.
To modify or add features to the theme, navigate to the planet4-nordic-child-theme directory, make changes to the appropriate files, and use the provided npm scripts for development.
Development
Available npm Scripts
-
Build CSS: Compiles the SCSS files into a minified CSS file.
npm run build:css
-
Build: Compiles all assets for production using Webpack and outputs them to the
build/directory.npm run build
-
Start: Launches a development server with live reloading and builds assets in development mode.
npm run start
-
Lint CSS: Lints the SCSS files to ensure coding standards are followed.
npm run lint:css
Composer Scripts for PHP Code Standards
-
Fixes: Automatically fixes PHP code style issues.
composer run fixes
-
Sniffs: Runs PHP CodeSniffer (
phpcs) to check PHP files against coding standards.composer run sniffs
File Structure
Here's a brief overview of the key directories and files in the project:
planet4-nordic-child-theme/
├── assets/ # Compiled theme assets (CSS, JS)
│ ├── build/ # Output directory for compiled and minified production assets
│ └── src/ # Source SCSS and JS files
├── includes/ # Theme-specific PHP includes
├── page-templates/ # Theme-specific Twig templates
├── vendor/ # Composer dependencies
├── functions.php # Main theme functions
├── webpack.config.js # Webpack configuration for asset bundling
├── style.css # Main stylesheet (import parent theme styles)
├── package.json # Node.js dependencies and npm scripts
├── composer.json # PHP dependencies and Composer scripts
└── README.md # Project documentation (this file)
Customization
To override parent theme styles, place your custom SCSS files in the assets/src/scss/ directory. These files are automatically compiled and output to assets/build/ when running the build scripts.
Coding Standards
We follow WordPress Coding Standards to ensure clean, readable, and maintainable code.
The coding standards are enforced through phpcs (PHP CodeSniffer) and can be automatically corrected using phpcbf. Composer handles both tools.
To check for coding standard violations:
composer run sniffs
To automatically fix issues:
composer run fixes
Contributing
We welcome contributions! To contribute to this project:
- Fork the repository.
- Create a new branch (
git checkout -b feat/my-feature). - Make your changes.
- Push your branch (
git push origin feat/my-feature). - Open a Pull Request.
Please ensure that your code follows the project's coding standards. Use npm run lint:css for CSS and composer run sniffs for PHP.
License
This project is licensed under the GNU License. See the LICENSE file for details.
greenpeace/planet4-child-theme-nordic 适用场景与选型建议
greenpeace/planet4-child-theme-nordic 是一款 基于 SCSS 开发的 Composer 扩展包,目前已累计 4.76k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2020 年 04 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 greenpeace/planet4-child-theme-nordic 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 greenpeace/planet4-child-theme-nordic 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 4.76k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2020-04-13