%
var
aTopicList: THndTopicsInfoArray;
var
sDefaultTopicId: string;
var
nCurTopic, nHeaderKind, nFooterKind: integer;
var
sTopicHeader, sTopicFooter, sTopicContent: string;
var
sTocContent: string;
var
sSitemapData: string;
var
isNextDefaultTheIndex, isGeneratingIndex: Boolean;
var
isDefaultSearchDataProcessed, doAddSearchDataForThisTopic: Boolean;
// Generate the CSS for the whole project
procedure GenerateContentCss();
var
sCssContent: string;
begin
HndGeneratorInfo.CurrentFile := 'css\hnd.content.css';
sCssContent := HndProjects.GetProjectCssContent();
sCssContent := StringReplace(sCssContent, 'body, table,', '.main-content, .main-content table', [rfIgnoreCase]);
print(sCssContent);
end;
// Generate the search data
procedure GenerateSearchData();
begin
HndGeneratorInfo.CurrentFile := 'js\hndsd.min.js';
print(HndJsSearchEngine.GetJsData());
// Clear the search engine
HndJsSearchEngine.ClearSearchData();
end;
// Return the topic extension, starting with a dot
function GetTopicExtension: string;
begin
Result := Trim(HndGeneratorInfo.TemplateInfo.TopicExtension);
if ((Length(Result) > 0) and (Result[1] <> '.')) then
Result := '.' + Result;
end;
procedure SitemapAdd(sUrl: string; bIsHome: Boolean = False);
var
sPriority, sChangeFreq, sBaseUrl: string;
begin
// Do we need to generate it ?
if not HndGeneratorInfo.GetCustomSettingValue('SitemapGenerate') then
Exit;
// Set the properties
if (bIsHome) then
begin
sChangeFreq := HndGeneratorInfo.GetCustomSettingValue('SitemapChangeFreqHome');
sPriority := HndGeneratorInfo.GetCustomSettingValue('SitemapPriorityHome');
end
else begin
sChangeFreq := HndGeneratorInfo.GetCustomSettingValue('SitemapChangeFreqOther');
sPriority := HndGeneratorInfo.GetCustomSettingValue('SitemapPriorityOther');
end;
// Update the URL
sBaseUrl := HndGeneratorInfo.GetCustomSettingValue('SitemapBaseUrl');
if Length(sBaseUrl) > 0 then
begin
if sBaseUrl[Length(sBaseUrl)] <> '/' then
sBaseUrl := sBaseUrl + '/';
end;
sUrl := sBaseUrl + sUrl;
// Add the entry
sSitemapData := sSitemapData + Format('%s%s%s%s', [sUrl, FormatDateTime('yyyy-mm-dd', Now), sChangeFreq, sPriority]);
end;
// Generate the sitemap
procedure SitemapGenerate();
begin
// Do we need to generate it ?
if not HndGeneratorInfo.GetCustomSettingValue('SitemapGenerate') then
Exit;
// Add the home URL
SitemapAdd('', True);
// Generate the file
HndGeneratorInfo.CurrentFile := 'sitemap.xml';
print('');
print(sSitemapData);
print('');
end;
function GetCustomCss: string;
begin
Result := HndGeneratorInfo.GetCustomSettingValue('CustomCss');
if (Result <> '') then
Result := '';
end;
function GetCustomJs: string;
begin
Result := HndGeneratorInfo.GetCustomSettingValue('CustomJs');
if (Result <> '') then
Result := 'try{' + #13#10 + Result + #13#10 + '}catch(e){console.warn("Exception in custom JavaScript Code:", e);}';
end;
function GetHtmlParamValue(Value: string): string;
begin
// Replace double quotes
Result := StringReplace(Value, '"', '"', [rfReplaceAll]);
end;
// Returns the footer
function GetTemplateHtmlFooter: string;
begin
Result := HndGeneratorInfo.GetCustomSettingValue('Footer');
end;
// Returns the icon
function GetIconAsHtml: string;
var
aLogoId: string;
aLogoUrl: string;
aLogoLink: string;
aLogoAlt: string;
aLogoContent: TMemoryStream;
aLogoExtension: string;
begin
aLogoId := HndGeneratorInfo.GetCustomSettingValue('Logo');
aLogoUrl := HndGeneratorInfo.GetCustomSettingValue('LogoUrl');
aLogoLink := HndGeneratorInfo.GetCustomSettingValue('LogoLink');
aLogoAlt := GetHtmlParamValue(HndGeneratorInfo.GetCustomSettingValue('LogoAlt'));
if (aLogoAlt = '') then aLogoAlt := 'logo';
// Using URL
if aLogoUrl <> '' then
begin
// Return HTML
Result := Format('', [aLogoUrl, aLogoAlt]);
end
// Using library item
else if aLogoId <> '' then
begin
aLogoContent := HndLibraryItems.GetItemContent(aLogoId);
aLogoExtension := HndLibraryItems.GetItemExtension(aLogoId);
if Assigned(aLogoContent) then
try
if (aLogoContent.Size > 0) then
begin
// Save logo
aLogoContent.SaveToFile(ExtractFilePath(HndGeneratorInfo.OutputFile) + '_logo.' + aLogoExtension);
// Return HTML
Result := Format('', [aLogoExtension, aLogoAlt]);
end;
finally
aLogoContent.Free;
end;
end;
// Add the link
if (Result <> '') and (aLogoLink <> '') then
Result := '' + Result + '';
end;
// Returns the theme CSS
function GetThemeAsHtml: string;
var
aThemeName: string;
begin
aThemeName := LowerCase(HndGeneratorInfo.GetCustomSettingValue('Theme'));
Result := Format('', [aThemeName]);
end;
// Returns HTML/CSS to customize the width of the Toc
function GetTocWidthAsHtml: string;
var
aSize: integer;
begin
Result := '';
// Get value
aSize := StrToIntDef(HndGeneratorInfo.GetCustomSettingValue('TocWidth'), 0);
// Check panels visibility
if (not HndGeneratorInfo.GetCustomSettingValue('TocShow')) and (not HndGeneratorInfo.GetCustomSettingValue('TocKeywordsShow')) and (not HndGeneratorInfo.GetCustomSettingValue('TocSearchShow')) then
aSize := 0;
// Return style content
if (aSize > 0) then
begin
Result := Format('', [aSize, aSize, aSize + 14]);
end
// Hide left panel
else begin
Result := '';
end;
end;
// Returns HTML/CSS to customize the width of the inline toc
function GetInlineTocWidthAsHtml: string;
begin
Result := '';
// Get value
var aWidth := HndGeneratorInfo.GetCustomSettingValue('InlineTocWitdh');
if (aWidth <> '') then
Result := Format('', [aWidth]);
end;
// Returns HTML/CSS to display the splitter
function GetSplitterAsHtml: string;
var
aSize: integer;
begin
Result := '';
// Show the splitter?
if (not HndGeneratorInfo.GetCustomSettingValue('ShowSplitter')) then
Exit;
// Get value
aSize := StrToIntDef(HndGeneratorInfo.GetCustomSettingValue('TocWidth'), 0);
// Return content
if (aSize > 0) then
begin
Result := Format('
', [aSize]);
end;
end;
// Returns the description of the topic
function GetTopicDescription: string;
begin
// Get value
Result := HndTopics.GetTopicDescription(HndGeneratorInfo.CurrentTopic);
// Empty ? Use project's description instead
if (Result = '') then Result := HndProjects.GetProjectSummary;
end;
// Returns a list of keywords
function GetTopicKeywordsAsHtml: string;
var
aTopicKeywords: array of string;
nCurKeyword: integer;
begin
Result := '';
aTopicKeywords := HndTopicsKeywords.GetKeywordsAssociatedWithTopic(HndGeneratorInfo.CurrentTopic);
for nCurKeyword := 0 to High(aTopicKeywords) do
begin
if nCurKeyword > 0 then Result := Result + ',';
Result := Result + HTMLEncode(HndKeywords.GetKeywordCaption(aTopicKeywords[nCurKeyword]));
end;
end;
// Returns the formatted breadcrumb for the current topic
function GetTopicBreadCrumbAsHtml: string;
var
aBreadCrumb: array of string;
sRelativeTopic: string;
nCurParent, nCurTopicKind: Integer;
begin
Result := '';
// Create the breadcrumb
aBreadCrumb.SetLength(0);
if HndGeneratorInfo.GetCustomSettingValue('ShowBreadCrumbs') then
begin
sRelativeTopic := HndTopics.GetTopicParent(HndGeneratorInfo.CurrentTopic);
while (sRelativeTopic <> '') and (sRelativeTopic <> HndTopics.GetProjectTopic()) do
begin
aBreadCrumb.SetLength(Length(aBreadCrumb) + 1);
aBreadCrumb[Length(aBreadCrumb) - 1] := sRelativeTopic;
sRelativeTopic := HndTopics.GetTopicParent(sRelativeTopic);
end;
end;
// Return it if any
if (Length(aBreadCrumb) > 0) then
begin
for nCurParent := Length(aBreadCrumb) - 1 downto 0 do
begin
// Get topic kind
nCurTopicKind := HndTopics.GetTopicKind(aBreadCrumb[nCurParent]);
// Empty topic
if (nCurTopicKind = 1) then
begin
Result := Result + format('
%s
', [HTMLEncode(HndTopics.GetTopicCaption(aBreadCrumb[nCurParent]))]);
end
// URL topic
else if (nCurTopicKind = 2) then
begin
Result := Result + format('
', [HndTopics.GetTopicUrlLink(aBreadCrumb[nCurParent]), HTMLEncode(HndTopics.GetTopicCaption(aBreadCrumb[nCurParent]))]);
end
// Normal topic
else begin
Result := Result + format('
', [HndTopics.GetTopicHelpId(aBreadCrumb[nCurParent]), GetTopicExtension(), HTMLEncode(HndTopics.GetTopicCaption(aBreadCrumb[nCurParent]))]);
end;
end;
end;
end;
// Returns the inline table of contents and navigation arrows for the current topic
function GetTopicNavArrowsAsHtml: string;
var
aRelativeTopic: string;
begin
Result := '';
if HndGeneratorInfo.GetCustomSettingValue('ShowInlineToc') then
begin
Result := Result + '
';
Result := Result + Format('', [HndGeneratorInfo.GetCustomSettingValue('TranslationInlineToc')]);
Result := Result + '
';
Result := Result + '
';
end;
if HndGeneratorInfo.GetCustomSettingValue('ShowNavigation') then
begin
// Parent
aRelativeTopic := HndTopics.GetTopicParent(HndGeneratorInfo.CurrentTopic);
if (aRelativeTopic <> '') and (aRelativeTopic <> HndTopics.GetProjectTopic())
and (HndTopics.GetTopicKind(aRelativeTopic) <> 1) // Skip blank topics
then
begin
Result := Result + Format(
'',
[
HndTopics.GetTopicHelpId(aRelativeTopic),
GetTopicExtension(),
HTMLEncode(HndTopics.GetTopicCaption(aRelativeTopic))
]
);
end;
// Previous
aRelativeTopic := HndTopicsEx.GetTopicPreviousGenerated(HndGeneratorInfo.CurrentTopic, True);
while (HndTopics.GetTopicKind(aRelativeTopic) = 1) do // Skip blank topics
aRelativeTopic := HndTopicsEx.GetTopicPreviousGenerated(aRelativeTopic, True);
if (aRelativeTopic <> '') and (aRelativeTopic <> HndTopics.GetProjectTopic()) then
begin
Result := Result + Format(
'',
[
HndTopics.GetTopicHelpId(aRelativeTopic),
GetTopicExtension(),
HTMLEncode(HndTopics.GetTopicCaption(aRelativeTopic))
]
);
end;
// Next
aRelativeTopic := HndTopicsEx.GetTopicNextGenerated(HndGeneratorInfo.CurrentTopic, True);
while (HndTopics.GetTopicKind(aRelativeTopic) = 1) do // Skip blank topics
aRelativeTopic := HndTopicsEx.GetTopicNextGenerated(aRelativeTopic, True);
if (aRelativeTopic <> '') and (aRelativeTopic <> HndTopics.GetProjectTopic()) then
begin
Result := Result + Format(
'',
[
HndTopics.GetTopicHelpId(aRelativeTopic),
GetTopicExtension(),
HTMLEncode(HndTopics.GetTopicCaption(aRelativeTopic))
]
);
end;
end;
// Wrap the content in a group
if Result <> '' then
Result := '
' + Result + '
';
end;
// Returns the table of contents
function GetTocAsHtml(): string;
var
aTocTopicList: THndTopicsInfoArray;
nBlocLevel, nDif, nClose: Integer;
nCurTopic, nCurTopicLevel, nCurTopicChildrenCnt: Integer;
nCurTopicIcon: Integer;
sTopicUrl, sTopicData: string;
begin
Result := '
';
nBlocLevel := 0;
try
aTocTopicList := HndTopicsEx.GetTopicListGenerated(True, False);
for nCurTopic := 0 to length(aTocTopicList) - 1 do
begin
HndGeneratorInfo.CurrentTopic := aTocTopicList[nCurTopic].id;
nCurTopicLevel := HndTopics.GetTopicLevel(HndGeneratorInfo.CurrentTopic);
nCurTopicChildrenCnt := HndTopicsEx.GetTopicDirectChildrenCountGenerated(HndGeneratorInfo.CurrentTopic, True);
nCurTopicIcon := HndTopics.GetTopicIconIndex(HndGeneratorInfo.CurrentTopic);
// Topic URL
if aTocTopicList[nCurTopic].Kind = 2 then sTopicUrl := HndTopics.GetTopicUrlLink(HndGeneratorInfo.CurrentTopic) // Link to URL
else if aTocTopicList[nCurTopic].Kind = 1 then sTopicUrl := '#" onclick="return false;' // Empty
else sTopicUrl := format('%s%s', [aTocTopicList[nCurTopic].HelpId, GetTopicExtension()]); // Normal topic
// Close the previous topics
if ((nCurTopic > 0) and (nCurTopicLevel < HndTopics.GetTopicLevel(aTocTopicList[nCurTopic - 1].id))) then
begin
nDif := HndTopics.GetTopicLevel(aTocTopicList[nCurTopic - 1].id) - nCurTopicLevel;
for nClose := 0 to nDif - 1 do
begin
Result := Result + '
';
nBlocLevel := nBlocLevel - 1;
end;
end;
// Topic data
if nCurTopicIcon > -1 then sTopicData := 'data-jstree=''{"icon": "icon-' + IntToStr(nCurTopicIcon) + '"}'''
else sTopicData := '';
Result := Result + format('
', [aTocTopicList[nCurTopic].HelpId, sTopicData]);
Result := Result + format('%s', [sTopicUrl, HTMLEncode(aTocTopicList[nCurTopic].caption)]);
if (nCurTopicChildrenCnt > 0) then
begin
Result := Result + '
';
nBlocLevel := nBlocLevel + 1;
end
else begin
Result := Result + '
';
end;
// Close the last topic
if (HndTopicsEx.GetTopicNextGenerated(HndGeneratorInfo.CurrentTopic, True) = '') then
begin
while nBlocLevel > 0 do
begin
Result := Result + '';
nBlocLevel := nBlocLevel - 1;
end;
end;
end;
finally
Result := Result + '';
end;
end;
// Returns the keywords
function GetKeywordsAsHtml(): string;
var
aKeywordList: THndKeywordsInfoArray;
aAssociatedTopics: array of string;
nBlocLevel, nDif, nClose, nCurKeywordLevel, nCurKeywordChildrenCnt: Integer;
nCurKeyword, nCurKeywordTopic: Integer;
sCurrentKeyword, sKeywordLink, sKeywordRelated: string;
sKeywordJsCaption: string;
begin
Result := '
';
nBlocLevel := 0;
try
aKeywordList := HndKeywords.GetKeywordList(False);
for nCurKeyword := 0 to length(aKeywordList) - 1 do
begin
sCurrentKeyword := aKeywordList[nCurKeyword].id;
nCurKeywordLevel := HndKeywords.GetKeywordLevel(sCurrentKeyword);
nCurKeywordChildrenCnt := HndKeywords.GetKeywordDirectChildrenCount(sCurrentKeyword);
sKeywordLink := '#';
sKeywordRelated := '[]';
aAssociatedTopics := HndTopicsKeywordsEx.GetGeneratedTopicsAssociatedWithKeyword(sCurrentKeyword);
if Length(aAssociatedTopics) > 0 then
begin
sKeywordLink := format('%s%s', [HndTopics.GetTopicHelpId(aAssociatedTopics[0]), GetTopicExtension()]);
if Length(aAssociatedTopics) > 1 then
begin
sKeywordRelated := '[';
for nCurKeywordTopic := 0 to Length(aAssociatedTopics) - 1 do
begin
if nCurKeywordTopic > 0 then
sKeywordRelated := sKeywordRelated + ',';
// Escape caption
sKeywordJsCaption := StringReplace(HndTopics.GetTopicCaption(aAssociatedTopics[nCurKeywordTopic]), '\', '\\', [rfReplaceAll]);
sKeywordJsCaption := StringReplace(sKeywordJsCaption, '"', '\"', [rfReplaceAll]);
sKeywordJsCaption := StringReplace(sKeywordJsCaption, '''', ''', [rfReplaceAll]);
// Format it
sKeywordRelated := sKeywordRelated + format('{"title":"%s","url":"%s%s"}', [sKeywordJsCaption, HndTopics.GetTopicHelpId(aAssociatedTopics[nCurKeywordTopic]), GetTopicExtension()]);
end;
sKeywordRelated := sKeywordRelated + ']';
end;
end;
// Close the previous keywords
if ((nCurKeyword > 0) and (nCurKeywordLevel < HndKeywords.GetKeywordLevel(aKeywordList[nCurKeyword - 1].id))) then
begin
nDif := HndKeywords.GetKeywordLevel(aKeywordList[nCurKeyword - 1].id) - nCurKeywordLevel;
for nClose := 0 to nDif - 1 do
begin
Result := Result + '
';
nBlocLevel := nBlocLevel - 1;
end;
end;
Result := Result + '
';
Result := Result + format('%s', [sKeywordLink, sKeywordRelated, aKeywordList[nCurKeyword].caption]);
if (nCurKeywordChildrenCnt > 0) then
begin
Result := Result + '
';
nBlocLevel := nBlocLevel + 1;
end
else begin
Result := Result + '
';
end;
// Close the last keyword
if (HndKeywords.GetKeywordNext(sCurrentKeyword) = '') then
begin
while nBlocLevel > 0 do
begin
Result := Result + '';
nBlocLevel := nBlocLevel - 1;
end;
end;
end;
finally
Result := Result + '';
end;
end;
// Returns the header of the current topic
function GetTopicHeaderAsHtml(): string;
begin
Result := '';
// Only return if not hidden
if (nHeaderKind <> 2) then
begin
Result := format('
%s
', [HTMLEncode(sTopicHeader)])
end;
end;
// Returns the footer of the current topic
function GetTopicFooterAsHtml(): string;
begin
Result := '';
// Only return if not hidden
if (nFooterKind <> 2) then
begin
Result := format('', [HTMLEncode(sTopicFooter)])
end;
end;
// Adds the default topic as the home page
function AddDefaultTopic(var aList: THndTopicsInfoArray): string;
var
nLength: integer;
begin
Result := HndProjects.GetProjectDefaultTopic();
// Try to get the default topic
Result := HndProjects.GetProjectDefaultTopic();
// None defined: the first one is the default topic
if (Result = '') then
Result := HndTopicsEx.GetTopicNextGenerated(HndTopics.GetProjectTopic(), False);
if (Result <> '') then
begin
// Add the default topic another time
nLength := Length(aList);
aList.SetLength(nLength + 1);
aList[nLength].Id := Result;
aList[nLength].Caption := HndTopics.GetTopicCaption(Result);
aList[nLength].HelpId := HndTopics.GetTopicHelpId(Result);
aList[nLength].HelpContext := HndTopics.GetTopicHelpContext(Result);
aList[nLength].Kind := HndTopics.GetTopicKind(Result);
aList[nLength].Visibility := HndTopics.GetTopicVisibility(Result);
end;
end;
// Returns the google analytics code
function GetGoogleAnalyticsCode(): string;
var
sId: string;
begin
Result := '';
// Get the analytics Id
sId := HndGeneratorInfo.GetCustomSettingValue('GoogleAnalyticsId');
if (sId <> '') then
begin
Result := Format(
''
+ ''
+ '',
[sId, sId]
);
end;
end;
// Returns the Google Tag Manager code
function GetGoogleTagManagerCode(isHead: Boolean): string;
var
sId: string;
begin
Result := '';
// Get the Google Tag Manager Id
sId := HndGeneratorInfo.GetCustomSettingValue('GoogleTagManagerId');
if (sId <> '') then
begin
if (isHead) then
Result := Format(
'' + #13#10
+ '' + #13#10
+ '',
[sId]
)
else
Result := Format(
'' + #13#10
+ '' + #13#10
+ '',
[sId]
)
end;
end;
begin
// Init
isDefaultSearchDataProcessed := False;
isNextDefaultTheIndex := False;
// No need BOM for UTF8 files
HndGeneratorInfo.BOMOutput := False;
// Output global CSS content.
GenerateContentCss();
// Clear search data
HndJsSearchEngine.ClearSearchData();
// Get the content of the Toc. /!\ Must be done here as it updates current topic
sTocContent := GetTocAsHtml();
// Get a list of generated topics
aTopicList := HndTopicsEx.GetTopicListGenerated(False, False);
// Trick to add the default topic as the home page
sDefaultTopicId := AddDefaultTopic(aTopicList);
// Each individual topics...
for nCurTopic := 0 to length(aTopicList) - 1 do
begin
// Init
isGeneratingIndex := False;
// Notify about the topic being generated
HndGeneratorInfo.CurrentTopic := aTopicList[nCurTopic].id;
// Topic kind
if (aTopicList[nCurTopic].Kind = 1) then continue; // Empty topic: do not generate anything
// Setup the file name
if (HndGeneratorInfo.CurrentTopic <> sDefaultTopicId) then
begin
HndGeneratorInfo.CurrentFile := aTopicList[nCurTopic].HelpId + GetTopicExtension();
end
// Special handle for default topic
else begin
// We will generate the index next time
if not isNextDefaultTheIndex then
begin
// Next time we see the default topic, it will be the index
isNextDefaultTheIndex := True;
// Use the default convention
HndGeneratorInfo.CurrentFile := aTopicList[nCurTopic].HelpId + GetTopicExtension();
end
// We generate the index now
else begin
// We are generating the index
isGeneratingIndex := True;
// Use the file chosen by the user
HndGeneratorInfo.CurrentFile := ExtractFileName(HndGeneratorInfo.OutputFile);
end;
end;
// XML sitemap
SitemapAdd(HndGeneratorInfo.CurrentFile, False);
// Topic header
nHeaderKind := HndTopics.GetTopicHeaderKind(HndGeneratorInfo.CurrentTopic);
sTopicHeader := '';
if (nHeaderKind <> 2) then
sTopicHeader := HndTopics.GetTopicHeaderTextCalculated(HndGeneratorInfo.CurrentTopic);
// Topic footer
nFooterKind := HndTopics.GetTopicFooterKind(HndGeneratorInfo.CurrentTopic);
sTopicFooter := '';
if (nFooterKind <> 2) then
sTopicFooter := HndTopics.GetTopicFooterTextCalculated(HndGeneratorInfo.CurrentTopic);
// Topic content
sTopicContent := HndTopics.GetTopicContentAsHtml(HndGeneratorInfo.CurrentTopic);
// Do we add search data for this topic ?
doAddSearchDataForThisTopic :=
(HndGeneratorInfo.CurrentTopic <> sDefaultTopicId)
or ((HndGeneratorInfo.CurrentTopic = sDefaultTopicId) and (not isDefaultSearchDataProcessed));
// Add Search data
if doAddSearchDataForThisTopic then
begin
HndJsSearchEngine.AddSearchData(
sTopicHeader,
HndGeneratorInfo.CurrentTopic,
HndGeneratorInfo.GetCustomSettingValue('SearchEngineMinChars')
);
HndJsSearchEngine.AddSearchData(
HndUtils.HtmlToText(sTopicContent),
HndGeneratorInfo.CurrentTopic,
HndGeneratorInfo.GetCustomSettingValue('SearchEngineMinChars')
);
HndJsSearchEngine.AddSearchData(
sTopicFooter,
HndGeneratorInfo.CurrentTopic,
HndGeneratorInfo.GetCustomSettingValue('SearchEngineMinChars')
);
end;
// Search data already processed for default topic
if (HndGeneratorInfo.CurrentTopic = sDefaultTopicId) then
isDefaultSearchDataProcessed := True;
%>
<% print(HTMLEncode(HndTopics.GetTopicCaption(HndGeneratorInfo.CurrentTopic))); %>
<%
// Redirect for URL and Files topic
if (aTopicList[nCurTopic].Kind = 2) then
begin
printf('', [HndTopics.GetTopicUrlLink(HndGeneratorInfo.CurrentTopic)]);
end
else begin
%>
<% print(GetGoogleTagManagerCode(True)); %>
<% print(GetGoogleAnalyticsCode()); %>
<% print(GetThemeAsHtml()); %>
<% print(GetTocWidthAsHtml()); %>
<% print(GetInlineTocWidthAsHtml()); %>
<% print(GetCustomCss()); %>
<%
end; // Redirection for URL and Files topics
%>
<%
// Redirect for URL and Files topic
if (aTopicList[nCurTopic].Kind = 2) then
begin
printf('Redirecting... click here if nothing happens', [HndTopics.GetTopicUrlLink(HndGeneratorInfo.CurrentTopic)]);
end
else begin
%>
<% print(GetGoogleTagManagerCode(False)); %>
<% if (HndGeneratorInfo.GetCustomSettingValue('ShowBreadCrumbs') or HndGeneratorInfo.GetCustomSettingValue('ShowNavigation') or HndGeneratorInfo.GetCustomSettingValue('ShowInlineToc')) then begin %>
<% print(GetTopicBreadCrumbAsHtml()); %>
<% print(GetTopicNavArrowsAsHtml()); %>
<% end; %>
<% print(GetTopicHeaderAsHtml()); %>
<% print(sTopicContent); %>
<% print(GetTopicFooterAsHtml()); %>
<% print(GetSplitterAsHtml()); %>
<%
end; // Redirecting
%>
<%
end; // For each topic
// Output JS Search engine data
GenerateSearchData();
// Output Sitemap
SitemapGenerate();
end.
%>