Fixing authors/version metada preview.
This commit is contained in:
parent
326a28fce3
commit
c5f71e8230
@ -10,13 +10,13 @@ LePage >> asMarkdeep [
|
|||||||
markdeep := Markdeep new
|
markdeep := Markdeep new
|
||||||
title: self title;
|
title: self title;
|
||||||
body: bodyStream contents.
|
body: bodyStream contents.
|
||||||
markdeep metadata at: 'authors' put: (self metadata at: 'authors' ifAbsentPut: [ '']).
|
|
||||||
markdeep metadata at: 'version' put: (self metadata at: 'version' ifAbsentPut: [ '']).
|
|
||||||
self metadata keysAndValuesDo: [:k :v |
|
self metadata keysAndValuesDo: [:k :v |
|
||||||
markdeep header
|
markdeep header
|
||||||
add: '<meta name="', k, '" content="', v,'">';
|
add: '<meta name="', k, '" content="', v,'">';
|
||||||
yourself.
|
yourself.
|
||||||
].
|
].
|
||||||
|
self metadata at: 'authors' ifPresent: [:author | markdeep metadata at: 'authors' put: author ].
|
||||||
|
self metadata at: 'version' ifPresent: [:version | markdeep metadata at: 'version' put: version ].
|
||||||
^ markdeep.
|
^ markdeep.
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -55,6 +55,7 @@ LePage >> metadataInit [
|
|||||||
|
|
||||||
^ OrderedDictionary new
|
^ OrderedDictionary new
|
||||||
at: 'id' put: self uidString;
|
at: 'id' put: self uidString;
|
||||||
|
at: 'title' put: self contentAsString;
|
||||||
at: 'created' put: self createTime asString;
|
at: 'created' put: self createTime asString;
|
||||||
at: 'modified' put: self latestEditTime asString;
|
at: 'modified' put: self latestEditTime asString;
|
||||||
at: 'creator' put: self createEmail asString;
|
at: 'creator' put: self createEmail asString;
|
||||||
|
@ -25,7 +25,8 @@ Markdeep class >> fromMarkdownFile: aFileReference [
|
|||||||
|
|
||||||
{ #category : #'instance creation' }
|
{ #category : #'instance creation' }
|
||||||
Markdeep >> authors [
|
Markdeep >> authors [
|
||||||
^ self metadata at: 'authors' ifAbsent: [ ^'' ]
|
self metadata at: 'authors' ifPresent: [:k | ^ '**', k, '**' ].
|
||||||
|
^ ''.
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
@ -96,7 +97,7 @@ Markdeep >> contents [
|
|||||||
output
|
output
|
||||||
nextPutAll: self headerContents; lf; lf;
|
nextPutAll: self headerContents; lf; lf;
|
||||||
nextPutAll: ' **', self title, '**'; lf;
|
nextPutAll: ' **', self title, '**'; lf;
|
||||||
nextPutAll: ' **', self authors, '**'; lf;
|
nextPutAll: ' ', self authors ; lf;
|
||||||
nextPutAll: ' ', self version; lf; lf;
|
nextPutAll: ' ', self version; lf; lf;
|
||||||
nextPutAll: self body; lf; lf;
|
nextPutAll: self body; lf; lf;
|
||||||
nextPutAll: self tail; lf; lf; lf; lf;
|
nextPutAll: self tail; lf; lf; lf; lf;
|
||||||
@ -259,7 +260,6 @@ Markdeep >> tocStyle: anObject [
|
|||||||
|
|
||||||
{ #category : #'instance creation' }
|
{ #category : #'instance creation' }
|
||||||
Markdeep >> version [
|
Markdeep >> version [
|
||||||
| semVer |
|
self metadata at: 'version' ifPresent: [:value | ^ 'v',value ].
|
||||||
semVer := self metadata at: 'version' ifAbsent: [ ^'' ].
|
^ ''
|
||||||
^ 'v', semVer
|
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user