Move yoga docs into docs folder on master branch

Summary: Move yoga docs into master branch so that pull requests are able to include doc updates as part of other changes.

Reviewed By: JoelMarcey

Differential Revision: D4365700

fbshipit-source-id: 2f46a88974104c454c00bcdf1257abb5c4075a68
This commit is contained in:
Emil Sjolander
2016-12-28 03:57:57 -08:00
committed by Facebook Github Bot
parent cd78291de5
commit f2080e520f
113 changed files with 5020 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
<!-- Pagination links - copied from http://jekyllrb.com/docs/pagination/ -->
{% if paginator.total_pages > 1 %}
<br />
<div class="pagination">
{% if paginator.previous_page %}
<a href="{{ paginator.previous_page_path | relative_url | replace: '//', '/' }}">&laquo; Prev</a>
{% else %}
<span>&laquo; Prev</span>
{% endif %}
{% for page in (1..paginator.total_pages) %}
{% if page == paginator.page %}
<em>{{ page }}</em>
{% elsif page == 1 %}
<a href="{{ '/blog' | relative_url }}">{{ page }}</a>
{% else %}
<a href="{{ site.paginate_path | relative_url | replace: '//', '/' | replace: ':num', page }}">{{ page }}</a>
{% endif %}
{% endfor %}
{% if paginator.next_page %}
<a href="{{ paginator.next_page_path | relative_url | replace: '//', '/' }}">Next &raquo;</a>
{% else %}
<span>Next &raquo;</span>
{% endif %}
</div>
<br />
{% endif %}

View File

@@ -0,0 +1,5 @@
<div class="gridBlock">
{% for item in {{include.data_source}} %}
{% include content/items/gridblock.html item=item layout=include.layout imagealign=include.imagealign align=include.align %}
{% endfor %}
</div>

View File

@@ -0,0 +1,37 @@
{% if include.layout == "fourColumn" %}
{% assign layout = "fourByGridBlock" %}
{% else %}
{% assign layout = "twoByGridBlock" %}
{% endif %}
{% if include.imagealign == "side" %}
{% assign imagealign = "imageAlignSide" %}
{% else %}
{% if item.image %}
{% assign imagealign = "imageAlignTop" %}
{% else %}
{% assign imagealign = "" %}
{% endif %}
{% endif %}
{% if include.align == "right" %}
{% assign align = "alignRight" %}
{% elsif include.align == "center" %}
{% assign align = "alignCenter" %}
{% else %}
{% assign align = "alignLeft" %}
{% endif %}
<div class="blockElement {{ layout }} {{ imagealign }} {{ align }}">
{% if item.image %}
<div class="blockImage">
<img src="/static/{{ item.image }}" alt="{{ item.title }}" title="{{ item.title }}" />
</div>
{% endif %}
<div class="blockContent">
<h3>{{ item.title }}</h3>
{% if item.text %}
{{ item.text | markdownify }}
{% endif %}
</div>
</div>

25
docs/_includes/doc.html Normal file
View File

@@ -0,0 +1,25 @@
<div class="post">
<header class="post-header">
<h1 class="post-title">{% if include.truncate %}<a href="{{ page.url | absolute_url }}">{{ page.title }}</a>{% else %}{{ page.title }}{% endif %}</h1>
</header>
<article class="post-content">
{% if include.truncate %}
{% if page.content contains '<!--truncate-->' %}
{{ page.content | split:'<!--truncate-->' | first }}
<div class="read-more">
<a href="{{ page.url | absolute_url }}" >
...Read More
</a>
</div>
{% else %}
{{ page.content }}
{% endif %}
{% else %}
{{ content }}
{% endif %}
</article>
{% include doc_paging.html %}
</div>

View File

View File

@@ -0,0 +1,33 @@
<div class="footerContainer">
<div id="footer_wrap" class="wrapper footerWrapper">
<div class="footerBlocks">
<div id="fb_oss" class="footerSection fbOpenSourceFooter">
<svg class="facebookOSSLogoSvg" viewBox="0 0 1133.9 1133.9" x="0px" y="0px">
<g>
<path class="logoRing outerRing" d="M 498.3 3.7 c 153.6 88.9 307.3 177.7 461.1 266.2 c 7.6 4.4 10.3 9.1 10.3 17.8 c -0.3 179.1 -0.2 358.3 0 537.4 c 0 8.1 -2.4 12.8 -9.7 17.1 c -154.5 88.9 -308.8 178.1 -462.9 267.5 c -9 5.2 -15.5 5.3 -24.6 0.1 c -153.9 -89.2 -307.9 -178 -462.1 -266.8 C 3 838.8 0 833.9 0 825.1 c 0.3 -179.1 0.2 -358.3 0 -537.4 c 0 -8.6 2.6 -13.6 10.2 -18 C 164.4 180.9 318.4 92 472.4 3 C 477 -1.5 494.3 -0.7 498.3 3.7 Z M 48.8 555.3 c 0 79.9 0.2 159.9 -0.2 239.8 c -0.1 10 3 15.6 11.7 20.6 c 137.2 78.8 274.2 157.8 411 237.3 c 9.9 5.7 17 5.7 26.8 0.1 c 137.5 -79.8 275.2 -159.2 412.9 -238.5 c 7.4 -4.3 10.5 -8.9 10.5 -17.8 c -0.3 -160.2 -0.3 -320.5 0 -480.7 c 0 -8.8 -2.8 -13.6 -10.3 -18 C 772.1 218 633.1 137.8 494.2 57.4 c -6.5 -3.8 -11.5 -4.5 -18.5 -0.5 C 336.8 137.4 197.9 217.7 58.8 297.7 c -7.7 4.4 -10.2 9.2 -10.2 17.9 C 48.9 395.5 48.8 475.4 48.8 555.3 Z" />
<path class="logoRing middleRing" d="M 184.4 555.9 c 0 -33.3 -1 -66.7 0.3 -100 c 1.9 -48 24.1 -86 64.7 -110.9 c 54.8 -33.6 110.7 -65.5 167 -96.6 c 45.7 -25.2 92.9 -24.7 138.6 1 c 54.4 30.6 108.7 61.5 162.2 93.7 c 44 26.5 67.3 66.8 68 118.4 c 0.9 63.2 0.9 126.5 0 189.7 c -0.7 50.6 -23.4 90.7 -66.6 116.9 c -55 33.4 -110.8 65.4 -167.1 96.5 c -43.4 24 -89 24.2 -132.3 0.5 c -57.5 -31.3 -114.2 -64 -170 -98.3 c -41 -25.1 -62.9 -63.7 -64.5 -112.2 C 183.5 621.9 184.3 588.9 184.4 555.9 Z M 232.9 556.3 c 0 29.5 0.5 59.1 -0.1 88.6 c -0.8 39.2 16.9 67.1 50.2 86.2 c 51.2 29.4 102.2 59.2 153.4 88.4 c 31.4 17.9 63.6 18.3 95 0.6 c 53.7 -30.3 107.1 -61.2 160.3 -92.5 c 29.7 -17.5 45 -44.5 45.3 -78.8 c 0.6 -61.7 0.5 -123.5 0 -185.2 c -0.3 -34.4 -15.3 -61.5 -44.9 -79 C 637.7 352.6 583 320.8 527.9 290 c -27.5 -15.4 -57.2 -16.1 -84.7 -0.7 c -56.9 31.6 -113.4 64 -169.1 97.6 c -26.4 15.9 -40.7 41.3 -41.1 72.9 C 232.6 491.9 232.9 524.1 232.9 556.3 Z" />
<path class="logoRing innerRing" d="M 484.9 424.4 c 69.8 -2.8 133.2 57.8 132.6 132 C 617 630 558.5 688.7 484.9 689.1 c -75.1 0.4 -132.6 -63.6 -132.7 -132.7 C 352.1 485 413.4 421.5 484.9 424.4 Z M 401.3 556.7 c -3.4 37.2 30.5 83.6 83 84.1 c 46.6 0.4 84.8 -37.6 84.9 -84 c 0.1 -46.6 -37.2 -84.4 -84.2 -84.6 C 432.2 472.1 397.9 518.3 401.3 556.7 Z" />
</g>
</svg>
<h2>Facebook Open Source</h2>
</div>
<div class="footerSection">
<a class="footerLink" href="https://code.facebook.com/projects/" target="_blank">Open Source Projects</a>
<a class="footerLink" href="https://github.com/facebook/" target="_blank">GitHub</a>
<a class="footerLink" href="https://twitter.com/fbOpenSource" target="_blank">Twitter</a>
</div>
<div class="footerSection rightAlign">
<a class="footerLink" href="https://github.com/{{ site.ghrepo }}" target="_blank">Contribute to this project on GitHub</a>
</div>
</div>
</div>
</div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '{{ site.gacode }}', 'auto');
ga('send', 'pageview');
</script>

23
docs/_includes/head.html Normal file
View File

@@ -0,0 +1,23 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta property="og:url" content="{{ page.url | replace:'index.html','' | absolute_url }}" />
<meta property="og:site_name" content="{{ site.title }}"/>
<meta property="og:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}" />
<meta property="og:image" content="{{ 'static/og_image.png' | absolute_url }}" />
<meta property="og:description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}" />
<link rel="stylesheet" href="{{ '/css/main.css' | relative_url }}" media="screen">
<link rel="icon" href="{{ '/static/favicon.png' | relative_url }}" type="image/x-icon">
{% if site.searchconfig %}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css" />
{% endif %}
<title>{% if page.title %}{{ page.title }} | {{ site.title }}{% else %}{{ site.title }}{% endif %}</title>
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
<link rel="canonical" href="{{ page.url | replace:'index.html','' | absolute_url }}">
<link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ '/feed.xml' | absolute_url }}" />
</head>

View File

@@ -0,0 +1,19 @@
<div class="headerContainer">
<div id="header_wrap" class="wrapper headerWrapper">
<div class="inner">
<img class="projectLogo" src="{{ '/static/logo.svg' | relative_url }}" alt="{{ site.title }}" title="{{ site.title }}" />
<h1 id="project_title">{{ site.title }}</h1>
<h2 id="project_tagline" class="fbossFontLight">{{ site.tagline }}</h2>
<section id="intro">
<p>{% if page.excerpt %}{{ page.excerpt | strip_html }}{% else %}{{ site.description }}{% endif %}</p>
</section>
<div id="promo" class="section promoSection">
{% for promo in site.data.promo %}
{% include plugins/{{promo.type}}.html button_href=promo.href button_text=promo.text %}
<div class="gridClear"></div>
{% endfor %}
</div>
</div>
</div>
</div>

0
docs/_includes/hero.html Normal file
View File

View File

@@ -0,0 +1,31 @@
<div class="homeContainer">
<div class="homeSplashFade">
<div id="home_wrap" class="wrapper homeWrapper">
<div id="inner">
<h2 id="project_tagline">{{ site.tagline }}</h2>
<section id="intro">
<!--<p>{% if page.excerpt %}{{ page.excerpt | strip_html }}{% else %}{{ site.description }}{% endif %}</p>-->
<p>
Yoga is a cross-platform layout engine enabling maximum collaboration within your team by implementing an API familiar to many designers and opening it up to developers across different platforms.
</p>
<ul>
<li>Do you already know Flexbox? Then you already know Yoga.</li>
<li>Write code in a language familiar to you - Java, C#, Objective-C, C.</li>
<li>C under the hood so your code moves fast.</li>
<li>Battle tested in popular frameworks like React Native.</li>
</ul>
</section>
<div id="promo" class="section promoSection">
{% for promo in site.data.promo %}
<div class="promoRow">
{% include plugins/{{promo.type}}.html href=promo.href text=promo.text children=promo.children %}
</div>
{% endfor %}
</div>
</div>
<div class="projectLogo">
<img src="{{ '/static/logo.svg' | relative_url }}" alt="{{ site.title }}">
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,3 @@
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.2.0/katex.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.2.0/katex.min.js"></script>

View File

@@ -0,0 +1,210 @@
<script type="text/javascript">
/* global katex */
var findEndOfMath = function(delimiter, text, startIndex) {
// Adapted from
// https://github.com/Khan/perseus/blob/master/src/perseus-markdown.jsx
var index = startIndex;
var braceLevel = 0;
var delimLength = delimiter.length;
while (index < text.length) {
var character = text[index];
if (braceLevel <= 0 &&
text.slice(index, index + delimLength) === delimiter) {
return index;
} else if (character === "\\") {
index++;
} else if (character === "{") {
braceLevel++;
} else if (character === "}") {
braceLevel--;
}
index++;
}
return -1;
};
var splitAtDelimiters = function(startData, leftDelim, rightDelim, display) {
var finalData = [];
for (var i = 0; i < startData.length; i++) {
if (startData[i].type === "text") {
var text = startData[i].data;
var lookingForLeft = true;
var currIndex = 0;
var nextIndex;
nextIndex = text.indexOf(leftDelim);
if (nextIndex !== -1) {
currIndex = nextIndex;
finalData.push({
type: "text",
data: text.slice(0, currIndex)
});
lookingForLeft = false;
}
while (true) {
if (lookingForLeft) {
nextIndex = text.indexOf(leftDelim, currIndex);
if (nextIndex === -1) {
break;
}
finalData.push({
type: "text",
data: text.slice(currIndex, nextIndex)
});
currIndex = nextIndex;
} else {
nextIndex = findEndOfMath(
rightDelim,
text,
currIndex + leftDelim.length);
if (nextIndex === -1) {
break;
}
finalData.push({
type: "math",
data: text.slice(
currIndex + leftDelim.length,
nextIndex),
rawData: text.slice(
currIndex,
nextIndex + rightDelim.length),
display: display
});
currIndex = nextIndex + rightDelim.length;
}
lookingForLeft = !lookingForLeft;
}
finalData.push({
type: "text",
data: text.slice(currIndex)
});
} else {
finalData.push(startData[i]);
}
}
return finalData;
};
var splitWithDelimiters = function(text, delimiters) {
var data = [{type: "text", data: text}];
for (var i = 0; i < delimiters.length; i++) {
var delimiter = delimiters[i];
data = splitAtDelimiters(
data, delimiter.left, delimiter.right,
delimiter.display || false);
}
return data;
};
var renderMathInText = function(text, delimiters) {
var data = splitWithDelimiters(text, delimiters);
var fragment = document.createDocumentFragment();
for (var i = 0; i < data.length; i++) {
if (data[i].type === "text") {
fragment.appendChild(document.createTextNode(data[i].data));
} else {
var span = document.createElement("span");
var math = data[i].data;
try {
katex.render(math, span, {
displayMode: data[i].display
});
} catch (e) {
if (!(e instanceof katex.ParseError)) {
throw e;
}
console.error(
"KaTeX auto-render: Failed to parse `" + data[i].data +
"` with ",
e
);
fragment.appendChild(document.createTextNode(data[i].rawData));
continue;
}
fragment.appendChild(span);
}
}
return fragment;
};
var renderElem = function(elem, delimiters, ignoredTags) {
for (var i = 0; i < elem.childNodes.length; i++) {
var childNode = elem.childNodes[i];
if (childNode.nodeType === 3) {
// Text node
var frag = renderMathInText(childNode.textContent, delimiters);
i += frag.childNodes.length - 1;
elem.replaceChild(frag, childNode);
} else if (childNode.nodeType === 1) {
// Element node
var shouldRender = ignoredTags.indexOf(
childNode.nodeName.toLowerCase()) === -1;
if (shouldRender) {
renderElem(childNode, delimiters, ignoredTags);
}
}
// Otherwise, it's something else, and ignore it.
}
};
var defaultOptions = {
delimiters: [
{left: "$$", right: "$$", display: true},
{left: "\\[", right: "\\]", display: true},
{left: "\\(", right: "\\)", display: false}
// LaTeX uses this, but it ruins the display of normal `$` in text:
// {left: "$", right: "$", display: false}
],
ignoredTags: [
"script", "noscript", "style", "textarea", "pre", "code"
]
};
var extend = function(obj) {
// Adapted from underscore.js' `_.extend`. See LICENSE.txt for license.
var source, prop;
for (var i = 1, length = arguments.length; i < length; i++) {
source = arguments[i];
for (prop in source) {
if (Object.prototype.hasOwnProperty.call(source, prop)) {
obj[prop] = source[prop];
}
}
}
return obj;
};
var renderMathInElement = function(elem, options) {
if (!elem) {
throw new Error("No element provided to render");
}
options = extend({}, defaultOptions, options);
renderElem(elem, options.delimiters, options.ignoredTags);
};
renderMathInElement(document.body);
</script>

32
docs/_includes/nav.html Normal file
View File

@@ -0,0 +1,32 @@
<div id="fixed_header" class="fixedHeaderContainer{% if include.alwayson %} visible{% endif %}">
<div class="headerWrapper wrapper">
<header>
<a href="{{ '/' | absolute_url }}">
<img src="{{ '/static/logo.svg' | relative_url }}">
<h2>{{ site.title }}</h2>
</a>
<div class="navigationWrapper navigationFull" id="flat_nav">
<nav class="navigation">
<ul>
{% for item in site.data.nav %}
<li class="navItem{% if page.collection == item.category or page.category == item.category %} navItemActive{% endif %}">
{% if item.category == "external" %}
<a href="{{ item.href }}">{{ item.title }}</a>
{% else %}
<a href="{{ item.href | relative_url }}">{{ item.title }}</a>
{% endif %}
</li>
{% endfor %}
{% if site.searchconfig %}
{% include nav_search.html inputselector="search_input" %}
{% endif %}
</ul>
</nav>
</div>
<div class="navigationWrapper navigationSlider" id="navigation_wrap">
{% include nav/header_nav.html %}
</div>
</header>
</div>
</div>

View File

@@ -0,0 +1,54 @@
<div class="docsNavContainer">
<nav class="toc" id="doc_nav">
<div class="toggleNav" id="collection_nav">
<section class="navWrapper wrapper">
<div class="navBreadcrumb wrapper">
<div class="navToggle" id="collection_nav_toggler">
<i></i>
</div>
<h2>
<a href="{{ include.sectionpath }}">{{ include.sectiontitle }}</a>
{% if include.currentgroup %}
<i></i>
<span>{{ include.currentgroup }}</span>
{% endif %}
</h2>
</div>
<div class="navGroups">
{% if include.type == "blog" %}
{% assign grouptitle = "All Posts" %}
{% assign groupitems = include.navdata %}
{% include nav/collection_nav_group.html %}
{% else %}
{% for group in include.navdata %}
{% assign grouptitle = group.title %}
{% for item in group.items %}
{% if item.id == page.docid %}
{% assign currentselected = item.id %}
{% assign currentgroup = group %}
{% endif %}
{% endfor %}
{% include nav/collection_nav_group.html %}
{% endfor %}
{% endif %}
</div>
</section>
</div>
</nav>
</div>
<script>
var docsevent = document.createEvent('Event');
docsevent.initEvent('docs_slide', true, true);
document.addEventListener('docs_slide', function (e) {
document.body.classList.toggle('docsSliderActive');
}, false);
var collectionNav = document.getElementById('collection_nav');
var collectionNavToggler =
document.getElementById('collection_nav_toggler');
collectionNavToggler.addEventListener('click', function(e) {
collectionNav.classList.toggle('toggleNavActive');
document.dispatchEvent(docsevent);
});
</script>

View File

@@ -0,0 +1,19 @@
<div class="navGroup navGroupActive navGroupCurrent">
<h3><span>{{ grouptitle }}</span></h3>
<ul>
{% if include.data_collection %}
{% for item in group.items %}
{% for collectionitem in include.data_collection %}
{% if collectionitem.docid == item.id %}
{% assign groupitem = collectionitem %}
{% include nav/collection_nav_group_item.html %}
{% endif %}
{% endfor %}
{% endfor %}
{% else %}
{% for groupitem in groupitems %}
{% include nav/collection_nav_group_item.html %}
{% endfor %}
{% endif %}
</ul>
</div>

View File

@@ -0,0 +1 @@
<li class="navListItem"><a class="navItem {% if item.id == currentselected %}navItemActive{% endif %}" href="{{ groupitem.url | relative_url }}">{{ groupitem.title }}</a></li>

View File

@@ -0,0 +1,34 @@
<div id="header_nav">
<div class="navSlideout">
<i class="menuExpand" id="header_nav_expander"><span></span><span></span><span></span></i>
</div>
<nav class="slidingNav">
<ul>
{% for item in site.data.nav %}
<li class="navItem">
{% if item.category == "external" %}
<a href="{{ item.href }}" target="_blank">{{ item.title }}</a>
{% else %}
<a href="{{ item.href | relative_url }}">{{ item.title }}</a>
{% endif %}
</li>
{% endfor %}
{% if site.searchconfig %}
{% include nav_search.html inputselector="search_input_react" %}
{% endif %}
</ul>
</nav>
</div>
<script>
var event = document.createEvent('Event');
event.initEvent('slide', true, true);
document.addEventListener('slide', function (e) {
document.body.classList.toggle('sliderActive');
}, false);
var headerNav = document.getElementById('header_nav');
var headerNavExpander = document.getElementById('header_nav_expander');
headerNavExpander.addEventListener('click', function(e) {
headerNav.classList.toggle('navSlideoutActive');
document.dispatchEvent(event);
}, false);
</script>

View File

@@ -0,0 +1,15 @@
<li class="navSearchWrapper">
<input id="{{ include.inputselector }}" type="search" />
</li>
<script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script>
<script>
// For Algolia search
(function() {
// Algolia
docsearch({
apiKey: '{{ site.searchconfig.apikey }}',
indexName: '{{ site.searchconfig.indexname }}',
inputSelector: '#{{ include.inputselector }}',
});
}());
</script>

View File

@@ -0,0 +1,3 @@
<div class="pluginBlock allShareBlock">
{% include plugins/like_button.html %}{% include plugins/twitter_share.html %}{% include plugins/google_share.html %}
</div>

View File

@@ -0,0 +1,2 @@
<div class="ascii-cinema pluginBlock"></div>
<script type="text/javascript" src="https://asciinema.org/a/{{ include.href }}.js" id="asciicast-{{ include.href }}" async data-autoplay="true" data-loop="true" data-speed="2" data-t="23"></script>

View File

@@ -0,0 +1,6 @@
<div class="pluginWrapper buttonWrapper">
<a
class="button"
href="{{ include.href }}"
>{{ include.text }}</a>
</div>

View File

@@ -0,0 +1,4 @@
<div class="pluginWrapper ghStarWrapper">
<a aria-label="Star {{ site.ghrepo }} on GitHub" data-count-aria-label="# stargazers on GitHub" data-count-api="/repos/{{ site.ghrepo }}#stargazers_count" data-count-href="/{{ site.ghrepo }}/stargazers" data-style="mega" data-icon="octicon-star" href="https://github.com/{{ site.ghrepo }}" class="github-button">Star</a>
</div>
<script async defer id="github-bjs" src="https://buttons.github.io/buttons.js"></script>

View File

@@ -0,0 +1,4 @@
<div class="pluginWrapper ghWatchWrapper">
<a aria-label="Watch {{ site.ghrepo }} on GitHub" data-count-aria-label="# watchers on GitHub" data-count-api="/repos/{{ site.ghrepo }}#subscribers_count" data-count-href="/{{ site.ghrepo }}/watchers" data-style="mega" data-icon="octicon-eye" href="https://github.com/{{ site.ghrepo }}" class="github-button">Watch</a>
</div>
<script async defer id="github-bjs" src="https://buttons.github.io/buttons.js"></script>

View File

@@ -0,0 +1,5 @@
<div class="pluginBlock">
<div class="g-plusone" data-size="medium"></div>
</div>
<script src="https://apis.google.com/js/platform.js" async defer></script>

View File

@@ -0,0 +1,6 @@
<div class="iframeContent">
<iframe class="pluginIframe" src="{{ include.href }}" seamless></iframe>
</div>
<div class="iframePreview">
{% include plugins/button.html href=include.href text=include.text %}
</div>

View File

@@ -0,0 +1,18 @@
<div class="fb-like pluginWrapper likeButtonWrapper" data-layout="button_count" data-action="like" data-show-faces="true" data-share="true"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '{{ site.fbappid }}',
xfbml : true,
version : 'v2.3'
});
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>

View File

@@ -0,0 +1,6 @@
<div class="pluginRowBlock">
{% for child in include.children %}
{% include plugins/{{child.type}}.html href=child.href text=child.text %}
<div style="width: 20px;"></div>
{% endfor %}
</div>

View File

@@ -0,0 +1,34 @@
<div class="postSocialPlugins">
<a
href="https://twitter.com/share"
class="twitter-share-button"
data-url="{{ page.url | replace:'index.html','' | absolute_url }}"
data-text="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}"
data-hashtags="flowtype">Tweet</a>
<div
class="fb-like"
data-href="{{ page.url | replace:'index.html','' | absolute_url }}"
data-layout="button_count"
data-action="like"
data-show-faces="false"
data-share="true"></div>
</div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '{{ site.fbappid }}',
xfbml : true,
version : 'v2.2'
});
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>

View File

@@ -0,0 +1,88 @@
<div class="slideshowBlock pluginWrapper" id="slideshow"></div>
<script>
var slideshowData = [
{% for image in site.data.slideshow %}
{
id : "{{ image.id }}",
imagesrc : "{{ image.src }}",
tooltip : "{{ image.tooltip }}",
href : "{{ image.link }}",
},
{% endfor %}
];
</script>
<script src="http://fb.me/react-with-addons-0.13.1.min.js"></script>
<script type="text/javascript">
var Slideshow = React.createClass({displayName: "Slideshow",
getInitialState: function() {
return {
currentSlide: 0,
};
},
getDefaultProps: function() {
return {
data: slideshowData,
};
},
handleSelect: function(id) {
var index = this.props.data.map(function (el, elIndex) {
return (
elIndex
);
});
var currentIndex = index.indexOf(id);
this.setState({
currentSlide: currentIndex,
});
},
render: function() {
return (
React.createElement("div", {className: "slideshow"},
React.createElement("div", {className: "slides"},
this.props.data.map(this.renderSlide)
),
React.createElement("div", {className: "pagination"},
this.props.data.map(this.renderPager)
)
)
);
},
renderSlide: function(child, index) {
var classes = React.addons.classSet({
'slide': true,
'slideActive': this.state.currentSlide === index,
});
if (child.href) {
return (
React.createElement("div", {key: index, className: classes},
React.createElement("a", {href: child.href, alt: child.tooltip, title: child.tooltip},
React.createElement("img", {src: child.imagesrc, alt: child.tooltip, title: child.tooltip})
)
)
);
}
return (
React.createElement("div", {key: index, className: classes},
React.createElement("img", {src: child.imagesrc, alt: child.tooltip})
)
);
},
renderPager: function(child, index) {
var classes = React.addons.classSet({
'pager': true,
'pagerActive': this.state.currentSlide === index,
});
return (
React.createElement("span", {key: index, className: classes, onClick: this.handleSelect.bind(this, index)})
);
},
});
function render(slideshowData) {
React.render(
React.createElement(Slideshow, {data: slideshowData}),
document.getElementById('slideshow')
);
}
render(slideshowData);
</script>

View File

@@ -0,0 +1,5 @@
<div class="pluginBlock">
<a href="https://twitter.com/{{ include.href }}" class="twitter-follow-button pluginBlock" data-show-count="false">Follow @{{ include.href }}</a>
</div>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>

View File

@@ -0,0 +1,4 @@
<div class="pluginWrapper twitterSharePlugin">
<a href="https://twitter.com/share" class="twitter-share-button" data-hashtags="{{ site.title| replace: ' ', '' }}">Tweet</a>
</div>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>

35
docs/_includes/post.html Normal file
View File

@@ -0,0 +1,35 @@
<div class="post">
{% assign author = site.data.authors[page.author] %}
<header class="post-header">
{% if author.fbid %}
<div class="authorPhoto">
<img src="http://graph.facebook.com/{{ author.fbid }}/picture/" alt="{{ author.fullname }}" title="{{ author.fullname }}" />
</div>
{% endif %}
{% if author.full_name %}
<p class="post-authorName">{{ author.full_name }}</p>
{% endif %}
<h1 class="post-title">{% if include.truncate %}<a href="{{ page.url | absolute_url }}">{{ page.title }}</a>{% else %}{{ page.title }}{% endif %}</h1>
<p class="post-meta">Posted {{ page.date | date: '%B %d, %Y' }}{% if page.meta %} • {{ page.meta }}{% endif %}</p>
</header>
<article class="post-content">
{% if include.truncate %}
{% if page.content contains '<!--truncate-->' %}
{{ page.content | split:'<!--truncate-->' | first | markdownify }}
<div class="read-more">
<a href="{{ page.url | absolute_url}}" >
Read More
</a>
</div>
{% else %}
{{ page.content | markdownify }}
{% endif %}
{% else %}
{{ content }}
{% endif %}
{% unless include.truncate %}
{% include plugins/all_share.html %}
{% endunless %}
</article>
</div>

View File

@@ -0,0 +1,28 @@
{% if site.data.powered_by.first.items or site.data.powered_by_highlight.first.items %}
<div class="poweredByContainer">
<div class="wrapper mainWrapper poweredByWrapper">
{% if site.data.powered_by_highlight.first.title %}
<h2>{{ site.data.powered_by_highlight.first.title }}</h2>
{% else %}
<h2>{{ site.data.powered_by.first.title }}</h2>
{% endif %}
{% if site.data.powered_by_highlight.first.items %}
<div class="poweredByItems">
{% for item in site.data.powered_by_highlight.first.items %}
<div class="poweredByItem itemLarge">
<a href="{{ item.url }}" target="_blank"><img src="{{ item.img }}" alt="{{ item.name }}" /></a>
</div>
{% endfor %}
</div>
{% endif %}
<div class="poweredByItems">
{% for item in site.data.powered_by.first.items %}
<div class="poweredByItem itemSmall">
<a href="{{ item.url }}" target="_blank">{{ item.name }}</a>
</div>
{% endfor %}
</div>
<div class="poweredByMessage">Does your app use {{ site.title }}? Add it to this list with <a href="https://github.com/{{ site.ghrepo }}/edit/gh-pages/_data/powered_by.yml" target="_blank">a pull request!</a></div>
</div>
</div>
{% endif %}

View File

@@ -0,0 +1,24 @@
<a
href="https://twitter.com/share"
class="twitter-share-button"
data-url="http://facebook.github.io/fresco{{ page.url }}"
data-text="Fresco | {{ page.title }}"
data-hashtags="fresco">Tweet</a>
<div
class="fb-like"
data-href="http://facebook.github.io/fresco{{ page.url }}"
data-layout="standard"
data-action="like"
data-show-faces="true"
data-share="true"></div>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>

View File

@@ -0,0 +1 @@
<span class="buttonWrap {{ include.align }}"><a class="button blockButton fbossFontLight pluginBlock margin{{ include.margin }}" target="{{ include.button_target }}" href="{{ include.button_href }}">{{ include.button_text }}</a></span>