<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE section [
<!ENTITY % BOOK_ENTITIES SYSTEM "Users_Guide.ent">
%BOOK_ENTITIES;
<!ENTITY % sgml.features "IGNORE">
<!ENTITY % xml.features "INCLUDE">
<!ENTITY % DOCBOOK_ENTS PUBLIC "-//OASIS//ENTITIES DocBook Character Entities V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/dbcentx.mod">
%DOCBOOK_ENTS;
]>
<section conformance="232" version="5.0" xml:id="sect-Publican-Users_Guide-Creating_the_website_structure-rpm" xml:lang="de-DE" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
	<info xml:id="info-Publican-Users_Guide-Creating_the_website_structure">
		<title>Creating the website structure</title>

	</info>
	 <warning>
		<info xml:id="info-Publican-Users_Guide-Warning_This_procedure_replaces_files">
			<title>Warning — This procedure replaces files</title>

		</info>
		 <para>
			When you create the website structure, <application>Publican</application> places files in the <filename>/var/www/html/docs</filename> directory. Existing files in this directory might be overwritten by this procedure.
		</para>

	</warning>
	 <para>
		Perform the following steps on your webserver.
	</para>
	 <procedure>
		<step>
			<para>
				Log into the webserver.
			</para>

		</step>
		 <step>
			<para>
				Install <application>Publican</application> and its web components package. For example, on a webserver with a Fedora operating system, run:
			</para>
			 
<screen><prompt>$</prompt> <command>sudo yum install publican publican-common-web</command></screen>

		</step>
		 <step>
			<para>
				With root privileges, edit the <filename>/etc/publican-website.cfg</filename> file to specify the name of the site, the web host, and optionally, search parameters, default language, dump file settings, and web style for the site:
			</para>
			 <substeps>
				<step>
					<para>
						Specify the title with the <parameter>title</parameter> parameter, for example:
					</para>
					 
<programlisting>title: "Foomaster Documentation"</programlisting>
					 <para>
						Normally, visitors to your website do not see this title because the site's JavaScript redirects them to a homepage. However, this title is likely to be found and indexed by search engines.
					</para>

				</step>
				 <step>
					<para>
						Specify the web host with the <parameter>host</parameter> parameter as a full URL, including the protocol (for example, <literal>http://</literal>). For example:
					</para>
					 
<programlisting>host: http://docs.example.com</programlisting>
					 <para>
						<application>Publican</application> uses the value set for <parameter>host</parameter> to construct the URLs in the XML <filename>Sitemap</filename> that it creates for search engine crawlers, and to limit searches submitted through the search box in the navigation menu to results on your site only.
					</para>

				</step>
				 <step>
					<para>
						Optionally, construct a search engine query to use with the search box in the navigation menu and specify the entire content of a HTML <tag>&lt;form&gt;</tag> with the <parameter>search</parameter> parameter. If you do not specify a custom web search, <application>Publican</application> creates a Google search limited to the host that you specified in the <parameter>host</parameter> parameter.
					</para>
					 <para>
						For example, to construct a Yahoo! search limited to <literal>docs.example.com</literal>, set:
					</para>
					 
<programlisting language="HTML">search: '&lt;form target="_top" method="get" action="http://search.yahoo.com/search"&gt; &lt;div class="search"&gt; &lt;input type="text" name="p" value="" /&gt; &lt;input type="hidden" name="vs" value="docs.example.com" /&gt; &lt;input type="submit" value="###Search###" /&gt; &lt;/div&gt; &lt;/form&gt;'</programlisting>
					 <para>
						Refer to the documentation of your chosen search engine for details of how to construct custom searches.
					</para>
					 <para>
						If you set <literal>value="###Search###"</literal> in the code for a submit button, <application>Publican</application> uses the word <literal>Search</literal> on the button, localized into any language that <application>Publican</application> supports.
					</para>
					 <important>
						<info xml:id="info-Publican-Users_Guide-Important_the_search_parameter_is_not_validated">
							<title>Important — the search parameter is not validated</title>

						</info>
						 <para>
							<application>Publican</application> does not validate the <parameter>search</parameter> parameter, but builds the value of this parameter into the navigation menu exactly as you specify it. Be especially careful when you use this feature.
						</para>

					</important>

				</step>
				 <step>
					<para>
						Optionally, set the default language of the website. <application>Publican</application> creates a separate, translatable navigation menu for each language in which you publish documentation. However, if a document is not available in a particular language, <application>Publican</application> links visitors to the untranslated version of that document. To specify the default, untranslated language for the site, set <parameter>def_lang</parameter> with a language code. For example:
					</para>
					 
<programlisting>def_lang: fr-FR</programlisting>
					 <para>
						With <parameter>def_lang</parameter> set to <literal>fr-FR</literal>, visitors viewing the navigation menu in (for example) Spanish are presented with a link to the original French version of the document if the document has not yet been translated into Spanish.
					</para>

				</step>
				 <step>
					<para>
						Optionally, configure a <firstterm>dump file</firstterm> for the website. <application>Publican</application> can output an XML file that provides complete site content details for delivery of other services, such as web feeds or customised search pages. The file is updated whenever a book is installed or removed from the site, or the <prompt>$</prompt> <command>publican update_site</command> command is run. Configure the <parameter>dump</parameter>, <parameter>dump_file</parameter>, and <parameter>zip_dump</parameter> parameters as follows:
					</para>
					 <variablelist>
						<varlistentry>
							<term><parameter>dump</parameter></term>
							 <listitem>
								<para>
									Set <literal>dump: 1</literal> to enable the dump file function. This parameter defaults to <literal>0</literal> (off).
								</para>

							</listitem>

						</varlistentry>
						 <varlistentry>
							<term><parameter>dump_file</parameter></term>
							 <listitem>
								<para>
									Set <literal>dump_file: <replaceable>name</replaceable></literal> to specify the name of the dump file and the directory in which <application>Publican</application> stores it. This parameter defaults to <literal>/var/www/html/DUMP.xml</literal>.
								</para>

							</listitem>

						</varlistentry>
						 <varlistentry>
							<term><parameter>zip_dump</parameter></term>
							 <listitem>
								<para>
									Set <literal>zip_dump: 1</literal> to specify that <application>Publican</application> should create a zipped version of the XML file together with the XML version. This parameter defaults to <literal>0</literal> (off).
								</para>

							</listitem>

						</varlistentry>

					</variablelist>
					 <para>
						Refer to <xref linkend="appe-Publican-Users_Guide-Contents_of_the_website_dump_file" /> for a description of the contents of the dump file.
					</para>

				</step>
				 <step>
					<para>
						Optionally, specify the web style with the <parameter>web_style</parameter>.
					</para>
					 <variablelist>
						<varlistentry>
							<term>web_style: 1</term>
							 <listitem>
								<para>
									The website resembles those produced by Publican 2, with a list of products displayed in a navigation pane at the left of the page. (Default)
								</para>

							</listitem>

						</varlistentry>
						 <varlistentry>
							<term>web_style: 2</term>
							 <listitem>
								<para>
									The website includes a breadcrumb-like navigation bar across the top of the documentation.
								</para>

							</listitem>

						</varlistentry>

					</variablelist>
					 <important>
						<para>
							The web style set for your site must match the web style set for your content. For example, if you set <literal>web_style: 2</literal> for your website, you need to have <literal>web_style: 2</literal> set in each of the books that you want to install on the site. Consider setting this parameter in the <filename>defaults.cfg</filename> or <filename>overrides.cfg</filename> files of the brands that you intend to use with this site.
						</para>

					</important>

				</step>
				 <step>
					<para>
						Optionally, specify that the site tables of contents will be updated manually with the <parameter>manual_toc_update</parameter> parameter, for example:
					</para>
					 
<programlisting>manual_toc_update: 1</programlisting>
					 <para>
						Normally, <application>Publican</application> updates the site's tables of contents every time a documentation package is added or removed. On a site with a large number of documents on it (more than a few hundred), or where documents are updated very frequently (dozens of updates per week), this process is very demanding on a server. On a large or busy site, we recommend that you set this parameter and then periodically update the tables of contents with the <prompt>$</prompt> <command>publican update_site</command> command.
					</para>

				</step>
				 <step>
					<para>
						Optionally, override the default JavaScript for the site with the <parameter>toc_js</parameter> parameter, for example:
					</para>
					 
<programlisting>toc_js: "mybrand/scripts/megafoo.js"</programlisting>
					 <para>
						This file will be symlinked as <parameter>toc_path</parameter>/toc.js with the <prompt>$</prompt> <command>publican update_site</command> command. This path should be relative to the <parameter>toc_path</parameter> parameter.
					</para>

				</step>

			</substeps>

		</step>
		 <step>
			<para>
				Create an empty file named <filename>site_overrides.css</filename>. If you want to use site-specific styles to override those provided by <filename>interactive.css</filename>, you can add a <filename>site_overrides.css</filename> to the document that provides the site <firstterm>home page</firstterm> — refer to <xref linkend="sect-Publican-Users_Guide-Creating_installing_and_updating_the_home_page" />. If you do not want to use site-specific styles, the empty file you add here will prevent 404 errors on your server. On a Linux system, run:
			</para>
			 
<screen><prompt>#</prompt> <command>touch /var/www/html/docs/site_overrides.css</command></screen>

		</step>

	</procedure>
	 <para>
		To make <application>Publican</application> refresh the site structure at any time, run:
	</para>
	 
<screen><prompt>$</prompt> <command>publican update_site</command></screen>
</section>

