roots-example-project.com

Example Roots stack project (Trellis, Bedrock, Sage)

  • 所有者: roots/roots-example-project.com
  • 平台:
  • 許可證:
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

Roots Example Project

WordPress Version
Follow Roots

This repository is an example of how to integrate and use the following projects together:

For more background, see this blog post.

This project is a complete working example that's deployed on a Digital Ocean $5 droplet.

You can view it at https://roots-example-project.com/.

Requirements

Make sure you have installed all of the dependencies for Trellis, Bedrock and Sage before moving on.

At a minimum you need to have:

See our Getting Started docs:

Instructions

Here's how this example project was created:

  1. Create a new project directory: $ mkdir example.com && cd example.com
  2. Clone Trellis: $ git clone --depth=1 git@github.com:roots/trellis.git && rm -rf trellis/.git
  3. Clone Bedrock: $ composer create-project roots/bedrock site
  4. Install Sage: $ composer create-project roots/sage site/web/app/themes/sage
    • During theme setup, specify "https://roots-example-project.test" as the "Local development URL"
example.com/      # → Root folder for the project
├── trellis/      # → System management & deployment
└── site/         # → A Bedrock-based WordPress site
    └── web/
        ├── app/  # → WordPress content directory (themes, plugins, etc.)
        └── wp/   # → WordPress core (don't touch!)

Local development setup

  1. Clone this repository into a working directory (e.g., ~/Sites)
$ git clone git@github.com:roots/roots-example-project.com.git
  1. Install theme components
# @ roots-example-project.com/site/web/app/themes/sage
$ composer install
$ yarn && yarn build
  1. Fire up the server (be patient, but watch the console––it may prompt for your system password)
# @ roots-example-project.com/trellis
$ vagrant up

Note: to shut down the server: vagrant halt

  1. Test the install at roots-example-project.test

Remote server setup (staging/production)

Provision server:

# @ roots-example-project.com/trellis
$ ansible-playbook server.yml -e env=<environment>

Deploy:

# @ roots-example-project.com/trellis
./deploy.sh <environment> roots-example-project.com

# OR
ansible-playbook deploy.yml -e "site=roots-example-project.com env=<environment>"

To rollback a deploy:

ansible-playbook rollback.yml -e "site=roots-example-project.com env=<environment>"

Theme development

In development, run yarn start for live updates at localhost:3000. Important: always use the roots-example-project.test URL to access the WordPress admin.

# @ roots-example-project.com/site/web/app/themes/sage
$ yarn start

Production assets (minified CSS, JavaScript, images, fonts, etc.) need to be compiled. Run yarn build:production. The resulting files will be saved in themes/sage/dist/. Never edit files in the dist directory.

# @ roots-example-project.com/site/web/app/themes/sage
$ yarn build:production

Contributing

Contributions are welcome from everyone. We have contributing guidelines to help you get started.

Community

Keep track of development and community news.

主要指標

概覽
名稱與所有者roots/roots-example-project.com
主編程語言Jinja
編程語言Shell (語言數: 9)
平台
許可證
所有者活动
創建於2015-04-15 19:20:08
推送於2022-10-16 16:14:48
最后一次提交2022-10-16 12:13:30
發布數0
用户参与
星數461
關注者數45
派生數170
提交數682
已啟用問題?
問題數40
打開的問題數0
拉請求數28
打開的拉請求數0
關閉的拉請求數26
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?