You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Kristine Hahn (JIRA)" <ji...@apache.org> on 2015/12/25 00:20:49 UTC
[jira] [Comment Edited] (DRILL-4213) add page last updated to Drill
docs
[ https://issues.apache.org/jira/browse/DRILL-4213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15071288#comment-15071288 ]
Kristine Hahn edited comment on DRILL-4213 at 12/24/15 11:20 PM:
-----------------------------------------------------------------
Adding the site.time liquid filter doesn't do what I thought. It updates the date each time you build the site. I propose the following solution:
In _layouts/docpage.html, I'll add this line after the page.title div:
{code}
{% unless page.nodate %} {{ page.date | date: "%b %-d, %Y" }}{% endunless %}
{code}
One-time local set-up for gh-pages writers:
1. In your cloned directory of Drill, in drill/.git/hooks, create a file named pre-commit that contains this script:
{code}
#!/bin/sh
# Contents of .git/hooks/pre-commit
git diff --cached --name-status | grep "^M" | while read a b; do
cat $b | sed "/---.*/,/---.*/s/^date:.*$/date: $(date -u "+%Y-%m-%d %T %Z")/" > tmp
mv tmp $b
git add $b
done
{code}
2. Make the file executable.
{code}
chmod +x pre-commit
{code}
3. Add the date: to the front matter of any file you create or modify. For example:
{code}
---
title: "Configuring Multitenant Resources"
parent: "Configuring a Multitenant Cluster"
date:
---
{code}
The pre-commit script will enter the date (and UTC time) each time a modified file is committed, but the published file will show only month, day, year after the page title. For example:
*Configuring Multitenant Resources*
Dec 24, 2015
was (Author: krishahn):
Adding the site.time liquid filter doesn't do what I thought. It updates the day each time you build the site. I propose the following solution:
In _layouts/docpage.html, I'll add this line after the page.title div:
{code}
{% unless page.nodate %} {{ page.date | date: "%b %-d, %Y" }}{% endunless %}
{code}
One-time local set-up for gh-pages writers:
1. In your cloned directory of Drill, in drill/.git/hooks, create a file named pre-commit that contains this script:
{code}
#!/bin/sh
# Contents of .git/hooks/pre-commit
git diff --cached --name-status | grep "^M" | while read a b; do
cat $b | sed "/---.*/,/---.*/s/^date:.*$/date: $(date -u "+%Y-%m-%d %T %Z")/" > tmp
mv tmp $b
git add $b
done
{code}
2. Make the file executable.
{code}
chmod +x pre-commit
{code}
3. Add the date: to the front matter of any file you create or modify. For example:
{code}
---
title: "Configuring Multitenant Resources"
parent: "Configuring a Multitenant Cluster"
date:
---
{code}
The pre-commit script will enter the date (and UTC time) each time a modified file is committed, but the published file will show only month, day, year after the page title. For example:
*Configuring Multitenant Resources*
Dec 24, 2015
> add page last updated to Drill docs
> -----------------------------------
>
> Key: DRILL-4213
> URL: https://issues.apache.org/jira/browse/DRILL-4213
> Project: Apache Drill
> Issue Type: Wish
> Components: Documentation
> Affects Versions: 1.4.0
> Reporter: Kristine Hahn
> Assignee: Kristine Hahn
> Fix For: 1.5.0
>
>
> Received suggestion from community member to add a page last updated feature to docs (see user list email Dec 18, 2015 "Documentation Changes: version and date"). Maybe something like https://github.com/gjtorikian/jekyll-last-modified-at?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)