Skip to content

Commit 3042139

Browse files
committed
Add blog to site
1 parent 99cd66f commit 3042139

File tree

9 files changed

+129
-1
lines changed

9 files changed

+129
-1
lines changed

site/jekyll/_config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: ReactJS.NET
22
markdown: redcarpet
33
pygments: true
4+
permalink: /:year/:month/:title.html
5+
paginate: 5
6+
paginate_path: /blog/page:num.html
7+
url: http://reactjs.net
48
doc-sections:
59
- id: getting-started
610
title: Getting Started

site/jekyll/_includes/blog_post.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<h1><a href="{{ page.url }}">{{ page.title }}</a></h1>
2+
<p class="meta">{{ page.date | date_to_string }} by {{ page.author }}</p>
3+
4+
<div id="post">
5+
{% if content != '' %}
6+
{{ page.excerpt }}
7+
{% else %}
8+
{{ page.content }}
9+
{% endif %}
10+
</div>

site/jekyll/_includes/nav_blog.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<div class="nav-docs nav-blog">
2+
<div class="nav-docs-section">
3+
<h3>Recent posts</h3>
4+
<ul>
5+
{% for post in site.posts limit:10 %}
6+
<li><a href="{{ post.url }}"{% if page.title == post.title %} class="active"{% endif %}>{{ post.title }}</a></li>
7+
{% endfor %}
8+
<li><a href="/blog/all.html">All posts ...</a></li>
9+
</ul>
10+
</div>
11+
</div>

site/jekyll/_layouts/default.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@
88
<meta name="viewport" content="width=device-width" />
99
<meta property="og:title" content="{{ page.title }} | {{ site.name }}" />
1010
<meta property="og:type" content="website" />
11-
<meta property="og:url" content="http://reactjs.net{{ page.url }}" />
11+
<meta property="og:url" content="{{ site.url }}{{ page.url }}" />
1212
<meta property="og:image" content="http://facebook.github.io/react/img/logo_og.png" />
1313
<meta property="og:description" content=".NET integration for ReactJS" />
1414
<meta property="fb:app_id" content="1417169611875552" />
1515

16+
<link rel="shortcut icon" href="http://facebook.github.io/react/favicon.ico" />
17+
<link rel="alternate" type="application/rss+xml" title="{{ site.name }}" href="{{ site.url }}/feed.xml" />
18+
1619
{% stylesheet main %}
1720

1821
<script type="text/javascript" src="//use.typekit.net/vqa1hcx.js"></script>
@@ -41,6 +44,7 @@
4144
<li><a href="/docs"{% if page.sectionid == 'docs' and page.id != 'tutorial' and page.id != 'download' %} class="active"{% endif %}>Docs</a></li>
4245
<li><a href="/getting-started/tutorial.html"{% if page.id == 'tutorial' %} class="active"{% endif %}>Tutorial</a></li>
4346
<li><a href="/getting-started/download.html"{% if page.id == 'download' %} class="active"{% endif %}>Download</a></li>
47+
<li><a href="/blog/"{% if page.sectionid == 'blog' %} class="active"{% endif %}>Blog</a></li>
4448
<li><a href="http://github.com/reactjs/React.NET">GitHub</a>
4549
</ul>
4650
</div>

site/jekyll/_layouts/post.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
layout: default
3+
sectionid: blog
4+
---
5+
6+
<section class="content wrap blogContent">
7+
{% include nav_blog.html %}
8+
<div class="inner-content">
9+
<h1>{{ page.title }}</h1>
10+
<p class="meta">{{ page.date | date: "%B %e, %Y" }} by {{ page.author }}</p>
11+
12+
<hr>
13+
14+
<div class="post">
15+
{{ content }}
16+
</div>
17+
18+
<div class="fb-like" data-send="true" data-width="650" data-show-faces="false"></div>
19+
20+
<h2>Comments</h2>
21+
<div class="fb-comments" data-width="650" data-num-posts="10" data-href="http://reactjs.net{{ page.url }}"></div>
22+
</div>
23+
</section>

site/jekyll/blog/all.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: Blog
3+
layout: default
4+
sectionid: blog
5+
id: all-posts
6+
---
7+
8+
<section class="content wrap documentationContent nosidebar">
9+
<div class="inner-content">
10+
<h1>All Posts</h1>
11+
{% for page in site.posts %}
12+
<p><strong><a href="{{ page.url }}">{{ page.title }}</a></strong> on {{ page.date | date: "%B %e, %Y" }} by {{ page.author }}</p>
13+
{% endfor %}
14+
</div>
15+
</section>

site/jekyll/blog/index.html

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
title: Blog
3+
layout: default
4+
sectionid: blog
5+
---
6+
7+
<section class="content wrap blogContent">
8+
{% include nav_blog.html %}
9+
<div class="inner-content">
10+
{% for page in paginator.posts %}
11+
<div class="post-list-item">
12+
<h1><a href="{{ page.url }}">{{ page.title }}</a></h1>
13+
<p class="meta">{{ page.date | date: "%B %e, %Y" }} by {{ page.author }}</p>
14+
<hr />
15+
<div class="post">
16+
{{ page.content }}
17+
</div>
18+
</div>
19+
{% endfor %}
20+
21+
<div class="pagination">
22+
{% if paginator.previous_page %}
23+
<a href="{{ paginator.previous_page_path }}" class="previous">
24+
&laquo; Previous Page
25+
</a>
26+
{% endif %}
27+
{% if paginator.next_page %}
28+
<a href="{{ paginator.next_page_path }}" class="next">
29+
Next Page &raquo;
30+
</a>
31+
{% endif %}
32+
</div>
33+
</div>
34+
</section>

site/jekyll/feed.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
layout: none
3+
---
4+
<?xml version="1.0" encoding="UTF-8"?>
5+
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
6+
<channel>
7+
<title>{{ site.name }}</title>
8+
<description>{{ site.description }}</description>
9+
<link>{{ site.url }}/</link>
10+
<atom:link href="{{ site.url }}/feed.xml" rel="self" type="application/rss+xml" />
11+
{% for post in site.posts limit:10 %}
12+
<item>
13+
<title>{{ post.title | xml_escape }}</title>
14+
<description>{{ post.content | xml_escape }}</description>
15+
<pubDate>{{ post.date | date_to_xmlschema }}</pubDate>
16+
<link>{{ site.url }}{{ post.url }}</link>
17+
<guid isPermaLink="true">{{ site.url }}{{ post.url }}</guid>
18+
</item>
19+
{% endfor %}
20+
</channel>
21+
</rss>

site/jekyll/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ id: home
2222
[the tutorial](/getting-started/tutorial.html) to see how easy it is to
2323
get started with React and ReactJS.NET!
2424
</p>
25+
<p>
26+
<em>
27+
Latest news:
28+
<a href="{{ site.posts.first.url }}">{{ site.posts.first.title }}</a>
29+
</em>
30+
</p>
2531
<div id="examples">
2632
<div class="example">
2733
<h3>On-the-fly [JSX to JavaScript compilation](/getting-started/usage.html)</h3>

0 commit comments

Comments
 (0)