Skip to content

Commit

Permalink
Setup blog
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwdouglas committed Jul 8, 2013
1 parent 7f0dd37 commit a839203
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 0 deletions.
2 changes: 2 additions & 0 deletions _ext/pipeline.rb
Expand Up @@ -20,5 +20,7 @@
transformer Awestruct::Extensions::HtmlMinifier.new
extension Awestruct::Extensions::FileMerger.new
extension Awestruct::Extensions::LessConfig.new
extension Awestruct::Extensions::Posts.new( '/blog', :posts )
extension Awestruct::Extensions::Paginator.new(:posts, '/blog/index', :per_page => 5)
end

6 changes: 6 additions & 0 deletions _layouts/project-blog.html.haml
@@ -0,0 +1,6 @@
---
layout: project-nav
---
%h2.title=page.title

~ content
2 changes: 2 additions & 0 deletions _layouts/project-nav.html.haml
Expand Up @@ -14,6 +14,8 @@ layout: project
%ul.nav
%li{:class=>"#{'active' if page.output_path.start_with?('/index') }" }<
%a(href="#{site.base_url}/index.html") Home
%li{:class=>"#{'active' if page.output_path.start_with?('/blog') }" }<
%a(href="#{site.base_url}/blog/index.html") Blog
%li{:class=>"#{'active' if page.output_path.start_with?('/downloads') }" }<
%a(href="#{site.base_url}/downloads.html") Download
%li{:class=>"#{'active' if page.output_path.start_with?('/docs') }" }<
Expand Down
12 changes: 12 additions & 0 deletions _partials/post.html.haml
@@ -0,0 +1,12 @@
---
---
%article.post
%header.header
%h2.title
%a{:href=>page.post.url}= page.post.title
.byline
%span.dateinline on #{page.post.date.strftime('%b %d, %Y')}
.body
~ page.post.content
.footer
%a{:href=>page.post.url} permalink
72 changes: 72 additions & 0 deletions blog/2013-07-09-Undertow-Beta1-Released.asciidoc
@@ -0,0 +1,72 @@
---
layout: project-blog
---

Undertow 1.0.0.Beta1 Released
=============================
Undertow is a high performance non-blocking webserver that is the new web server in Wildfly.
Some notable features include:
* HTTP upgrade support - This enables management and EJB invocations to be multiplexed over the web port without any performance loss
* Websocket support, including JSR-356
* Servlet 3.1 support
* Ability to mix non-blocking handlers with Servlet
Undertow is completely standalone, starts in milliseconds, and has a fluent builder API for building deployments. This all makes it well suited for use in unit tests. An example of setting up an embedded servlet deployment is shown below:
One of the goals of Undertow was to have great performance and I am happy to say so far we have surpassed our own expectations. Against the competition Undertow comes out ahead on every internal test we have run, and this is also represented in a third party benchmark by Tech Empower (the benchmarks that were posted to the core a while back), where it comes in as the fastest Java web server (and in many of the tests as the fastest server overall).
The results are listed here:
* http://www.techempower.com/benchmarks/#section=data-r6&hw=ec2&test=plaintext
* http://www.techempower.com/benchmarks/#section=data-r6&hw=i7&test=plaintext
* http://www.techempower.com/benchmarks/#section=data-r6&hw=ec2&test=json
* http://www.techempower.com/benchmarks/#section=data-r6&hw=i7&test=json
If anyone want to participate the dev list is undertow-dev@lists.jboss.org and we hang out on #undertow on freenode.
Some examples
-------------
.Embedded Servlet Deployment
[source,java]
----
DeploymentInfo servletBuilder = deployment()
.setClassLoader(ServletServer.class.getClassLoader())
.setContextPath("/myapp")
.setDeploymentName("test.war")
.addServlets(
servlet("MessageServlet", MessageServlet.class)
.addInitParam("message", "Hello World")
.addMapping("/*"),
servlet("MyServlet", MessageServlet.class)
.addInitParam("message", "MyServlet")
.addMapping("/myservlet"));
DeploymentManager manager = defaultContainer().addDeployment(servletBuilder);
manager.deploy();
Undertow server = Undertow.builder()
.addListener(8080, "localhost")
.setHandler(manager.start())
.build();
server.start();
----
.Simple non-blocking handler
[source,java]
----
Undertow server = Undertow.builder()
.addListener(8080, "localhost")
.setHandler(new HttpHandler() {
@Override
public void handleRequest(final HttpServerExchange exchange) throws Exception {
exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "text/plain");
exchange.getResponseSender().send("Hello World");
}
}).build();
server.start();
----
14 changes: 14 additions & 0 deletions blog/index.html.haml
@@ -0,0 +1,14 @@
---
layout: project-nav
title: Undertow Blog
title_link: /blog/
body_class: blog index
---
- page.posts.each do |post|
= partial('post.html.haml', :parent => page, :post => post, :include_comments_count => post.equal?(page.posts.last))
%ul.pager
%li.previous{:class=>('disabled' unless page.posts.next_page)}
%a{:href=>page.posts.next_page ? page.posts.next_page.url : '#'} &laquo; Older
%li.pages Page #{page.posts.current_page_index + 1} of #{page.posts.pages.size}
%li.next{:class=>('disabled' unless page.posts.previous_page)}
%a{:href=>page.posts.previous_page ? page.posts.previous_page.url : '#'} Newer &raquo;

0 comments on commit a839203

Please sign in to comment.