You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafu.apache.org by mh...@apache.org on 2015/12/10 21:29:23 UTC
incubator-datafu git commit: DATAFU-113 Add Twitter and OpenGraph
meta tags to blog posts
Repository: incubator-datafu
Updated Branches:
refs/heads/master 0456797ef -> 92a56e49f
DATAFU-113 Add Twitter and OpenGraph meta tags to blog posts
Project: http://git-wip-us.apache.org/repos/asf/incubator-datafu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-datafu/commit/92a56e49
Tree: http://git-wip-us.apache.org/repos/asf/incubator-datafu/tree/92a56e49
Diff: http://git-wip-us.apache.org/repos/asf/incubator-datafu/diff/92a56e49
Branch: refs/heads/master
Commit: 92a56e49f96fb3a1e3cfbfaade55e7a7e1748b07
Parents: 0456797
Author: Matthew Hayes <ma...@gmail.com>
Authored: Thu Dec 10 11:48:35 2015 -0800
Committer: Matthew Hayes <ma...@gmail.com>
Committed: Thu Dec 10 11:48:35 2015 -0800
----------------------------------------------------------------------
site/config.rb | 10 +++++-----
site/source/blog/2013-09-04-datafu-1-0.markdown | 6 +++---
...s-incremental-data-processing-in-hadoop.markdown | 6 +++---
site/source/layouts/blog.erb | 11 +++++++++++
site/source/layouts/layout.erb | 16 ++++++++++------
5 files changed, 32 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-datafu/blob/92a56e49/site/config.rb
----------------------------------------------------------------------
diff --git a/site/config.rb b/site/config.rb
index eac5fb2..745a3f8 100644
--- a/site/config.rb
+++ b/site/config.rb
@@ -58,11 +58,11 @@ Dir['./lib/*'].each { |f| require f }
# activate :livereload
# Methods defined in the helpers block are available in templates
-# helpers do
-# def some_helper
-# "Helping"
-# end
-# end
+helpers do
+ def inner_text(html)
+ Nokogiri.HTML(html).text.gsub(/\s+/, " ")
+ end
+end
set :css_dir, 'stylesheets'
http://git-wip-us.apache.org/repos/asf/incubator-datafu/blob/92a56e49/site/source/blog/2013-09-04-datafu-1-0.markdown
----------------------------------------------------------------------
diff --git a/site/source/blog/2013-09-04-datafu-1-0.markdown b/site/source/blog/2013-09-04-datafu-1-0.markdown
index f7bbf4d..8231ccb 100644
--- a/site/source/blog/2013-09-04-datafu-1-0.markdown
+++ b/site/source/blog/2013-09-04-datafu-1-0.markdown
@@ -18,8 +18,6 @@ license: >
limitations under the License.
---
-_Update (10/15/2015): The links in this blog post have been updated to point to the correct locations within the Apache DataFu website._
-
[DataFu](/) is an open-source collection of user-defined functions for working with large-scale data in [Hadoop](http://hadoop.apache.org/) and [Pig](http://pig.apache.org/).
About two years ago, we recognized a need for a stable, well-tested library of Pig UDFs that could assist in common data mining and statistics tasks. Over the years, we had developed several routines that were used across LinkedIn and were thrown together into an internal package we affectionately called “littlepiggy.” The unfortunate part, and this is true of many such efforts, is that the UDFs were ill-documented, ill-organized, and easily got broken when someone made a change. Along came [PigUnit](http://pig.apache.org/docs/r0.11.1/test.html#pigunit), which allowed UDF testing, so we spent the time to clean up these routines by adding documentation and rigorous unit tests. From this “datafoo” package, we thought this would help the community at large, and there you have the initial release of DataFu.
@@ -611,4 +609,6 @@ features = left_outer_join(input1, val1, input2, val2, input3, val3);
So, that's a lot to digest, but it's just a highlight into a few interesting pieces of DataFu. Check out the [DataFu 1.0 release](/docs/datafu/1.0.0/) as there's even more in store.
-We hope that it proves valuable to you and as always welcome any contributions. Please let us know how you're using the library — we would love to hear from you.
\ No newline at end of file
+We hope that it proves valuable to you and as always welcome any contributions. Please let us know how you're using the library — we would love to hear from you.
+
+_Update (10/15/2015): The links in this blog post have been updated to point to the correct locations within the Apache DataFu website._
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-datafu/blob/92a56e49/site/source/blog/2013-10-03-datafus-hourglass-incremental-data-processing-in-hadoop.markdown
----------------------------------------------------------------------
diff --git a/site/source/blog/2013-10-03-datafus-hourglass-incremental-data-processing-in-hadoop.markdown b/site/source/blog/2013-10-03-datafus-hourglass-incremental-data-processing-in-hadoop.markdown
index cd9c73e..2cb3388 100644
--- a/site/source/blog/2013-10-03-datafus-hourglass-incremental-data-processing-in-hadoop.markdown
+++ b/site/source/blog/2013-10-03-datafus-hourglass-incremental-data-processing-in-hadoop.markdown
@@ -18,8 +18,6 @@ license: >
limitations under the License.
---
-_Update (10/15/2015): The links in this blog post have been updated to point to the correct locations within the Apache DataFu website._
-
For a large scale site such as LinkedIn, tracking metrics accurately and efficiently is an important task. For example, imagine we need a dashboard that shows the number of visitors to every page on the site over the last thirty days. To keep this dashboard up to date, we can schedule a query that runs daily and gathers the stats for the last 30 days. However, this simple implementation would be wasteful: only one day of data has changed, but we'd be consuming and recalculating the stats for all 30.
A more efficient solution is to make the query incremental: using basic arithmetic, we can update the output from the previous day by adding and subtracting input data. This enables the job to process only the new data, significantly reducing the computational resources required. Unfortunately, although there are many benefits to the incremental approach, getting incremental jobs right is hard:
@@ -460,4 +458,6 @@ If you're interested in the project, we also encourage you to try running the un
## Conclusion
-We hope this whets your appetite for incremental data processing with DataFu's Hourglass. The [code](https://github.com/apache/incubator-datafu/tree/master/datafu-hourglass) is available on Github in the [DataFu](https://github.com/apache/incubator-datafu) repository under an Apache 2.0 license. Documentation is available [here](/docs/hourglass/javadoc.html). We are accepting contributions, so if you are interesting in helping out, please fork the code and send us your pull requests!
\ No newline at end of file
+We hope this whets your appetite for incremental data processing with DataFu's Hourglass. The [code](https://github.com/apache/incubator-datafu/tree/master/datafu-hourglass) is available on Github in the [DataFu](https://github.com/apache/incubator-datafu) repository under an Apache 2.0 license. Documentation is available [here](/docs/hourglass/javadoc.html). We are accepting contributions, so if you are interesting in helping out, please fork the code and send us your pull requests!
+
+_Update (10/15/2015): The links in this blog post have been updated to point to the correct locations within the Apache DataFu website._
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-datafu/blob/92a56e49/site/source/layouts/blog.erb
----------------------------------------------------------------------
diff --git a/site/source/layouts/blog.erb b/site/source/layouts/blog.erb
index 66397f9..c93c462 100644
--- a/site/source/layouts/blog.erb
+++ b/site/source/layouts/blog.erb
@@ -17,6 +17,17 @@
# under the License.
%>
+<% content_for :meta_tags do %>
+ <meta name="twitter:card" content="summary" />
+ <meta name="twitter:site" content="@apachedatafu" />
+ <meta name="twitter:title" content="<%= current_article.title %>" />
+ <meta name="twitter:description" content="<%= inner_text current_article.summary %>" />
+ <meta property="og:url" content="http://datafu.incubator.apache.org<%= current_page.url %>" />
+ <meta property="og:type" content="article" />
+ <meta property="og:title" content="<%= current_article.title %>" />
+ <meta property="og:description" content="<%= inner_text current_article.summary %>" />
+<% end %>
+
<% wrap_layout :layout do %>
<div class="row">
<article class="col-lg-10">
http://git-wip-us.apache.org/repos/asf/incubator-datafu/blob/92a56e49/site/source/layouts/layout.erb
----------------------------------------------------------------------
diff --git a/site/source/layouts/layout.erb b/site/source/layouts/layout.erb
index d33e6ad..44d37f0 100644
--- a/site/source/layouts/layout.erb
+++ b/site/source/layouts/layout.erb
@@ -21,14 +21,18 @@
<html>
<head>
<meta charset="utf-8">
-
+
<!-- Always force latest IE rendering engine or request Chrome Frame -->
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
<meta name="google-site-verification" content="9N7qTOUYyX4kYfXYc0OIomWJku3PVvGrf6oTNWg2CHI" />
-
+
+ <% if content_for?(:meta_tags) %>
+ <%= yield_content :meta_tags %>
+ <% end %>
+
<!-- Use title if it's in the page YAML frontmatter -->
<title><%= current_page.data.title || "The Middleman" %></title>
-
+
<%= stylesheet_link_tag "all", "highlight" %>
<%= javascript_include_tag "all" %>
@@ -46,15 +50,15 @@
</script>
<% end %>
</head>
-
+
<body class="<%= page_classes %>">
<div class="container">
<%= partial "layouts/header" %>
-
+
<%= yield %>
-
+
<%= partial "layouts/footer" %>
</div>