Skip to content

Latest commit

 

History

History
114 lines (101 loc) · 3.85 KB

index.md

File metadata and controls

114 lines (101 loc) · 3.85 KB
layout title nav_order
minimal
Search
2
Year
Series
Topics
Software
<script src="assets/javascript/jquery.js"></script> <script src="assets/javascript/search-script.js" type="text/javascript"></script> <script> function getProperty(title, prop) { try { return json[title][prop]; } catch(e) { console.log("json not initialized"); } } var title = ""; var json = ""; var search = ""; $.getJSON('data.json', function(obj) { json = obj; $.getJSON('search.json', function(objj) { search = objj; var sjs = SimpleJekyllSearch({ searchInput: document.getElementById('search-inputt'), resultsContainer: document.getElementById('results-container'), json: search, noResultsText: 'No result found!', limit: 12, fuzzy: true, searchResultTemplate: '

{title}

{series} - {year}

', templateMiddleware: function(prop, value, template) { if(prop === 'title') { title = value; } if (prop === 'tags') { var strr = ""; function createHTMLTag(tag) { return `

${tag}

`;} function createTag(tag) { strr = strr.concat(" ", createHTMLTag(tag)); } value = value.split(", "); value.forEach(createTag); return strr; } if (prop === 'year') { var strr = ""; function createYear(year) { strr = strr.concat(year, ", "); } value = value.split(";"); value.forEach(createYear); return strr.slice(0, -2); } if (prop === 'url' || prop === 'year' || prop === 'series' || prop === 'image') { return getProperty(title, prop); } } }) }); }) </script>