You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2019/07/31 15:55:50 UTC

[arrow] branch master updated: ARROW-6066: [Website] Fix blog post author header

This is an automated email from the ASF dual-hosted git repository.

wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 9d7e77c  ARROW-6066: [Website] Fix blog post author header
9d7e77c is described below

commit 9d7e77cbf8046520b8042c9dd8140c460b47cbaa
Author: Neal Richardson <ne...@gmail.com>
AuthorDate: Wed Jul 31 10:55:38 2019 -0500

    ARROW-6066: [Website] Fix blog post author header
    
    This fixes the author metadata logic in a few ways:
    
    1. If the author isn't listed in contributors.yml, it is printed verbatim with no href
    2. To make this work in the /blog/ page, the partial template has to null out the author_name variable so that the previous pass in the for loop doesn't spill over
    3. The author link is either "homepage" if given, else a link to their GitHub page if "githubId" is given, else a link to the Apache phonebook
    4. Logic for this header was consolidated in a single _include partial and used in both the main blog page and the individual permalinked pages
    
    Before:
    ![image](https://user-images.githubusercontent.com/2975928/62084720-c7a0c800-b20e-11e9-9b31-f8fb48833a29.png)
    ![image](https://user-images.githubusercontent.com/2975928/62084745-dab39800-b20e-11e9-9ec1-21e35b30afa2.png)
    
    After:
    ![image](https://user-images.githubusercontent.com/2975928/62084789-f5860c80-b20e-11e9-8303-7db0ad1e0643.png)
    ![image](https://user-images.githubusercontent.com/2975928/62084801-ff0f7480-b20e-11e9-912e-d9a0a6422a53.png)
    
    This is also now documented in the README.
    
    While I was in there, I also deleted some unused templates.
    
    Closes #4964 from nealrichardson/jekyll-cleanup and squashes the following commits:
    
    a5b971c2a <Neal Richardson> Fix blog post author metadata and document it; remove some unused templates
    
    Authored-by: Neal Richardson <ne...@gmail.com>
    Signed-off-by: Wes McKinney <we...@apache.org>
---
 site/README.md                                 |  4 ++
 site/_data/contributors.yml                    |  7 +--
 site/_docs/c_glib/index.md                     |  2 +-
 site/_includes/blog_contents.html              | 12 ------
 site/_includes/blog_entry.html                 | 33 +-------------
 site/_includes/blog_header.html                | 59 ++++++++++++++++++++++++++
 site/_layouts/blog.html                        | 15 -------
 site/_layouts/docs.html                        | 17 --------
 site/_layouts/post.html                        | 39 +++--------------
 site/_posts/2019-01-25-r-spark-improvements.md |  2 +-
 site/_posts/2019-07-08-0.14.0-release.md       |  4 +-
 11 files changed, 75 insertions(+), 119 deletions(-)

diff --git a/site/README.md b/site/README.md
index 33758e9..651b013 100644
--- a/site/README.md
+++ b/site/README.md
@@ -26,6 +26,10 @@ format. [Jekyll](https://jekyllrb.com/) is used to generate HTML files that can
 then be committed to the [arrow-site](https://github.com/apache/arrow-site)
 repository.
 
+## Adding Content
+
+To add a blog post, create a new markdown file in the `_posts` directory, following the model of existing posts. In the front matter, you should specify an "author". This should be your Apache ID if you have one, or it can just be your name. To add additional metadata about yourself (GitHub ID, website), add yourself to `_data/contributors.yml`. This object is keyed by `apacheId`, so use that as the `author` in your post. (It doesn't matter if the ID actually exists in the ASF; all metad [...]
+
 ## Prerequisites
 
 With Ruby >= 2.1 installed, run the following commands to install
diff --git a/site/_data/contributors.yml b/site/_data/contributors.yml
index 185a565..3d86a48 100644
--- a/site/_data/contributors.yml
+++ b/site/_data/contributors.yml
@@ -16,9 +16,6 @@
 # Database of contributors to Apache Arrow (WIP)
 # Blogs and other pages use this data
 #
-- name: Apache Arrow Community
-  githubId: apache
-  homepage: https://arrow.apache.org
 - name: Wes McKinney
   apacheId: wesm
   githubId: wesm
@@ -43,8 +40,8 @@
   apacheId: siddharthteotia
   githubId: siddharthteotia
 - name: The Apache Arrow PMC
-  apacheId: pmc
-  githubId: pmc
+  apacheId: pmc # Not a real apacheId
+  homepage: https://arrow.apache.org
 - name: Andy Grove
   apacheId: agrove
   githubId: andygrove
diff --git a/site/_docs/c_glib/index.md b/site/_docs/c_glib/index.md
index e92788b..d232d88 100644
--- a/site/_docs/c_glib/index.md
+++ b/site/_docs/c_glib/index.md
@@ -1,5 +1,5 @@
 ---
-layout: docs
+layout: default
 title: Apache Arrow GLib (C)
 permalink: /docs/c_glib/index.html
 ---
diff --git a/site/_includes/blog_contents.html b/site/_includes/blog_contents.html
deleted file mode 100644
index b3b785d..0000000
--- a/site/_includes/blog_contents.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<div>
-  <aside>
-    <h4>Posts</h4>
-    <ul>
-        {% for post in site.posts %}
-        <li class="{% if page.title == post.title %}current{% endif %}">
-          <a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a>
-        </li>
-        {% endfor %}
-    </ul>
-  </aside>
-</div>
diff --git a/site/_includes/blog_entry.html b/site/_includes/blog_entry.html
index f6276d3..65ec138 100644
--- a/site/_includes/blog_entry.html
+++ b/site/_includes/blog_entry.html
@@ -15,37 +15,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 {% endcomment %}
   <div class="blog-post" style="margin-bottom: 4rem">
-    <h1>
-      {{ post.title }}
-      <a href="{{ post.url }}" class="permalink" title="Permalink">∞</a>
-    </h1>
-
-    {% capture discard %}
-      {% for c in site.data.contributors %}
-        {% if c.apacheId == post.author %}
-          {% assign author_name = c.name %}
-          {% if c.homepage %}
-            {% assign homepage = c.homepage %}
-          {% else %}
-            {% capture homepage %}http://github.com/{{ c.githubId }}{% endcapture %}
-          {% endif %}
-          {% if c.avatar %}
-            {% assign avatar = c.avatar %}
-          {% else %}
-            {% capture avatar %}http://github.com/{{ c.githubId }}.png{% endcapture %}
-          {% endif %}
-        {% endif %}
-      {% endfor %}
-    {% endcapture %}{% assign discard = nil %}
-
-    <p>
-      <span class="badge badge-secondary">Published</span>
-      <span class="published">
-        {{ post.date | date_to_string }}
-      </span>
-      <br />
-      <span class="badge badge-secondary">By</span>
-      <a href="{{ homepage }}">{{ author_name }} ({{ post.author }})</a>
-    </p>
+    {% include blog_header.html %}
     {{ post.content }}
   </div>
diff --git a/site/_includes/blog_header.html b/site/_includes/blog_header.html
new file mode 100644
index 0000000..a5a1bac
--- /dev/null
+++ b/site/_includes/blog_header.html
@@ -0,0 +1,59 @@
+{% comment %}
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to you under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+{% endcomment %}
+<h1>
+  {{ post.title }}
+  <a href="{{ post.url }}" class="permalink" title="Permalink">∞</a>
+</h1>
+
+{% capture discard %}
+  {% comment %}
+    We have to initialize the author_name to nil so that when this _include
+    is used in a for loop, the previous entry doesn't contaminate
+  {% endcomment %}
+  {% assign author_name = nil %}
+  {% for c in site.data.contributors %}
+    {% if c.apacheId == post.author %}
+      {% assign author_name = c.name %}
+      {% if c.homepage %}
+        {% assign homepage = c.homepage %}
+      {% else if c.githubId %}
+        {% capture homepage %}http://github.com/{{ c.githubId }}{% endcapture %}
+      {% else %}
+        {% capture homepage %}http://people.apache.org/~{{ post.author }}{% endcapture %}
+      {% endif %}
+      {% if c.avatar %}
+        {% assign avatar = c.avatar %}
+      {% else %}
+        {% capture avatar %}http://github.com/{{ c.githubId }}.png{% endcapture %}
+      {% endif %}
+    {% endif %}
+  {% endfor %}
+{% endcapture %}{% assign discard = nil %}
+
+<p>
+  <span class="badge badge-secondary">Published</span>
+  <span class="published">
+    {{ post.date | date_to_string }}
+  </span>
+  <br />
+  <span class="badge badge-secondary">By</span>
+  {% if author_name %}
+    <a href="{{ homepage }}">{{ author_name }} ({{ post.author }}) </a>
+  {% else %}
+    {{ post.author }}
+  {% endif %}
+</p>
diff --git a/site/_layouts/blog.html b/site/_layouts/blog.html
deleted file mode 100644
index 31fd719..0000000
--- a/site/_layouts/blog.html
+++ /dev/null
@@ -1,15 +0,0 @@
----
-layout: default
----
-
-<section class="blog">
-  <div class="grid">
-
-    <div class="">
-      {{ content }}
-    </div>
-
-    <!-- {% include blog_contents.html %} -->
-    <div class="clear"></div>
-  </div>
-</section>
diff --git a/site/_layouts/docs.html b/site/_layouts/docs.html
deleted file mode 100644
index 65ce345..0000000
--- a/site/_layouts/docs.html
+++ /dev/null
@@ -1,17 +0,0 @@
-{% include top.html %}
-
-<body class="wrap">
-  <header>
-    {% include header.html %}
-  </header>
-
-  <div class="container p-lg-4">
-    <main role="main">
-      {{ content }}
-    </main>
-
-    {% include footer.html %}
-  </div>
-</body>
-</html>
-
diff --git a/site/_layouts/post.html b/site/_layouts/post.html
index bc00bd9..1e9db93 100644
--- a/site/_layouts/post.html
+++ b/site/_layouts/post.html
@@ -1,5 +1,4 @@
 {% include top.html %}
-{% capture homepage %}http://people.apache.org/~{{ page.author }}{% endcapture %}
 
 <body class="wrap">
   <header>
@@ -8,39 +7,11 @@
 
   <div class="container p-lg-4">
     <main role="main">
-
-    <h1>
-      {{ page.title }}
-      <a href="{{ page.url }}" class="permalink" title="Permalink">∞</a>
-    </h1>
-
-    {% capture discard %}
-      {% for c in site.data.contributors %}
-        {% if c.apacheId == page.author %}
-          {% assign author_name = c.name %}
-          {% if c.homepage %}
-            {% assign homepage = c.homepage %}
-          {% else %}
-            {% capture homepage %}http://github.com/{{ c.githubId }}{% endcapture %}
-          {% endif %}
-          {% if c.avatar %}
-            {% assign avatar = c.avatar %}
-          {% else %}
-            {% capture avatar %}http://github.com/{{ c.githubId }}.png{% endcapture %}
-          {% endif %}
-        {% endif %}
-      {% endfor %}
-    {% endcapture %}{% assign discard = nil %}
-
-    <p>
-      <span class="badge badge-secondary">Published</span>
-      <span class="published">
-        {{ page.date | date_to_string }}
-      </span>
-      <br />
-      <span class="badge badge-secondary">By</span>
-      <a href="{{ homepage }}">{{ author_name }} ({{ post.author }})</a>
-    </p>
+    {% comment %}
+      This 'assign' is to match the variable name used in _includes/blog_header.html
+    {% endcomment %}
+    {% assign post = page %}
+    {% include blog_header.html %}
 
     {{ content }}
     </main>
diff --git a/site/_posts/2019-01-25-r-spark-improvements.md b/site/_posts/2019-01-25-r-spark-improvements.md
index 982514a..a06d7aa 100644
--- a/site/_posts/2019-01-25-r-spark-improvements.md
+++ b/site/_posts/2019-01-25-r-spark-improvements.md
@@ -2,7 +2,7 @@
 layout: post
 title: "Speeding up R and Apache Spark using Apache Arrow"
 date: "2019-01-25 00:00:00 -0600"
-author: javierluraschi
+author: Javier Luraschi
 categories: [application]
 ---
 <!--
diff --git a/site/_posts/2019-07-08-0.14.0-release.md b/site/_posts/2019-07-08-0.14.0-release.md
index 1c1f1c8..bd85705 100644
--- a/site/_posts/2019-07-08-0.14.0-release.md
+++ b/site/_posts/2019-07-08-0.14.0-release.md
@@ -2,7 +2,7 @@
 layout: post
 title: "Apache Arrow 0.14.0 Release"
 date: "2019-07-02 00:00:00 -0600"
-author: apache
+author: pmc
 categories: [release]
 ---
 <!--
@@ -297,4 +297,4 @@ community there:
 [12]: https://lists.apache.org/thread.html/a99124e57c14c3c9ef9d98f3c80cfe1dd25496bf3ff7046778add937@%3Cdev.arrow.apache.org%3E
 [13]: https://lists.apache.org/thread.html/96b2e22606e8a7b0ad7dc4aae16f232724d1059b34636676ed971d40@%3Cdev.arrow.apache.org%3E
 [14]: https://lists.apache.org/thread.html/82a7c026ad18dbe9fdbcffa3560979aff6fd86dd56a49f40d9cfb46e@%3Cdev.arrow.apache.org%3E
-[15]: https://lists.apache.org/thread.html/44a7a3d256ab5dbd62da6fe45b56951b435697426bf4adedb6520907@%3Cdev.arrow.apache.org%3E
\ No newline at end of file
+[15]: https://lists.apache.org/thread.html/44a7a3d256ab5dbd62da6fe45b56951b435697426bf4adedb6520907@%3Cdev.arrow.apache.org%3E