Last active
August 29, 2015 14:20
-
-
Save hagenburger/38b0565370e70b81660a to your computer and use it in GitHub Desktop.
Eurucamp Front-end API Draft
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%html | |
%head | |
= style_css | |
= style_javascript | |
= style_template :layout do | |
= style_template :navigation, root_url: "/", items: [{ url: "/", text: "Home"}, { url: xyz_path(@abc), text: "XYZ" }]) | |
= style_template :cover, date: "...", location: "..." | |
= style_template :team, items: data.team | |
= style_template :footer, ... | |
-# Add attributes to root element of template (maybe needed for JavaScript): | |
= style_template :team, items: data.team, attributes: { "data-section": "team" } | |
:html | |
<div class="team" data-section="team"> | |
<div class="team--item"> | |
.. | |
</div> | |
</div> | |
-# Add attributes to each item element of template (maybe needed for JavaScript): | |
= style_template :team, items: data.team, item_attributes: { "data-id": "\#{item.id}", class: "js-user" } | |
:html | |
<div class="team"> | |
<div class="team--item js-user" data-id="47"> | |
.. | |
</div> | |
<div class="team--item js-user" data-id="11"> | |
.. | |
</div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
StyleGuideAPI.load("http://style-guide.eurucamp.org/af45de/2015/style.json") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"stylesheets": ["http://style-guide.eurucamp.org/af45de/2015/eurucamp.css"], | |
"javascripts": [], | |
"templates": { | |
"navigation": { | |
"source": "%header.layout--header\n .layout--header-container\n %a.layout--header-logo(href=root_path) eurucamp\n %nav.layout--header-navigation\n - items.each do |item|\n %a.layout--header-navigation-item(href=\"#{item[:url]}\")= item[:text]", | |
"type": "haml" | |
}, | |
"layout": { | |
"source": "%body.layout\n = yield", | |
"type": "haml" | |
}, | |
"cover": { | |
... | |
}, | |
"team": { | |
... | |
}, | |
"footer": { | |
... | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment