This repository has been archived by the owner on Jan 15, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First version of the @lewagon's Middleman Template
- Loading branch information
0 parents
commit ddea134
Showing
10 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Le Wagon Middleman template | ||
|
||
Welcome on this short guide on how to quickstart your next Middleman project with [Le Wagon](https://www.lewagon.com) best practices. | ||
|
||
## Getting started | ||
|
||
In your terminal, check you have Middleman: | ||
|
||
```bash | ||
gem install middleman | ||
# You should have a version >= 4.2.1 | ||
``` | ||
|
||
Then run the following: | ||
|
||
```bash | ||
cd ~/code/YOUR_GITHUB_NICKNAME | ||
middleman init YOUR_PROJECT -B -T lewagon/middleman-template | ||
cd YOUR_PROJECT | ||
|
||
git init | ||
git add . | ||
git commit -m 'Generated a new middleman project with lewagon/middleman-template' | ||
|
||
hub create # To create a repo on GitHub | ||
git remote -v # Check that the `origin` remote is set. | ||
git push origin master | ||
``` | ||
|
||
You should be able to run: | ||
|
||
```bash | ||
middleman server | ||
``` | ||
|
||
And go to [localhost:4567](http://localhost:4567) | ||
|
||
## Deployment | ||
|
||
Make sure that your `git status` is clean and run: | ||
|
||
```bash | ||
middleman deploy | ||
``` | ||
|
||
This should build your Middleman project and push it to the `gh-pages` of your GitHub repository. Then go to `YOUR_GITHUB_NICKNAME.github.io/YOUR_PROJECT` to see it live 🚀 ! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
require 'thor/group' | ||
|
||
module Middleman | ||
class Generator < ::Thor::Group | ||
include ::Thor::Actions | ||
|
||
source_root File.expand_path(File.dirname(__FILE__)) | ||
|
||
def copy_default_files | ||
directory 'template', '.', exclude_pattern: /\.DS_Store$/ | ||
end | ||
|
||
def bundle_install | ||
run 'bundle install' | ||
end | ||
|
||
def download_assets | ||
run 'curl -L https://github.com/lewagon/stylesheets/archive/master.zip > stylesheets.zip' | ||
run 'unzip stylesheets.zip -d source && rm stylesheets.zip' | ||
run 'mv source/rails-stylesheets-master source/stylesheets' | ||
run 'mv source/stylesheets/application.scss source/stylesheets/application.css.scss' | ||
run 'rm source/stylesheets/README.md' | ||
end | ||
|
||
def generate_binstub | ||
run 'bundle binstubs middleman-cli' | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.bundle | ||
.cache | ||
.DS_Store | ||
.sass-cache | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'middleman', '~> 4.2' | ||
gem 'middleman-autoprefixer', '~> 2.7' | ||
gem 'middleman-sprockets' | ||
gem 'middleman-deploy', git: 'https://github.com/lewagon/middleman-deploy.git' | ||
|
||
# Assets | ||
gem 'font-awesome-sass', '~> 4.2.0' | ||
gem 'bootstrap-sass', '~> 3.3.1' | ||
gem 'jquery-middleman' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
activate :autoprefixer do |prefix| | ||
prefix.browsers = "last 2 versions" | ||
end | ||
|
||
page '/*.xml', layout: false | ||
page '/*.json', layout: false | ||
page '/*.txt', layout: false | ||
|
||
configure :build do | ||
activate :minify_css | ||
activate :minify_javascript | ||
activate :asset_hash | ||
activate :relative_assets | ||
set :relative_links, true | ||
end | ||
|
||
activate :deploy do |deploy| | ||
deploy.build_before = true | ||
deploy.deploy_method = :git | ||
end |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
title: Le Wagon - Middleman | ||
--- | ||
|
||
<h1> | ||
Congrats! | ||
</h1> | ||
|
||
<p>Le Wagon's middleman template is now set up.</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// This is where it all goes :) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="x-ua-compatible" content="ie=edge"> | ||
<meta name="viewport" | ||
content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
<!-- Use the title from a page's frontmatter if it has one --> | ||
<title><%= current_page.data.title %></title> | ||
<%= stylesheet_link_tag "application" %> | ||
<%= javascript_include_tag "application" %> | ||
<%= favicon_tag 'images/favicon.png' %> | ||
</head> | ||
<body> | ||
<%= yield %> | ||
</body> | ||
</html> |