diff options
| author | Shulhan <ms@kilabit.info> | 2020-11-24 03:10:40 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2020-11-24 03:10:40 +0700 |
| commit | d6d948319f596c4026e0ac7ce99758cc1e270ca3 (patch) | |
| tree | 7ab057bedfd3deea7059bb4a1a5996aab27e2525 /filehtml.go | |
| parent | 81d73b727ac9131183cf8ff42ed09e91ddf8484f (diff) | |
| download | ciigo-d6d948319f596c4026e0ac7ce99758cc1e270ca3.tar.xz | |
go.mod: update with latest asciidoctor-go
Changes,
ea961ec (HEAD -> main, origin/main) chore: increase the debug value to supress logs on DEBUG=1
6f33f2a README: change the format to markdown
d5502ca all: support all column style "a", "e", "h", "l", "m", "d", "s", "v"
f14e27f go.mod: update with latest share module
f1c0969 all: implement parser for table
4f24d95 all: support forcing line break by ending the line with " +\n"
18f26d6 all: change attributeClass from map to slice
43dfd5e all: support section "[discrete]" headings style
4a96e9e all: implement additional metadatas
aa9956d html_backend: check for meta "version-label" when generating footer
73255a6 all: support additional metadatas
02594b3 all: unpack the revision number, date, and remark into Revision
15ab720 all: add support for multiple authors with email
0d1a3e6 all: change the classes field from slice to map
d63f184 all: minimize number of short HTML templates
fa7fd13 all: add support for disable rendering title using "showtitle!"
7e3de28 all: add method ToEmbeddedHTML
1d89381 all: support meta "noheader"
e108779 all: parse the document subtitle
6429bf9 all: support setting document title through meta "doctitle"
842a827 all: fix linter warnings
3cbc0a0 all: minimize error checking by using bytes.Buffer
31c0a7d document_parser: remove unused return 'c'
ab98ae3 document_parser: minimize duplicate code when parsing paragraph
177f09b all: split between document and a document parser
54c1fa5 all: rewrite HTML backend template without text/template
Diffstat (limited to 'filehtml.go')
| -rw-r--r-- | filehtml.go | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/filehtml.go b/filehtml.go index 51afca0..9b975a3 100644 --- a/filehtml.go +++ b/filehtml.go @@ -72,16 +72,18 @@ func (fhtml *fileHTML) unpackMarkup(fa *fileMarkup) { func (fhtml *fileHTML) unpackAdocMetadata(doc *asciidoctor.Document) { fhtml.Metadata = make(map[string]string) - fhtml.Date = doc.LastUpdated - fhtml.Title = doc.Title - fhtml.Author = doc.Author + if len(doc.Revision.Date) > 0 { + fhtml.Date = doc.Revision.Date + } else { + fhtml.Date = doc.LastUpdated + } + fhtml.Title = doc.Title.String() + if len(doc.Authors) > 0 { + fhtml.Author = doc.Authors[0].FullName() + } for k, v := range doc.Attributes { switch k { - case metadataAuthor: - fhtml.Author = v - case metadataDate: - fhtml.Date = v case metadataStylesheet: fhtml.Styles = append(fhtml.Styles, v) default: |
