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

roza
Posts: 2

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

Mon Jun 11, 2018 6:15 pm

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: 345

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

Tue Jun 12, 2018 12:12 pm

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: 2

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

Wed Jun 13, 2018 7:52 pm

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: 345

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

Thu Jun 14, 2018 11:25 am

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

Return to “DITA (Editing and Publishing DITA Content)”

Who is online

Users browsing this forum: No registered users and 1 guest