Add search and links to it.

This commit is contained in:
Danila Fedorin 2021-02-22 17:21:27 -08:00
parent ca939da28e
commit 77ae0be899
4 changed files with 33 additions and 0 deletions

14
content/search.md Normal file
View File

@ -0,0 +1,14 @@
---
title: Search
type: "search"
description: Interactive search for posts on Daniel's personal site.
---
Here's a [Stork](https://github.com/jameslittle230/stork)-powered search for all articles on
this site. Stork takes some time to load on slower devices, which is why this isn't on
every page (or even on the index page). Because the LaTeX rendering occurs _after_
the search indexing, you may see raw LaTeX code in the content of the presented
articles, like `\beta`. This does, however, also mean that you can search for mathematical
symbols using only the English alphabet!
If you're just browsing, you could alternatively check out [all posts](/blog), or perhaps my [favorite articles](/favorites) from this blog.

BIN
static/index.st Normal file

Binary file not shown.

View File

@ -8,6 +8,8 @@
<a href="https://github.com/DanilaFe">GitHub</a> <a href="https://github.com/DanilaFe">GitHub</a>
<a href="/Resume-Danila-Fedorin.pdf">Resume</a> <a href="/Resume-Danila-Fedorin.pdf">Resume</a>
<a href="/tags">Tags</a> <a href="/tags">Tags</a>
<a href="/favorites">Favorites</a>
<a href="/search">Search</a>
<a href="/blog">All Posts</a> <a href="/blog">All Posts</a>
</div> </div>
</nav> </nav>

View File

@ -0,0 +1,17 @@
{{ define "main" }}
<h2>{{ .Title }} </h2>
{{ .Content }}
{{ $search := resources.Get "scss/search.scss" | resources.ToCSS | resources.Minify }}
<link rel="stylesheet" href="{{ $search.Permalink }}" media="screen">
<div class="stork-wrapper">
<div class="stork-input-wrapper">
<input class="stork-input" data-stork="blog" placeholder="Search (requires JavaScript)"/>
</div>
<div class="stork-output" data-stork="blog-output"></div>
</div>
<script src="https://files.stork-search.net/stork.js"></script>
<script>stork.register("blog", "/index.st", {"showProgress" : false});</script>
{{ end }}