Skip to content

Commit

Permalink
Fix date read in asciidoc files
Browse files Browse the repository at this point in the history
  • Loading branch information
javamind committed Jun 13, 2019
1 parent 29e4658 commit ad671a0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions extension/read-asciidoctor.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ function extReadAsciidoc(options) {
var asciidoc = file.contents.toString();
file.ast = asciidoctor.load(asciidoc, opts);
file.attributes = file.ast.getAttributes();
file.attributes.strdate = file.attributes.revdate;
var filename = file.path.substring(file.path.lastIndexOf("/") + 1, file.path.lastIndexOf("."));
var dir = '';
if (file.path.lastIndexOf("blog/") > 0) {
Expand All @@ -45,7 +44,7 @@ function extReadAsciidoc(options) {
dir = file.path.substring(file.path.lastIndexOf("training/") + "training/".length, file.path.lastIndexOf("/"));
}
var indexData = {
strdate: time_1.currentDate(),
strdate: file.attributes.revdate,
revdate: time_1.convertDateEn(file.attributes.revdate),
description: file.attributes.description,
doctitle: file.attributes.doctitle,
Expand Down
3 changes: 1 addition & 2 deletions extension/read-asciidoctor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export function extReadAsciidoc(options: Options) {
const asciidoc = file.contents.toString();
file.ast = asciidoctor.load(asciidoc, opts);
file.attributes = file.ast.getAttributes();
file.attributes.strdate = file.attributes.revdate;

const filename = file.path.substring(file.path.lastIndexOf("/") + 1, file.path.lastIndexOf("."));

Expand All @@ -56,7 +55,7 @@ export function extReadAsciidoc(options: Options) {
}

const indexData: IndexBlogData = {
strdate: currentDate(),
strdate: file.attributes.revdate,
revdate: convertDateEn(file.attributes.revdate),
description: file.attributes.description,
doctitle: file.attributes.doctitle,
Expand Down

0 comments on commit ad671a0

Please sign in to comment.