bramdeleeuw/recipe-boilerplate

快速启动新 SilverStripe 项目的模板

安装: 189

依赖者: 0

建议者: 0

安全性: 0

星级: 2

关注者: 2

分支: 2

语言:SCSS

类型:silverstripe-recipe

4.4.1 2022-11-16 12:07 UTC

README

SilverStripe Boilerplate 旨在简化新 SilverStripe 项目的启动,只需下载并开始使用。

维护者

如何安装

# create the project
# make sure to point to the new remote afterwards
composer create-project bramdeleeuw/recipe-boilerplate ./myproject dev-master

配置(使用 .env

您可以将 .env.example 文件重命名为 .env,该文件应如下所示(更多信息请参阅 https://docs.silverstripe.org/en/4/getting_started/environment_management/

此方法建议用于数据库和环境配置,因为您可以从版本控制中轻松排除它

# What kind of environment is this: development, test, or live (ie, production)?
SS_ENVIRONMENT_TYPE="dev"

# Database settings
SS_DATABASE_SERVER="localhost"
SS_DATABASE_USERNAME="USER"
SS_DATABASE_PASSWORD="PASSWORD"
SS_DATABASE_NAME="DB_NAME"

# Configure a default username and password to access the CMS on all sites in this environment.
SS_DEFAULT_ADMIN_USERNAME="admin"
SS_DEFAULT_ADMIN_PASSWORD="password"

# Make sure the command line knows what the site url is
SS_BASE_URL="http://example.com"

现在只需运行 mysite.com/dev/build,您就完成了,不需要进一步设置,您可以开始使用了

如何使用

此模板基于假设项目将是一个定制的网站/网络应用程序。因此,您可能会注意到主题文件夹中没有主题,计划是将所有模板、JavaScript 和 css/scss 添加到 mysite。这的好处是将整个项目放在一个地方,而不是分成两个文件夹。

文件结构

app
|-- src // your php code in here
|-- client // your frond end code goes in here
|   |-- src
|   |   |-- js // your js files and modules
|   |   |-- styles // your sass files and modules
|   |-- dist // compiled code
|-- images // project images
|-- templates // your templates, that others put into themes/mytheme/templates
|-- .gitignore
|-- .htaccess
|-- _config.php
|-- package.json
|-- webpack.mix.js
|-- yarn.lock