github.com/xiaq/elvish@v0.12.0/website/src/template.html (about) 1 <!doctype html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 6 {{ if is "homepage" }} 7 <link rel="alternate" type="application/atom+xml" 8 href="{{ rootURL }}/feed.atom"> 9 {{ end }} 10 11 <title> 12 {{ if is "homepage" }} 13 {{ .BlogTitle }} 14 {{ else if is "category" }} 15 {{ index .CategoryMap .Category }} 16 {{ else }} 17 {{ .Title }} 18 {{ end }} 19 </title> 20 21 <!-- Generated by realfavicongenerator.net --> 22 <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"> 23 <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"> 24 <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"> 25 <link rel="manifest" href="/manifest.json"> 26 <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#55bb55"> 27 <meta name="theme-color" content="#ffffff"> 28 29 <link href="/assets/genblog.css" rel="stylesheet"> 30 <link href="/assets/elvish.css" rel="stylesheet"> 31 </head> 32 33 <body> 34 <div id="navbar-container"> <div id="navbar"> 35 <div id="blog-title"> 36 <code> 37 <a href="/">~></a> 38 <a href="/download" class="command">elvish</a> 39 </code> 40 </div> 41 <ul id="category-list"> 42 {{ $homepageTitle := .HomepageTitle }} 43 {{ $curcat := .Category }} 44 <li class="{{ if eq $curcat "homepage" }}current{{ end }}"> 45 <a href="{{ rootURL }}" class="nav-link"> 46 {{ $homepageTitle }} 47 </a> 48 </li> 49 {{ range $info := .Categories }} 50 <li class="{{ if eq $curcat $info.Name}}current{{ end }}"> 51 <a href="{{ rootURL }}/{{ $info.Name }}/" class="nav-link"> 52 {{ $info.Title }} 53 </a> 54 </li> 55 {{ end }} 56 </ul> 57 <div class="clear"></div> 58 </div> </div> 59 60 {{/* 61 The reference to "content" is a free one and has to be fixed elsewhere. 62 The *-content templates defined below are intended to be used for this. 63 64 For instance, by adding the following code, this whole template file will 65 function as the template for articles: 66 67 {{ define "content" }} {{ template "article-content" . }} {{ end }} 68 69 This snippet can be generated by contentIs("article"). 70 */}} 71 {{ template "content" . }} 72 </body> 73 </html> 74 75 {{ define "article-content" }} 76 <div class="card"> 77 <article class="article"> 78 {{ if not .IsHomepage }} 79 <div class="article-header"> 80 <div class="timestamp"> {{ .Timestamp }} </div> 81 <h1> {{ .Title }} </h1> 82 <div class="clear"></div> 83 </div> 84 <div class="card-splitter"></div> 85 {{ end }} 86 <div class="article-content"> 87 {{ .Content }} 88 </div> 89 <div class="clear"></div> 90 </article> 91 </div> 92 {{ end }} 93 94 {{ define "category-content" }} 95 {{ $category := .Category }} 96 <div class="card"> 97 {{ if ne .Prelude "" }} 98 <div class="category-prelude article"> 99 <article class="article"> 100 {{ .Prelude }} 101 </article> 102 </div> 103 {{ end }} 104 <ul class="article-list"> 105 {{ range $article := .Articles }} 106 <li> 107 <a href="{{ rootURL }}/{{ $category }}/{{ $article.Name }}.html" 108 class="nav-link">{{ $article.Title }}</a> 109 <span class="article-timestamp"> 110 {{ $article.Timestamp }} 111 </span> 112 <div class="clear"></div> 113 </li> 114 {{ end }} 115 </ul> 116 </div> 117 {{ end }}