incorporate search into website
This commit is contained in:
parent
702cd0201c
commit
1c4fe877f5
5 changed files with 414 additions and 0 deletions
1
layouts/_default/index.json
Normal file
1
layouts/_default/index.json
Normal file
|
@ -0,0 +1 @@
|
|||
{{- $.Scratch.Add "index" slice -}} {{- range .Site.RegularPages -}} {{- $.Scratch.Add "index" (dict "date" (.PublishDate.Format "01-12-2006") "title" .Title "tags" .Params.tags "section" (index .Params.categories 0) "desc" .Plain "summary" (printf "%s..." (substr (.Summary | plainify) 0 90)) "permalink" .Permalink) -}} {{- end -}} {{- $.Scratch.Get "index" | jsonify -}}
|
|
@ -3,8 +3,68 @@
|
|||
<head>
|
||||
<style>
|
||||
code { padding: 2px 4px; font-size: 90%; border-radius: 4px; background-color: #1c1c1d; }
|
||||
|
||||
.searchprompt {
|
||||
color: #4b4b4b;
|
||||
font-size: 12px;
|
||||
margin-left: 42em;
|
||||
position: absolute;
|
||||
top:24px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#fastSearch {
|
||||
visibility: hidden;
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
top: 70px;
|
||||
display: inline-block;
|
||||
width: 340px;
|
||||
}
|
||||
|
||||
#fastSearch input {
|
||||
border-radius: 8px;
|
||||
padding: 8px 10px;
|
||||
width: 100%;
|
||||
margin-left: -2em;
|
||||
height: 20px;
|
||||
font-size: 1.4em;
|
||||
font-family: "FiraMono";
|
||||
color: #f3f8f8;
|
||||
font-weight: bold;
|
||||
background-color: #1e1f20;
|
||||
border: none;
|
||||
outline: none;
|
||||
text-align: left;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#searchResults li {
|
||||
border-radius: 8px;
|
||||
list-style: none;
|
||||
width: 350px;
|
||||
padding: 6px 6px 6px 6px;
|
||||
margin-left: -5.3em;
|
||||
color: #f3f8f8;
|
||||
background-color: #1e1f20;
|
||||
margin-top: 8px;
|
||||
font-family: "OpenSans";
|
||||
|
||||
if (isPlatformAltOrCmdKey(event) && event.key === '/') {
|
||||
}
|
||||
#searchResults li .title { font-size: 1.1em; margin-bottom: 10px; display: inline-block;}
|
||||
|
||||
#searchResults { visibility: inherit; display: inline-block; width: 320px; }
|
||||
#searchResults a { text-decoration: none !important; padding: 10px; display: inline-block; }
|
||||
#searchResults a:hover, a:focus { outline: 0; background-color: #666; color: #f3f8f8; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
<div id="fastSearch">
|
||||
<input id="searchInput" tabindex="0">
|
||||
<ul id="searchResults">
|
||||
</ul>
|
||||
</div>
|
||||
<script src="/js/fastsearch.js"></script>
|
||||
</html>
|
||||
|
|
23
layouts/partials/header.html
Normal file
23
layouts/partials/header.html
Normal file
|
@ -0,0 +1,23 @@
|
|||
<header class="headerWrapper">
|
||||
<div class="header">
|
||||
<div>
|
||||
<a class="terminal" href="{{ .Site.BaseURL | relLangURL }}">
|
||||
<span>{{ .Site.Params.user }}@{{ .Site.Params.hostname }} ~ $</span>
|
||||
</a>
|
||||
</div>
|
||||
<input class="side-menu" type="checkbox" id="side-menu">
|
||||
<label class="hamb" for="side-menu"><span class="hamb-line"></span></label>
|
||||
<p><span class="searchprompt">Buscar: Presiona Meta (tecla Win) + /</span></p>
|
||||
<nav class="headerLinks">
|
||||
<ul>
|
||||
{{ range .Site.Menus.header }}
|
||||
<li>
|
||||
<a href="{{ .URL | absLangURL }}" title="{{ .Title }}" >
|
||||
~/{{- .Name -}}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
Loading…
Add table
Add a link
Reference in a new issue