Static site, run the preview server locally while developing, then compile it and push it to the server via ftp.
Rather than making changes through a CMS, you just edit the code and commit it.
- Pull down the project
git clone [email protected]:hyfn/hyfn8-corporate.git
- Navigate into it:
cd hyfn8-corporate
- Install dependencies:
bundle install
- Run the server:
middleman
- You can access the project at
http://localhost:4567/
middleman
- Starts the preview server at http://localhost:4567/middleman build
- Compiles the site into the "build" folder.middleman help
- Show a list of all commands.middleman sync
- Deploys the build folder to S3 (staging.)middleman deploy
- Deploys the build folder to prod.
Be sure to push changes to git as well.
source
directory - This is the non-compiled stuff that you edit.- New pages go in the top level of the source folder. URLs correspond the the file name -
work.html.erb
is at/work/
build
directory - This is the generated static site. This gets deployed. Don't edit it directly.config.rb
- Configuration file for the site.- Files starting with an underscore aren't compiled. So partials and files included in other files should start with an underscore.
- All css/js assets are loaded on every page.
- Only
all.css.scss
,all.js.cofee
andhead.js.coffee
have corresponding compiled files. All other css/js files are concatenated into these. - CSS - one stylesheet for each page, and distinct components get their own files. Additionally, the
css/_common.css.scss
contains styles for common elements, andcss/_layout.css.scss
contains styles for the elements inlayout.erb
. - When referring to image paths in code, always use a helper. Use image-url("path.png") in css and <%= image_tag "path.png" %> in html.
- Putting an underscore at the beginning of the file name will usually do it.
Currently pushes to S3. Do it like this:
- copy
data/sync.sample.yml
todata/sync.yml
and update the values - run
middleman build
- run
middleman sync
- go to http://hyfn8-corporate.s3-website-us-east-1.amazonaws.com/
- add your public key to the prod server (ask [email protected] or [email protected])
- run
middleman build
- run
middleman sync
- go to http://hyfn8.com