Skip to content

Restore the document metadata dropped when the pages were ported - #506

Open
slachiewicz wants to merge 1 commit into
apache:masterfrom
slachiewicz:restore-site-metadata-master
Open

Restore the document metadata dropped when the pages were ported#506
slachiewicz wants to merge 1 commit into
apache:masterfrom
slachiewicz:restore-site-metadata-master

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

The site pages lost their document metadata when they were ported from APT.

An APT document opens with a header block giving its title, authors and date, and
doxia-converter turns that into YAML front matter. The port dropped the front matter
along with the converter's per-line licence comments, so the generated pages lost their
<meta name="author"> and date, and took their <title> from the first heading instead
of from the document title.

Building one project's site from the APT sources and from the ported Markdown shows the
difference:

<title> produced
APT original Release Notes - Modello
ported Markdown Modello - Modello
with this change Release Notes - Modello

The front matter has to come first in the file, because the Markdown parser only looks
for it when the source begins with ---; a licence header ahead of it would hide it.
RAT is happy either way.

Verified by building the site before and after and comparing <title> and the author
meta tags of every generated page, and by confirming the front matter does not reach
the rendered body.

An APT document opens with a header block giving its title, authors and date, and
doxia-converter turns that into YAML front matter. The port removed the front
matter along with the converter's per-line licence comments, so the generated
pages lost their author and date meta tags, and took their title from the first
heading rather than from the document title.

The front matter has to come first in the file: the Markdown parser only looks for
it when the source begins with "---". A licence header ahead of it would hide it,
and RAT is happy either way.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant