From 06e464b835b1462b50a66458fe8cb38971deb197 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phaneDucasse?= Date: Mon, 24 Jun 2024 17:00:06 +0200 Subject: [PATCH] fixing headerlink --- src/Microdown-Blog/MicBlogCreator.class.st | 4 +++- src/Microdown-Blog/MicSingleSummarizer.class.st | 12 +++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Microdown-Blog/MicBlogCreator.class.st b/src/Microdown-Blog/MicBlogCreator.class.st index 9e099f6f..eac96855 100644 --- a/src/Microdown-Blog/MicBlogCreator.class.st +++ b/src/Microdown-Blog/MicBlogCreator.class.st @@ -88,7 +88,9 @@ MicBlogCreator >> createAllHtmlFile [ "Create _monthListBlog" listOfSingleSummary := allFileParse collect: [ :each | - MicSingleSummarizer new summarize: each ]. + MicSingleSummarizer new + targetDirectory: targetDirectory; + summarize: each ]. self initializeMonthList: listOfSingleSummary. "transform all markdown file into html file" diff --git a/src/Microdown-Blog/MicSingleSummarizer.class.st b/src/Microdown-Blog/MicSingleSummarizer.class.st index 8d83cf43..51b2b691 100644 --- a/src/Microdown-Blog/MicSingleSummarizer.class.st +++ b/src/Microdown-Blog/MicSingleSummarizer.class.st @@ -69,17 +69,15 @@ MicSingleSummarizer >> firstParagraphBlockOf: aMicRootBlock [ { #category : 'parsing' } MicSingleSummarizer >> headerLink: aMicRootBlock [ - | headerLink header disk | + | headerLink header path | headerLink := MicHeaderBlock new. header := self firstHeaderBlockOf: aMicRootBlock. - - (aMicRootBlock fromFile fileSystem store isKindOf: WindowsStore) ifTrue: [ - disk := 'File:///' , aMicRootBlock fromFile fileSystem store currentDisk ]. - disk ifNil: [ disk := '' ]. + + path := (aMicRootBlock fromFile withoutExtension fullName + withoutPrefix: targetDirectory fullName) , '.html'. headerLink - addChild: - (self makeALink: header text to: disk, aMicRootBlock fromFile fullName); + addChild: (self makeALink: header text to: path); level: header level. ^ headerLink