/* * [CoHome.java] * * Summary: Produce the header for the Home page for Cherokee O'Bama. * * Copyright: (c) 2004-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 1.8 2009-02-06 include go package in ZIP bundle. */ package com.mindprod.htmlmacros.macro; import com.mindprod.fastcat.FastCat; import com.mindprod.htmlmacros.support.GoogleAdSense; import com.mindprod.htmlmacros.support.Indexing; import static com.mindprod.entities.DeEntifyStrings.stripHTMLTags; import static com.mindprod.htmlmacros.macro.Global.configuration; import static java.lang.System.*; /** * Produce the header for the Home page for Cherokee O'Bama. * * @author Roedy Green, Canadian Mind Products * @version 1.8 2009-02-06 include go package in ZIP bundle. * @since 2004 */ public final class CoHome extends Head { // declarations /** * how to use the macro */ private static final String USAGE = "\nCoHome macro takes no parameters"; // /declarations // methods /** * build a simplified header used by kindle * * @param title title to display * @param description long description, (might contain entities and tags). not null. for head meta Description. * @param keywords indexing keywords. * @param icon16 for title bar * * @return HTML for header and simplified title. */ private String buildKindleHead( final String title, final String shortTitle, final String description, final String keywords, final String icon16 ) { final int firstCopyrightYear = configuration.getFirstCopyrightYear( fileBeingDistributed ); final String copyrightHolderForPage = configuration.getCopyrightHolderForPage( fileBeingDistributed ); final FastCat sb = new FastCat( 6 ); // header sb.append( configuration.getDoctypeDefault( fileBeingDistributed ) ); sb.append( buildInvisHead( stripHTMLTags( title ), stripHTMLTags( shortTitle ), stripHTMLTags( description ), keywords, icon16, firstCopyrightYear, copyrightHolderForPage ) ); /* includeMainStylesheet */ /* includeJDisplayStylesheet */ /* isHomePage */ /* includeCarolStylesheet */ /* prevRelLink */ /* nextRelLink */ // append body, TOP anchor, CONFIG sb.append( "

" ); sb.append( title ); sb.append( "

\n" ); return sb.toString(); } // /method /** * Generate the header for a Home page. * * @param parms parameters from macro command line. parms[0] = title description of fragment. parms[1] * = description parms[2] = keywords parms[3] = icon16 png icon for title bar, usually * icon16/xxx.png parms[4] = image for essay parms[5] = optional menu, * LOCAL_WEBROOT_WITH_BACKSLASHES relative * @param quiet true if want output suppressed. * @param verbose @return expanded macro HTML */ public String expandMacro( String[] parms, final boolean quiet, final boolean verbose ) { if ( !quiet ) { out.print( "H" ); } if ( parms.length != 0 ) { throw new IllegalArgumentException( USAGE ); } final String title = "

Dreaming Gods of Gaia" + configuration.getBr() + "cherokeeobama.com

"; final String description = "Cherokee O’Bama home page"; final String keywords = "Cherokee O'bama, Dreaming Gods of Gaia, online novel, science fiction, witchcraft"; final String icon16 = "icon16/co.png"; final String topLeftOfPageImage = "logo/co.png"; if ( configuration.isKindle() ) { return buildKindleHead( "Dreaming Gods Of Gaia", "Dreaming Gods", description, keywords, icon16 ); } else { return generalHead( title, null, description, title, "titlehome", keywords, icon16, null, topLeftOfPageImage, null, null, null, null, null, null, null, null, null, null, Indexing.NONE, GoogleAdSense.MEDIUM_RECTANGLE, null, null ); } } // /method // /methods }