diff --git a/content/search.md b/content/search.md index 6738487..6f09250 100644 --- a/content/search.md +++ b/content/search.md @@ -1,5 +1,6 @@ --- title: Search +linkTitle: 🔎 layout: search --- diff --git a/layouts/_default/search.html b/layouts/_default/search.html index a030428..7baedca 100644 --- a/layouts/_default/search.html +++ b/layouts/_default/search.html @@ -1,10 +1,15 @@ {{ partial "page_start.html" . }}
{{ partial "content.html" . }} +
+ +
- {{ $valid_pages := where (where .Site.Pages.ByTitle "Kind" "page") ".Parent" "!=" nil }} - {{ range $valid_pages }} + {{ $valid_pages := where .Site.Pages ".Parent" "!=" nil }} + {{ $valid_pages := where $valid_pages "Kind" "page" }} + {{ $valid_pages := where $valid_pages ".UniqueID" "!=" .UniqueID }} + {{ range (sort $valid_pages ".LinkTitle") }} {{ partial "box_image.html" . }} {{ end }}
diff --git a/static/src/js/index.js b/static/src/js/index.js index 3fe4a83..0a98bc9 100644 --- a/static/src/js/index.js +++ b/static/src/js/index.js @@ -9,6 +9,7 @@ require('club-alpha/assets/js/util'); require('lightgallery/dist/js/lightgallery'); require('lg-thumbnail/dist/lg-thumbnail'); require('./alpha/main'); +require('./search'); $('.image').each(function () { // setup div-image hybrids diff --git a/static/src/js/search.js b/static/src/js/search.js new file mode 100644 index 0000000..534fe1a --- /dev/null +++ b/static/src/js/search.js @@ -0,0 +1,16 @@ +$(document).ready(function(){ + var FADE_SETTINGS = { + duration: 400 + }; + + $("input#search").keyup(function() { + var filter = new RegExp($(this).val(), 'gi'); + $("div.search-results > div").each(function(){ + if ($(this).text().search(filter) === -1) { + $(this).fadeOut(FADE_SETTINGS); + } else { + $(this).fadeIn(FADE_SETTINGS); + } + }); + }); +}); diff --git a/static/src/scss/style.scss b/static/src/scss/style.scss index c7eac0a..e0b6d3f 100644 --- a/static/src/scss/style.scss +++ b/static/src/scss/style.scss @@ -178,3 +178,11 @@ nav { display: inline-block; padding: 0 2px; } + +.search-input-container { + margin: 20px 40px; + + input { + text-align: center; + } +}