percipioglobal / craft
Percipio.London Craft 4 CMS 框架项目
该包的规范仓库似乎已不存在,因此该包已被冻结。
- dev-v4-vite
- dev-develop
- dev-craft-webpack
- 4.2.0
- 4.1.0
- 4.0.0
- 2.0.0
- 1.5.1
- 1.5.0
- 1.4.10
- 1.4.9.1
- 1.4.9
- 1.4.8
- 1.4.7
- 1.4.6
- 1.4.5
- 1.4.4
- 1.4.3
- 1.4.2
- 1.4.1.4
- 1.4.1.3
- 1.4.1.2
- 1.4.1.1
- 1.4.1
- 1.4.0.2
- 1.4.0
- 1.3.0
- 1.2.2
- 1.2.1.2
- 1.2.1.1
- 1.2.1
- 1.2.0
- 1.1.3
- 1.1.2.1
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-renovate/configure
- dev-craft-v4-vite
- dev-craft-vite
This package is auto-updated.
Last update: 2024-04-11 03:10:07 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 页面,并实现了一系列技术和技巧。
- Docker;Docker 用于本地开发;有关详细信息,请参阅下面的 设置本地开发。
- 如 An Effective Twig Base Templating Setup 中所述,这是一个基于 Twig 的基本模板设置。
- 如 Vite.js Next Generation Frontend Tooling + Craft CMS 中所述,使用 Vite.js 作为构建系统。
- 使用 TypeScript 为严格类型 JavaScript 代码。
- 使用 Vue.js 3.0 处理网站的一些交互部分,Vue.js 3.x 允许我们利用 Composition API。
- 使用 Tailwind CSS 为全站 CSS。
- 如 Annotated JSON-LD Structured Data Examples 中所述,使用 JSON-LD 结构化数据。
- 播客剧集和其他页面的 Google AMP 版本
- 图像转换是通过 Serverless Image Handler lambda 函数完成的,如 Setting Up Your Own Image Transform Service 文章中所述。
- 静态资产存储在 AWS S3 存储桶中,CloudFront 作为 CDN,如 Setting Up AWS S3 Buckets + CloudFront CDN for your Assets 文章中所述。
- 通过 Google 的 Workbox 实现服务工作者,如 Service Workers and Offline Browsing 中所述。
- 如 Implementing Critical CSS on your website 中所述,实现关键 CSS。
- 如 Handling Errors Gracefully in Craft CMS 中所述,处理前端错误。
- 根据使用自定义模块增强Craft CMS 3网站,创建了一个自定义网站模块
- 基于CLI的队列,请参阅Craft CMS中强大的队列任务处理
- buddy.works原子部署
...以及可能还有许多其他内容。
以下Craft CMS插件在本网站中使用:
- AWS S3 - 添加Amazon S3存储类型
- Feed Me - 从XML、RSS或ATOM源导入条目和数据
- Redactor - 使用Imperavi的Redactor编辑富文本内容
- Mailgun - Craft CMS的Mailgun邮件适配器
- Position Fieldtype - 添加位置字段类型
- ImageOptimize - 用于网站上的优化图像和
srcset - Minify - 压缩HTML和内联JS/CSS
- Eager Beaver - 处理条目页面的预加载
- SEOmatic - 处理网站端SEO
- Vite - 以现代方式加载由vite生成的
manifest.json资源 - Typogrify - 智能引号和其他排版连字
- Colour Swatches - 添加调色板
- Timeloop - 创建可重复的日期
- Super Table - 字段类型,用于创建强大的表格
- Spoon - 组织我们的矩阵字段
使用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-server在https://: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),可在网络上和更广泛的应用场景中创建定制化数字体验。
它具有以下特点:
- 直观的控制面板,用于管理任务和内容创建。
- 全新的内容建模方法和前端开发方法,具体请参考 CraftCMS 开发文档。
- 内置的插件商店,提供数百个免费和商业插件,具体请参考 CraftCMS 插件商店。
- 强大的框架,用于模块和插件开发,具体请参考 CraftCMS 扩展文档。
更多关于 Craft 的信息请访问 craftcms.com。
技术规格
Craft 使用 PHP(7+)编写,基于 Yii 2 框架。它可以使用 MySQL(5.5+)和 PostgreSQL(9.5+)进行内容存储。
安装
有关安装 Craft 3 的帮助,请参阅以下文档页面:
常用资源
- 文档 – 阅读官方文档。
- 指南 – 跟随官方指南。
- #craftcms – 查看关于 Craft 的最新推文。
- Discord – 加入社区。
- Stack Exchange – 获取帮助并帮助他人。
- CraftQuest – 观看无限的视频课程和课程。
- Craft 链接列表 – 保持最新信息。
- nystudio107 博客 – 学习 Craft 和现代网络开发。