From ad671a0e9c0ecfb5ab4e100869afb1995da0f0ab Mon Sep 17 00:00:00 2001 From: Guillaume EHRET Date: Thu, 13 Jun 2019 15:44:25 +0200 Subject: [PATCH] Fix date read in asciidoc files --- extension/read-asciidoctor.js | 3 +-- extension/read-asciidoctor.ts | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/extension/read-asciidoctor.js b/extension/read-asciidoctor.js index f62ddb0..6ca878b 100644 --- a/extension/read-asciidoctor.js +++ b/extension/read-asciidoctor.js @@ -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) { @@ -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, diff --git a/extension/read-asciidoctor.ts b/extension/read-asciidoctor.ts index a65aca5..bffaf2a 100644 --- a/extension/read-asciidoctor.ts +++ b/extension/read-asciidoctor.ts @@ -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(".")); @@ -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,