Updated Aug 27, 2016
You only need to do this for your system when you first start developing Airship projects, or whenever a new version of the cli becomes available. Download the latest version of the cli at:
[install.airshipcms.io[(http://install.airshipcms.io)
Nope.
Before you start building your project templates, set up the basic pages, collections, and product collections in your project's AirshipCMS admin panel. Remember the names of the layouts, templates, and template directories you are using for each page and section.
In your terminal, navigate to the directory you would like to work on Airship files. Ideally, this also the home for your project Git repository.
- Run
airship login projectsubdomain
, andy
to set the project root. Enter your superadmin email and password for the project - Run
airship land
to get the initial project files. You only need to do this once, if you are using Git to keep your files synced with other developers in your team. You may occasionally need to runairship land
again, if Airship core files change and you need to re-sync the hidden ".airship" files. - Run
airship serve
to pull in content from the cms. - Add the markup
{{{help}}}
in any template file to see what data is retreivable via HandlebarsJS. - Set up your
.gitignore
and any pre-process files and development files outsite of thecompartments
directory. - Use SourceTree or some other GUI to manage git files.
- Use Chrome to view the locally running project at
localhost:9001
.airship
/compartments
/airmail
/layouts
/partials
/assets
/styles
/scripts
/media
/templates
.env
/(other development project directories and assets go out here)
- All
compartments
struts are synced with Airship. layouts
andtemplates
mirror the layouts & template settings in the CMS for the project.assets
contain thescripts
andstyles
andmedia
directories. These directories can have any number of subdirectories.- For a list of allowed file types for each directory: [need to document]
- Keep any code and files that are not necessary for production outside of
compartments
This lists all commands.
airship
Log in to your project with your superadmin access level email, your password, and your AirshipCMS subdomain.
airship login projectname
You will be prompted to enter your email (careful, backspace is disabled).
Then you will be prompted to enter your password.
Note: airship login [projectname]
connects you to the airship server for the project globally on your computer. If you have landed the project in more than one location, logging in will open the connection to airship for the project in all those locations.
Do this the first time you work on the project. This pulls down necessary Airship config files and initial project structure. After the first time, you should have all your files frequently backed up in Git, so you will never really have to run airship land anymore, and you can simply create and launch your new files without ever landing again.
airship land
If for some reason you want to pull down the files that are live, you can run airship land again. Be sure you have backed up your local files because airship land will overwrite them. If you are using Git and have things safely backed up, you have nothing to worry about.
Airship serve runs the server that will locally render layouts, templates, and pull content from AirshipCMS. Run this in a terminal tab, while in other tabs you can run other airship commands and other processes that may be located outside of the compartments directory (such as scss compiline, gulp, etc).
airship serve
When you are ready to launch your local changes to production, run airship launch. This will overwrite all files on the server to match your local directory structure. If you have added files locally, they will be added to the server. If you have deleted files locally, they will be deleted from the server.
airship launch
If for some reason you need to back up the state of production compartments, then airship land files in a separate directory, or better yet, you already have them backed up in a different Git branch.
airship logout
Note: airship logout
disconnects you from the airship server for the project globally on your computer. If you have landed the project in more than one location, logging out will close the connection to airship for the project in all those locations.
- When you to scripts or styles that are located in the /assets/scripts or /assets/styles directories, they will link to "/assets/scripts/yourfile.js" and "/assets/styles/app.css"
- you can add whatever files you want outside of /compartments
- Only add .html templates files to /airmail, /layouts, and /templates.
- you can add .js and other scripts (and subdirectories) to /assets/scripts.
- You can add .css (and subdirectories) to /assets/styles.
- when you add a new collection or product collection, you need to add the appropriate /templatedirectory to /templates. The template directory should contains only the following 4 templates: index.html, show.html, categories.html, category.html (You can omit any of these, though they correspond directly to the list of aerostats, a view of a single aerostat, the list of categories for the collection, a list of aerostats within a category for a collection. Of course, if your collection does not require a show.html view or categories.html list, it is safe to omit the irrelevant files and not use the route.
- run {{{ help }}} on any template to get a generated list of accessible properties
- Airship propellers rendering uses _HandlebarsJS. View (Handlebars Documentation)[] for rendering syntax.
- Alternatively, you can access all content through the API, so you do not have to rely on handlebars rendering at all. This is especially useful when you want to filter items that have complex queries and constraints. With the api, you can build a custom app or mini-app that simply pulls data from Airship API and uses whatever method you want for rendering.
- If you have a shop on your site, you will need the cart and checkout scripts.
- need to add content to each page and section because otherwise nothing will render.
- create template directories. templates autogenerate. template directories do not.
- add base markup or autogenerate markup for each page & section.
When you run the installer, if you don't have proper permissions to run anything, run
chmod +x ~/.airship-bin/*