asciidoctor / asciidoctor-maven-plugin

A Maven plugin that uses Asciidoctor via JRuby to process AsciiDoc source files within the project.
http://asciidoctor.org
Apache License 2.0
317 stars 122 forks source link

Integration with Maven Site Plugin: document title is not set #739

Open raoulvdberge opened 8 months ago

raoulvdberge commented 8 months ago

Thank you for taking your time to talk with us!

What is this issue about?

Description

I have Asciidoc documents that I'm loading into a Maven site.

However, the HTML page title is always empty, in the form of "site name - ". It seems to ignore the document title.

How can I make it use the document title?

This is my maven config:

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.12.1</version>
                <configuration>
                    <generateReports>false</generateReports>
                    <generateSitemap>true</generateSitemap>
                    <relativizeDecorationLinks>false</relativizeDecorationLinks>
                    <locales>en</locales>
                    <inputEncoding>UTF-8</inputEncoding>
                    <outputEncoding>UTF-8</outputEncoding>
                    <asciidoc>
                        <attributes>
                            <source-highlighter>coderay</source-highlighter>
                            <coderay-css>style</coderay-css>
                        </attributes>
                    </asciidoc>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctor-maven-plugin</artifactId>
                        <version>2.2.4</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

Environment information

abelsromero commented 8 months ago

Not sure I understand, each document title should appear on the page as seen in the examples

image

On top of that, there's the site title, which comes from the pom's project name.

abelsromero commented 8 months ago

Btw, I was planning to release v3.0.0 soon-ish :tm: and that provides a new maven-site module that offers a better out of the box experience with fluido, no need to add custom CSS. If that's your goal maybe you want to give it a try? You'll find that several elements are not correctly displayed in the current module because the HTML (elements, clasess, etc.) don't match the default fluido CSS styles.

raoulvdberge commented 8 months ago

Hi, sorry, typed this issue out when my brain was quite fried 😁

I meant the html page title, between the <title> tags. It doesn't seem to put the asciidoc document title there.

abelsromero commented 8 months ago

I meant the html page title, between the <title> tags. It doesn't seem to put the asciidoc document title there.

The module embeds the page without headers. The the menu/toc, top section and meta are handled by maven-site, not asciidoctor. The interface does not provide a way to customize meta, but it's something we could discuss with the maven team.

abelsromero commented 8 months ago

It seems something similar was discussed some time ago but went stale https://issues.apache.org/jira/browse/DOXIA-471?jql=project%20%3D%20%22Maven%20Doxia%22%20AND%20text%20~%20title. Before re-opening it'd be good to do some extra research, maven-site team is working on a new major, so it's the time to propose breaking changes.