-
Notifications
You must be signed in to change notification settings - Fork 170
Website content builds
Each sub-site and its contents are stored in a github repository under https://github.com/jquery/. For example, navigating to https://github.com/jquery/api.jquery.com will show the contents of the api.jquery.com site.
Scott Gonzalez's (https://github.com/scottgonzalez) grunt-jquery-content plugin translates the contents from the various website repositories into WordPress posts/page files into the dist/wordpress directory, then deploys these to your local/development WordPress instance using grunt-wordpress using the config.json file located in the local repository directory.
Many of the grunt builds for the website content projects require xsltproc to be installed. If you are on a Mac you likely have this installed (simply run xsltproc from the terminal to determine). If you're on a Windows machine you may need to download and install xsltproc and its dependencies:
- http://www.sagehill.net/docbookxsl/InstallingAProcessor.html
- http://www.zlatkovic.com/libxml.en.html
- ftp://ftp.zlatkovic.com/libxml/
Additionally, this guide assumes that grunt & npm are installed and configured.
If you have not already done so, fork the website content repo that you want to publish locally then clone it to a build outside of your *.jquery.com WordPress environment.
git clone https://github.com/{ghname}/api.jquery.com
Add remote upstream/etc. as normal
cd to the directory
cd api.jquery.com
Install dependencies
npm install
Get coffee while dependencies download
Rename the config-sample.json to config.json
mv config-sample.json config.json
OR
ren config-sample.json config.json
Open that file in whatever text editor you prefer, and change the username & password entries to match the admin login/password of your local WordPress instance.
Note: when originally committed the config-sample.json files used "dev." as a prefix; later configurations are now using "local." (e.g. "local.api.jquery.com") which are resolved by jQuery's DNS servers. This simplifies configuration so that you don't need to add entries to your /etc/hosts or C:\Windows\system32\drivers\etc\hosts file. You may need to also adjust the url in the config.json depending on how you've configured your environment, but this url should always be prefixed with "dev." or "local."
A 'grunt deploy' is all that remains.
grunt deploy
Possible issues:
`>> Error publishing {file.ext}
Error: XML-RPC fault: Unable to create directory {webroot}/web-base-templates/blogs.dir/.…` For grunt-wordpress to function properly, the plugin needs to be able to write to {webroot}/web-base-template/ - you may have to adjust permissions to ensure this.