Percipio.London Craft 4 CMS 框架项目

该包的规范仓库似乎已不存在,因此该包已被冻结。

安装: 144

依赖: 0

建议者: 0

安全: 0

星标: 7

关注者: 5

分支: 4

语言:Twig

类型:项目

4.2.0 2023-01-26 10:41 UTC

README

这是 Craft 3 CMS 项目用于 Pixel & Tonic 的规范 craftcms/craft 包的替代框架包。

Vite 构建链

该项目使用 Vite.js 作为构建系统,如 Vite.js Next Generation Frontend Tooling + Craft CMS 中所述,而不是通常的 webpack 构建链。

Vite 很

该项目基于 Craft CMS,使用独特的 templates/_boilerplate 系统为网页/AJAX/AMP 页面,并实现了一系列技术和技巧。

...以及可能还有许多其他内容。

以下Craft CMS插件在本网站中使用:

使用percipioglobal/craft

此项目包的工作方式与Pixel & Tonic的craftcms/craft包完全相同;您首先创建并安装项目来创建新项目

`composer create-project percipioglobal/craft:dev-craft-v4-vite PATH --no-install --remove-vcs`

请确保PATH是包含项目名称的路径,例如:

`composer create-project percipioglobal/craft:dev-craft-v4-vite vitecraft --no-install --remove-vcs`

我们使用--no-install,以确保不安装根项目的composer包。

设置本地开发环境

您需要在平台上安装Docker桌面,以在本地开发中运行项目

  • 在项目的根目录中(第一次构建可能需要一些时间),在终端中键入make dev启动站点
  • 导航到https://:8000以使用站点;vite-dev-serverhttps://:3000上运行

等待看到以下信息,以指示PHP容器已就绪

php_1         | Craft is installed.
php_1         | Applying changes from your project config files ... done
php_1         | [01-Dec-2020 18:38:46] NOTICE: fpm is running, pid 22
php_1         | [01-Dec-2020 18:38:46] NOTICE: ready to handle connections

...and the following to indicate that the Vite container is ready:

vite_1 | vite v2.3.2开发服务器运行在:https://:3000/ vite_1 | vite_1 | 网络:http://172.22.0.5:3000/ vite_1 | vite_1 | 1573ms内准备好。


The CP login credentials are initially set as follows:

Login: `support@percipio.london` \
Password: `letmein`

Obviously change these to whatever you like as needed.

Build the production assets by typing `make build` to build the critical CSS, fonts, and other production assets. They will appear in `cms/web/dist/` (just double-click on the `report-legacy.html` and `report-modern.html` files to view them).

**Important:** To find the correct credentials for `LOCAL_DB_CONTAINER` run `docker-compose up` and once the docker container is running, use the command `docker container ls` to find the correct name of the container.
If your project is called `test` the container will be somewhere along the lines of `test_mysql_1`. That's the value you do have to enter.

**N.B.:** Without authorization & credentials (which are private), the `make pulldb` will not work (it just runs `scripts/docker_pull_db.sh`). It's provided here for instructional purposes.

## Makefile Project Commands

This project uses Docker to shrink-wrap the devops it needs to run around the project.

To make using it easier, we're using a Makefile and the built-in `make` utility to create local aliases. You can run the following from terminal in the project directory:

- `make dev` - starts up the local dev server listening on `https://:8000/`
- `make build` - builds the static assets via the Vite buildchain
- `make clean` - shuts down the Docker containers, removes any mounted volumes (including the database), and then rebuilds the containers from scratch
- `make update` - causes the project to update to the latest Composer and NPM dependencies
- `make update-clean` - completely removes `node_modules/` & `vendor/`, then causes the project to update to the latest Composer and NPM dependencies
- `make composer xxx` - runs the `composer` command passed in, e.g. `make composer install`
- `make craft xxx` - runs the `craft` [console command](https://craftcms.com/docs/3.x/console-commands.html) passed in, e.g. `make craft project-config/apply` in the php container
- `make npm xxx` - runs the `npm` command passed in, e.g. `make npm install`
- `make pulldb` - runs the `scripts/docker_pull_db.sh` script to pull a remote database into the database container; the `scripts/.env.sh` must be set up first
- `make restoredb xxx` - runs the `scripts/docker_restore_db.sh` script to restore a local database dump into the database container; the `scripts/.env.sh` must be set up first

### Other notes

To update to the latest Composer packages (as constrained by the `cms/composer.json` semvers) and latest npm packages (as constrained by the `buildchain/package.json` semvers), do:

make update


To start from scratch by removing `buildchain/node_modules/` & `cms/vendor/`, then update to the latest Composer packages (as constrained by the `cms/composer.json` semvers) and latest npm packages (as constrained by the `buildchain/package.json` semvers), do:

make update-clean


To use Xdebug with VSCode install the [PHP Debug extension](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug ) and use the following configuration:
```json
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen for Xdebug",
            "type": "php",
            "request": "launch",
            "port": 9001,
            "log": true,
            "externalConsole": false,
            "pathMappings": {
                "/var/www/project/cms": "${workspaceRoot}/cms"
            },
            "ignore": ["**/vendor/**/*.php"]
        }
    ]
}

以下是从Pixel & Tonic的craftcms/craft的完整、未修改的README.md

.....

Craft CMS

关于Craft CMS

Craft 是一款灵活可扩展的内容管理系统(CMS),可在网络上和更广泛的应用场景中创建定制化数字体验。

它具有以下特点:

  • 直观的控制面板,用于管理任务和内容创建。
  • 全新的内容建模方法和前端开发方法,具体请参考 CraftCMS 开发文档
  • 内置的插件商店,提供数百个免费和商业插件,具体请参考 CraftCMS 插件商店
  • 强大的框架,用于模块和插件开发,具体请参考 CraftCMS 扩展文档

更多关于 Craft 的信息请访问 craftcms.com

技术规格

Craft 使用 PHP(7+)编写,基于 Yii 2 框架。它可以使用 MySQL(5.5+)和 PostgreSQL(9.5+)进行内容存储。

安装

有关安装 Craft 3 的帮助,请参阅以下文档页面:

常用资源