{"id":22606356,"url":"https://github.com/themejuice/sprout","last_synced_at":"2025-04-15T15:21:13.632Z","repository":{"id":17484953,"uuid":"20266596","full_name":"themejuice/sprout","owner":"themejuice","description":"Sprout – WordPress starter template. Utilizes Grunt, Composer, Bower, WP-CLI, Sass, CoffeeScript \u0026 even a little PHP Haml.","archived":false,"fork":false,"pushed_at":"2017-02-14T15:10:52.000Z","size":359,"stargazers_count":13,"open_issues_count":3,"forks_count":6,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-28T21:46:48.128Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.themejuice.it","language":"ApacheConf","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/themejuice.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-28T17:41:27.000Z","updated_at":"2024-08-27T16:15:40.000Z","dependencies_parsed_at":"2022-08-04T19:16:12.050Z","dependency_job_id":null,"html_url":"https://github.com/themejuice/sprout","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themejuice%2Fsprout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themejuice%2Fsprout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themejuice%2Fsprout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themejuice%2Fsprout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/themejuice","download_url":"https://codeload.github.com/themejuice/sprout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249094939,"owners_count":21211837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-08T14:13:19.038Z","updated_at":"2025-04-15T15:21:13.594Z","avatar_url":"https://github.com/themejuice.png","language":"ApacheConf","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sprout\n_You are free to fork this repository and modify it as you see fit. If you do go that route, let us know and we can add it into the list of available starter templates for our [command line utility, `tj`](https://github.com/ezekg/theme-juice-cli)._\n\n## Features\n* Awesome and trendy tech! Develop with [PHP Haml](https://github.com/arnaud-lb/MtHaml), [CoffeeScript](https://github.com/gruntjs/grunt-contrib-coffee) and [Sass](https://github.com/gruntjs/grunt-contrib-sass)\n* Dependency management with Composer and Bower, allowing easier version control\n* More organized folder structure, allowing WordPress to be inside its own directory\n* Manage and deploy to different environments with [Dotenv](https://github.com/vlucas/phpdotenv), all from a single codebase\n\nWhen used with [Theme Juice CLI](https://github.com/ezekg/theme-juice-cli), you can also:\n* Easily create local development environments using Vagrant\n* Easily manage your development sites using WP-CLI from your local machine\n* Multi-stage one command deployments using [Capistrano](http://capistranorb.com/) and [WP-CLI](http://wp-cli.org/)\n\n## ⚠️ Development dependencies ⚠️\n**Please ensure that you have these dependencies installed before attempting to\nuse this starter template.** The build step **will fail** if you do not have\nall of these installed on your machine.\n* [Composer](https://getcomposer.org/)\n* [WP-CLI \u003e= 0.24](http://wp-cli.org/)\n* [Ruby \u003e= 1.9.3](https://www.ruby-lang.org/en/) ([use RVM, or something similar to avoid having to use `sudo`](https://rvm.io/rvm/install))\n* [Bundler](http://bundler.io/)\n* [NPM](https://www.npmjs.com/) ([here's a good guide on properly installing NPM to not need `sudo`](http://www.johnpapa.net/how-to-use-npm-global-without-sudo-on-osx/))\n* [Grunt](http://gruntjs.com/)\n* [Bower](http://bower.io/)\n\n## Installation\nAfter all of the required tools are properly installed and they're executable\nwithout `sudo`, run:\n\n```\ntj install\n```\n\nto execute the template install command defined within the `Juicefile`.\n\n## Included packages\n* [Core](https://github.com/ezekg/theme-juice-core)\n* [Functions](https://github.com/ezekg/theme-juice-functions) (commonly used helper-functions)\n* [Shortcodes](https://github.com/ezekg/theme-juice-shortcodes) (commonly used shortcodes)\n\n## Getting started\n\n### Setting up a new project\nIf you're starting a new project, run:\n\n```\ntj create\n```\n\nand follow the prompts.\n\n### Setting up an existing project\nIf you're working on an existing project, run:\n\n```\ntj setup\n```\n\nand follow the prompts. Multiple values will be inferred from the `Juicefile`\nfrom previous development of the project.\n\n### Building a project\nTo build a project (compile assets, install dependencies, etc.), run:\n\n```\ntj install\n```\n\n### Watching and compiling assets\nTo watch and compile assets with Grunt, run:\n\n```\ntj dev\n```\n\nSee the `Gruntfile.coffee` file for additional tasks. See Grunt's documentation\nfor additional information.\n\n### Managing front-end dependencies\nTo install and update Bower dependencies, run:\n\n```\ntj asset install \u003cbower_package\u003e\n```\n\nSee Bower's documentation for additional commands and information.\n\n### Managing back-end dependencies\nTo install and update Composer dependencies, run:\n\n```\ntj vendor require \u003ccomposer_package\u003e\n```\n\nSee Composer's documentation for additional commands and information.\n\n### Managing WordPress\nTo manage your development WordPress installation with WP-CLI, run\n`wp @development \u003ccommand\u003e` e.g. `wp @development db export`,\n`wp @development search-replace project.com project.dev`.\n\nYou can add additional stages to your `wp-cli.yml` or `wp-cli.local.yml` file to\nmanage them via the command line as well. For example,\n\n```yml\n@staging:\n  ssh: deploy@192.168.1.1/var/www/staging\n@production:\n  ssh: deploy@192.168.1.1:1234/var/www/production\n```\n\nSee WP-CLI's documentation for additional commands and information.\n\n## Configuring your `$theme`\nWithin the `functions.php` file, there is a global `$theme` variable. This is\nwhere you will add your theme's assets and configure any packages that you are\nincluding. Most packages will accept an empty array (`array()`) to use the\ndefault settings defined within the package itself; if you want more control,\nyou can specify which features to load with a boolean. For example, by default,\nwe selectively load only a few short codes:\n\n```php\n\u003c?php\n\nuse \\ThemeJuice\\Theme;\n\n$theme = new Theme(array(\n  \"packages\" =\u003e array(\n    \"functions\" =\u003e array(),\n    \"shortcodes\" =\u003e array(\n      \"button\" =\u003e true,\n      \"colors\" =\u003e true,\n      \"fonts\" =\u003e true,\n    ),\n  ),\n  \"assets\" =\u003e array(\n    \"jquery\" =\u003e array(\n      \"type\" =\u003e \"script\",\n      \"location\" =\u003e \"assets/scripts/jquery.min.js\",\n      \"version\" =\u003e \"1.11.2\",\n      \"in_footer\" =\u003e true,\n    ),\n    \"sprout-scripts\" =\u003e array(\n      \"type\" =\u003e \"script\",\n      \"location\" =\u003e \"assets/scripts/main.min.js\",\n      \"dependencies\" =\u003e array(\"jquery\"),\n      \"version\" =\u003e \"0.1.0\",\n      \"in_footer\" =\u003e true,\n    ),\n    \"sprout-styles\" =\u003e array(\n      \"type\" =\u003e \"style\",\n      \"location\" =\u003e \"assets/css/main.min.css\",\n      \"version\" =\u003e \"0.1.0\",\n    ),\n  ),\n));\n```\n\n## App structure\nWe try to follow the [12 factor app](http://12factor.net/) philosophy as closely as makes sense for WordPress.\n* We use a `.env` file to store all environment information, such as database credentials, debug options, salts, etc. These files should _never_ be shared or version controlled. If an `.env` is not desired for production, you may set global `ENV` variables instead. _Never_ hard-code these into the `wp-config.php` file, as it will be overwritten on the next deployment\n* All source files are kept inside `src/`, which contains uncompiled Sass, CoffeeScript, Haml, as well as uncompressed images, font files, etc. _Be warned:_ do not place assets straight into the `app/` directory, as they will be permanently removed on the next build cycle. Keep everything inside `src/`, using Grunt to copy over files where necessary\n* WordPress and plugins are managed via Composer\n* Front-end assets are managed through Bower\n* Grunt is used as our build tool of choice\n\n## Programming languages\n* We use Sass for writing CSS\n* We use CoffeeScript for writing JavaScript\n* We use a PHP port of Haml called MtHaml for templating\n* Other site-assets, such as custom controllers are written in PHP\n\n## `.env` precedence\nOrder that the starter template attempts to load is (order defined within `wp-config.php`),\n\n1. `.env.development`\n1. `.env.staging`\n1. `.env.production`\n1. `.env`\n\n## Deploying to production\nTo deploy a project, please install [`tj`](http://themejuice.it/deploy). After\nyou've done that, please follow these steps:\n\n1. Create a new user for deployment on the server (optional).\n1. Go through [GitHub's tutorial on generating an SSH key](https://help.github.com/articles/generating-an-ssh-key/) (if you've already set up public/private keys, then feel free to skip this step).\n1. Add your public key to the server you want to deploy to, so that you can SSH into it without a password (required by Capistrano, the tool used for deployment); to do so, copy your public key via `pbcopy \u003c ~/.ssh/id_rsa.pub` on your machine, and then add it into the `~/.ssh/authorized_keys` file on the server.\n1. Set up a stage within your `Juicefile` configuration, using one of the [example stages](https://github.com/ezekg/theme-juice-starter/blob/master/Juicefile#L126-L155) as a starting point.\n1. Confirm the deployment user owns the deploy path.\n1. Run `tj remote \u003cstage\u003e setup` to setup the required directories, where `stage` is the stage name you've chosen. Ensure that this runs without any errors.\n1. Configure your stage's web root to point to `{deploy_path}/current`. [See Capistrano's folder structure for more information](http://capistranorb.com/documentation/getting-started/structure/).\n1. Create an empty database and configure your `{deploy_path}/shared/.env.{stage}` file on the server.\n1. Run `tj deploy \u003cstage\u003e` to deploy your project.\n1. Run `tj remote \u003cstage\u003e uploads:push` to push uploads from your development environment to the server (optional).\n1. Run `tj remote \u003cstage\u003e db:push` to push your development database to the server (optional).\n1. Have a beer (or 2)! 🍻\n\nWhen deploying to production, ensure that you do _not_ deploy the `robots.txt` file,\nand that you disable all development plugins. Do not deploy the `src/` directory,\nor any of the build files e.g. `Gruntfile.coffee`, `bower.json`, `package.json`,\n`composer.json`, `composer.lock`, etc.\n\nYou can do so by adding a stage that looks similar to this:\n\n```yml\ndeployment:\n  rsync:\n    options:\n      - --recursive\n      - --delete\n      - --delete-excluded\n      - --include=\"vendor/**/*\" # Overrides any excluded patterns\n      - --exclude=\"src/\" # Everything below this ignores files that we do not want to deploy\n      - --exclude=\"bower_components/\"\n      - --exclude=\"node_modules/\"\n      - --exclude=\".sass-cache/\"\n      - --exclude=\".editorconfig\"\n      - --exclude=\".env.sample\"\n      - --exclude=\".git*\"\n      - --exclude=\"Gemfile*\"\n      - --exclude=\"Gruntfile*\"\n      - --exclude=\"Juicefile*\"\n      - --exclude=\"composer.*\"\n      - --exclude=\"package.json\"\n      - --exclude=\"bower.json\"\n      - --exclude=\"README.*\"\nstages:\n  production:\n    server: 192.168.1.1\n    path: /var/www/production\n    user: deploy\n    url: example.com\n    uploads: app/uploads\n    tmp: tmp\n    shared:\n      - .env.production\n    ignore:\n      - robots.txt # Ignore the robots.txt file on production ONLY\n    roles:\n      - :web\n      - :app\n      - :db\n```\n\nA lot configuration has been omitted here for demonstration purposes only. Please\nbe sure to check out the deployment section within the `Juicefile` for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthemejuice%2Fsprout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthemejuice%2Fsprout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthemejuice%2Fsprout/lists"}