Page 1 of 1

How to generate <meta name="description" content="..."> in HTML output?

Posted: Mon Jun 11, 2018 6:15 pm
by roza
Hello,

We are using the <shortdesc> element in our DITA documentation. Hoping to have it output as the contents of description in meta. What should I do? Where is this controlled in the XSLT files? We are using the Classic version, with some skin and custom modifications.

Currently, the <shortdesc> element outputs as <p> at the top of the topic. I am not opposed to this behavior, but also want it in <meta>.

Thank you.

Re: How to generate <meta name="description" content="..."> in HTML output?

Posted: Tue Jun 12, 2018 12:12 pm
by Costin
Hi roza,

The short description from the topics should be already present also in the meta information from the HTML files resulted as output for each of the corresponding topics, by default.
To double check this, you should try open from the output the HTML file corresponding to the specific topic that contains a short description in oXygen and you should be able to find the short description text content in one of the <meta/> elements inside the file.

Best Regards,
Costin

Re: How to generate <meta name="description" content="..."> in HTML output?

Posted: Wed Jun 13, 2018 7:52 pm
by roza
Thank you for replying. However, this is not happening.

It is unfortunate, but I hope you can help me resolve it by indicating which processing file controls this output.

Here is the topic content (start):

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="analytical-views" xml:lang="en">
<title>Analytical Views</title>
<shortdesc>Understanding and implementing analytical views.</shortdesc>
<body>
....
</body>
</topic>

Here is the html output:

Code: Select all

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="">
<meta name="copyright" content="(C) Copyright 2018"> \
<meta name="DC.rights.owner" content="(C) Copyright 2018">
<title>Analytical Views</title>

<!-- Generated with Oxygen version 18.1, build number 2017020917. --
....
</head>

Re: How to generate <meta name="description" content="..."> in HTML output?

Posted: Thu Jun 14, 2018 11:25 am
by Costin
Hi roza,

I tested this behavior with both 18.1 and 20.0 versions of oXygen, but could not reproduce the reported issue.
As the short description is added in the meta information by the DITA OT, could you check if you are using an external/custom DITA OT?

In case you are publishing your output from oXygen (applying the predefined DITA Map WebHelp Classic transformation scenario from the list of availble scenarios), you can see what DITA OT you are using, by going into the oXygen menu Options > Preferences > DITA. There you can see what DITA Open Toolkit are you using. Is it Built-in DITA-OT 1.8, Built-in DITA-OT 2.x, or a custom DITA OT?

In case you are using a custom DITA OT, could you please try using the built-in DITA-OT 2.x that oXygen comes bundled with and see if it works?
Also, as the WebHelp transformations are based on XHTML, could you also try applying the DITA Map XHTML trasnformation scenario and see if the description content is present in the meta information from <head>?

Regards,
Costin

Re: How to generate <meta name="description" content="..."> in HTML output?

Posted: Fri Jun 15, 2018 7:28 pm
by roza
We are using custom on top of classic. Please let me know WHICH FILE in classic controls this behavior so I can get this resolved. I really need to know where this is handled.

Re: How to generate <meta name="description" content="..."> in HTML output?

Posted: Fri Jun 15, 2018 8:36 pm
by roza
Costin, we have too many customizations to go back. Please tell me what transformation file I need to check within classic build.