CPress 的目录结构如下:
.
├── application.properties               # 配置文件
├── cpress.jar                           # 主程序
├── plugins                              # 插件
├── public
│   ├── themes                           # 主题
│   │   ├── classic
│   │   └── simple
│   │       ├── css
│   │       │   └── style.css
│   │       ├── images
│   │       │   └── desert.png
│   │       ├── screenshot.png
│   │       └── templates
│   │           ├── _base.twig
│   │           ├── index.twig
│   │           └── single.twig
│   └── uploads                           # 用户上传文件保存目录
├── startup.bat                           # Windows 系统启动脚本
└── startup.sh                            # Linux / macOS 系统启动脚本
 
在 public/themes 目录中存放着所有【主题】,如果有多个题主题,则可以在管理后台 → 系统配置 → 主题 菜单下切换不同的主题。开发新主题,可以参考 simple 主题,这是一套非常简单的为初学者准备的主题。
通常一个主题有如下文件:
- screenshot.png 主题的封面截图,用于显示在管理后台的主题列表中
- css/ 存放该主题的样式文件
- images/ 存放主题中的图片
- templates/ 存放模板文件
- templates/index.twig 网站首页模板文件
开发新主题,只需要在 public/themes 中创建主题的目录(英文),编写模板代码,并放入 screenshot.png 封面截图。然后就可以在管理后台主题菜单中,切换使用新主题。