[ 
https://issues.apache.org/jira/browse/SOLR-10670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16006593#comment-16006593
 ] 

Cassandra Targett commented on SOLR-10670:
------------------------------------------

I figured out a way to make it all work the way we want...

First, {{index.adoc}} is going to have to be a "special" page, with some 
special rules. Hopefully comments in the right places will make it clear to all 
of us in the future what's going on.

I set two new attributes to {{index.adoc}} at the top:
* I removed the {{= Apache Solr Reference Guide}} at the top and replaced it 
with {{:doctitle: Home}}. This sets the document title to Home but it will get 
treated different by the asciidoc preprocessor (see this issue for how I got 
the idea: https://github.com/asciidoctor/asciidoctor-pdf/issues/95). This is 
totally valid syntax, so doesn't cause either Jekyll or asciidoc-pdf to 
complain.
* I added a new attribute {{:page-displayname: Apache Solr Reference Guide}}

Next I added a conditional statement to {{index.adoc}} as follows:

{code}
ifdef::backend-pdf[:notitle:]
ifdef::backend-pdf[]
= {page-displaytitle}
endif::[]
{code}

That says, if it's a PDF, don't set the document title (that {{:doctitle: 
attribute}}). Instead, use the page-displaytitle attribute ("Apache Solr 
Reference Guide"). In the PDF that's generated, the user doesn't see "Home" - 
only "Apache Solr Reference Guide" in TOC and page title. We could call this 
something else if desired. 

For the HTML page, if we set the page title to "Home" with something like {{= 
Home}}, then the first thing the user would see at the top of the page is 
"Home", which is bad. So I added a conditional to {{page.html}} where that 
title is set to use the page-displaytitle instead:

{code}
<div class="post-header">
   {% if page.title == "Home" %}
   <h1 class="post-title-main">{{ page.displaytitle }}</h1>
   {% else %}
   <h1 class="post-title-main">{{ page.title }}</h1>
   {% endif %}
</div>
{code}

Now what happens is that the HTML page is generated with metadata that defines 
{{Home | Apache Solr Reference Guide}} as the title, but displays "Apache Solr 
Reference Guide" on the page.

This all seems to work fine - nothing complains during build. I'll attach a 
patch so you can see it for yourself.

> [ref-guide] Various top-bar fixes
> ---------------------------------
>
>                 Key: SOLR-10670
>                 URL: https://issues.apache.org/jira/browse/SOLR-10670
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: documentation
>            Reporter: Jan Høydahl
>              Labels: asciidoc, html
>             Fix For: 6.6
>
>         Attachments: SOLR-10670.patch
>
>
> A few suggestions for the new ref-guide HTML format:
> * Favicon is not displayed, image missing in folder
> * Topnav link to community should point to 
> http://lucene.apache.org/solr/community.html
> * Replace "Solr News" link with a "Solr Website" link - we should link to the 
> website
> * Instead of pointint the Source Code link to cryptic apache GIT, point to 
> https://lucene.apache.org/solr/community.html#version-control where people 
> get more context and can also find the GitHub link



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to