locomotivecms_steam 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (172) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +21 -0
  3. data/.travis.yml +4 -0
  4. data/CHANGELOG.md +19 -0
  5. data/Gemfile +8 -0
  6. data/Gemfile.lock +188 -0
  7. data/LICENSE +20 -0
  8. data/README.md +36 -0
  9. data/Rakefile +17 -0
  10. data/bin/publish +28 -0
  11. data/config/locales/de.yml +157 -0
  12. data/config/locales/en.yml +189 -0
  13. data/config/locales/es.yml +133 -0
  14. data/config/locales/et.yml +154 -0
  15. data/config/locales/fr.yml +148 -0
  16. data/config/locales/it.yml +155 -0
  17. data/config/locales/nb.yml +191 -0
  18. data/config/locales/nl.yml +160 -0
  19. data/config/locales/pl.yml +203 -0
  20. data/config/locales/pt-BR.yml +139 -0
  21. data/config/locales/ru.yml +224 -0
  22. data/lib/locomotive/steam/core_ext.rb +5 -0
  23. data/lib/locomotive/steam/core_ext/array.rb +3 -0
  24. data/lib/locomotive/steam/core_ext/boolean/false.rb +3 -0
  25. data/lib/locomotive/steam/core_ext/boolean/true.rb +3 -0
  26. data/lib/locomotive/steam/core_ext/hash.rb +27 -0
  27. data/lib/locomotive/steam/core_ext/string.rb +8 -0
  28. data/lib/locomotive/steam/exceptions.rb +62 -0
  29. data/lib/locomotive/steam/initializers.rb +5 -0
  30. data/lib/locomotive/steam/initializers/i18n.rb +3 -0
  31. data/lib/locomotive/steam/initializers/markdown.rb +27 -0
  32. data/lib/locomotive/steam/initializers/will_paginate.rb +16 -0
  33. data/lib/locomotive/steam/liquid.rb +22 -0
  34. data/lib/locomotive/steam/liquid/drops/base.rb +46 -0
  35. data/lib/locomotive/steam/liquid/drops/content_entry.rb +48 -0
  36. data/lib/locomotive/steam/liquid/drops/content_types.rb +117 -0
  37. data/lib/locomotive/steam/liquid/drops/page.rb +28 -0
  38. data/lib/locomotive/steam/liquid/drops/session_proxy.rb +18 -0
  39. data/lib/locomotive/steam/liquid/drops/site.rb +26 -0
  40. data/lib/locomotive/steam/liquid/errors.rb +17 -0
  41. data/lib/locomotive/steam/liquid/filters/date.rb +136 -0
  42. data/lib/locomotive/steam/liquid/filters/html.rb +188 -0
  43. data/lib/locomotive/steam/liquid/filters/misc.rb +49 -0
  44. data/lib/locomotive/steam/liquid/filters/resize.rb +18 -0
  45. data/lib/locomotive/steam/liquid/filters/text.rb +55 -0
  46. data/lib/locomotive/steam/liquid/filters/translate.rb +28 -0
  47. data/lib/locomotive/steam/liquid/patches.rb +47 -0
  48. data/lib/locomotive/steam/liquid/scopeable.rb +149 -0
  49. data/lib/locomotive/steam/liquid/tags/consume.rb +97 -0
  50. data/lib/locomotive/steam/liquid/tags/csrf.rb +34 -0
  51. data/lib/locomotive/steam/liquid/tags/editable.rb +6 -0
  52. data/lib/locomotive/steam/liquid/tags/editable/base.rb +50 -0
  53. data/lib/locomotive/steam/liquid/tags/editable/control.rb +19 -0
  54. data/lib/locomotive/steam/liquid/tags/editable/file.rb +15 -0
  55. data/lib/locomotive/steam/liquid/tags/editable/long_text.rb +15 -0
  56. data/lib/locomotive/steam/liquid/tags/editable/short_text.rb +20 -0
  57. data/lib/locomotive/steam/liquid/tags/editable/text.rb +15 -0
  58. data/lib/locomotive/steam/liquid/tags/extends.rb +25 -0
  59. data/lib/locomotive/steam/liquid/tags/google_analytics.rb +28 -0
  60. data/lib/locomotive/steam/liquid/tags/hybrid.rb +27 -0
  61. data/lib/locomotive/steam/liquid/tags/inline_editor.rb +16 -0
  62. data/lib/locomotive/steam/liquid/tags/link_to.rb +56 -0
  63. data/lib/locomotive/steam/liquid/tags/locale_switcher.rb +106 -0
  64. data/lib/locomotive/steam/liquid/tags/nav.rb +287 -0
  65. data/lib/locomotive/steam/liquid/tags/paginate.rb +105 -0
  66. data/lib/locomotive/steam/liquid/tags/path_helper.rb +98 -0
  67. data/lib/locomotive/steam/liquid/tags/path_to.rb +36 -0
  68. data/lib/locomotive/steam/liquid/tags/seo.rb +74 -0
  69. data/lib/locomotive/steam/liquid/tags/session_assign.rb +41 -0
  70. data/lib/locomotive/steam/liquid/tags/snippet.rb +63 -0
  71. data/lib/locomotive/steam/liquid/tags/with_scope.rb +44 -0
  72. data/lib/locomotive/steam/listen.rb +64 -0
  73. data/lib/locomotive/steam/logger.rb +54 -0
  74. data/lib/locomotive/steam/monkey_patches.rb +5 -0
  75. data/lib/locomotive/steam/monkey_patches/better_errors.rb +70 -0
  76. data/lib/locomotive/steam/monkey_patches/dragonfly.rb +79 -0
  77. data/lib/locomotive/steam/monkey_patches/haml.rb +15 -0
  78. data/lib/locomotive/steam/monkey_patches/httparty.rb +46 -0
  79. data/lib/locomotive/steam/monkey_patches/mounter.rb +32 -0
  80. data/lib/locomotive/steam/server.rb +81 -0
  81. data/lib/locomotive/steam/server/dynamic_assets.rb +33 -0
  82. data/lib/locomotive/steam/server/entry_submission.rb +120 -0
  83. data/lib/locomotive/steam/server/favicon.rb +18 -0
  84. data/lib/locomotive/steam/server/locale.rb +42 -0
  85. data/lib/locomotive/steam/server/logging.rb +32 -0
  86. data/lib/locomotive/steam/server/middleware.rb +61 -0
  87. data/lib/locomotive/steam/server/page.rb +69 -0
  88. data/lib/locomotive/steam/server/path.rb +34 -0
  89. data/lib/locomotive/steam/server/renderer.rb +118 -0
  90. data/lib/locomotive/steam/server/templatized_page.rb +32 -0
  91. data/lib/locomotive/steam/server/timezone.rb +18 -0
  92. data/lib/locomotive/steam/standalone_server.rb +33 -0
  93. data/lib/locomotive/steam/version.rb +5 -0
  94. data/lib/steam.rb +4 -0
  95. data/locomotivecms_steam.gemspec +42 -0
  96. data/spec/fixtures/default/README +0 -0
  97. data/spec/fixtures/default/app/content_types/bands.yml +19 -0
  98. data/spec/fixtures/default/app/content_types/events.yml +25 -0
  99. data/spec/fixtures/default/app/content_types/messages.yml +17 -0
  100. data/spec/fixtures/default/app/content_types/songs.yml +25 -0
  101. data/spec/fixtures/default/app/content_types/updates.yml +33 -0
  102. data/spec/fixtures/default/app/views/pages/404.liquid.haml +10 -0
  103. data/spec/fixtures/default/app/views/pages/about_us.fr.liquid.haml +7 -0
  104. data/spec/fixtures/default/app/views/pages/about_us.liquid.haml +21 -0
  105. data/spec/fixtures/default/app/views/pages/about_us.nb.liquid.haml +4 -0
  106. data/spec/fixtures/default/app/views/pages/about_us/jane_doe.liquid.haml +4 -0
  107. data/spec/fixtures/default/app/views/pages/about_us/john_doe.fr.liquid.haml +5 -0
  108. data/spec/fixtures/default/app/views/pages/about_us/john_doe.liquid.haml +6 -0
  109. data/spec/fixtures/default/app/views/pages/all.liquid.haml +13 -0
  110. data/spec/fixtures/default/app/views/pages/archives/news.liquid.haml +10 -0
  111. data/spec/fixtures/default/app/views/pages/contact.liquid.haml +54 -0
  112. data/spec/fixtures/default/app/views/pages/contest.liquid.haml +18 -0
  113. data/spec/fixtures/default/app/views/pages/events.liquid.haml +42 -0
  114. data/spec/fixtures/default/app/views/pages/filtered.liquid.haml +10 -0
  115. data/spec/fixtures/default/app/views/pages/grunge_bands.liquid.haml +8 -0
  116. data/spec/fixtures/default/app/views/pages/index.fr.liquid.haml +3 -0
  117. data/spec/fixtures/default/app/views/pages/index.liquid.haml +100 -0
  118. data/spec/fixtures/default/app/views/pages/music.fr.liquid.haml +4 -0
  119. data/spec/fixtures/default/app/views/pages/music.liquid.haml +42 -0
  120. data/spec/fixtures/default/app/views/pages/songs/template.fr.liquid.haml +16 -0
  121. data/spec/fixtures/default/app/views/pages/songs/template.liquid.haml +18 -0
  122. data/spec/fixtures/default/app/views/pages/songs/template/band.liquid.haml +16 -0
  123. data/spec/fixtures/default/app/views/pages/store.fr.liquid.haml +5 -0
  124. data/spec/fixtures/default/app/views/pages/store.liquid +5 -0
  125. data/spec/fixtures/default/app/views/pages/tags/nav.liquid.haml +6 -0
  126. data/spec/fixtures/default/app/views/pages/tags/nav_in_deep.liquid.haml +6 -0
  127. data/spec/fixtures/default/app/views/pages/unlisted_pages.liquid.haml +9 -0
  128. data/spec/fixtures/default/app/views/snippets/A_Complicated-one.liquid.haml +1 -0
  129. data/spec/fixtures/default/app/views/snippets/footer.liquid.haml +6 -0
  130. data/spec/fixtures/default/app/views/snippets/header.liquid.haml +1 -0
  131. data/spec/fixtures/default/app/views/snippets/song.fr.liquid.haml +8 -0
  132. data/spec/fixtures/default/app/views/snippets/song.liquid +12 -0
  133. data/spec/fixtures/default/config/deploy.yml +12 -0
  134. data/spec/fixtures/default/config/deploy_example.yml +12 -0
  135. data/spec/fixtures/default/config/site.yml +15 -0
  136. data/spec/fixtures/default/config/translations.yml +3 -0
  137. data/spec/fixtures/default/data/bands.yml +10 -0
  138. data/spec/fixtures/default/data/events.yml +53 -0
  139. data/spec/fixtures/default/data/songs.yml +46 -0
  140. data/spec/fixtures/default/data/updates.yml +48 -0
  141. data/spec/fixtures/default/public/fonts/chunkfive-webfont.eot +0 -0
  142. data/spec/fixtures/default/public/fonts/chunkfive-webfont.svg +213 -0
  143. data/spec/fixtures/default/public/fonts/chunkfive-webfont.ttf +0 -0
  144. data/spec/fixtures/default/public/fonts/chunkfive-webfont.woff +0 -0
  145. data/spec/fixtures/default/public/fonts/chunkfive.css +8 -0
  146. data/spec/fixtures/default/public/fonts/chunkfive.otf +0 -0
  147. data/spec/fixtures/default/public/images/nav_on.png +0 -0
  148. data/spec/fixtures/default/public/images/photo_frame.png +0 -0
  149. data/spec/fixtures/default/public/images/sep.png +0 -0
  150. data/spec/fixtures/default/public/images/top.jpg +0 -0
  151. data/spec/fixtures/default/public/javascripts/application.js.coffee +2 -0
  152. data/spec/fixtures/default/public/javascripts/common.js +1 -0
  153. data/spec/fixtures/default/public/samples/asset_collections/cover.jpg +0 -0
  154. data/spec/fixtures/default/public/samples/photo.jpg +0 -0
  155. data/spec/fixtures/default/public/samples/photo_2.jpg +0 -0
  156. data/spec/fixtures/default/public/stylesheets/application.css +64 -0
  157. data/spec/fixtures/default/public/stylesheets/other/extra.css.less +8 -0
  158. data/spec/fixtures/default/public/stylesheets/other/style.css.scss +13 -0
  159. data/spec/fixtures/default/public/stylesheets/reboot.css +82 -0
  160. data/spec/integration/integration_helper.rb +15 -0
  161. data/spec/integration/server/basic_spec.rb +170 -0
  162. data/spec/integration/server/contact_form_spec.rb +111 -0
  163. data/spec/integration/server/liquid_spec.rb +91 -0
  164. data/spec/integration/server/with_scope_spec.rb +20 -0
  165. data/spec/locales/locales_spec.rb +22 -0
  166. data/spec/spec_helper.rb +21 -0
  167. data/spec/support.rb +4 -0
  168. data/spec/support/examples/locale_file.rb +14 -0
  169. data/spec/support/examples/matching_locale.rb +8 -0
  170. data/spec/support/helpers.rb +22 -0
  171. data/spec/support/matchers/hash.rb +5 -0
  172. metadata +564 -0
File without changes
@@ -0,0 +1,19 @@
1
+ name: Bands
2
+ description: List of bands
3
+ slug: bands
4
+ order_by: name
5
+ fields:
6
+ - name:
7
+ hint: Name of the band
8
+ - leader:
9
+ type: string
10
+ label: Fullname of the leader
11
+ - kind:
12
+ type: select
13
+ label: "Music kind (grunge, rock, pop, country)"
14
+ select_options: ['grunge', 'rock', 'country']
15
+ - songs:
16
+ type: has_many
17
+ class_name: songs
18
+ inverse_of: band
19
+ ui_enabled: true
@@ -0,0 +1,25 @@
1
+ name: Events
2
+ description: List of upcoming events
3
+ slug: events
4
+ order_by: created_at
5
+ label_field_name: place
6
+ fields:
7
+ - place:
8
+ hint: Name of the place
9
+ - date:
10
+ type: date
11
+ hint: Date of the event
12
+ - city:
13
+ type: string
14
+ label: City of the event
15
+ - state:
16
+ type: string
17
+ label: State of the event
18
+ - notes:
19
+ type: text
20
+ - tags:
21
+ type: tags
22
+ label: List of tags
23
+ - price:
24
+ type: Float
25
+ label: Price of the event
@@ -0,0 +1,17 @@
1
+ name: Messages
2
+ description: Messages posted by new potential customers
3
+ slug: messages
4
+ label_field_name: name
5
+ public_submission_enabled: true
6
+ order_by: created_at
7
+ fields:
8
+ - name:
9
+ hint: Full name
10
+ required: true
11
+ - email:
12
+ hint: Email
13
+ required: true
14
+ - message:
15
+ hint: Customer message
16
+ type: text
17
+ required: true
@@ -0,0 +1,25 @@
1
+ name: Songs
2
+ label_field_name: title
3
+ order_by: _position
4
+ slug: songs
5
+ fields:
6
+ - title:
7
+ type: string
8
+ required: true
9
+ hint: Title of your song
10
+ - band:
11
+ label: Band
12
+ type: belongs_to
13
+ target: bands
14
+ - cover:
15
+ label: Cover
16
+ type: file
17
+ required: true
18
+ - short_description:
19
+ type: text
20
+ text_formatting: html
21
+ - audio_url:
22
+ type: string
23
+ hint: Url to a service like Blip for instance
24
+ - duration:
25
+ hint: "format like: mm:ss"
@@ -0,0 +1,33 @@
1
+ name: Updates
2
+ description: List of updates
3
+ slug: updates
4
+ order_by: date
5
+ label_field_name: title
6
+ public_submission_enabled: false
7
+ fields:
8
+ - title:
9
+ hint: Not displayed in the website
10
+ localized: true
11
+ - text:
12
+ type: text
13
+ hint: Text displayed in the home page
14
+ localized: true
15
+ text_formatting: html
16
+ - category:
17
+ type: select
18
+ hint: Pick a category
19
+ localized: true
20
+ # select_options:
21
+ # en: ['General', 'Gigs', 'Bands']
22
+ # fr: ['Général', 'Concerts', 'Groupes']
23
+ select_options:
24
+ - en: General
25
+ fr: Général
26
+ - en: Gigs
27
+ fr: Concerts
28
+ - en: Bands
29
+ fr: Groupes
30
+ - Albums
31
+ - date:
32
+ type: date
33
+ hint: Date of the update
@@ -0,0 +1,10 @@
1
+ ---
2
+ title: Page not found
3
+ ---
4
+ {% extends index %}
5
+
6
+ {% block content %}
7
+
8
+ %p.error page not found
9
+
10
+ {% endblock %}
@@ -0,0 +1,7 @@
1
+ ---
2
+ title: A notre sujet
3
+ slug: a-notre-sujet
4
+ editable_elements:
5
+ 'banner/page_image': "/samples/photo.jpg"
6
+ 'banner/pitch': "<h2>A notre sujet</h2><p>Lorem ipsum...(FR)</p>"
7
+ ---
@@ -0,0 +1,21 @@
1
+ ---
2
+ title: About Us
3
+ listed: true
4
+ position: 1
5
+ handle: about-us
6
+ editable_elements:
7
+ 'banner/page_image': "/samples/photo_2.jpg"
8
+ 'banner/pitch': "<h2>About us</h2><p>Lorem ipsum...</p>"
9
+ ---
10
+ {% extends parent %}
11
+
12
+ {% block content %}
13
+
14
+ {% editable_long_text 'content' %}
15
+
16
+ %p
17
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur vitae tincidunt urna. Nunc felis purus, ultricies et venenatis bibendum, fringilla eu lectus. Sed cursus, sem at blandit mattis, libero quam egestas tortor, eget cursus dolor tellus id nunc. Quisque mauris diam, tincidunt in commodo sed, feugiat eu nibh. Nulla erat nunc, dapibus vel eleifend et, egestas sed quam. Vestibulum mollis eros at dolor vulputate vel sollicitudin enim convallis. Etiam velit nisi, rutrum vel sagittis facilisis, pretium id lorem. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque mauris nisl, consequat sed tincidunt nec, lacinia in odio. In hac habitasse platea dictumst. Nam semper libero aliquam turpis gravida vel varius erat vulputate. Integer consequat ipsum vitae augue porttitor ullamcorper. Nam vulputate aliquet ante at gravida. Vestibulum luctus urna et dui hendrerit eu suscipit velit varius. Sed ornare eleifend sem, vitae pharetra dolor sodales egestas. Mauris lobortis hendrerit odio, vitae porttitor urna rutrum at. Ut at lectus erat, nec dictum dolor. Praesent in sapien interdum nibh euismod vestibulum. Vestibulum tincidunt pulvinar accumsan.
18
+
19
+ {% endeditable_long_text %}
20
+
21
+ {% endblock %}
@@ -0,0 +1,4 @@
1
+ ---
2
+ title: Om oss
3
+ slug: om-oss
4
+ ---
@@ -0,0 +1,4 @@
1
+ ---
2
+ position: 2
3
+ ---
4
+ {% extends parent %}
@@ -0,0 +1,5 @@
1
+ ---
2
+ title: Jean Personne
3
+ slug: jean-personne
4
+ ---
5
+ {% extends parent %}
@@ -0,0 +1,6 @@
1
+ ---
2
+ position: 1
3
+ published: true
4
+ listed: true
5
+ ---
6
+ {% extends parent %}
@@ -0,0 +1,13 @@
1
+ ---
2
+ title: All the pages
3
+ listed: false
4
+ published: false
5
+ ---
6
+ {% extends parent %}
7
+ {% block content %}
8
+ <ul>
9
+ {% for page in site.pages %}
10
+ <li>{{ page.title }}</li>
11
+ {% endfor %}
12
+ </ul>
13
+ {% endblock %}
@@ -0,0 +1,10 @@
1
+ ---
2
+ title: News archive
3
+ ---
4
+ {% extends parent %}
5
+
6
+ {% block content %}
7
+
8
+ %p News Archives. Lorem ipsum....
9
+
10
+ {% endblock %}
@@ -0,0 +1,54 @@
1
+ ---
2
+ title: Contact Us
3
+ listed: true
4
+ position: 4
5
+ ---
6
+ {% extends 'parent' %}
7
+
8
+ {% block content %}
9
+
10
+ .text
11
+ {% editable_long_text 'text' %}
12
+ %p
13
+ Ut imperdiet velit eu metus semper tristique. Vivamus risus nisi, tincidunt et euismod a, auctor pretium eros. Vestibulum sed magna et velit pulvinar euismod. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sed velit quis nisl blandit vulputate id non tortor. Mauris nec placerat massa. Vivamus sed odio non ligula pharetra pretium. Ut convallis, purus et lobortis suscipit, mauris orci ullamcorper lectus, nec vulputate turpis mauris sed augue. Maecenas faucibus ultricies nisl, non ullamcorper justo bibendum nec. Duis vitae mauris condimentum risus commodo mattis vel sed libero. Fusce diam elit, porta id vestibulum ut, aliquet mattis neque.
14
+ {% endeditable_long_text %}
15
+
16
+ %form#contactform{ :name => 'contact', :action => '{{ contents.messages.public_submission_url }}.json', :method => 'post' }
17
+ / %input{ type: 'hidden', name: 'success_callback', value: '/events' }
18
+ / %input{ type: 'hidden', name: 'error_callback', value: '/contact' }
19
+
20
+ %p
21
+ %label{ :for => 'name' } Name
22
+ %input{ :type => 'text', :id => 'name', :name => 'content[name]', :placeholder => 'First and last name', :tabindex => '1', required: 'required', value: '{{ message.name }}' }
23
+ %span {{ message.errors.name }}
24
+
25
+ %p
26
+ %label{ :for => 'email' } Email
27
+ %input{ :type => 'text', :id => 'email', :name => 'content[email]', :placeholder => 'example@domain.com', :tabindex => '2', required: 'required', value: '{{ message.email }}' }
28
+ %span {{ message.errors.email }}
29
+
30
+ %p
31
+ %label{ :for => 'comment' } Your Message
32
+ %textarea{ :id => 'comment', :name => 'content[message]', :tabindex => '3', required: 'required' } {{ message.message }}
33
+ %span {{ message.errors.message }}
34
+
35
+ %p.action
36
+ %input{ :name => 'submit', :type => 'submit', :tabindex => '4', :value => 'Send Message' }
37
+
38
+ :javascript
39
+ $(document).ready(function() {
40
+ var form = $('form[name=contact]');
41
+ form.submit(function(e) {
42
+ e.stopPropagation();
43
+ e.preventDefault();
44
+ $.post(form.attr('action'),
45
+ form.serializeArray(),
46
+ function() {
47
+ alert("Thank you ! Your message have been received");
48
+ }, "json").error(function(response) {
49
+ alert("We are sorry but we were unable to treat your message. Please try later.");
50
+ });
51
+ });
52
+ });
53
+
54
+ {% endblock %}
@@ -0,0 +1,18 @@
1
+ ---
2
+ title: A sample contest
3
+ listed: false
4
+ ---
5
+ {% extends 'parent' %}
6
+
7
+ {% block content %}
8
+
9
+ %h1 Contest sample
10
+
11
+ {% if session.already_participated %}
12
+ %p You've already participated to that contest ! Come back later.
13
+ {% else %}
14
+ %p Your code is: HELLO WORLD
15
+ {% session_assign already_participated = true %}
16
+ {% endif %}
17
+
18
+ {% endblock %}
@@ -0,0 +1,42 @@
1
+ ---
2
+ position: 5
3
+ ---
4
+ {% extends parent %}
5
+
6
+ {% block content %}
7
+
8
+ %p Thank you {{ message.name }} !
9
+
10
+ #events.unit.size2of3
11
+ %h2 Upcoming events
12
+
13
+ %ul.list
14
+ {% for event in contents.events %}
15
+ %li
16
+ %em {{ event.date | localized_date: '%a, %B %d, %Y' }}
17
+ &nbsp;-&nbsp;
18
+ {{ event.place }}, {{ event.city }}, {{ event.state }}
19
+ {% endfor %}
20
+
21
+ #sidebar.unit.size1of3
22
+ {% editable_long_text 'sidebar' %}
23
+
24
+ %p
25
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur vitae tincidunt urna. Nunc felis purus, ultricies et venenatis bibendum, fringilla eu lectus. Sed cursus, sem at blandit mattis, libero quam egestas tortor, eget cursus dolor tellus id nunc. Quisque mauris diam, tincidunt in commodo sed, feugiat eu nibh. Nulla erat nunc, dapibus vel eleifend et, egestas sed quam. Vestibulum mollis eros at dolor vulputate vel sollicitudin enim convallis. Etiam velit nisi, rutrum vel sagittis facilisis, pretium id lorem. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque mauris nisl, consequat sed tincidunt nec, lacinia in odio. In hac habitasse platea dictumst. Nam semper libero aliquam turpis gravida vel varius erat vulputate. Integer consequat ipsum vitae augue porttitor ullamcorper. Nam vulputate aliquet ante at gravida. Vestibulum luctus urna et dui hendrerit eu suscipit velit varius. Sed ornare eleifend sem, vitae pharetra dolor sodales egestas. Mauris lobortis hendrerit odio, vitae porttitor urna rutrum at. Ut at lectus erat, nec dictum dolor. Praesent in sapien interdum nibh euismod vestibulum. Vestibulum tincidunt pulvinar accumsan
26
+
27
+ {% endeditable_long_text %}
28
+
29
+ %p
30
+ %strong Discover: {% link_to our-music %}
31
+ %br
32
+ %strong More about us: {% link_to about-us %}Who are we ?{% endlink_to %}
33
+ %br
34
+ %strong Plus à notre sujet: {% link_to about-us, locale: fr %}Qui sommes nous ?{% endlink_to %}
35
+ %br
36
+ {% assign song = contents.songs.first %}
37
+ %strong {% link_to song %}
38
+ %br
39
+ {% assign another_song = contents.songs.last %}
40
+ %strong {% link_to another_song, with: a-song-template %}
41
+
42
+ {% endblock %}
@@ -0,0 +1,10 @@
1
+ ---
2
+ title: Various uses of the with_scope tag
3
+ ---
4
+ {% assign begin = '2012-06-01 00:00:00' %}
5
+ {% assign end = '2012-06-10 23:59:59' %}
6
+ {% assign prices = '5.0,5.5' | split: ',' | map: 'to_f' %}
7
+
8
+ {% with_scope date.gte: begin, date.lte: end, city: /Kansas/, state.ne: 'Illinois', tags: 'awesome', tags.nin: 'bad', price.in: prices %}
9
+ events={{ contents.events.count }}.
10
+ {% endwith_scope %}
@@ -0,0 +1,8 @@
1
+ ---
2
+ title: Grunge leaders
3
+ ---
4
+ {% with_scope kind: "grunge" %}
5
+ {% for band in contents.bands %}
6
+ {{ band.leader }}
7
+ {% endfor %}
8
+ {% endwith_scope %}
@@ -0,0 +1,3 @@
1
+ ---
2
+ title: Page d'accueil
3
+ ---
@@ -0,0 +1,100 @@
1
+ ---
2
+ title: Home page
3
+ ---
4
+ !!! XML
5
+ !!!
6
+ %html{ :lang => "en" }
7
+ %head
8
+ %meta{ :charset => "utf-8" }
9
+
10
+ %title {{ site.name }}
11
+
12
+ %meta{ :content => "{{ site.meta_description }}", :name => "description" }
13
+ %meta{ :content => "{{ site.meta_keywords }}", :name => "keywords" }
14
+
15
+ {{ '/foo/bar' | auto_discovery_link_tag: 'rel:alternate', 'type:application/atom+xml', 'title:A title' }}
16
+
17
+ / Le HTML5 shim, for IE6-8 support of HTML elements
18
+
19
+ /[if lt IE 9]
20
+ <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
21
+
22
+ <link href="/fonts/chunkfive.css" media="screen" rel="stylesheet" type="text/css" />
23
+
24
+ / Le styles
25
+ {{ 'http://fonts.googleapis.com/css?family=Open+Sans:400,700' | stylesheet_tag }}
26
+ {{ 'reboot' | stylesheet_tag }}
27
+ {{ 'application' | stylesheet_tag }}
28
+ %script{ :src => "{{ 'application.js' | javascript_url }}", :type => 'text/javascript' }
29
+
30
+ %script{ :src => 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js', :type => 'text/javascript' }
31
+
32
+ {% inline_editor %}
33
+
34
+ %body
35
+ .container
36
+ #menu
37
+ %ul#nav
38
+ %li#home{ :class => "{% if page.fullpath == 'index' %}on{% endif %} link" }
39
+ %a{ :href => '/' } Home
40
+ {% nav site, no_wrapper: true, exclude: 'events' %}
41
+ .clear
42
+
43
+ #banner
44
+ {% block banner %}
45
+ .photo
46
+ %img{ :src => "{% editable_file 'Page image', hint: 'Top banner image in each page (602px by 397px)' %}/samples/photo.jpg{% endeditable_file %}" }
47
+
48
+ .text
49
+ {% editable_long_text 'pitch' %}
50
+ %h2 About Us
51
+ %p
52
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse vitae egestas neque. Proin ac ante ante, sit amet egestas purus. Fusce tincidunt mattis sapien eget sodales. Cras aliquet odio eu nisl dapibus placerat.
53
+ %br
54
+ %a{ :href => '/about_us' } read more...
55
+ {% endeditable_long_text %}
56
+ {% endblock %}
57
+
58
+ .clear
59
+
60
+ #content
61
+ {% block content %}
62
+
63
+ #events.unit.size1of2
64
+ %h2 Upcoming events
65
+
66
+ %ul.list
67
+ {% for event in contents.events limit: 6 %}
68
+ %li
69
+ %em {{ event.date | localized_date: '%a, %B %d, %Y' }}
70
+ &nbsp;-&nbsp;
71
+ {{ event.place }}, {{ event.city }}, {{ event.state }}
72
+ {% endfor %}
73
+
74
+ %p.more
75
+ %a{ :href => '/events' } See more events ...
76
+
77
+ #updates.unit.size1of2
78
+ %h2 Site updates
79
+
80
+ %ul.list
81
+ {% for update in contents.updates %}
82
+ %li
83
+ %em {{ update.date | localized_date: '%B %d' }}
84
+ &nbsp;-&nbsp;
85
+ {{ update.title }}
86
+ {% endfor %}
87
+
88
+ {% endblock %}
89
+
90
+ .clear
91
+
92
+ #footer
93
+ #is_templatized{templatized: "{{ page.templatized? }}"}
94
+ #scoped_translation{scoped_translation: "{{ 'fr' | translate: 'en', 'locomotive.locales' }}"}
95
+
96
+ {% include footer %}
97
+
98
+ {% include a_complicated-one %}
99
+
100
+ {% google_analytics 'UA-20661758-1' %}