diff --git a/app/index.js b/app/index.js index 2902fb5..c16b37f 100755 --- a/app/index.js +++ b/app/index.js @@ -90,10 +90,14 @@ JekyllizeGenerator.prototype.askForProject = function askForProject() { }, { name: 'tagline', message: 'What is the tagline of your project?' + }, { + name: 'projecturl', + message: 'What will the address for your site be?' }], function (props) { this.projectname = props.projectname; this.description = props.description; this.tagline = props.tagline; + this.projecturl = props.projecturl; cb(); }.bind(this)); @@ -194,7 +198,7 @@ JekyllizeGenerator.prototype.askForJekyll = function askForJekyll() { }, { name: 'jekyllPageinate', message: 'Number of posts to show on the home page', - default: 'all', + default: '10', validate: function (input) { if (/^[0-9]*$/.test(input)) { return true; diff --git a/app/templates/Gemfile b/app/templates/Gemfile index ddde18c..7609c68 100755 --- a/app/templates/Gemfile +++ b/app/templates/Gemfile @@ -1,4 +1,4 @@ source "http://rubygems.org" gem 'jekyll', '~>1.4.0' -gem 'redcarpet' +gem 'redcarpet' \ No newline at end of file diff --git a/app/templates/_config.build.yml b/app/templates/_config.build.yml index e3d347b..d221593 100644 --- a/app/templates/_config.build.yml +++ b/app/templates/_config.build.yml @@ -1,10 +1,16 @@ -# Jekyll configuration precedence: -# 1. Gruntfile task -# 2. config.build.yml -# 3. config.yml +# Run during the 'gulp build' command +# Overrides these options in the +# Overrides the default URL, needed for your atom feed and sitemap +url: <%= projecturl %> + +# Hides your drafts and future posts future: false show_drafts: false +# Gives you more accurate related posts +lsi: true +# Removes the upper limit for posts generated +limit_posts: 0 source: 'src' destination: 'serve' \ No newline at end of file diff --git a/app/templates/_config.yml b/app/templates/_config.yml index e68ee8c..2fd7179 100755 --- a/app/templates/_config.yml +++ b/app/templates/_config.yml @@ -1,16 +1,16 @@ -# Jekyll configuration precedence: -# 1. gulpfile -# 2. config.build.yml -# 3. config.yml - -name: <%= projectname %> +# Title, decription, tagline and URL for your site +# Can be used in your theme by calling 'site.title' and so on +title: <%= projectname %> description: <%= description %> tagline: <%= tagline %> +url: localhost:4000 -# Used so Gulp knows where our app lives -source: 'src' -destination: 'serve' +# Used so Jekyll outputs the site correctly so Gulp can do what it wants +source: src +destination: serve +# Same as the title etc for your site but can instead be +# called by using 'site.owner.name' and so on owner: name: <%= ownerName %> email: <%= ownerEmail %> @@ -20,11 +20,18 @@ owner: # general setting for Jekyll googleAnalytics: UA-XXXXX-X -# _config.build.yml sets future and show_drafts to false on `grunt build` +# _config.build.yml overwrites these options when you run `gulp build` +# Enables future posts (posts with dates in the future) and drafts future: true -show_drafts: true<% if (jekyllPageinate) { %> - -permalink: <%= jekyllPermalinks %> +show_drafts: true +# Disables the more accurate related posts for faster generating of the site +lsi: false +# Only make the last 10 posts so generating isn't slow +limit_posts: 10 + +# Permalink structure and pagination options +relative_permalinks: true +permalink: <%= jekyllPermalinks %><% if (jekyllPageinate) { %> paginate: <%= jekyllPageinate %> paginate_path: 'page:num'<% } %> @@ -33,5 +40,4 @@ markdown: redcarpet # Markdown library options # redcarpet: # extensions: ['fenced_code_blocks', 'smart'] - pygments: true diff --git a/app/templates/app/404.html b/app/templates/app/404.html new file mode 100644 index 0000000..5f5b9bf --- /dev/null +++ b/app/templates/app/404.html @@ -0,0 +1,9 @@ +--- +layout: default +title: "404: Page not found" +--- + +
+

404: Page not found

+

Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. Head back home to try finding it again.

+
diff --git a/app/templates/app/_drafts/2014-03-01-example-content.md b/app/templates/app/_drafts/2014-03-01-example-content.md new file mode 100644 index 0000000..e6e5462 --- /dev/null +++ b/app/templates/app/_drafts/2014-03-01-example-content.md @@ -0,0 +1,132 @@ +--- +layout: post +date: 2014-03-01 +title: Example content +categories: jekyll example +--- + + +
+ Howdy! This is an example blog post that shows several types of HTML content supported in this theme. +
+ +Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. *Aenean eu leo quam.* Pellentesque ornare sem lacinia quam venenatis vestibulum. Sed posuere consectetur est at lobortis. Cras mattis consectetur purus sit amet fermentum. + +> Curabitur blandit tempus porttitor. Nullam quis risus eget urna mollis ornare vel eu leo. Nullam id dolor id nibh ultricies vehicula ut id elit. + +Etiam porta **sem malesuada magna** mollis euismod. Cras mattis consectetur purus sit amet fermentum. Aenean lacinia bibendum nulla sed consectetur. + +## Inline HTML elements + +HTML defines a long list of available inline tags, a complete list of which can be found on the [Mozilla Developer Network](https://developer.mozilla.org/en-US/docs/Web/HTML/Element). + +- **To bold text**, use ``. +- *To italicize text*, use ``. +- Abbreviations, like HTML should use ``, with an optional `title` attribute for the full phrase. +- Citations, like — Mark otto, should use ``. +- Deleted text should use `` and inserted text should use ``. +- Superscript text uses `` and subscript text uses ``. + +Most of these elements are styled by browsers with few modifications on our part. + +## Heading + +Vivamus sagittis lacus vel augue rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. + +### Code + +Cum sociis natoque penatibus et magnis dis `code element` montes, nascetur ridiculus mus. + +{% highlight js %} +// Example can be run directly in your JavaScript console + +// Create a function that takes two arguments and returns the sum of those arguments +var adder = new Function("a", "b", "return a + b"); + +// Call the function +adder(2, 6); +// > 8 +{% endhighlight %} + +Aenean lacinia bibendum nulla sed consectetur. Etiam porta sem malesuada magna mollis euismod. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa. + +### Gists via GitHub Pages + +Vestibulum id ligula porta felis euismod semper. Nullam quis risus eget urna mollis ornare vel eu leo. Donec sed odio dui. + +{% gist 5555251 gist.md %} + +Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec sed odio dui. Vestibulum id ligula porta felis euismod semper. + +### Lists + +Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean lacinia bibendum nulla sed consectetur. Etiam porta sem malesuada magna mollis euismod. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. + +* Praesent commodo cursus magna, vel scelerisque nisl consectetur et. +* Donec id elit non mi porta gravida at eget metus. +* Nulla vitae elit libero, a pharetra augue. + +Donec ullamcorper nulla non metus auctor fringilla. Nulla vitae elit libero, a pharetra augue. + +1. Vestibulum id ligula porta felis euismod semper. +2. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. +3. Maecenas sed diam eget risus varius blandit sit amet non magna. + +Cras mattis consectetur purus sit amet fermentum. Sed posuere consectetur est at lobortis. + +
+
HyperText Markup Language (HTML)
+
The language used to describe and define the content of a Web page
+ +
Cascading Style Sheets (CSS)
+
Used to describe the appearance of Web content
+ +
JavaScript (JS)
+
The programming language used to build advanced Web sites and applications
+
+ +Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Nullam quis risus eget urna mollis ornare vel eu leo. + +### Tables + +Aenean lacinia bibendum nulla sed consectetur. Lorem ipsum dolor sit amet, consectetur adipiscing elit. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameUpvotesDownvotes
Totals2123
Alice1011
Bob43
Charlie79
+ +Nullam id dolor id nibh ultricies vehicula ut id elit. Sed posuere consectetur est at lobortis. Nullam quis risus eget urna mollis ornare vel eu leo. + +----- + +Want to see something else added? Open an issue. diff --git a/app/templates/app/_includes/head.html b/app/templates/app/_includes/head.html new file mode 100644 index 0000000..d099c43 --- /dev/null +++ b/app/templates/app/_includes/head.html @@ -0,0 +1,31 @@ + + + + + + + + + {% if page.title == "Home" %} + {{ site.title }} · {{ site.tagline }} + {% else %} + {{ page.title }} · {{ site.title }} + {% endif %} + + + + + + + + + + + + + + + + + + diff --git a/app/templates/app/_includes/sidebar.html b/app/templates/app/_includes/sidebar.html new file mode 100644 index 0000000..3e56d1b --- /dev/null +++ b/app/templates/app/_includes/sidebar.html @@ -0,0 +1,38 @@ + + + + + diff --git a/app/templates/app/_layouts/default.html b/app/templates/app/_layouts/default.html index 370eb48..ed19ec7 100644 --- a/app/templates/app/_layouts/default.html +++ b/app/templates/app/_layouts/default.html @@ -1,46 +1,30 @@ - - - - - {{ page.title }} - + - - + {% include head.html %} - - - - + - - + {% include sidebar.html %} -
- + +
+
+
+

+ {{ site.title }} + {{ site.tagline }} +

+
+
- {{ content }} +
+ {{ content }} +
+
- -
+ - + diff --git a/app/templates/app/_layouts/page.html b/app/templates/app/_layouts/page.html new file mode 100644 index 0000000..4e0d4eb --- /dev/null +++ b/app/templates/app/_layouts/page.html @@ -0,0 +1,8 @@ +--- +layout: default +--- + +
+

{{ page.title }}

+ {{ content }} +
diff --git a/app/templates/app/_layouts/post.html b/app/templates/app/_layouts/post.html index 04e3586..2a6c7c1 100644 --- a/app/templates/app/_layouts/post.html +++ b/app/templates/app/_layouts/post.html @@ -1,9 +1,25 @@ --- layout: default --- -

{{ page.title }}

-

{{ page.date | date_to_string }}

-{{ content }} +

{{ page.title }}

+ + {{ content }} +
+ + diff --git a/app/templates/app/_posts/2014-03-02-introducing-poole.md b/app/templates/app/_posts/2014-03-02-introducing-poole.md new file mode 100644 index 0000000..9e0a7cb --- /dev/null +++ b/app/templates/app/_posts/2014-03-02-introducing-poole.md @@ -0,0 +1,42 @@ +--- +layout: post +date: 2014-03-02 +title: Introducing Poole +categories: jekyll poole +--- + +*The Strange Case of Dr. Jeykll and Mr. Hyde* tells the story of a lawyer investigating the connection of two persons, Dr. Henry Jekyll and Mr. Edward Hyde. Chief among the novel's supporting cast is a man by the name of Mr. Poole, Dr. Jekyll's loyal butler. + +----- + +Poole is the butler for [Jekyll](http://jekyllrb.com), the static site generator. It's designed and developed by [@mdo](https://twitter.com/mdo) to provide a clear and concise foundational setup for any Jekyll site. It does so by furnishing a full vanilla Jekyll install with example templates, pages, posts, and styles. + +There are currently two themes built on Poole: + +* [Hyde](http://hyde.getpoole.com) +* [Lanyon](http://lanyon.getpoole.com) + +Learn more and contribute on [GitHub](https://github.com/poole). + +### What's included + +Poole is a streamlined Jekyll site designed and built as a foundation for building more meaningful themes. Poole, and every theme built on it, includes the following: + +* Complete Jekyll setup included (layouts, config, [404](/404), [RSS feed](/atom.xml), posts, and [example page](/about)) +* Mobile friendly design and development +* Easily scalable text and component sizing with `rem` units in the CSS +* Support for a wide gamut of HTML elements +* Related posts (time-based, because Jekyll) below each post +* Syntax highlighting, courtesy Pygments (the Python-based code snippet highlighter) + +Additional features are available in individual themes. + +### Browser support + +Poole and it's themes are by preference a forward-thinking project. In addition to the latest versions of Chrome, Safari (mobile and desktop), and Firefox, it is only compatible with Internet Explorer 9 and above. + +### Download + +Poole is developed on and hosted with GitHub. Head to the GitHub repository for downloads, bug reports, and features requests. + +Thanks! diff --git a/app/templates/app/_posts/2014-03-01-welcome-to-jekyll.md b/app/templates/app/_posts/2014-03-03-welcome-to-jekyll.md similarity index 74% rename from app/templates/app/_posts/2014-03-01-welcome-to-jekyll.md rename to app/templates/app/_posts/2014-03-03-welcome-to-jekyll.md index e7487fb..14b3529 100644 --- a/app/templates/app/_posts/2014-03-01-welcome-to-jekyll.md +++ b/app/templates/app/_posts/2014-03-03-welcome-to-jekyll.md @@ -1,8 +1,8 @@ --- layout: post -title: "Welcome to Jekyll!" -date: 2014-03-01 21:49:55 -categories: jekyll update +date: 2014-03-03 +title: Welcome to Jekyll! +categories: jekyll --- You'll find this post in your `_posts` directory - edit this post and re-build (or run with the `-w` switch) to see your changes! @@ -20,9 +20,5 @@ print_hi('Tom') Check out the [Jekyll docs][jekyll] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll's GitHub repo][jekyll-gh]. -Maybe some paragraphs in the post then? It should bloody work now. If it is in the correct directory... And has the correct file ending. - -What about now then? - [jekyll-gh]: https://github.com/mojombo/jekyll [jekyll]: http://jekyllrb.com diff --git a/app/templates/app/about.md b/app/templates/app/about.md new file mode 100644 index 0000000..9b2605b --- /dev/null +++ b/app/templates/app/about.md @@ -0,0 +1,30 @@ +--- +layout: page +title: About +--- + +

+ Hey there! This page is included as an example. Feel free to customize it for your own use upon downloading. Carry on! +

+ +In the novel, *The Strange Case of Dr. Jeykll and Mr. Hyde*, Mr. Poole is Dr. Jekyll's virtuous and loyal butler. Similarly, Poole is an upstanding and effective butler that helps you build Jekyll themes. It's made by [@mdo](https://twitter.com/mdo). + +There are currently two themes built on Poole: + +* [Hyde](http://hyde.getpoole.com) +* [Lanyon](http://lanyon.getpoole.com) + +Learn more and contribute on [GitHub](https://github.com/poole). + +## Setup + +Some fun facts about the setup of this project include: + +* Built for [Jekyll](http://jekyllrb.com) +* Developed on GitHub and hosted for free on [GitHub Pages](https://pages.github.com) +* Coded with [Sublime Text 2](http://sublimetext.com), an amazing code editor +* Designed and developed while listening to music like [Blood Bros Trilogy](https://soundcloud.com/maddecent/sets/blood-bros-series) + +Have questions or suggestions? Feel free to [open an issue on GitHub](https://github.com/poole/issues/new) or [ask me on Twitter](https://twitter.com/mdo). + +Thanks for reading! diff --git a/app/templates/app/assets/_scss/main.scss b/app/templates/app/assets/_scss/main.scss index d1ec725..66a1374 100644 --- a/app/templates/app/assets/_scss/main.scss +++ b/app/templates/app/assets/_scss/main.scss @@ -2,5 +2,6 @@ The main SCSS file for everything, yep */ -@import "style"; -@import "syntax"; \ No newline at end of file +@import "poole"; +@import "syntax"; +@import "style"; \ No newline at end of file diff --git a/app/templates/app/assets/_scss/poole.scss b/app/templates/app/assets/_scss/poole.scss new file mode 100644 index 0000000..69e6dd1 --- /dev/null +++ b/app/templates/app/assets/_scss/poole.scss @@ -0,0 +1,425 @@ +/* + * ___ + * /\_ \ + * _____ ___ ___\//\ \ __ + * /\ '__`\ / __`\ / __`\\ \ \ /'__`\ + * \ \ \_\ \/\ \_\ \/\ \_\ \\_\ \_/\ __/ + * \ \ ,__/\ \____/\ \____//\____\ \____\ + * \ \ \/ \/___/ \/___/ \/____/\/____/ + * \ \_\ + * \/_/ + * + * Designed, built, and released under MIT license by @mdo. Learn more at + * https://github.com/poole/poole. + */ + +/* + * Contents + * + * Body resets + * Custom type + * Messages + * Container + * Masthead + * Posts and pages + * Pagination + * Reverse layout + * Themes + */ + +/* + * Body resets + * + * Update the foundational and global aspects of the page. + */ + +* { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +html, body { + margin: 0; + padding: 0; +} + +html { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 16px; + line-height: 1.5; +} + +@media (min-width: 38rem) { + html { + font-size: 20px; + } +} + +body { + color: #515151; + background-color: #fff; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; +} + +/* No `:visited` state is required by default (browsers will use `a`) */ + +a { + color: #268bd2; + text-decoration: none; + &:hover, &:focus { + text-decoration: underline; + } +} + +/* `:focus` is linked to `:hover` for basic accessibility */ + +/* Headings */ + +h1, h2, h3, h4, h5, h6 { + margin-bottom: .5rem; + font-weight: bold; + line-height: 1.25; + color: #313131; + text-rendering: optimizeLegibility; +} + +h1 { + font-size: 2rem; +} + +h2 { + margin-top: 1rem; + font-size: 1.5rem; +} + +h3 { + margin-top: 1.5rem; + font-size: 1.25rem; +} + +h4, h5, h6 { + margin-top: 1rem; + font-size: 1rem; +} + +/* Body text */ + +p { + margin-top: 0; + margin-bottom: 1rem; +} + +strong { + color: #303030; +} + +/* Lists */ + +ul, ol, dl { + margin-top: 0; + margin-bottom: 1rem; +} + +dt { + font-weight: bold; +} + +dd { + margin-bottom: .5rem; +} + +/* Misc */ + +hr { + position: relative; + margin: 1.5rem 0; + border: 0; + border-top: 1px solid #eee; + border-bottom: 1px solid #fff; +} + +abbr { + font-size: 85%; + font-weight: bold; + color: #555; + text-transform: uppercase; + &[title] { + cursor: help; + border-bottom: 1px dotted #e5e5e5; + } +} + +/* Code */ + +code, pre { + font-family: Menlo, Monaco, "Courier New", monospace; +} + +code { + padding: .25em .5em; + font-size: 85%; + color: #bf616a; + background-color: #f9f9f9; + border-radius: 3px; +} + +pre { + display: block; + margin-top: 0; + margin-bottom: 1rem; + padding: 1rem; + font-size: .8rem; + line-height: 1.4; + white-space: pre; + white-space: pre-wrap; + word-break: break-all; + word-wrap: break-word; + background-color: #f9f9f9; + code { + padding: 0; + font-size: 100%; + color: inherit; + background-color: transparent; + } +} + +.highlight { + margin-bottom: 1rem; + border-radius: 4px; + pre { + margin-bottom: 0; + } +} + +/* Quotes */ + +blockquote { + padding: .5rem 1rem; + margin: .8rem 0; + color: #7a7a7a; + border-left: .25rem solid #e5e5e5; + p:last-child { + margin-bottom: 0; + } +} + +@media (min-width: 30rem) { + blockquote { + padding-right: 5rem; + padding-left: 1.25rem; + } +} + +img { + display: block; + margin: 0 0 1rem; + border-radius: 5px; +} + +/* Tables */ + +table { + margin-bottom: 1rem; + width: 100%; + border: 1px solid #e5e5e5; + border-collapse: collapse; +} + +td, th { + padding: .25rem .5rem; + border: 1px solid #e5e5e5; +} + +tbody tr:nth-child(odd) { + td, th { + background-color: #f9f9f9; + } +} + +/* + * Custom type + * + * Extend paragraphs with `.lead` for larger introductory text. + */ + +.lead { + font-size: 1.25rem; + font-weight: 300; +} + +/* + * Messages + * + * Show alert messages to users. You may add it to single elements like a `

`, + * or to a parent if there are multiple elements to show. + */ + +.message { + margin-bottom: 1rem; + padding: 1rem; + color: #717171; + background-color: #f9f9f9; +} + +/* + * Container + * + * Center the page content. + */ + +.container { + max-width: 38rem; + padding-left: 1rem; + padding-right: 1rem; + margin-left: auto; + margin-right: auto; +} + +/* + * Masthead + * + * Super small header above the content for site name and short description. + */ + +.masthead { + padding-top: 1rem; + padding-bottom: 1rem; + margin-bottom: 3rem; +} + +.masthead-title { + margin-top: 0; + margin-bottom: 0; + color: #505050; + a { + color: #505050; + } + small { + font-size: 75%; + font-weight: 400; + color: #c0c0c0; + letter-spacing: 0; + } +} + +/* + * Posts and pages + * + * Each post is wrapped in `.post` and is used on default and post layouts. Each + * page is wrapped in `.page` and is only used on the page layout. + */ + +.page, .post { + margin-bottom: 4em; +} + +/* Blog post or page title */ + +.page-title { + color: #303030; +} + +.post-title { + color: #303030; + a { + color: #303030; + } +} + +.page-title, .post-title { + margin-top: 0; +} + +/* Meta data line below post title */ + +.post-date { + display: block; + margin-top: -.5rem; + margin-bottom: 1rem; + color: #9a9a9a; +} + +/* Related posts */ + +.related { + padding-top: 2rem; + padding-bottom: 2rem; + border-top: 1px solid #eee; +} + +.related-posts { + padding-left: 0; + list-style: none; + h3 { + margin-top: 0; + } + li { + small { + font-size: 75%; + color: #999; + } + a:hover { + color: #268bd2; + text-decoration: none; + small { + color: inherit; + } + } + } +} + +/* + * Pagination + * + * Super lightweight (HTML-wise) blog pagination. `span`s are provide for when + * there are no more previous or next posts to show. + */ + +.pagination { + overflow: hidden; + /* clearfix */ + margin-left: -1rem; + margin-right: -1rem; + font-family: "PT Sans", Helvetica, Arial, sans-serif; + color: #ccc; + text-align: center; +} + +/* Pagination items can be `span`s or `a`s */ + +.pagination-item { + display: block; + padding: 1rem; + border: 1px solid #eee; + &:first-child { + margin-bottom: -1px; + } +} + +/* Only provide a hover state for linked pagination items */ + +a.pagination-item:hover { + background-color: #f5f5f5; +} + +@media (min-width: 30rem) { + .pagination { + margin: 3rem 0; + } + .pagination-item { + float: left; + width: 50%; + &:first-child { + margin-bottom: 0; + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; + } + &:last-child { + margin-left: -1px; + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; + } + } +} diff --git a/app/templates/app/assets/_scss/style.scss b/app/templates/app/assets/_scss/style.scss index 4ebae80..5fcad21 100644 --- a/app/templates/app/assets/_scss/style.scss +++ b/app/templates/app/assets/_scss/style.scss @@ -1,168 +1,542 @@ -/*****************************************************************************/ /* -/* Common + * ___ + * /\_ \ + * \//\ \ __ ___ __ __ ___ ___ + * \ \ \ /'__`\ /' _ `\/\ \/\ \ / __`\ /' _ `\ + * \_\ \_/\ \_\.\_/\ \/\ \ \ \_\ \/\ \_\ \/\ \/\ \ + * /\____\ \__/.\_\ \_\ \_\/`____ \ \____/\ \_\ \_\ + * \/____/\/__/\/_/\/_/\/_/`/___/> \/___/ \/_/\/_/ + * /\___/ + * \/__/ + * + * Designed, built, and released under MIT license by @mdo. Learn more at + * https://github.com/poole/lanyon. + */ + /* -/*****************************************************************************/ + * Contents + * + * Global resets + * Masthead + * Sidebar + * Slide effect + * Posts and pages + * Pagination + * Reverse layout + * Themes + */ -/* Global Reset */ +/* + * Global resets + * + * Update the foundational and global aspects of the page. + */ -* { - margin: 0; - padding: 0; -} +/* Prevent scroll on narrow devices */ -html { - height: 100%; +html, body { + overflow-x: hidden; } -body { - height: 100%; - background-color: #FFF; - font: 13.34px Helvetica, Arial, sans-serif; - font-size: small; - text-align: center; +html { + font-family: "PT Serif", Georgia, "Times New Roman", serif; } h1, h2, h3, h4, h5, h6 { - font-size: 100%; + font-family: "PT Sans", Helvetica, Arial, sans-serif; + font-weight: 400; + color: #313131; + letter-spacing: -.025rem; } -h1 { - margin-bottom: 1em; +/* + * Wrapper + * + * The wrapper is used to position site content when the sidebar is toggled. We + * use an outter wrap to position the sidebar without interferring with the + * regular page content. + */ + +.wrap { + position: relative; + width: 100%; } -p { - margin: 1em 0; +/* + * Container + * + * Center the page content. + */ + +.container { + max-width: 28rem; } -a { - color: #00a; - &:hover { - color: #000; +@media (min-width: 38rem) { + .container { + max-width: 32rem; } - &:visited { - color: #a0a; +} + +@media (min-width: 56rem) { + .container { + max-width: 38rem; } } -/*****************************************************************************/ /* -/* Home -/* -/*****************************************************************************/ + * Masthead + * + * Super small header above the content for site name and short description. + */ -.posts { - list-style-type: none; - margin-bottom: 2em; - li { - line-height: 1.75em; +.masthead { + padding-top: 1rem; + padding-bottom: 1rem; + margin-bottom: 3rem; + border-bottom: 1px solid #eee; +} + +.masthead-title { + margin-top: 0; + margin-bottom: 0; + color: #505050; + a { + color: #505050; + } + small { + font-size: 75%; + font-weight: 400; + color: #c0c0c0; + letter-spacing: 0; } - span { - color: #aaa; - font-family: Monaco, "Courier New", monospace; - font-size: 80%; +} + +@media (max-width: 48rem) { + .masthead-title { + text-align: center; + small { + display: none; + } } } -/*****************************************************************************/ /* -/* Site + * Sidebar + * + * The sidebar is the drawer, the item we are toggling with our handy hamburger + * button in the corner of the page. + * + * This particular sidebar implementation was inspired by Chris Coyier's + * "Offcanvas Menu with CSS Target" article, and the checkbox variation from the + * comments by a reader. It modifies both implementations to continue using the + * checkbox (no change in URL means no polluted browser history), but this uses + * `position` for the menu to avoid some potential content reflow issues. + * + * Source: http://css-tricks.com/off-canvas-menu-with-css-target/#comment-207504 + */ + +/* Style and "hide" the sidebar */ + +.sidebar { + position: fixed; + top: 0; + bottom: 0; + left: -14rem; + width: 14rem; + visibility: hidden; + overflow-y: auto; + font-family: "PT Sans", Helvetica, Arial, sans-serif; + font-size: .875rem; + /* 15px */ + color: rgba(255, 255, 255, 0.6); + background-color: #202020; + -webkit-transition: all .3s ease-in-out; + transition: all .3s ease-in-out; + a { + font-weight: normal; + color: #fff; + } +} + +@media (min-width: 30rem) { + .sidebar { + font-size: .75rem; + /* 14px */ + } +} + +/* Sidebar content */ + +.sidebar-item { + padding: 1rem; + p:last-child { + margin-bottom: 0; + } +} + +/* Sidebar nav */ + +.sidebar-nav { + border-bottom: 1px solid rgba(255, 255, 255, 0.1); +} + +.sidebar-nav-item { + display: block; + padding: .5rem 1rem; + border-top: 1px solid rgba(255, 255, 255, 0.1); + &.active { + text-decoration: none; + background-color: rgba(255, 255, 255, 0.1); + border-color: transparent; + } +} + +a.sidebar-nav-item { + &:hover, &:focus { + text-decoration: none; + background-color: rgba(255, 255, 255, 0.1); + border-color: transparent; + } +} + +@media (min-width: 48rem) { + .sidebar-item { + padding: 1.5rem; + } + .sidebar-nav-item { + padding-left: 1.5rem; + padding-right: 1.5rem; + } +} + +/* Hide the sidebar checkbox that we toggle with `.sidebar-toggle` */ + +.sidebar-checkbox { + display: none; +} + +/* Style the `label` that we use to target the `.sidebar-checkbox` */ + +.sidebar-toggle { + position: absolute; + top: 1rem; + left: 1rem; + display: block; + width: 2.2rem; + padding: .5rem .65rem; + color: #505050; + background-color: #fff; + border-radius: 4px; + cursor: pointer; + &:before { + display: block; + content: ""; + width: 100%; + padding-bottom: .125rem; + border-top: .375rem double; + border-bottom: .125rem solid; + /* Make the border inside the box */ + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + &:active { + color: #fff; + background-color: #505050; + } +} + +#sidebar-checkbox:checked ~ .sidebar-toggle { + color: #fff; + background-color: #505050; +} + +@media (min-width: 30.1rem) { + .sidebar-toggle { + position: fixed; + width: 2.25rem; + &:before { + padding-bottom: .15rem; + border-top-width: .45rem; + border-bottom-width: .15rem; + } + } +} + +/* Slide effect + * + * Handle the sliding effects of the sidebar and content in one spot, seperate + * from the default styles. + * + * As an a heads up, we don't use `transform: translate3d()` here because when + * mixed with `position: fixed;` for the sidebar toggle, it creates a new + * containing block. Put simply, the fixed sidebar toggle behaves like + * `position: absolute;` when transformed. + * + * Read more about it at http://meyerweb.com/eric/thoughts/2011/09/12/. + */ + +.wrap, .sidebar, .sidebar-toggle { + -webkit-backface-visibility: hidden; + -ms-backface-visibility: hidden; + backface-visibility: hidden; +} + +.wrap, .sidebar-toggle { + -webkit-transition: -webkit-transform .3s ease-in-out; + transition: transform .3s ease-in-out; +} + +#sidebar-checkbox:checked { + + .sidebar { + visibility: visible; + } + ~ { + .sidebar, .wrap, .sidebar-toggle { + -webkit-transform: translateX(14rem); + -ms-transform: translateX(14rem); + transform: translateX(14rem); + } + } +} + /* -/*****************************************************************************/ + * Posts and pages + * + * Each post is wrapped in `.post` and is used on default and post layouts. Each + * page is wrapped in `.page` and is only used on the page layout. + */ -.site { - font-size: 115%; - text-align: justify; - width: 42em; - margin: 3em auto 2em; - line-height: 1.5em; +.page, .post { + margin-bottom: 4em; } -.header a { - font-weight: bold; - text-decoration: none; +/* Blog post or page title */ + +.page-title { + color: #303030; } -.title { - display: inline-block; - margin-bottom: 2em; +.post-title { + color: #303030; a { - color: #a00; - &:hover { - color: #000; + color: #303030; + } +} + +.page-title, .post-title { + margin-top: 0; +} + +/* Meta data line below post title */ + +.post-date { + display: block; + margin-top: -.5rem; + margin-bottom: 1rem; + color: #9a9a9a; +} + +/* Related posts */ + +.related { + padding-top: 2rem; + padding-bottom: 2rem; + border-top: 1px solid #eee; +} + +.related-posts { + padding-left: 0; + list-style: none; + h3 { + margin-top: 0; + } + li { + small { + font-size: 75%; + color: #999; + } + a:hover { + color: #268bd2; + text-decoration: none; + small { + color: inherit; + } } } } -.header a.extra { - color: #aaa; - margin-left: 1em; - &:hover { - color: #000; +/* + * Pagination + * + * Super lightweight (HTML-wise) blog pagination. `span`s are provide for when + * there are no more previous or next posts to show. + */ + +.pagination { + overflow: hidden; + /* clearfix */ + margin-left: -1rem; + margin-right: -1rem; + font-family: "PT Sans", Helvetica, Arial, sans-serif; + color: #ccc; + text-align: center; +} + +/* Pagination items can be `span`s or `a`s */ + +.pagination-item { + display: block; + padding: 1rem; + border: 1px solid #eee; + &:first-child { + margin-bottom: -1px; } } -.meta { - color: #aaa; +/* Only provide a hover state for linked pagination items */ + +a.pagination-item:hover { + background-color: #f5f5f5; } -.footer { - font-size: 80%; - color: #666; - border-top: 4px solid #eee; - margin-top: 2em; - overflow: hidden; - .contact { +@media (min-width: 30rem) { + .pagination { + margin: 3rem 0; + } + .pagination-item { float: left; - margin-right: 3em; - a { - color: #8085C1; + width: 50%; + &:first-child { + margin-bottom: 0; + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; } - } - .rss { - margin-top: 1.1em; - margin-right: -.2em; - float: right; - img { - border: 0; + &:last-child { + margin-left: -1px; + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; } } } -/*****************************************************************************/ /* -/* Posts + * Reverse layout + * + * Flip the orientation of the page by placing the `.sidebar` and sidebar toggle + * on the right side. + */ + +.layout-reverse { + .sidebar { + left: auto; + right: -14rem; + } + .sidebar-toggle { + left: auto; + right: 1rem; + } + #sidebar-checkbox:checked ~ { + .sidebar, .wrap, .sidebar-toggle { + -webkit-transform: translateX(-14rem); + -ms-transform: translateX(-14rem); + transform: translateX(-14rem); + } + } +} + /* -/*****************************************************************************/ + * Themes + * + * Apply custom color schemes by adding the appropriate class to the `body`. + * Based on colors from Base16: http://chriskempson.github.io/base16/#default. + */ + +/* Red */ -/* standard */ +.theme-base-08 { + .sidebar, .sidebar-toggle:active, #sidebar-checkbox:checked ~ .sidebar-toggle { + background-color: #ac4142; + } + .container a, .sidebar-toggle, .related-posts li a:hover { + color: #ac4142; + } +} -.post { - pre { - border: 1px solid #ddd; - background-color: #eef; - padding: 0 .4em; +/* Orange */ + +.theme-base-09 { + .sidebar, .sidebar-toggle:active, #sidebar-checkbox:checked ~ .sidebar-toggle { + background-color: #d28445; } - ul, ol { - margin-left: 1.35em; + .container a, .sidebar-toggle, .related-posts li a:hover { + color: #d28445; } - code { - border: 1px solid #ddd; - background-color: #eef; - padding: 0 .2em; +} + +/* Yellow */ + +.theme-base-0a { + .sidebar, .sidebar-toggle:active, #sidebar-checkbox:checked ~ .sidebar-toggle { + background-color: #f4bf75; } - pre { - code { - border: none; - } - /* terminal */ - &.terminal { - border: 1px solid #000; - background-color: #333; - color: #FFF; - code { - background-color: #333; - } - } + .container a, .sidebar-toggle, .related-posts li a:hover { + color: #f4bf75; + } +} + +/* Green */ + +.theme-base-0b { + .sidebar, .sidebar-toggle:active, #sidebar-checkbox:checked ~ .sidebar-toggle { + background-color: #90a959; + } + .container a, .sidebar-toggle, .related-posts li a:hover { + color: #90a959; + } +} + +/* Cyan */ + +.theme-base-0c { + .sidebar, .sidebar-toggle:active, #sidebar-checkbox:checked ~ .sidebar-toggle { + background-color: #75b5aa; + } + .container a, .sidebar-toggle, .related-posts li a:hover { + color: #75b5aa; + } +} + +/* Blue */ + +.theme-base-0d { + .sidebar, .sidebar-toggle:active, #sidebar-checkbox:checked ~ .sidebar-toggle { + background-color: #6a9fb5; + } + .container a, .sidebar-toggle, .related-posts li a:hover { + color: #6a9fb5; + } +} + +/* Magenta */ + +.theme-base-0e { + .sidebar, .sidebar-toggle:active, #sidebar-checkbox:checked ~ .sidebar-toggle { + background-color: #aa759f; + } + .container a, .sidebar-toggle, .related-posts li a:hover { + color: #aa759f; + } +} + +/* Brown */ + +.theme-base-0f { + .sidebar, .sidebar-toggle:active, #sidebar-checkbox:checked ~ .sidebar-toggle { + background-color: #8f5536; + } + .container a, .sidebar-toggle, .related-posts li a:hover { + color: #8f5536; } } diff --git a/app/templates/app/assets/_scss/syntax.scss b/app/templates/app/assets/_scss/syntax.scss index 26da07f..5aa1e8a 100644 --- a/app/templates/app/assets/_scss/syntax.scss +++ b/app/templates/app/assets/_scss/syntax.scss @@ -1,143 +1,66 @@ -.highlight { - background: #ffffff; - .c { /* Comment */ - color: #999988; - font-style: italic; - } - .err { /* Error */ - color: #a61717; - background-color: #e3d2d2; - } - .k, .o { /* Keyword & Operator */ - font-weight: bold; - } - .cm { /* Comment.Multiline */ - color: #999988; - font-style: italic; - } - .cp { /* Comment.Preproc */ - color: #999999; - font-weight: bold; - } - .c1 { /* Comment.Single */ - color: #999988; - font-style: italic; - } - .cs { /* Comment.Special */ - color: #999999; - font-weight: bold; - font-style: italic; - } - .gd { /* Generic.Deleted */ - color: #000000; - background-color: #ffdddd; - .x { /* Generic.Deleted.Specific */ - color: #000000; - background-color: #ffaaaa; - } - } - .ge { /* Generic.Emph */ - font-style: italic; - } - .gr { /* Generic.Error */ - color: #aa0000; - } - .gh { /* Generic.Heading */ - color: #999999; - } - .gi { /* Generic.Inserted */ - color: #000000; - background-color: #ddffdd; - .x { /* Generic.Inserted.Specific */ - color: #000000; - background-color: #aaffaa; - } - } - .go { /* Generic.Output */ - color: #888888; - } - .gp { /* Generic.Prompt */ - color: #555555; - } - .gs { /* Generic.Strong */ - font-weight: bold; - } - .gu { /* Generic.Subheading */ - color: #aaaaaa; - } - .gt { /* Generic.Traceback */ - color: #aa0000; - } - .kc, .kd, .kp, .kr { /* Keyword.{Constant,Declaration,Pseudo,Reserved} */ - font-weight: bold; - } - .kt { /* Keyword.Type */ - color: #445588; - font-weight: bold; - } - .m { /* Literal.Number */ - color: #009999; - } - .s { /* Literal.String */ - color: #dd1144; - } - .na { /* Name.Attribute */ - color: teal; - } - .nb { /* Name.Builtin */ - color: #0086b3; - } - .nc { /* Name.Class */ - color: #445588; - font-weight: bold; - } - .no { /* Name.Constant */ - color: teal; - } - .ni { /* Name.Entity */ - color: purple; - } - .ne, .nf { /* Name.Exception & Name.Function */ - color: #990000; - font-weight: bold; - } - .nn { /* Name.Namespace */ - color: #555555; - } - .nt { /* Name.Tag */ - color: navy; - } - .nv { /* Name.Variable */ - color: teal; - } - .ow { /* Operator.Word */ - font-weight: bold; - } - .w { /* Text.Whitespace */ - color: #bbbbbb; - } - .mf, .mh, .mi, .mo { /* Literal.Number.{Float,Hex,Integer,Oct} */ - color: #009999; - } - .sb, .sc, .sd, .s2, .se, .sh, .si, .sx { /* Literal.String.{Backtick,Char,Doc,Double,Escape,Heredoc,Interpol,Other} */ - color: #dd1144; - } - .sr { /* Literal.String.Regex */ - color: #009926; - } - .s1 { /* Literal.String.Single */ - color: #dd1144; - } - .ss { /* Literal.String.Symbol */ - color: #990073; - } - .bp { /* Name.Builtin.Pseudo */ - color: #999999; - } - .vc, .vg, .vi { /* Name.Variable.{Class,Global,Instance} */ - color: teal; - } - .il { /* Literal.Number.Integer.Long */ - color: #009999; - } -} \ No newline at end of file +.hll { background-color: #ffffcc } + //{ background: #f0f3f3; } +.c { color: #999; } // Comment +.err { color: #AA0000; background-color: #FFAAAA } // Error +.k { color: #006699; } // Keyword +.o { color: #555555 } // Operator +.cm { color: #0099FF; font-style: italic } // Comment.Multiline +.cp { color: #009999 } // Comment.Preproc +.c1 { color: #999; } // Comment.Single +.cs { color: #999; } // Comment.Special +.gd { background-color: #FFCCCC; border: 1px solid #CC0000 } // Generic.Deleted +.ge { font-style: italic } // Generic.Emph +.gr { color: #FF0000 } // Generic.Error +.gh { color: #003300; } // Generic.Heading +.gi { background-color: #CCFFCC; border: 1px solid #00CC00 } // Generic.Inserted +.go { color: #AAAAAA } // Generic.Output +.gp { color: #000099; } // Generic.Prompt +.gs { } // Generic.Strong +.gu { color: #003300; } // Generic.Subheading +.gt { color: #99CC66 } // Generic.Traceback +.kc { color: #006699; } // Keyword.Constant +.kd { color: #006699; } // Keyword.Declaration +.kn { color: #006699; } // Keyword.Namespace +.kp { color: #006699 } // Keyword.Pseudo +.kr { color: #006699; } // Keyword.Reserved +.kt { color: #007788; } // Keyword.Type +.m { color: #FF6600 } // Literal.Number +.s { color: #d44950 } // Literal.String +.na { color: #4f9fcf } // Name.Attribute +.nb { color: #336666 } // Name.Builtin +.nc { color: #00AA88; } // Name.Class +.no { color: #336600 } // Name.Constant +.nd { color: #9999FF } // Name.Decorator +.ni { color: #999999; } // Name.Entity +.ne { color: #CC0000; } // Name.Exception +.nf { color: #CC00FF } // Name.Function +.nl { color: #9999FF } // Name.Label +.nn { color: #00CCFF; } // Name.Namespace +.nt { color: #2f6f9f; } // Name.Tag +.nv { color: #003333 } // Name.Variable +.ow { color: #000000; } // Operator.Word +.w { color: #bbbbbb } // Text.Whitespace +.mf { color: #FF6600 } // Literal.Number.Float +.mh { color: #FF6600 } // Literal.Number.Hex +.mi { color: #FF6600 } // Literal.Number.Integer +.mo { color: #FF6600 } // Literal.Number.Oct +.sb { color: #CC3300 } // Literal.String.Backtick +.sc { color: #CC3300 } // Literal.String.Char +.sd { color: #CC3300; font-style: italic } // Literal.String.Doc +.s2 { color: #CC3300 } // Literal.String.Double +.se { color: #CC3300; } // Literal.String.Escape +.sh { color: #CC3300 } // Literal.String.Heredoc +.si { color: #AA0000 } // Literal.String.Interpol +.sx { color: #CC3300 } // Literal.String.Other +.sr { color: #33AAAA } // Literal.String.Regex +.s1 { color: #CC3300 } // Literal.String.Single +.ss { color: #FFCC33 } // Literal.String.Symbol +.bp { color: #336666 } // Name.Builtin.Pseudo +.vc { color: #003333 } // Name.Variable.Class +.vg { color: #003333 } // Name.Variable.Global +.vi { color: #003333 } // Name.Variable.Instance +.il { color: #FF6600 } // Literal.Number.Integer.Long + +.css .o, +.css .o + .nt, +.css .nt + .nt { color: #999; } diff --git a/app/templates/app/assets/apple-touch-icon-144-precomposed.png b/app/templates/app/assets/apple-touch-icon-144-precomposed.png new file mode 100644 index 0000000..177bbae Binary files /dev/null and b/app/templates/app/assets/apple-touch-icon-144-precomposed.png differ diff --git a/app/templates/app/assets/favicon.ico b/app/templates/app/assets/favicon.ico new file mode 100644 index 0000000..34b4206 Binary files /dev/null and b/app/templates/app/assets/favicon.ico differ diff --git a/app/templates/app/assets/images/logo-2x.png b/app/templates/app/assets/images/logo-2x.png deleted file mode 100644 index bc84a9e..0000000 Binary files a/app/templates/app/assets/images/logo-2x.png and /dev/null differ diff --git a/app/templates/app/assets/javascript/fastclick.js b/app/templates/app/assets/javascript/fastclick.js deleted file mode 100644 index 193714a..0000000 --- a/app/templates/app/assets/javascript/fastclick.js +++ /dev/null @@ -1,772 +0,0 @@ -/** - * @preserve FastClick: polyfill to remove click delays on browsers with touch UIs. - * - * @version 1.0.0 - * @codingstandard ftlabs-jsv2 - * @copyright The Financial Times Limited [All Rights Reserved] - * @license MIT License (see LICENSE.txt) - */ - -/*jslint browser:true, node:true*/ -/*global define, Event, Node*/ - - -/** - * Instantiate fast-clicking listeners on the specificed layer. - * - * @constructor - * @param {Element} layer The layer to listen on - */ -function FastClick(layer) { - 'use strict'; - var oldOnClick; - - - /** - * Whether a click is currently being tracked. - * - * @type boolean - */ - this.trackingClick = false; - - - /** - * Timestamp for when when click tracking started. - * - * @type number - */ - this.trackingClickStart = 0; - - - /** - * The element being tracked for a click. - * - * @type EventTarget - */ - this.targetElement = null; - - - /** - * X-coordinate of touch start event. - * - * @type number - */ - this.touchStartX = 0; - - - /** - * Y-coordinate of touch start event. - * - * @type number - */ - this.touchStartY = 0; - - - /** - * ID of the last touch, retrieved from Touch.identifier. - * - * @type number - */ - this.lastTouchIdentifier = 0; - - - /** - * Touchmove boundary, beyond which a click will be cancelled. - * - * @type number - */ - this.touchBoundary = 10; - - - /** - * The FastClick layer. - * - * @type Element - */ - this.layer = layer; - - if (FastClick.notNeeded(layer)) { - return; - } - - // Some old versions of Android don't have Function.prototype.bind - function bind(method, context) { - return function() { return method.apply(context, arguments); }; - } - - // Set up event handlers as required - if (deviceIsAndroid) { - layer.addEventListener('mouseover', bind(this.onMouse, this), true); - layer.addEventListener('mousedown', bind(this.onMouse, this), true); - layer.addEventListener('mouseup', bind(this.onMouse, this), true); - } - - layer.addEventListener('click', bind(this.onClick, this), true); - layer.addEventListener('touchstart', bind(this.onTouchStart, this), false); - layer.addEventListener('touchmove', bind(this.onTouchMove, this), false); - layer.addEventListener('touchend', bind(this.onTouchEnd, this), false); - layer.addEventListener('touchcancel', bind(this.onTouchCancel, this), false); - - // Hack is required for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2) - // which is how FastClick normally stops click events bubbling to callbacks registered on the FastClick - // layer when they are cancelled. - if (!Event.prototype.stopImmediatePropagation) { - layer.removeEventListener = function(type, callback, capture) { - var rmv = Node.prototype.removeEventListener; - if (type === 'click') { - rmv.call(layer, type, callback.hijacked || callback, capture); - } else { - rmv.call(layer, type, callback, capture); - } - }; - - layer.addEventListener = function(type, callback, capture) { - var adv = Node.prototype.addEventListener; - if (type === 'click') { - adv.call(layer, type, callback.hijacked || (callback.hijacked = function(event) { - if (!event.propagationStopped) { - callback(event); - } - }), capture); - } else { - adv.call(layer, type, callback, capture); - } - }; - } - - // If a handler is already declared in the element's onclick attribute, it will be fired before - // FastClick's onClick handler. Fix this by pulling out the user-defined handler function and - // adding it as listener. - if (typeof layer.onclick === 'function') { - - // Android browser on at least 3.2 requires a new reference to the function in layer.onclick - // - the old one won't work if passed to addEventListener directly. - oldOnClick = layer.onclick; - layer.addEventListener('click', function(event) { - oldOnClick(event); - }, false); - layer.onclick = null; - } -} - - -/** - * Android requires exceptions. - * - * @type boolean - */ -var deviceIsAndroid = navigator.userAgent.indexOf('Android') > 0; - - -/** - * iOS requires exceptions. - * - * @type boolean - */ -var deviceIsIOS = /iP(ad|hone|od)/.test(navigator.userAgent); - - -/** - * iOS 4 requires an exception for select elements. - * - * @type boolean - */ -var deviceIsIOS4 = deviceIsIOS && (/OS 4_\d(_\d)?/).test(navigator.userAgent); - - -/** - * iOS 6.0(+?) requires the target element to be manually derived - * - * @type boolean - */ -var deviceIsIOSWithBadTarget = deviceIsIOS && (/OS ([6-9]|\d{2})_\d/).test(navigator.userAgent); - - -/** - * Determine whether a given element requires a native click. - * - * @param {EventTarget|Element} target Target DOM element - * @returns {boolean} Returns true if the element needs a native click - */ -FastClick.prototype.needsClick = function(target) { - 'use strict'; - switch (target.nodeName.toLowerCase()) { - - // Don't send a synthetic click to disabled inputs (issue #62) - case 'button': - case 'select': - case 'textarea': - if (target.disabled) { - return true; - } - - break; - case 'input': - - // File inputs need real clicks on iOS 6 due to a browser bug (issue #68) - if ((deviceIsIOS && target.type === 'file') || target.disabled) { - return true; - } - - break; - case 'label': - case 'video': - return true; - } - - return (/\bneedsclick\b/).test(target.className); -}; - - -/** - * Determine whether a given element requires a call to focus to simulate click into element. - * - * @param {EventTarget|Element} target Target DOM element - * @returns {boolean} Returns true if the element requires a call to focus to simulate native click. - */ -FastClick.prototype.needsFocus = function(target) { - 'use strict'; - switch (target.nodeName.toLowerCase()) { - case 'textarea': - return true; - case 'select': - return !deviceIsAndroid; - case 'input': - switch (target.type) { - case 'button': - case 'checkbox': - case 'file': - case 'image': - case 'radio': - case 'submit': - return false; - } - - // No point in attempting to focus disabled inputs - return !target.disabled && !target.readOnly; - default: - return (/\bneedsfocus\b/).test(target.className); - } -}; - - -/** - * Send a click event to the specified element. - * - * @param {EventTarget|Element} targetElement - * @param {Event} event - */ -FastClick.prototype.sendClick = function(targetElement, event) { - 'use strict'; - var clickEvent, touch; - - // On some Android devices activeElement needs to be blurred otherwise the synthetic click will have no effect (#24) - if (document.activeElement && document.activeElement !== targetElement) { - document.activeElement.blur(); - } - - touch = event.changedTouches[0]; - - // Synthesise a click event, with an extra attribute so it can be tracked - clickEvent = document.createEvent('MouseEvents'); - clickEvent.initMouseEvent(this.determineEventType(targetElement), true, true, window, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null); - clickEvent.forwardedTouchEvent = true; - targetElement.dispatchEvent(clickEvent); -}; - -FastClick.prototype.determineEventType = function(targetElement) { - 'use strict'; - - //Issue #159: Android Chrome Select Box does not open with a synthetic click event - if (deviceIsAndroid && targetElement.tagName.toLowerCase() === 'select') { - return 'mousedown'; - } - - return 'click'; -}; - - -/** - * @param {EventTarget|Element} targetElement - */ -FastClick.prototype.focus = function(targetElement) { - 'use strict'; - var length; - - // Issue #160: on iOS 7, some input elements (e.g. date datetime) throw a vague TypeError on setSelectionRange. These elements don't have an integer value for the selectionStart and selectionEnd properties, but unfortunately that can't be used for detection because accessing the properties also throws a TypeError. Just check the type instead. Filed as Apple bug #15122724. - if (deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time') { - length = targetElement.value.length; - targetElement.setSelectionRange(length, length); - } else { - targetElement.focus(); - } -}; - - -/** - * Check whether the given target element is a child of a scrollable layer and if so, set a flag on it. - * - * @param {EventTarget|Element} targetElement - */ -FastClick.prototype.updateScrollParent = function(targetElement) { - 'use strict'; - var scrollParent, parentElement; - - scrollParent = targetElement.fastClickScrollParent; - - // Attempt to discover whether the target element is contained within a scrollable layer. Re-check if the - // target element was moved to another parent. - if (!scrollParent || !scrollParent.contains(targetElement)) { - parentElement = targetElement; - do { - if (parentElement.scrollHeight > parentElement.offsetHeight) { - scrollParent = parentElement; - targetElement.fastClickScrollParent = parentElement; - break; - } - - parentElement = parentElement.parentElement; - } while (parentElement); - } - - // Always update the scroll top tracker if possible. - if (scrollParent) { - scrollParent.fastClickLastScrollTop = scrollParent.scrollTop; - } -}; - - -/** - * @param {EventTarget} targetElement - * @returns {Element|EventTarget} - */ -FastClick.prototype.getTargetElementFromEventTarget = function(eventTarget) { - 'use strict'; - - // On some older browsers (notably Safari on iOS 4.1 - see issue #56) the event target may be a text node. - if (eventTarget.nodeType === Node.TEXT_NODE) { - return eventTarget.parentNode; - } - - return eventTarget; -}; - - -/** - * On touch start, record the position and scroll offset. - * - * @param {Event} event - * @returns {boolean} - */ -FastClick.prototype.onTouchStart = function(event) { - 'use strict'; - var targetElement, touch, selection; - - // Ignore multiple touches, otherwise pinch-to-zoom is prevented if both fingers are on the FastClick element (issue #111). - if (event.targetTouches.length > 1) { - return true; - } - - targetElement = this.getTargetElementFromEventTarget(event.target); - touch = event.targetTouches[0]; - - if (deviceIsIOS) { - - // Only trusted events will deselect text on iOS (issue #49) - selection = window.getSelection(); - if (selection.rangeCount && !selection.isCollapsed) { - return true; - } - - if (!deviceIsIOS4) { - - // Weird things happen on iOS when an alert or confirm dialog is opened from a click event callback (issue #23): - // when the user next taps anywhere else on the page, new touchstart and touchend events are dispatched - // with the same identifier as the touch event that previously triggered the click that triggered the alert. - // Sadly, there is an issue on iOS 4 that causes some normal touch events to have the same identifier as an - // immediately preceeding touch event (issue #52), so this fix is unavailable on that platform. - if (touch.identifier === this.lastTouchIdentifier) { - event.preventDefault(); - return false; - } - - this.lastTouchIdentifier = touch.identifier; - - // If the target element is a child of a scrollable layer (using -webkit-overflow-scrolling: touch) and: - // 1) the user does a fling scroll on the scrollable layer - // 2) the user stops the fling scroll with another tap - // then the event.target of the last 'touchend' event will be the element that was under the user's finger - // when the fling scroll was started, causing FastClick to send a click event to that layer - unless a check - // is made to ensure that a parent layer was not scrolled before sending a synthetic click (issue #42). - this.updateScrollParent(targetElement); - } - } - - this.trackingClick = true; - this.trackingClickStart = event.timeStamp; - this.targetElement = targetElement; - - this.touchStartX = touch.pageX; - this.touchStartY = touch.pageY; - - // Prevent phantom clicks on fast double-tap (issue #36) - if ((event.timeStamp - this.lastClickTime) < 200) { - event.preventDefault(); - } - - return true; -}; - - -/** - * Based on a touchmove event object, check whether the touch has moved past a boundary since it started. - * - * @param {Event} event - * @returns {boolean} - */ -FastClick.prototype.touchHasMoved = function(event) { - 'use strict'; - var touch = event.changedTouches[0], boundary = this.touchBoundary; - - if (Math.abs(touch.pageX - this.touchStartX) > boundary || Math.abs(touch.pageY - this.touchStartY) > boundary) { - return true; - } - - return false; -}; - - -/** - * Update the last position. - * - * @param {Event} event - * @returns {boolean} - */ -FastClick.prototype.onTouchMove = function(event) { - 'use strict'; - if (!this.trackingClick) { - return true; - } - - // If the touch has moved, cancel the click tracking - if (this.targetElement !== this.getTargetElementFromEventTarget(event.target) || this.touchHasMoved(event)) { - this.trackingClick = false; - this.targetElement = null; - } - - return true; -}; - - -/** - * Attempt to find the labelled control for the given label element. - * - * @param {EventTarget|HTMLLabelElement} labelElement - * @returns {Element|null} - */ -FastClick.prototype.findControl = function(labelElement) { - 'use strict'; - - // Fast path for newer browsers supporting the HTML5 control attribute - if (labelElement.control !== undefined) { - return labelElement.control; - } - - // All browsers under test that support touch events also support the HTML5 htmlFor attribute - if (labelElement.htmlFor) { - return document.getElementById(labelElement.htmlFor); - } - - // If no for attribute exists, attempt to retrieve the first labellable descendant element - // the list of which is defined here: http://www.w3.org/TR/html5/forms.html#category-label - return labelElement.querySelector('button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea'); -}; - - -/** - * On touch end, determine whether to send a click event at once. - * - * @param {Event} event - * @returns {boolean} - */ -FastClick.prototype.onTouchEnd = function(event) { - 'use strict'; - var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement; - - if (!this.trackingClick) { - return true; - } - - // Prevent phantom clicks on fast double-tap (issue #36) - if ((event.timeStamp - this.lastClickTime) < 200) { - this.cancelNextClick = true; - return true; - } - - // Reset to prevent wrong click cancel on input (issue #156). - this.cancelNextClick = false; - - this.lastClickTime = event.timeStamp; - - trackingClickStart = this.trackingClickStart; - this.trackingClick = false; - this.trackingClickStart = 0; - - // On some iOS devices, the targetElement supplied with the event is invalid if the layer - // is performing a transition or scroll, and has to be re-detected manually. Note that - // for this to function correctly, it must be called *after* the event target is checked! - // See issue #57; also filed as rdar://13048589 . - if (deviceIsIOSWithBadTarget) { - touch = event.changedTouches[0]; - - // In certain cases arguments of elementFromPoint can be negative, so prevent setting targetElement to null - targetElement = document.elementFromPoint(touch.pageX - window.pageXOffset, touch.pageY - window.pageYOffset) || targetElement; - targetElement.fastClickScrollParent = this.targetElement.fastClickScrollParent; - } - - targetTagName = targetElement.tagName.toLowerCase(); - if (targetTagName === 'label') { - forElement = this.findControl(targetElement); - if (forElement) { - this.focus(targetElement); - if (deviceIsAndroid) { - return false; - } - - targetElement = forElement; - } - } else if (this.needsFocus(targetElement)) { - - // Case 1: If the touch started a while ago (best guess is 100ms based on tests for issue #36) then focus will be triggered anyway. Return early and unset the target element reference so that the subsequent click will be allowed through. - // Case 2: Without this exception for input elements tapped when the document is contained in an iframe, then any inputted text won't be visible even though the value attribute is updated as the user types (issue #37). - if ((event.timeStamp - trackingClickStart) > 100 || (deviceIsIOS && window.top !== window && targetTagName === 'input')) { - this.targetElement = null; - return false; - } - - this.focus(targetElement); - this.sendClick(targetElement, event); - - // Select elements need the event to go through on iOS 4, otherwise the selector menu won't open. - if (!deviceIsIOS4 || targetTagName !== 'select') { - this.targetElement = null; - event.preventDefault(); - } - - return false; - } - - if (deviceIsIOS && !deviceIsIOS4) { - - // Don't send a synthetic click event if the target element is contained within a parent layer that was scrolled - // and this tap is being used to stop the scrolling (usually initiated by a fling - issue #42). - scrollParent = targetElement.fastClickScrollParent; - if (scrollParent && scrollParent.fastClickLastScrollTop !== scrollParent.scrollTop) { - return true; - } - } - - // Prevent the actual click from going though - unless the target node is marked as requiring - // real clicks or if it is in the whitelist in which case only non-programmatic clicks are permitted. - if (!this.needsClick(targetElement)) { - event.preventDefault(); - this.sendClick(targetElement, event); - } - - return false; -}; - - -/** - * On touch cancel, stop tracking the click. - * - * @returns {void} - */ -FastClick.prototype.onTouchCancel = function() { - 'use strict'; - this.trackingClick = false; - this.targetElement = null; -}; - - -/** - * Determine mouse events which should be permitted. - * - * @param {Event} event - * @returns {boolean} - */ -FastClick.prototype.onMouse = function(event) { - 'use strict'; - - // If a target element was never set (because a touch event was never fired) allow the event - if (!this.targetElement) { - return true; - } - - if (event.forwardedTouchEvent) { - return true; - } - - // Programmatically generated events targeting a specific element should be permitted - if (!event.cancelable) { - return true; - } - - // Derive and check the target element to see whether the mouse event needs to be permitted; - // unless explicitly enabled, prevent non-touch click events from triggering actions, - // to prevent ghost/doubleclicks. - if (!this.needsClick(this.targetElement) || this.cancelNextClick) { - - // Prevent any user-added listeners declared on FastClick element from being fired. - if (event.stopImmediatePropagation) { - event.stopImmediatePropagation(); - } else { - - // Part of the hack for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2) - event.propagationStopped = true; - } - - // Cancel the event - event.stopPropagation(); - event.preventDefault(); - - return false; - } - - // If the mouse event is permitted, return true for the action to go through. - return true; -}; - - -/** - * On actual clicks, determine whether this is a touch-generated click, a click action occurring - * naturally after a delay after a touch (which needs to be cancelled to avoid duplication), or - * an actual click which should be permitted. - * - * @param {Event} event - * @returns {boolean} - */ -FastClick.prototype.onClick = function(event) { - 'use strict'; - var permitted; - - // It's possible for another FastClick-like library delivered with third-party code to fire a click event before FastClick does (issue #44). In that case, set the click-tracking flag back to false and return early. This will cause onTouchEnd to return early. - if (this.trackingClick) { - this.targetElement = null; - this.trackingClick = false; - return true; - } - - // Very odd behaviour on iOS (issue #18): if a submit element is present inside a form and the user hits enter in the iOS simulator or clicks the Go button on the pop-up OS keyboard the a kind of 'fake' click event will be triggered with the submit-type input element as the target. - if (event.target.type === 'submit' && event.detail === 0) { - return true; - } - - permitted = this.onMouse(event); - - // Only unset targetElement if the click is not permitted. This will ensure that the check for !targetElement in onMouse fails and the browser's click doesn't go through. - if (!permitted) { - this.targetElement = null; - } - - // If clicks are permitted, return true for the action to go through. - return permitted; -}; - - -/** - * Remove all FastClick's event listeners. - * - * @returns {void} - */ -FastClick.prototype.destroy = function() { - 'use strict'; - var layer = this.layer; - - if (deviceIsAndroid) { - layer.removeEventListener('mouseover', this.onMouse, true); - layer.removeEventListener('mousedown', this.onMouse, true); - layer.removeEventListener('mouseup', this.onMouse, true); - } - - layer.removeEventListener('click', this.onClick, true); - layer.removeEventListener('touchstart', this.onTouchStart, false); - layer.removeEventListener('touchmove', this.onTouchMove, false); - layer.removeEventListener('touchend', this.onTouchEnd, false); - layer.removeEventListener('touchcancel', this.onTouchCancel, false); -}; - - -/** - * Check whether FastClick is needed. - * - * @param {Element} layer The layer to listen on - */ -FastClick.notNeeded = function(layer) { - 'use strict'; - var metaViewport; - var chromeVersion; - - // Devices that don't support touch don't need FastClick - if (typeof window.ontouchstart === 'undefined') { - return true; - } - - // Chrome version - zero for other browsers - chromeVersion = +(/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [,0])[1]; - - if (chromeVersion) { - - if (deviceIsAndroid) { - metaViewport = document.querySelector('meta[name=viewport]'); - - if (metaViewport) { - // Chrome on Android with user-scalable="no" doesn't need FastClick (issue #89) - if (metaViewport.content.indexOf('user-scalable=no') !== -1) { - return true; - } - // Chrome 32 and above with width=device-width or less don't need FastClick - if (chromeVersion > 31 && window.innerWidth <= window.screen.width) { - return true; - } - } - - // Chrome desktop doesn't need FastClick (issue #15) - } else { - return true; - } - } - - // IE10 with -ms-touch-action: none, which disables double-tap-to-zoom (issue #97) - if (layer.style.msTouchAction === 'none') { - return true; - } - - return false; -}; - - -/** - * Factory method for creating a FastClick object - * - * @param {Element} layer The layer to listen on - */ -FastClick.attach = function(layer) { - 'use strict'; - return new FastClick(layer); -}; - - -if (typeof define !== 'undefined' && define.amd) { - - // AMD. Register as an anonymous module. - define(function() { - 'use strict'; - return FastClick; - }); -} else if (typeof module !== 'undefined' && module.exports) { - module.exports = FastClick.attach; - module.exports.FastClick = FastClick; -} else { - window.FastClick = FastClick; -} \ No newline at end of file diff --git a/app/templates/app/assets/javascript/ngprogress.js b/app/templates/app/assets/javascript/ngprogress.js deleted file mode 100644 index 240fceb..0000000 --- a/app/templates/app/assets/javascript/ngprogress.js +++ /dev/null @@ -1,314 +0,0 @@ -/*! NProgress (c) 2013, Rico Sta. Cruz - * http://ricostacruz.com/nprogress */ - -;(function(factory) { - - if (typeof module === 'function') { - module.exports = factory(this.jQuery || require('jquery')); - } else if (typeof define === 'function' && define.amd) { - define(['jquery'], function($) { - return factory($); - }); - } else { - this.NProgress = factory(this.jQuery); - } - -})(function($) { - var NProgress = {}; - - NProgress.version = '0.1.2'; - - var Settings = NProgress.settings = { - minimum: 0.08, - easing: 'ease', - positionUsing: '', - speed: 200, - trickle: true, - trickleRate: 0.02, - trickleSpeed: 800, - showSpinner: true, - template: '

' - }; - - /** - * Updates configuration. - * - * NProgress.configure({ - * minimum: 0.1 - * }); - */ - NProgress.configure = function(options) { - $.extend(Settings, options); - return this; - }; - - /** - * Last number. - */ - - NProgress.status = null; - - /** - * Sets the progress bar status, where `n` is a number from `0.0` to `1.0`. - * - * NProgress.set(0.4); - * NProgress.set(1.0); - */ - - NProgress.set = function(n) { - var started = NProgress.isStarted(); - - n = clamp(n, Settings.minimum, 1); - NProgress.status = (n === 1 ? null : n); - - var $progress = NProgress.render(!started), - $bar = $progress.find('[role="bar"]'), - speed = Settings.speed, - ease = Settings.easing; - - $progress[0].offsetWidth; /* Repaint */ - - $progress.queue(function(next) { - // Set positionUsing if it hasn't already been set - if (Settings.positionUsing === '') Settings.positionUsing = NProgress.getPositioningCSS(); - - // Add transition - $bar.css(barPositionCSS(n, speed, ease)); - - if (n === 1) { - // Fade out - $progress.css({ transition: 'none', opacity: 1 }); - $progress[0].offsetWidth; /* Repaint */ - - setTimeout(function() { - $progress.css({ transition: 'all '+speed+'ms linear', opacity: 0 }); - setTimeout(function() { - NProgress.remove(); - next(); - }, speed); - }, speed); - } else { - setTimeout(next, speed); - } - }); - - return this; - }; - - NProgress.isStarted = function() { - return typeof NProgress.status === 'number'; - }; - - /** - * Shows the progress bar. - * This is the same as setting the status to 0%, except that it doesn't go backwards. - * - * NProgress.start(); - * - */ - NProgress.start = function() { - if (!NProgress.status) NProgress.set(0); - - var work = function() { - setTimeout(function() { - if (!NProgress.status) return; - NProgress.trickle(); - work(); - }, Settings.trickleSpeed); - }; - - if (Settings.trickle) work(); - - return this; - }; - - /** - * Hides the progress bar. - * This is the *sort of* the same as setting the status to 100%, with the - * difference being `done()` makes some placebo effect of some realistic motion. - * - * NProgress.done(); - * - * If `true` is passed, it will show the progress bar even if its hidden. - * - * NProgress.done(true); - */ - - NProgress.done = function(force) { - if (!force && !NProgress.status) return this; - - return NProgress.inc(0.3 + 0.5 * Math.random()).set(1); - }; - - /** - * Increments by a random amount. - */ - - NProgress.inc = function(amount) { - var n = NProgress.status; - - if (!n) { - return NProgress.start(); - } else { - if (typeof amount !== 'number') { - amount = (1 - n) * clamp(Math.random() * n, 0.1, 0.95); - } - - n = clamp(n + amount, 0, 0.994); - return NProgress.set(n); - } - }; - - NProgress.trickle = function() { - return NProgress.inc(Math.random() * Settings.trickleRate); - }; - - /** - * Waits for all supplied jQuery promises and - * increases the progress as the promises resolve. - * - * @param $promise jQUery Promise - */ - (function() { - var initial = 0, current = 0; - - NProgress.promise = function($promise) { - if (!$promise || $promise.state() == "resolved") { - return this; - } - - if (current == 0) { - NProgress.start(); - } - - initial++; - current++; - - $promise.always(function() { - current--; - if (current == 0) { - initial = 0; - NProgress.done(); - } else { - NProgress.set((initial - current) / initial); - } - }); - - return this; - }; - - })(); - - /** - * (Internal) renders the progress bar markup based on the `template` - * setting. - */ - - NProgress.render = function(fromStart) { - if (NProgress.isRendered()) return $("#nprogress"); - $('html').addClass('nprogress-busy'); - - var $el = $("
") - .html(Settings.template); - - var perc = fromStart ? '-100' : toBarPerc(NProgress.status || 0); - - $el.find('[role="bar"]').css({ - transition: 'all 0 linear', - transform: 'translate3d('+perc+'%,0,0)' - }); - - if (!Settings.showSpinner) - $el.find('[role="spinner"]').remove(); - - $el.appendTo(document.body); - - return $el; - }; - - /** - * Removes the element. Opposite of render(). - */ - - NProgress.remove = function() { - $('html').removeClass('nprogress-busy'); - $('#nprogress').remove(); - }; - - /** - * Checks if the progress bar is rendered. - */ - - NProgress.isRendered = function() { - return ($("#nprogress").length > 0); - }; - - /** - * Determine which positioning CSS rule to use. - */ - - NProgress.getPositioningCSS = function() { - // Sniff on document.body.style - var bodyStyle = document.body.style; - - // Sniff prefixes - var vendorPrefix = ('WebkitTransform' in bodyStyle) ? 'Webkit' : - ('MozTransform' in bodyStyle) ? 'Moz' : - ('msTransform' in bodyStyle) ? 'ms' : - ('OTransform' in bodyStyle) ? 'O' : ''; - - if (vendorPrefix + 'Perspective' in bodyStyle) { - // Modern browsers with 3D support, e.g. Webkit, IE10 - return 'translate3d'; - } else if (vendorPrefix + 'Transform' in bodyStyle) { - // Browsers without 3D support, e.g. IE9 - return 'translate'; - } else { - // Browsers without translate() support, e.g. IE7-8 - return 'margin'; - } - }; - - /** - * Helpers - */ - - function clamp(n, min, max) { - if (n < min) return min; - if (n > max) return max; - return n; - } - - /** - * (Internal) converts a percentage (`0..1`) to a bar translateX - * percentage (`-100%..0%`). - */ - - function toBarPerc(n) { - return (-1 + n) * 100; - } - - - /** - * (Internal) returns the correct CSS for changing the bar's - * position given an n percentage, and speed and ease from Settings - */ - - function barPositionCSS(n, speed, ease) { - var barCSS; - - if (Settings.positionUsing === 'translate3d') { - barCSS = { transform: 'translate3d('+toBarPerc(n)+'%,0,0)' }; - } else if (Settings.positionUsing === 'translate') { - barCSS = { transform: 'translate('+toBarPerc(n)+'%,0)' }; - } else { - barCSS = { 'margin-left': toBarPerc(n)+'%' }; - } - - barCSS.transition = 'all '+speed+'ms '+ease; - - return barCSS; - } - - return NProgress; -}); diff --git a/app/templates/app/assets/stylesheets/main.css b/app/templates/app/assets/stylesheets/main.css deleted file mode 100644 index e63582e..0000000 --- a/app/templates/app/assets/stylesheets/main.css +++ /dev/null @@ -1,274 +0,0 @@ -/* -The main SCSS file for everything, yep -*/ -/*****************************************************************************/ -/* -/* Common -/* -/*****************************************************************************/ -/* Global Reset */ -* { - margin: 0; - padding: 0; } - -html { - height: 100%; } - -body { - height: 100%; - background-color: #FFF; - font: 13.34px Helvetica, Arial, sans-serif; - font-size: small; - text-align: center; } - -h1, h2, h3, h4, h5, h6 { - font-size: 100%; } - -h1 { - margin-bottom: 1em; } - -p { - margin: 1em 0; } - -a { - color: #00a; } - a:hover { - color: #000; } - a:visited { - color: #a0a; } - -/*****************************************************************************/ -/* -/* Home -/* -/*****************************************************************************/ -.posts { - list-style-type: none; - margin-bottom: 2em; } - .posts li { - line-height: 1.75em; } - .posts span { - color: #aaa; - font-family: Monaco, "Courier New", monospace; - font-size: 80%; } - -/*****************************************************************************/ -/* -/* Site -/* -/*****************************************************************************/ -.site { - font-size: 115%; - text-align: justify; - width: 42em; - margin: 3em auto 2em; - line-height: 1.5em; } - -.header a { - font-weight: bold; - text-decoration: none; } - -.title { - display: inline-block; - margin-bottom: 2em; } - .title a { - color: #a00; } - .title a:hover { - color: #000; } - -.header a.extra { - color: #aaa; - margin-left: 1em; } - .header a.extra:hover { - color: #000; } - -.meta { - color: #aaa; } - -.footer { - font-size: 80%; - color: #666; - border-top: 4px solid #eee; - margin-top: 2em; - overflow: hidden; } - .footer .contact { - float: left; - margin-right: 3em; } - .footer .contact a { - color: #8085C1; } - .footer .rss { - margin-top: 1.1em; - margin-right: -0.2em; - float: right; } - .footer .rss img { - border: 0; } - -/*****************************************************************************/ -/* -/* Posts -/* -/*****************************************************************************/ -/* standard */ -.post pre { - border: 1px solid #ddd; - background-color: #eef; - padding: 0 0.4em; } -.post ul, .post ol { - margin-left: 1.35em; } -.post code { - border: 1px solid #ddd; - background-color: #eef; - padding: 0 0.2em; } -.post pre { - /* terminal */ } - .post pre code { - border: none; } - .post pre.terminal { - border: 1px solid #000; - background-color: #333; - color: #FFF; } - .post pre.terminal code { - background-color: #333; } - -.highlight { - background: #ffffff; } - .highlight .c { - /* Comment */ - color: #999988; - font-style: italic; } - .highlight .err { - /* Error */ - color: #a61717; - background-color: #e3d2d2; } - .highlight .k, .highlight .o { - /* Keyword & Operator */ - font-weight: bold; } - .highlight .cm { - /* Comment.Multiline */ - color: #999988; - font-style: italic; } - .highlight .cp { - /* Comment.Preproc */ - color: #999999; - font-weight: bold; } - .highlight .c1 { - /* Comment.Single */ - color: #999988; - font-style: italic; } - .highlight .cs { - /* Comment.Special */ - color: #999999; - font-weight: bold; - font-style: italic; } - .highlight .gd { - /* Generic.Deleted */ - color: #000000; - background-color: #ffdddd; } - .highlight .gd .x { - /* Generic.Deleted.Specific */ - color: #000000; - background-color: #ffaaaa; } - .highlight .ge { - /* Generic.Emph */ - font-style: italic; } - .highlight .gr { - /* Generic.Error */ - color: #aa0000; } - .highlight .gh { - /* Generic.Heading */ - color: #999999; } - .highlight .gi { - /* Generic.Inserted */ - color: #000000; - background-color: #ddffdd; } - .highlight .gi .x { - /* Generic.Inserted.Specific */ - color: #000000; - background-color: #aaffaa; } - .highlight .go { - /* Generic.Output */ - color: #888888; } - .highlight .gp { - /* Generic.Prompt */ - color: #555555; } - .highlight .gs { - /* Generic.Strong */ - font-weight: bold; } - .highlight .gu { - /* Generic.Subheading */ - color: #aaaaaa; } - .highlight .gt { - /* Generic.Traceback */ - color: #aa0000; } - .highlight .kc, .highlight .kd, .highlight .kp, .highlight .kr { - /* Keyword.{Constant,Declaration,Pseudo,Reserved} */ - font-weight: bold; } - .highlight .kt { - /* Keyword.Type */ - color: #445588; - font-weight: bold; } - .highlight .m { - /* Literal.Number */ - color: #009999; } - .highlight .s { - /* Literal.String */ - color: #dd1144; } - .highlight .na { - /* Name.Attribute */ - color: teal; } - .highlight .nb { - /* Name.Builtin */ - color: #0086b3; } - .highlight .nc { - /* Name.Class */ - color: #445588; - font-weight: bold; } - .highlight .no { - /* Name.Constant */ - color: teal; } - .highlight .ni { - /* Name.Entity */ - color: purple; } - .highlight .ne, .highlight .nf { - /* Name.Exception & Name.Function */ - color: #990000; - font-weight: bold; } - .highlight .nn { - /* Name.Namespace */ - color: #555555; } - .highlight .nt { - /* Name.Tag */ - color: navy; } - .highlight .nv { - /* Name.Variable */ - color: teal; } - .highlight .ow { - /* Operator.Word */ - font-weight: bold; } - .highlight .w { - /* Text.Whitespace */ - color: #bbbbbb; } - .highlight .mf, .highlight .mh, .highlight .mi, .highlight .mo { - /* Literal.Number.{Float,Hex,Integer,Oct} */ - color: #009999; } - .highlight .sb, .highlight .sc, .highlight .sd, .highlight .s2, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx { - /* Literal.String.{Backtick,Char,Doc,Double,Escape,Heredoc,Interpol,Other} */ - color: #dd1144; } - .highlight .sr { - /* Literal.String.Regex */ - color: #009926; } - .highlight .s1 { - /* Literal.String.Single */ - color: #dd1144; } - .highlight .ss { - /* Literal.String.Symbol */ - color: #990073; } - .highlight .bp { - /* Name.Builtin.Pseudo */ - color: #999999; } - .highlight .vc, .highlight .vg, .highlight .vi { - /* Name.Variable.{Class,Global,Instance} */ - color: teal; } - .highlight .il { - /* Literal.Number.Integer.Long */ - color: #009999; } diff --git a/app/templates/app/atom.xml b/app/templates/app/atom.xml new file mode 100644 index 0000000..8a1a28c --- /dev/null +++ b/app/templates/app/atom.xml @@ -0,0 +1,28 @@ +--- +layout: nil +--- + + + + + {{ site.title }} + + + {{ site.time | date_to_xmlschema }} + {{ site.url }} + + {{ site.author.name }} + {{ site.author.email }} + + + {% for post in site.posts %} + + {{ post.title }} + + {{ post.date | date_to_xmlschema }} + {{ site.url }}{{ post.id }} + {{ post.content | xml_escape }} + + {% endfor %} + + diff --git a/app/templates/app/crossdomain.xml b/app/templates/app/crossdomain.xml new file mode 100644 index 0000000..29a035d --- /dev/null +++ b/app/templates/app/crossdomain.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/app/templates/app/humans.txt b/app/templates/app/humans.txt new file mode 100644 index 0000000..5bae32d --- /dev/null +++ b/app/templates/app/humans.txt @@ -0,0 +1,16 @@ +# humanstxt.org/ +# The humans responsible & technology colophon + +# TEAM + + <%= ownerName %> -- -- @<%= ownerTwitter %> + +# THANKS + + + +# TECHNOLOGY COLOPHON + + HTML5, CSS3, JavaScript + Jekyll, Lanyon/Poole, HTML5 Boilerplate + Yeoman, Jekyllized diff --git a/app/templates/app/index.html b/app/templates/app/index.html index f76bde6..dc0e647 100644 --- a/app/templates/app/index.html +++ b/app/templates/app/index.html @@ -1,14 +1,37 @@ --- layout: default -title: Your New Jekyll Site +title: Home --- -
-

Blog Posts

-
    - {% for post in site.posts %} -
  • {{ post.date | date_to_string }} » {{ post.title }}
  • - {% endfor %} -
-

And a test paragraph. Make some changes... It still works, right?

+
+ {% for post in paginator.posts %} +
+

+ + {{ post.title }} + +

+ + + + {{ post.content }} +
+ {% endfor %} +
+ + \ No newline at end of file diff --git a/app/templates/app/robots.txt b/app/templates/app/robots.txt new file mode 100644 index 0000000..d0e5f1b --- /dev/null +++ b/app/templates/app/robots.txt @@ -0,0 +1,5 @@ +# www.robotstxt.org/ + +# Allow crawling of all content +User-agent: * +Disallow: diff --git a/app/templates/app/sitemap.xml b/app/templates/app/sitemap.xml new file mode 100644 index 0000000..52c5322 --- /dev/null +++ b/app/templates/app/sitemap.xml @@ -0,0 +1,56 @@ +--- +layout: nil +--- + + + + {{ site.url }}/ + {{ site.time | date_to_xmlschema }} + weekly + 1.0 + + {% for post in site.posts %} + + {{ site.url }}{{ post.url }} + {% if post.sitemap.lastmod %} + {{ post.sitemap.lastmod | date: "%Y-%m-%d" }} + {% elsif post.date %} + {{ post.date | date_to_xmlschema }} + {% else %} + {{ site.time | date_to_xmlschema }} + {% endif %} + {% if post.sitemap.changefreq %} + {{ post.sitemap.changefreq }} + {% else %} + monthly + {% endif %} + {% if post.sitemap.priority %} + {{ post.sitemap.priority }} + {% else %} + 0.5 + {% endif %} + + {% endfor %} + {% for page in site.pages %} + + {{ site.url }}{{ page.url }} + {% if page.sitemap.lastmod %} + {{ page.sitemap.lastmod | date: "%Y-%m-%d" }} + {% elsif page.date %} + {{ page.date | date_to_xmlschema }} + {% else %} + {{ site.time | date_to_xmlschema }} + {% endif %} + {% if page.sitemap.changefreq %} + {{ page.sitemap.changefreq }} + {% else %} + monthly + {% endif %} + {% if page.sitemap.priority %} + {{ page.sitemap.priority }} + {% else %} + 0.3 + {% endif %} + + {% endfor %} + diff --git a/app/templates/csslintrc b/app/templates/csslintrc index 3ffbfef..18686b8 100755 --- a/app/templates/csslintrc +++ b/app/templates/csslintrc @@ -1,37 +1,37 @@ { - "important": false, - "adjoining-classes": false, + "important": true, + "adjoining-classes": true, "known-properties": true, - "box-sizing": false, - "box-model": false, - "overqualified-elements": false, + "box-sizing": true, + "box-model": true, + "overqualified-elements": true, "display-property-grouping": true, - "bulletproof-font-face": false, - "compatible-vendor-prefixes": false, - "regex-selectors": false, - "errors": false, - "duplicate-background-images": false, - "duplicate-properties": false, - "empty-rules": false, - "selector-max-approaching": false, - "gradients": false, + "bulletproof-font-face": true, + "compatible-vendor-prefixes": true, + "regex-selectors": true, + "errors": true, + "duplicate-background-images": true, + "duplicate-properties": true, + "empty-rules": true, + "selector-max-approaching": true, + "gradients": true, "fallback-colors": true, - "font-sizes": false, - "font-faces": false, - "floats": false, - "star-property-hack": false, - "outline-none": false, + "font-sizes": true, + "font-faces": true, + "floats": true, + "star-property-hack": true, + "outline-none": true, "import": true, "ids": true, - "underscore-property-hack": false, - "rules-count": false, - "qualified-headings": false, - "selector-max": false, + "underscore-property-hack": true, + "rules-count": true, + "qualified-headings": true, + "selector-max": true, "shorthand": true, - "text-indent": false, - "unique-headings": false, - "universal-selector": false, + "text-indent": true, + "unique-headings": true, + "universal-selector": true, "unqualified-attributes": true, - "vendor-prefix": false, + "vendor-prefix": true, "zero-units": true } diff --git a/app/templates/gitignore b/app/templates/gitignore index 06b769b..26ca1c1 100644 --- a/app/templates/gitignore +++ b/app/templates/gitignore @@ -52,6 +52,7 @@ tags # Packages node_modules/* .tmp +test/ # Sublime *.sublime-project diff --git a/app/templates/gulpfile.js b/app/templates/gulpfile.js index cf294ae..2354b67 100755 --- a/app/templates/gulpfile.js +++ b/app/templates/gulpfile.js @@ -44,24 +44,30 @@ gulp.task('clean-dist', function() { .pipe($.rimraf()); }); -// Runs the build command for Jekyll to (re)compile the site -// When watching the site for changes this will be executed every time a HTML or Markdown -// file is changed and the changes are available via LiveReload automatically -gulp.task('jekyll', function() { +// Runs the build command for Jekyll to compile the site locally +gulp.task('jekyll-serve', function() { return gulp.src('') .pipe($.exec("jekyll build")); }); +// Almost identical to the above task, but instead we load in the build configuration +// that overwrites some of the settings in the regular configuration so that you +// don't end up publishing your drafts or future posts +gulp.task('jekyll-build', function() { + return gulp.src('') + .pipe($.exec("jekyll build --config _config.yml,_config.build.yml")); +}); + // Runs every time a HTML file is changed in the './src' directory // Also runs the 'jekyll' gulp task -gulp.task('html', ['jekyll'], function () { +gulp.task('html', ['jekyll-serve'], function () { return gulp.src('./src/**/*.html') .pipe($.connect.reload()); }); // Runs every time a Markdown file with the .md extention is changed in the './src' directory // Also runs the 'jekyll' gulp task -gulp.task('markdown',['jekyll'], function() { +gulp.task('markdown',['jekyll-serve'], function() { return gulp.src('./src/**/*.md') .pipe($.connect.reload()); }); @@ -93,11 +99,11 @@ gulp.task('stylesheets', function() { // LiveReload for JS gulp.task('scripts', function() { - return gulp.src('./src/<%= javascriptDirectory %>/**/*.js') - .pipe($.changed('./serve/<%= javascriptDirectory %>/**/*')) - .pipe(gulp.dest('./serve/<%= javascriptDirectory %>')) - .pipe($.size()) - .pipe($.connect.reload()); + return gulp.src('./src/<%= javascriptDirectory %>/**/*.js') + .pipe($.changed('./serve/<%= javascriptDirectory %>/**/*')) + .pipe(gulp.dest('./serve/<%= javascriptDirectory %>')) + .pipe($.size()) + .pipe($.connect.reload()); }); // LiveReload for images @@ -112,9 +118,15 @@ gulp.task('images', function() { // Minifies the HTML of the site gulp.task('htmlify', function() { - return gulp.src('./serve/**/*.html') - .pipe(minifyHTML()) - .pipe(gulp.dest('./site')); + return gulp.src('./serve/**/*.html') + .pipe(minifyHTML()) + .pipe(gulp.dest('./site')); +}); + +// Move the '.txt' and '.xml' files from './serve' to './site' +gulp.task('move', function() { + return gulp.src(['./serve/**/*.xml', './serve/**/*.txt']) + .pipe(gulp.dest('./site')) }); // Optimize the CSS with Autoprefixer and CSS Optimizer @@ -187,15 +199,15 @@ gulp.task('doctor', function() { gulp.task('watch', function () { gulp.watch('./src/**/*.html', ['html']); gulp.watch('./src/_posts/**/*.md', ['markdown']); - gulp.watch('./src/assets/images/**/*', ['jekyll']); + gulp.watch('./src/assets/images/**/*', ['jekyll-serve', 'images']); gulp.watch('./src/assets/_scss/**/*.scss', ['sass']); gulp.watch('./src/assets/stylesheets/**/*.css', ['stylesheets']); gulp.watch('./src/assets/javascript/**/*.js', ['scripts']); - gulp.watch('./src/assets/images/**/*', ['images']); }); // Default task, run when just writing 'gulp' in the terminal -gulp.task('default', ['clean-serve', 'jekyll'], function() { +gulp.task('default', ['clean-serve', 'jekyll-serve', 'sass', + 'stylesheets', 'scripts', 'images'], function() { gulp.start('connect', 'watch'); }); @@ -205,7 +217,7 @@ gulp.task('check', ['csslint', 'jslint', 'doctor'], function() { }); // Builds the site but doesn't serve it to you -gulp.task('build', ['clean-serve', 'jekyll', +gulp.task('build', ['clean-serve', 'jekyll-build', 'sass', 'stylesheets', 'images', 'scripts'], function() { }); @@ -213,6 +225,6 @@ gulp.task('build', ['clean-serve', 'jekyll', // Builds your site with the 'build' command and then runs all the optimizations on // it and outputs it to './site' gulp.task('publish', ['build', 'clean-dist'], function() { - gulp.start('htmlify', 'cssoptimize', + gulp.start('htmlify', 'cssoptimize', 'move', 'imgoptimize', 'jsoptimize'); }); \ No newline at end of file diff --git a/package.json b/package.json index 56034a7..3e9edb1 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "generator-jekyllized", - "version": "0.3.0", + "version": "0.4.0", "description": "Use Jekyll with Gulp, Yeoman, Bower, Bourbon and so much more!", "keywords": [ "yeoman-generator",