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

Post here questions and problems related to editing and publishing DITA content.
roza
Posts: 4
Joined: Sat Jun 09, 2018 3:02 am

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

Post 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.
Costin
Posts: 833
Joined: Mon Dec 05, 2011 6:04 pm

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

Post 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
Costin Sandoi
oXygen XML Editor and Author Support
roza
Posts: 4
Joined: Sat Jun 09, 2018 3:02 am

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

Post 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>
Costin
Posts: 833
Joined: Mon Dec 05, 2011 6:04 pm

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

Post 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
Costin Sandoi
oXygen XML Editor and Author Support
roza
Posts: 4
Joined: Sat Jun 09, 2018 3:02 am

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

Post 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.
roza
Posts: 4
Joined: Sat Jun 09, 2018 3:02 am

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

Post by roza »

Costin, we have too many customizations to go back. Please tell me what transformation file I need to check within classic build.
Post Reply