| Shawn Pearce | 374f184 | 2015-02-10 15:36:54 -0800 | [diff] [blame] | 1 | // Copyright 2015 Google Inc. All Rights Reserved. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | {namespace gitiles autoescape="strict"} |
| 15 | |
| 16 | /** |
| 17 | * Documentation page rendered from markdown. |
| 18 | * |
| Shawn Pearce | 99cdbce | 2015-02-10 12:05:45 -0800 | [diff] [blame] | 19 | * @param? siteTitle h1 title from navbar.md. |
| 20 | * @param pageTitle h1 title from specific page. |
| 21 | * @param? logoUrl url of image logo. |
| 22 | * @param? homeUrl url to jump to top of site. |
| Shawn Pearce | bc381a4 | 2015-06-22 12:17:43 -0700 | [diff] [blame^] | 23 | * @param? analyticsId Google Analytics Property ID. |
| Shawn Pearce | 374f184 | 2015-02-10 15:36:54 -0800 | [diff] [blame] | 24 | * @param sourceUrl url for source view of the page. |
| 25 | * @param logUrl url for log history of page. |
| 26 | * @param blameUrl url for blame of page source. |
| 27 | * @param? navbarHtml markdown ast node to convert. |
| 28 | * @param bodyHtml safe html to embed into the body of the page. |
| 29 | */ |
| 30 | {template .markdownDoc} |
| 31 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
| Shawn Pearce | a3e0e28 | 2015-02-12 13:57:54 -0800 | [diff] [blame] | 32 | <html class="doc-page"> |
| Shawn Pearce | 374f184 | 2015-02-10 15:36:54 -0800 | [diff] [blame] | 33 | <head> |
| Shawn Pearce | 99cdbce | 2015-02-10 12:05:45 -0800 | [diff] [blame] | 34 | <title> |
| 35 | {if $siteTitle}{$siteTitle} -{sp}{/if} |
| 36 | {$pageTitle} |
| 37 | </title> |
| Shawn Pearce | 374f184 | 2015-02-10 15:36:54 -0800 | [diff] [blame] | 38 | <link rel="stylesheet" type="text/css" href="{gitiles.DOC_CSS_URL}" /> |
| 39 | </head> |
| 40 | <body> |
| Shawn Pearce | 99cdbce | 2015-02-10 12:05:45 -0800 | [diff] [blame] | 41 | {if $siteTitle} |
| 42 | <div class="banner" role="banner"> |
| 43 | <div class="nav-aux"> |
| 44 | <h1> |
| 45 | {if $homeUrl}<a href="{$homeUrl}">{/if} |
| 46 | {if $logoUrl}<img src="{$logoUrl}" alt="project logo" />{/if} |
| 47 | {$siteTitle} |
| 48 | {if $homeUrl}</a>{/if} |
| 49 | </h1> |
| 50 | <h2>{$pageTitle}</h2> |
| 51 | </div> |
| 52 | </div> |
| 53 | {/if} |
| Shawn Pearce | 374f184 | 2015-02-10 15:36:54 -0800 | [diff] [blame] | 54 | {if $navbarHtml} |
| 55 | <div class="nav" role="navigation"> |
| 56 | <div class="nav-aux"> |
| 57 | {$navbarHtml} |
| 58 | </div> |
| 59 | </div> |
| 60 | {/if} |
| Shawn Pearce | a3e0e28 | 2015-02-12 13:57:54 -0800 | [diff] [blame] | 61 | <div class="doc"> |
| Shawn Pearce | 374f184 | 2015-02-10 15:36:54 -0800 | [diff] [blame] | 62 | {$bodyHtml} |
| 63 | </div> |
| 64 | <div class="footer-break"></div> |
| 65 | <div class="footer-line"> |
| 66 | <div class="nav-aux"> |
| 67 | <ul> |
| Shawn Pearce | 68311c7 | 2015-06-09 17:01:34 -0700 | [diff] [blame] | 68 | {if $sourceUrl}<li><a href="{$sourceUrl}">{msg desc="text for the source link"}source{/msg}</a></li>{/if} |
| 69 | {if $logUrl}<li><a href="{$logUrl}">{msg desc="text for the log link"}log{/msg}</a></li>{/if} |
| 70 | {if $blameUrl}<li><a href="{$blameUrl}">{msg desc="text for the blame link"}blame{/msg}</a></li>{/if} |
| Shawn Pearce | 374f184 | 2015-02-10 15:36:54 -0800 | [diff] [blame] | 71 | </ul> |
| 72 | <div class="gitiles-att"> |
| 73 | Powered by <a href="https://code.google.com/p/gitiles/">Gitiles</a> |
| 74 | </div> |
| 75 | </div> |
| 76 | </div> |
| Shawn Pearce | bc381a4 | 2015-06-22 12:17:43 -0700 | [diff] [blame^] | 77 | {if $analyticsId} |
| 78 | /* From https://developers.google.com/analytics/devguides/collection/analyticsjs/ */ |
| 79 | <script> |
| 80 | (function(i,s,o,g,r,a,m){lb}i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){lb} |
| 81 | (i[r].q=i[r].q||[]).push(arguments){rb},i[r].l=1*new Date();a=s.createElement(o), |
| 82 | m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) |
| 83 | {rb})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); |
| 84 | |
| 85 | ga('create', '{$analyticsId}', 'auto'); |
| 86 | ga('send', 'pageview', {lb}title: '{$pageTitle}'{rb}); |
| 87 | </script> |
| 88 | {/if} |
| Shawn Pearce | 374f184 | 2015-02-10 15:36:54 -0800 | [diff] [blame] | 89 | </body> |
| 90 | </html> |
| 91 | {/template} |