lunrjs is a client side search system that is perfectly suited for Jekyll and other static site systems.
Setting it up in Jekyll without any plugins (so it works on Github Pages) isn’t that hard only needs a couple of extra files and some Javascript. You can see the commit used to add lunr to this site here.
First off I needed a JSON file with all the data I want to make searchable in, I created /content.json
which is generated by this:
{
"2024-11-keeping-profiles-under-control": {
"title": "Keeping profiles under control with a remdiation.",
"url": "/2024/11/keeping-profiles-under-control",
"summary": "We had a persistent problem in school with computers having low disk space. This issue came from the local user profiles and was a constantly building issue as the number of profiles on each computer would just keep growing. With software like [Teams installing in AppData](https://superuser.com/questions/1634322/where-is-microsoft-teams-application-located-on-my-windows-10-computer#:~:text=If%20Microsoft%20Teams%20is%20actually%20installed%20then%20it%27s,location%20then%20Microsoft%20Teams%20is%20not%20actually%20installed.) local user profiles are..."
},
"2024-10-net-doc": {
"title": "Net-Doc",
"url": "/2024/10/net-doc",
"summary": "For the past 8 months I've been working on a documentation system for us to store everything we might need on our network. Especially given that _"network"_ in a secondary school means everything from the Hyper-V cluster down to the access control units for the motorised gates at the front..."
},
"2024-06-back-to-jekyll": {
"title": "Back to Jekyll",
"url": "/2024/06/back-to-jekyll",
"summary": "So after a few years bouncing around [Gatsby](/2018/12/moving-to-gatsby), [NextJS](http://localhost:4000/2021/02/next.js), and even [Remix](https://remix.run/) I've made my way back to [Jekyll](https://jekyllrb.com/).It might seem odd that a developer who works mainly in JavaScript and TypeScript would go with Jekyll/Ruby over a jaunt back to Gatsby. Personally I do use Jekyll for documentation sites..."
},
"2022-07-papercut-client-deployment-with-intune": {
"title": "Papercut Client deployment with Intune",
"url": "/2022/07/papercut-client-deployment-with-intune",
"summary": "Papercut have a ["handy" guide](https://www.papercut.com/kb/Main/DeployUserClientwithMS-Intune) on how to deploy the client using Intune on their site which I thought was going to be the end of this. However there are 2 fatal flaws with their approach.1. It deploys in the user's context so if they aren't a local admin on..."
},
"2022-03-windows-update-for-business": {
"title": "Windows Update for Business",
"url": "/2022/03/windows-update-for-business",
"summary": "I've been working with WSUS for years and over the last couple its become extremely apparent that without continual maintenance it can become un-managable. If I have to click *reset server node* one more time...For a while now Microsoft has been talking about [Windows Update for Business](https://docs.microsoft.com/en-us/windows/deployment/update/waas-manage-updates-wufb) which isn't exactly..."
},
"2021-06-improving-nextjs-file-performance": {
"title": "Improving Next.JS File Performance",
"url": "/2021/06/improving-nextjs-file-performance",
"summary": "One thing static site generators can lure us into is not caring about buildperformance. If code works and the build passes quickly enough, it getsoverlooked.I was building a new Code Component and, having to wait a minute for everyrefresh was making the feedback loop extremely slow. Couple that with having..."
},
"2021-06-adsync-missing": {
"title": "ADSync Service Missing on Server",
"url": "/2021/06/adsync-missing",
"summary": "I came into one of my schools to find this message in Office365.![ADSync Error](/assets/2021/06/adsync-missing/error.png)_Strange_.Jumped onto the server and tried to open the _Syncronization Service_ and no,_Service ADSync was not found_.Opening services showed that there was no service with the ID _ADSync_. A quick`sc start ADSync` agreeed, that service did not..."
},
"2021-04-images-with-mdx-bundler": {
"title": "Images with MDX-Bundler",
"url": "/2021/04/images-with-mdx-bundler",
"summary": "mdx-bundler 3.4.0 has just been released! This new version improves on anawesome feature of 3.3.0 which allows you to set the current working directoryof the build. With this you can require modules directly and co-locate yourimages within the same directory as the post!This cuts down on your overheads and means..."
},
"2021-03-mdx-bundler": {
"title": "MDX Bundler with Next.JS",
"url": "/2021/03/mdx-bundler",
"summary": "I've been using [mdx](/2020/03/moving-to-mdx) on this site for a little while now and with my move to [Next.JS](/2021/02/next.js) I went with [next-mdx-remote](https://github.com/hashicorp/next-mdx-remote) to compile it. I felt that next-mdx-remote just wasn't quite what I was after. It forced me to do some _odd_ things to get components into MDX and,..."
},
"2021-02-next-js": {
"title": "Next.JS",
"url": "/2021/02/next.js",
"summary": "I've seen some anti-Gatsby sentiment bubbling around recently. I normally ignore articles like this when they come along. It seems like every few weeks there is an article telling me I should abandon [React](https://reactjs.org/) for [Vue](https://vuejs.org/), then that Vue is dead long live [Svelte](https://svelte.dev/), and a few weeks later another..."
},
"2021-01-creating-a-wds-discover-image": {
"title": "Creating a WDS Discover Image",
"url": "/2021/01/creating-a-wds-discover-image",
"summary": "The DfE (Department for Education) has decided that the best laptop for pupils to use for remote learning is a [GeoBook 1e](https://geo-computers.com/geobook-1e/) and I know what you're thinking a Celeron and 64GB SSD! Kids today are spoiled!Joking aside this device has one big issue for us, no network port, which..."
},
"2020-08-utils-library": {
"title": "Write a Utils Library",
"url": "/2020/08/utils-library",
"summary": "If you [follow me on GitHub](https://github.com/Arcath) you may have seen that one of the repositories that I commit to on a semi regular basis is [Arcath/utils](https://github.com/Arcath/utils). This isn't the only thing I work on but it is the only bit of at-work code that enters the public domain.Now you might..."
},
"2020-07-wallpaper-generation-on-a-domain": {
"title": "Wallpaper Generation on a Domain",
"url": "/2020/07/wallpaper-generation-on-a-domain",
"summary": "I've been spending a bit of time recently thinking about wallpapers and lock screens for domain computers. For a long time I've used a static image for the computer's lock screen and then [BGInfo](https://docs.microsoft.com/en-us/sysinternals/downloads/bginfo) for the user's wallpaper. The problem is that, at least in my experience, BGInfo seems to..."
},
"2020-03-moving-to-mdx": {
"title": "Moving to MDX",
"url": "/2020/03/moving-to-mdx",
"summary": "[MDX](https://mdxjs.com/) if you haven't heard of it is an amazing merging between markdown and jsx. It allows you to import and use React components in your markdown, this makes for some amazing posts like [this one](https://kentcdodds.com/blog/avoid-the-test-user) by Kent C. Dodds.I want to add it here so I was going to..."
},
"2020-02-css-grid-layout": {
"title": "CSS Grid Layout",
"url": "/2020/02/css-grid-layout",
"summary": "I've been doing a fair bit of reading on CSS Grid recently and I'm conviced its magic.I've re-styled this site to use a grid layout which has almost completely removed the need for breakpoints.The main article layout came from [Dave Geddes' article](https://gedd.ski/post/article-grid-layout/) although I have put my own spin on..."
},
"2020-02-deploying-swiggle-screen-cover": {
"title": "Deploying Swiggle Screen Cover",
"url": "/2020/02/deploying-swiggle-screen-cover",
"summary": "> This is a follow on to my article on [setting Swiggle as the default search provider in chrome](/2019/10/setting-swiggle-as-the-default-search-provider-for-chrome).Swiggle Screen Cover is an extension for Chrome that gives pupils a button to cover the website. Teachers can then view a report to see which site they covered and report it..."
},
"2019-11-destructuring-in-javascript": {
"title": "Destructuring in JavaScript",
"url": "/2019/11/destructuring-in-javascript",
"summary": "Destructuring allows you to assign values to variables in a quick shorthand instead of having multiple lines. I use it pretty much every day but I can't remember a time when I actually learned anything about it, it just kind of appeared in my code and I've used it ever..."
},
"2019-10-setting-swiggle-as-the-default-search-provider-for-chrome": {
"title": "Setting Swiggle as the default search provider for Chrome",
"url": "/2019/10/setting-swiggle-as-the-default-search-provider-for-chrome",
"summary": "[Swiggle](https://swiggle.org.uk/) is a child friendly search engine developed by [SWGfl](https://swgfl.org.uk) that has come up in a few of the schools I work in.The request is normally to change the homepage, or change the homepages search box to a Swiggle box but that doesn't feel like enough to me. Chrome's omnibox..."
},
"2019-05-using-htmr-to-bring-life-to-links-in-gatsby": {
"title": "Using HTMR to bring life to links in Gatsby",
"url": "/2019/05/using-htmr-to-bring-life-to-links-in-gatsby",
"summary": "One of the amazing things about Gatsby is that your site is a full blown React app. Because of this it's always bugged me that whilst the navigation within _app_ is extremely fast anything I link to from my markdown triggers a full request for the page.This happens because the..."
},
"2019-04-dark-mode": {
"title": "Dark Mode",
"url": "/2019/04/dark-mode",
"summary": "I've redesigned my site! If you followed me back when I used Jekyll this was a regular occurance and something that using a static site generator makes so easy.There has been a trend of late of adding a _dark mode_ to sites. From what I can see there are 2..."
},
"2019-03-using-wix-to-create-an-msi": {
"title": "Using WIX to create an MSI",
"url": "/2019/03/using-wix-to-create-an-msi",
"summary": "I've had the odd rant on twitter before about companies that aim software at education and then provide no MSI to deploy it. I'm not going to repeat that rant here but suffice to say [Scratch 3](https://scratch.mit.edu/download) has followed [Scratch 2](https://scratch.mit.edu/download/scratch2)'s example of only giving us an exe.Scratch 3 is..."
},
"2019-02-wp-camo": {
"title": "WP-Camo",
"url": "/2019/02/wp-camo",
"summary": "WP-Camo is a WordPress plugin I wrote for [Ed-IT Solutions](https://www.ed-itsolutions.com). It was designed to fix 2 issues we had with the WordPress sites that we where building.## Mixed Content ErrorsWe use HTTPS for all the sites that we host. This gives us all the security and privacy of HTTPS as..."
},
"2019-02-wp-update-provider": {
"title": "WP Update Provider",
"url": "/2019/02/wp-update-provider",
"summary": "Over at Ed-IT Solutions we create [WordPress](https://www.wordpress.org) themes and plugins that we need to keep up-to-date on all our clients websites. We used to use a couple of packages together to get the desired results but they had a couple of issues. 1. They were outdated and not actively maintained...."
},
"2019-01-generated-social-images": {
"title": "Generated Social Images",
"url": "/2019/01/generated-social-images",
"summary": "I follow [dev.to](https://dev.to) who have some great images on their tweets that are bascially just the post title and author. I really like the way it looks and want to try something here.![dev.to example](/assets/2019/01/generated-social-images/dev.to.png)I'm not a fan of manual labour and that includes using photoshop to create an image for..."
},
"2019-01-netlify-cma-on-the-filesystem-with-gatsby": {
"title": "Netlify CMS on the filesystem with Gatsby",
"url": "/2019/01/netlify-cma-on-the-filesystem-with-gatsby",
"summary": "I was looking at [Netlify CMS](https://www.netlifycms.org/) for a website I was building and I wanted to test it before I put code to repo. Unfortunatley by default Netlify CMS will only let you use git as a backend which is great once the site is launched but when I want..."
},
"2018-12-robocopy": {
"title": "Robocopy, the best copying tool you already have.",
"url": "/2018/12/robocopy",
"summary": "Robocopy is an amazing tool that is built into Windows. If your running Windows 10 you already have it! Just fire up a command prompt and your away.I've known about and used Robocopy for quite a few years now. In my line of work I often find I need to..."
},
"2018-12-moving-to-gatsby": {
"title": "Moving to Gatsby",
"url": "/2018/12/moving-to-gatsby",
"summary": "![Gatsby Logo](/assets/2018/12/moving-to-gatsby/gatsby.png)[Gatsby](https://www.gatsbyjs.org/) is you haven't heard about it already is a static site generator that uses React & GraphQL to build pages from your source.The sites it creates are lightning fast and a bit more than a a static site due to the react components still _working_.I've used it a..."
},
"2018-07-wp-enqueue-less-a-replacement-for-wp-less": {
"title": "wp_enqueue_less a replacement for WP-Less",
"url": "/2018/07/wp_enqueue_less-a-replacement-for-wp-less",
"summary": "I’ve used WP-Less for a couple of years now and been pretty happy with it, but on a couple of occasions I’ve had issues with it and with and the underlying [lessphp](https://github.com/leafo/lessphp).There is a filter that can make it use the more upto date less.php instead but the fiter seemed..."
},
"2018-02-disable-windows-10-colour-filter-shortcut-with-a-gpo": {
"title": "Disable Windows 10 Colour Filter Shortcut with a GPO",
"url": "/2018/02/disable-windows-10-colour-filter-shortcut-with-a-gpo",
"summary": "I came across an interesting problem today. A Windows 10 1709 machine was black and white and no one knew how it had happened.Windows 10 has a colour filter system to help colour blind users that has the rather badly placed shortcut `Windows+Ctrl+C`. That’s right a shortcut that by default..."
},
"2017-12-screeps-part-22-war-and-claiming-another-shard": {
"title": "Screeps Part 22 – War and Claiming Another Shard",
"url": "/2017/12/screeps-part-22-war-and-claiming-another-shard",
"summary": "This is part 22 of my Screeps story, you can read the whole story [here](/tag/screeps).## WarRudykocur has been poking at me pretty hard the last few weeks and it’s not gone very well. My [new rangers](https://screeps.arcath.net/creep-designer/?share=14#0#0#8#7#6#0#0) can win a one on one fight with [his attackers](https://screeps.arcath.net/creep-designer/?share=16#0#9#3#2#2#0#0) no problem due to..."
},
"2017-11-screeps-part-21-optimizing-the-os": {
"title": "Screeps Part 21 – Optimizing the OS",
"url": "/2017/11/screeps-part-21-optimizing-the-os",
"summary": "This is part 21 of my Screeps story, you can read the whole story [here](/tag/screeps).## Respawn againAfter talking in the last post about wanting to hunker down in my bunker and wait it out I’ve gone back on that and respawned into a new respawn area that opened up next..."
},
"2017-10-screeps-part-20-bunkers": {
"title": "Screeps Part 20 – Bunkers",
"url": "/2017/10/screeps-part-20-bunkers",
"summary": "This is part 20 of my Screeps story, you can read the whole story [here](/tag/screeps).## Moving to BunkersThe first big hurdle with using bunkers is that my rooms already have layouts. I can’t just place the bunker flag and build it as the extensions/spawns/labs/storage and terminal already exist. In fact,..."
},
"2017-09-screeps-part-19-operating-systems": {
"title": "Screeps Part 19 – Operating Systems",
"url": "/2017/09/screeps-part-19-operating-systems",
"summary": "This is part 19 of my Screeps story, you can read the whole story [here](/tag/screeps).## Building an OSOne of my big issues is CPU usage. My inbox has been flooded with notifications telling me that my bucket is empty or high CPU forced my script to end etc… which is..."
},
"2017-09-office-update-remover": {
"title": "Office Update Remover",
"url": "/2017/09/office-update-remover",
"summary": "Over at [Ed-IT Solutions](https://www.ed-itsolutions.com/), we have been having a fun time with KB4011039, an Office update that can cause some pretty big problems for teachers. It makes the text inside merged table cells invisible and you can’t select the table cell at all. This is a huge pain for teachers..."
},
"2017-09-creating-an-msi-transform-with-super-orca": {
"title": "Creating an MSI Transform with Super Orca",
"url": "/2017/09/creating-an-msi-transform-with-super-orca",
"summary": "I quite frequently deploy software that needs config changes or options before it will work properly. MSI deployments can be given a transform file which modifies the options used when it is installed.This can be very useful for adding in serial keys or changing the install folder etc… Most MSIs..."
},
"2017-09-screeps-part-18-typescript": {
"title": "Screeps Part 18 – Typescript",
"url": "/2017/09/screeps-part-18-typescript",
"summary": "This is part 18 of my Screeps story, you can read the whole story [here](/articles/screeps).## TypescriptI’ve been seeing a lot of good things said about Typescript on the Screeps slack. Typescript is a version of Javascript created by Microsoft that adds typing to Javascript. Bonzai has written an introduction to..."
},
"2017-07-screeps-part-17-room-planning": {
"title": "Screeps Part 17 – Room Planning",
"url": "/2017/07/screeps-part-17-room-planning",
"summary": "This is part 17 of my Screeps story, you can read the whole story [here](/tag/screeps).## A RespawnSo yeah, fighting tier 3 boosted creeps did not go well. Once they downed a tower in my room that was it, a single tower could not out damage the healing of the creep..."
},
"2017-07-screeps-part-16-party-time": {
"title": "Screeps Part 16 – Faster in an Alliance",
"url": "/2017/07/screeps-part-16-party-time",
"summary": "This is part 16 of my Screeps story, you can read the whole story [here](/tag/screeps).## PathFinder.CostMatrixTo the south of my main rooms, there is a room with no spawn and a bunch of structures from a player who has not hit respawn after dying. This is great news for me.![A..."
},
"2017-07-screeps-part-15-new-empire": {
"title": "Screeps Part 15 – New Empire",
"url": "/2017/07/screeps-part-15-new-empire",
"summary": "This is part 15 of my Screeps story, you can read the whole story [here](/tag/screeps).## W48N98My new room is pretty run of the mill but it does have a fair few rooms around it that can be mined or claimed. As I said at the end of the last post..."
},
"2017-07-screeps-part-14-more-improvements-and-a-respawn": {
"title": "Screeps Part 14 – More Improvements and a Respawn",
"url": "/2017/07/screeps-part-14-more-improvements-and-a-respawn",
"summary": "This is part 14 of my Screeps story, you can read the whole story [here](/articles/screeps).## Remote MiningI wanted to get to grips with remote mining. At the moment I just send the creeps and they have no roads etc… I want to change that so I can speed them up..."
},
"2017-07-screeps-part-13-building-up": {
"title": "Screeps Part 13 – Building Up",
"url": "/2017/07/screeps-part-13-building-up",
"summary": "This is part 13 of my Screeps story, you can read the whole story [here](/tag/screeps).## Building UpThe new AI from [part 12](/2017/06/screeps-part-12-start-again/) was not as complete when it was called into service. It wasn’t important at the time, my rooms were all dead and I only needed it to gather..."
},
"2017-06-screeps-part-12-start-again": {
"title": "Screeps Part 12 – Start Again",
"url": "/2017/06/screeps-part-12-start-again",
"summary": "This is part 12 of my Screeps story, you can read the whole story [here](/tag/screeps). > Like the last time I re-wrote my AI this post has become rather long. It is well worth a read as I think I had some pretty good ideas for AI improvements.## DisasterSo it..."
},
"2017-06-b4rn": {
"title": "B4RN 1Gb/s FTTP Broadband",
"url": "/2017/06/b4rn",
"summary": "B4RN is a rural broadband project started in 2011. Through community funding, volunteers and hard work they have built an FTTP (Fibre To The Property) network in the North West of England.BT, the UKs provider of copper phone lines, has always struggled to provide decent broadband to rural areas. With..."
},
"2017-05-etch-router": {
"title": "Etch Router",
"url": "/2017/05/etch-router",
"summary": "[Etch](https://github.com/atom/etch) is Atom’s system for updating the DOM. Like other DOM managers (e.g. React) it uses javascript to define a DOM structure and then applies it to a given DOM node. When the state of the page changes Etch computes the required changes to the DOM and then applies them.The..."
},
"2017-03-theme-options": {
"title": "Theme Options",
"url": "/2017/03/theme-options",
"summary": "My latest composer release is a small library to help with theme options in WordPress. It provides a simple interface for defining theme options and retrieving them later.I made this library quite a while ago and manually copied it from theme to theme as I built them. Newer themes have..."
},
"2017-01-screeps-part-11-the-great-depression": {
"title": "Screeps Part 11 – The Great Depression",
"url": "/2017/01/screeps-part-11-the-great-depression",
"summary": "This is part 11 of my Screeps story, you can read the whole story [here](/tag/screeps).## The Great Depression.At the end of the last post I was waiting for a room I had attacked to become claimable. It did after downgrading through every level from 6. This is where my problems..."
},
"2017-01-screeps-part-10-rc6-twice-third-room": {
"title": "Screeps Part 10 – RC6 Twice and a Third Room",
"url": "/2017/01/screeps-part-10-rc6-twice-third-room",
"summary": "This is part 10 of my Screeps story, you can read the whole story [here](/tag/screeps).## RC6 TwiceAfter the respawn in the [last post](/2017/01/gcl3-another-respawn/), my rooms have been plodding along nicely. I now have 2 rooms at RC6. This means 2 rooms extracting and selling minerals.My AI doesn’t make full use..."
},
"2017-01-gcl3-another-respawn": {
"title": "Screeps Part 9 – GCL3 and Another Respawn",
"url": "/2017/01/gcl3-another-respawn",
"summary": "This is part 9 of my Screeps story, you can read the whole story [here](/tag/screeps).## GCL3I’ve hit GCL 3 and its time to take on a third room. I want a room with 2 sources and there is only one near me. [W24N68](https://screeps.com/a/#!/room/W24N68). Its placement near another player is not..."
},
"2016-12-remove-guided-access-mode-ipad": {
"title": "Remove Guided Access Mode on an iPad",
"url": "/2016/12/remove-guided-access-mode-ipad",
"summary": "One of the jobs I get asked to do on a regular basis is remove guided access mode from the school iPads. If you don’t know about it guided access mode allows you to lock an iPad to a single app. It’s great in theory and some of my schools..."
},
"2016-12-pac-file-system": {
"title": "A PAC File System using Jekyll",
"url": "/2016/12/pac-file-system",
"summary": "A PAC (Proxy Auto-Config) File is a small javascript file that a browser can be configured to use when choosing a proxy server. For a few reasons over at [Ed-IT Solutions](https://www.ed-itsolutions.com/), we decided we needed a PAC file system to create these files for each school.Normally a school’s ISP or..."
},
"2016-12-screeps-part-8-constructors-defcon": {
"title": "Screeps Part 8 – Constructors & DEFCON",
"url": "/2016/12/screeps-part-8-constructors-defcon",
"summary": "This is part 8 of my Screeps story, you can read the whole story [here](/tag/screeps).## W26N68So, that room I said needed some help now really needs some help.Another player has wiped it clean. It is now an empty room with a level 5 controller. I don’t feel any resentment to..."
},
"2016-12-screeps-part-7-a-complete-re-write": {
"title": "Screeps Part 7 – A complete Re Write",
"url": "/2016/12/screeps-part-7-a-complete-re-write",
"summary": "For Screeps Part 7 I have something a little different planned, a complete re-write of my code from the ground up. > I Apologise for the length of this post. I normally aim for 1000 words and cut off when I reach it. This post has smashed that but its..."
},
"2016-11-screeps-part-6-poking-enemy": {
"title": "Screeps Part 6 – Poking the Enemy",
"url": "/2016/11/screeps-part-6-poking-enemy",
"summary": "This is part 6 of my Screeps story, you can read the whole story [here](/tag/screeps).## Danger Harvesters[W26N66](https://screeps.com/a/#!/room/W26N66) is the room directly below my main room. It has 3 energy sources and a utrium mine with extractor already in place.It also has NPC creeps that guard the room.![Some Painful Creeps](/assets/2016/11/screeps-part-6-poking-enemy/some-painful-creeps.png)To beat..."
},
"2016-11-screeps-part-5-finishing-rc4-rewriting-creeps-gcl2": {
"title": "Screeps Part 5 – Finishing RC4 and Rewriting the Creeps for GCL2",
"url": "/2016/11/screeps-part-5-finishing-rc4-rewriting-creeps-gcl2",
"summary": "This is part 5 of my Screeps story, you can read the whole story [here](/tag/screeps).## Rewriting the Creeps.I am not happy with my creeps anymore.With any code I maintain, there comes a point where I stop sticking bits to the side and overhaul the whole block.I manually define how many..."
},
"2016-11-screeps-part-4": {
"title": "Screeps Part 4 – We can rebuild, we have the AI",
"url": "/2016/11/screeps-part-4",
"summary": "This is part 4 of my Screeps story, you can read the whole story [here](/tag/screeps).## Picking a new RoomWith the loss of my original room, I was now homeless.I actually struggled to find a room with 2 resources points that I could take. If your thinking of getting Screeps don’t..."
},
"2016-11-osticket-api-proxy": {
"title": "OSTicket API Proxy",
"url": "/2016/11/osticket-api-proxy",
"summary": "Over at Ed-IT Solutions we use OSTicket for our help desk. We like it and it does its job very well. Early in the development of our [support app](/2016/11/electron-app-customer-support/), the question was asked, “Can users open tickets from inside the app?”. Yes! They can, but some trickery is going to..."
},
"2016-11-screeps-part-3-rc4-surprise": {
"title": "Screeps Part 3 – RC4 & a Surprise",
"url": "/2016/11/screeps-part-3-rc4-surprise",
"summary": "This is part 3 of my Screeps story, you can read the whole story [here](/tag/screeps).## FormatNow that we are up to Screeps Part 3 I’m happy with the format these posts are going to take. For the next few weeks they will track with my RC level unless something big..."
},
"2016-11-screeps-part-2-rc3": {
"title": "Screeps Part 2 – RC3 & Beginnings of Multi-room",
"url": "/2016/11/screeps-part-2-rc3",
"summary": "This is part 2 of my Screeps story. You can read more about Screeps and part 1 [here](/2016/11/screeps-part-1-rc1-rc2/).## RC3After hitting RC3 I immediately dropped 5 more extensions and a tower. This lead to an issue of energy supply. My builders pulled energy so fast building everything at once and I..."
},
"2016-11-screeps-part-1-rc1-rc2": {
"title": "Screeps Part 1 – RC1 & RC2",
"url": "/2016/11/screeps-part-1-rc1-rc2",
"summary": "Screeps is an MMO RTS aimed at programmers. Unlike traditional games you don’t have direct control over your units. You instead write a program to govern their movements and actions.![Screeps Logo](/assets/2016/11/screeps-part-1-rc1-rc2/screeps.gif)The target market for Screeps is very narrow but to someone like myself it is an amazing game. Over the..."
},
"2016-11-electron-app-customer-support": {
"title": "Electron App to help with customer support",
"url": "/2016/11/electron-app-customer-support",
"summary": "Over at [Ed-IT Solutions](https://www.ed-itsolutions.com/), we take quite a few calls that require a small fix or bit of information that it would take us 2 seconds to get if we were on the computer. To help make our phone calls easier and give our customers the tools to fix minor..."
},
"2016-11-squirrel-release-server": {
"title": "Squirrel Release Server",
"url": "/2016/11/squirrel-release-server",
"summary": "Squirrel Release Server is a low featured release server for squirrel.It supports: - Windows clients. - Listing all releases after and including the local users current version. - Delta updates to reduce file size.And thats it!This is all I needed it to support. Our app is Windows only and installed..."
},
"2016-10-post-formats-theme": {
"title": "Post Formats in your WordPress Theme",
"url": "/2016/10/post-formats-theme",
"summary": "In an effort to leverage more of the in built WordPress features I’ve turned my attention to Post Formats. Post Formats allow users to select a style for their post similar to page templates. They take the place of some plugins allowing for galleries etc… using your theme.Galleries are actually..."
},
"2016-09-wp-controls": {
"title": "WP Controls, Multiple Icons & Images for WordPress",
"url": "/2016/09/wp-controls",
"summary": "Lately I have been working on a new theme from our Designer where I needed a theme customizer control that didn’t exist. I also wanted to replicate the social media icons system from Hueman. To do this I created a repository of WP Controls. These controls are self contained and..."
},
"2016-09-plugin-highlight-crop-thumbnails": {
"title": "Plugin Highlight: Crop Thumbnails",
"url": "/2016/09/plugin-highlight-crop-thumbnails",
"summary": "I used the Crop Thumbnails Plugin on pretty much every WordPress site I setup. More and more WordPress themes are becoming image heavy using a pre post image in particular. All the designs from our designer feature images on every page and most of our sites leverage the featured image..."
},
"2016-09-surface-pro-3-review": {
"title": "Surface Pro 3 a Review",
"url": "/2016/09/surface-pro-3-review",
"summary": "For over, a year now I have been using a [Surface Pro 3](http://amzn.to/2u3GwBd) (SP3) as my only computer at work. Before my SP3 I had a MacBook Pro which served me well for a couple of years (it wasn’t new when I got it). I elected to get an SP3..."
},
"2016-08-everything-option-theme": {
"title": "Everything an Option in the Theme",
"url": "/2016/08/everything-option-theme",
"summary": "Everything an Option is my design philosophy for WordPress Themes.With the Theme Customizer and tools like [WP-LESS](/2016/01/less-in-a-wordpress-theme) it is possible to make some very varied sites from the same theme. Take these 3 sites: - [Ridge Community Primary School](https://www.ridge.lancs.sch.uk/) - [Leck St Peters C of E Primary School](http://www.leck-st-peters.lancs.sch.uk/) - [Grimsargh..."
},
"2016-07-radius-with-windows-server-2012r2": {
"title": "RADIUS With Windows Server 2012R2",
"url": "/2016/07/radius-with-windows-server-2012r2",
"summary": "RADIUS is a form of network security that can link into your Windows Domain. The most common use (at least in my experience) is to secure Wireless Networks. Using RADIUS has the advantage of no shared key that has to be entered on each device, you can allow all domain..."
},
"2016-03-react": {
"title": "React",
"url": "/2016/03/react",
"summary": "[React](https://facebook.github.io/react/), in Jekyll, with dynamic pages!## Why?Most of my recent work on this site has been around using pushState, ajax and [lunr](http://lunrjs.com/) to create a static site that you can search with pages for every category etc… that didn’t require me to create a page for each one. This resulted..."
},
"2016-03-jekyll-atom-1-2-0": {
"title": "Jekyll Atom 1.2.0",
"url": "/2016/03/jekyll-atom-1-2-0",
"summary": "A new version of [Jekyll-Atom](https://atom.io/packages/jekyll) has just been released!This version adds some new syntax grammars to Atom to highlight Liquid tags and the YAML front matter.The Grammars don’t define a massive amount they are essentially just pull in more than one grammar.```js{ 'begin': '---' 'end': '---' 'patterns': [ { 'include':..."
},
"2016-02-using-jekyll-atom-from-start-to-finish": {
"title": "Using Jekyll Atom from start to finish",
"url": "/2016/02/using-jekyll-atom-from-start-to-finish",
"summary": "[Jekyll-Atom](https://github.com/arcath/Jekyll-Atom) is my [Atom](https://atom.io/) package for working with [Jekyll](http://jekyllrb.com/) (as the name implies).It makes working Jekyll a breeze but I have a had a couple of questions about how some of it works, so I am going to walk though the writing of this post.First off with Atom open in..."
},
"2016-02-setting-up-lunr-js-in-jekyll": {
"title": "Setting up lunr.js in Jekyll",
"url": "/2016/02/setting-up-lunr-js-in-jekyll",
"summary": "[lunrjs](http://lunrjs.com/) is a client side search system that is perfectly suited for [Jekyll](http://jekyllrb.com/) and other static site systems.Setting it up in Jekyll without any plugins (so it works on [Github Pages](https://pages.github.com/)) isn’t that hard only needs a couple of extra files and some Javascript. You can see the commit used..."
},
"2016-02-ajax-page-loading-in-jekyll": {
"title": "AJAX Page loading in Jekyll (Or any static site)",
"url": "/2016/02/ajax-page-loading-in-jekyll",
"summary": "This site is pretty fast, lets be honest static HTML loads incredibly quickly as there is no rendering or database overheads to slow it down. That being said AJAX page loading is even faster so can it be done without the use of HTTP headers etc…?Yes it can, quite easily,..."
},
"2016-02-building-windows-10-images": {
"title": "Building Windows 10 Images",
"url": "/2016/02/building-windows-10-images",
"summary": "Windows 10 is fantastic and naturally lots of my Schools are chomping at the bit to get it deployed to their devices.This has lead to a couple of problematic image builds over the past couple of months due to sysprep being unable to complete after the store has been setup..."
},
"2016-01-jekyll-atom-1-1-0": {
"title": "Jekyll Atom 1.1.0",
"url": "/2016/01/jekyll-atom-1-1-0",
"summary": "Jekyll-Atom has just hit 1.1.0 and with this release comes some new features and adjustments to the current ones.I outlined my ideas in the state of the universe and I think I have met them all with this update.ConfigurationIn 1.1.0 the config is a lot leaner favouring settings from _config.yml..."
},
"2016-01-state-of-the-universe": {
"title": "State of the Universe",
"url": "/2016/01/state-of-the-universe",
"summary": "This site has just had a pretty major re-design which I am intending to be the start of me writing a lot more here.More writingI do loads of cool things in my day job that deserve to be shared, if only to save some other poor soul the time of..."
},
"2016-01-improving-speed-in-jekyll-atom": {
"title": "Improving speed in Jekyll-Atom",
"url": "/2016/01/improving-speed-in-jekyll-atom",
"summary": "Jekyll-Atom is pretty slow at building sites.There is a noticeable delay between hitting ctrl-S and the site being updated which really slows development.The fatal flaw is the jekyll build is building the whole site every time which as your site grows results in longer and longer builds to the point..."
},
"2016-01-less-in-a-wordpress-theme": {
"title": "LESS in a WordPress theme",
"url": "/2016/01/less-in-a-wordpress-theme",
"summary": "I have made a replacement for wp-less! If you intrested in using less in your WordPress theme check it out. wp_enqueue_less.LESS is a CSS pre-processor which adds tonnes of features that extend CSS. I have been using it for a while when making my WordPress themes and have gotten it..."
},
"2015-11-motorway": {
"title": "Motorway",
"url": "/2015/11/motorway",
"summary": "Motorway provides flow control for your node applications through Junctions and Actions.Motorway was created to streamline my application launchers. I found that I normally ended up with a main.js that looked like this:Database = require('db/database')Database.init()app = Express()RouterA = require('routes/routerA')app.use('/', RouterA)app.listen(3000)//and so onWhich got messy and ambiguos. At no point does..."
},
"2015-07-caching-apple-downloads-on-a-windows-server": {
"title": "Caching Apple downloads on a Windows server",
"url": "/2015/07/caching-apple-downloads-on-a-windows-server",
"summary": "Yesterday I posted about caching apple downloads which was great but most of my schools do not have a linux server available nor do they have the spare equipment to setup anything that could be considered reliable enough.Now we do have plenty of Windows capacity so we need to run..."
},
"2015-07-sodb": {
"title": "SODB",
"url": "/2015/07/sodb",
"summary": "sodb is the latest of my little projects to hit npm and I really enjoyed making this one.It is written in coffee-script and fully tested.The idea is to have the features of a database table available to an array of objects. You have to admit that {name: 'bob', age: 10,..."
},
"2015-07-caching-apple-downloads": {
"title": "Caching Apple Downloads",
"url": "/2015/07/caching-apple-downloads",
"summary": "The worst part of working with iPads is waiting for apps to download, watching your internet connection strain at 40+ devices downloading the 599MB Garage Band update. The 10Mb/s connection in the school this article was written in is spread over nearly 200 devices so these iPad updates are causing..."
},
"2015-06-jekyll-atom-1-0-0": {
"title": "Jekyll Atom 1.0.0",
"url": "/2015/06/jekyll-atom-1-0-0",
"summary": "Version 1.0.0 of Jekyll Atom has just landed and it contains some changes to the way Atom interacts with Jekyll.The big change is how your site is served in development. 0.x.x used jekyll serve -w as a child process which lead to many issues with the child process not quiting..."
},
"2015-04-creating-the-less-compiler-for-compile-watch": {
"title": "Creating the Less compiler for compile-watch",
"url": "/2015/04/creating-the-less-compiler-for-compile-watch",
"summary": "compile-watch is the latest Atom package I’ve been working on, it is the successor to sass-watch and takes over all the functionality of sass-watch whilst adding a lot more.The primary improvement is that it is able to compile any kind of file as long as there is a format defined..."
},
"2014-04-a-jekyll-extension-for-atom": {
"title": "A Jekyll extension for Atom",
"url": "/2014/04/a-jekyll-extension-for-atom",
"summary": "I recently got into the Atom beta and have been using it for the past couple of weeks with no problems at all. One of the big features of Atom is that it is hackable to the point that it comes by default with a make new package command.The only..."
},
"2014-02-powershell-script-to-update-sims-and-fms": {
"title": "Powershell script to update SIMS & FMS",
"url": "/2014/02/powershell-script-to-update-sims-and-fms",
"summary": "SIMS is a large application made by Capita that the schools are forced to use by the LEA, one of its many features is that it installs its own updates on launch (in theory) but over the years I’ve had no end of problems with it either not updating or..."
},
"2014-02-deploying-adobe-air-and-air-apps": {
"title": "Deploying Adobe Air and Air Apps",
"url": "/2014/02/deploying-adobe-air-and-air-apps",
"summary": "As much as I hate Adobe Air some deluded companies think its the best way to make software and I’ve been forced on more than one occasion to deploy it to the whole network, which leads nicely into the big problem… There is no MSI and just as annoying software..."
},
"2013-11-cancan-route-contraints": {
"title": "CanCan Route Constraints",
"url": "/2013/11/cancan-route-contraints",
"summary": "I use Sidekiq to handle the background jobs which is working great, but I noticed that some of them seemed to be failing! I had no way of seeing which jobs where failing or why because I handn’t mounted the WebUI anywhere. The issue I had was securing it, I..."
},
"2013-08-active-record-like-search-results": {
"title": "Active Record like Search Results",
"url": "/2013/08/active-record-like-search-results",
"summary": "Active Records output may look like an array but its actually a special class that behaves like an array but has a lot of extensions attached to it.For Adauth I want to provide results in something more than an array with the ability to order etc… but not over complicate..."
},
"2013-08-expects": {
"title": "Expects",
"url": "/2013/08/expects",
"summary": "Expects is lightweight DSL for defining what you expect a method to receive as input.I’d expect this gem to be used more as a support gem, being a dependancy for other gems to use to make sure that what the end user/developer was passing met with requirements.Expects is pretty simple..."
},
"2013-08-issue-37": {
"title": "Issue 37",
"url": "/2013/08/issue-37",
"summary": "Adauth/Issue#37 was raised by weightyfoe and has proven to be a rather weird one.Basically Adauth would successfuly authenticate a user when no password was supplied which to me sounds like AD allowing some kind anonymous login to query data that everyone has access to. The problem is that Adauth uses..."
},
"about": {
"title": "About",
"url": "/about/.html",
"summary": "I am a School Network Manager from the North West of England.![Adam Laycock](/assets/profile.jpg)I've spent the last 15 years working as an IT Engineer in Schools. I've worked with all kinds of technologies, everything from Interactive Displays & Hall Audio systems through to USB Microscopes.As an Engineer at Ed-IT Solutions, I've..."
}
,
"blog": {
"title": "Blog",
"url": "/blog/.html",
"summary": " {% for post in site.posts %} {% include post.html post=post %} {% endfor %}"
}
,
"contact": {
"title": "Contact",
"url": "/contact/.html",
"summary": "If you need to get in touch I can be reached on a few social platforms and by email.## Social Media> [GitHub @Arcath](https://www.github.com/Arcath)> [Twitter @AdamMLaycock](https://www.twitter.com/AdamMLaycock)> [Polywork](https://cv.alaycock.co.uk)## By Email> adam@alaycock.co.uk"
}
,
"": {
"title": "Adam Laycock",
"url": "/.html",
"summary": "{% for link in site.data.links %} {{ link.label }} {% endfor %} {% for post in site.posts limit:4 %} {% include post.html post=post %} {% endfor %} More Posts All Posts {% capture tagString %}{% for tag in site.tags %}{{ tag[0] }}{% unless forloop.last %}|{% endunless %}{% endfor %}{% endcapture..."
}
,
"css-style-css": {
"title": "",
"url": "/css/style.css.html",
"summary": "@tailwind base;@tailwind components;@tailwind utilities;html { @apply min-h-full;}body { @apply font-sans bg-gradient-to-b from-brand-dark to-brand-light min-h-full;}a{ @apply text-brand-light hover:text-brand-dark transition-all;}.highlight table td { padding: 5px; }.highlight table pre { margin: 0; }.highlight, .highlight .w { color: #d0d0d0; background-color: #151515;}.highlight .err { color: #151515; background-color: #ac4142;}.highlight .c, .highlight .ch, .highlight .cd, .highlight .cm,..."
}
,
"talks": {
"title": "Talks",
"url": "/talks/.html",
"summary": "Through the [ANME](https://anme.co.uk/) I have given talks at the North West meetings.## Chrome OS within a Microsoft estateEarly 2024 I gave a talk at the North West ANME meeting on how we had intergrated ChromeOS Flex into our Microsfot Estate. Essentially how we had used Google without using Google.![ChromeOS Title..."
}
,
"uses": {
"title": "Uses",
"url": "/uses/.html",
"summary": "This is a mostly complete list of the software I use on a day to day basis.# Developer## Editor- [Visual Studio Code](https://code.visualstudio.com/). I've been using VSCode for a while now and its become my go to editor for everything.- [Railscasts Plus](https://marketplace.visualstudio.com/items?itemName=marlosirapuan.vscode-theme-railscasts-plus) editor theme.- [JetBrains Mono](https://www.jetbrains.com/lp/mono/). A great font with support..."
}
,
"tag-adauth": {
"title": "Posts Tagged adauth",
"url": "/tag/adauth/.html",
"summary": ""
}
,
"tag-ruby": {
"title": "Posts Tagged ruby",
"url": "/tag/ruby/.html",
"summary": ""
}
,
"tag-cancan": {
"title": "Posts Tagged cancan",
"url": "/tag/cancan/.html",
"summary": ""
}
,
"tag-ed-itsolutions": {
"title": "Posts Tagged ed-itsolutions",
"url": "/tag/ed-itsolutions/.html",
"summary": ""
}
,
"tag-powershell": {
"title": "Posts Tagged powershell",
"url": "/tag/powershell/.html",
"summary": ""
}
,
"tag-sims": {
"title": "Posts Tagged sims",
"url": "/tag/sims/.html",
"summary": ""
}
,
"tag-jekyll-atom": {
"title": "Posts Tagged jekyll-atom",
"url": "/tag/jekyll-atom/.html",
"summary": ""
}
,
"tag-atom": {
"title": "Posts Tagged atom",
"url": "/tag/atom/.html",
"summary": ""
}
,
"tag-compilewatch": {
"title": "Posts Tagged compilewatch",
"url": "/tag/compilewatch/.html",
"summary": ""
}
,
"tag-apple": {
"title": "Posts Tagged apple",
"url": "/tag/apple/.html",
"summary": ""
}
,
"tag-squid": {
"title": "Posts Tagged squid",
"url": "/tag/squid/.html",
"summary": ""
}
,
"tag-sodb": {
"title": "Posts Tagged sodb",
"url": "/tag/sodb/.html",
"summary": ""
}
,
"tag-motorway": {
"title": "Posts Tagged motorway",
"url": "/tag/motorway/.html",
"summary": ""
}
,
"tag-wordpress": {
"title": "Posts Tagged wordpress",
"url": "/tag/wordpress/.html",
"summary": ""
}
,
"tag-updates": {
"title": "Posts Tagged updates",
"url": "/tag/updates/.html",
"summary": ""
}
,
"tag-windows10": {
"title": "Posts Tagged windows10",
"url": "/tag/windows10/.html",
"summary": ""
}
,
"tag-jekyll": {
"title": "Posts Tagged jekyll",
"url": "/tag/jekyll/.html",
"summary": ""
}
,
"tag-react": {
"title": "Posts Tagged react",
"url": "/tag/react/.html",
"summary": ""
}
,
"tag-security": {
"title": "Posts Tagged security",
"url": "/tag/security/.html",
"summary": ""
}
,
"tag-featured": {
"title": "Posts Tagged featured",
"url": "/tag/featured/.html",
"summary": ""
}
,
"tag-review": {
"title": "Posts Tagged review",
"url": "/tag/review/.html",
"summary": ""
}
,
"tag-plugin-highlight": {
"title": "Posts Tagged plugin-highlight",
"url": "/tag/plugin-highlight/.html",
"summary": ""
}
,
"tag-post-formats": {
"title": "Posts Tagged post-formats",
"url": "/tag/post-formats/.html",
"summary": ""
}
,
"tag-php": {
"title": "Posts Tagged php",
"url": "/tag/php/.html",
"summary": ""
}
,
"tag-electron": {
"title": "Posts Tagged electron",
"url": "/tag/electron/.html",
"summary": ""
}
,
"tag-screeps": {
"title": "Posts Tagged screeps",
"url": "/tag/screeps/.html",
"summary": ""
}
,
"tag-ios": {
"title": "Posts Tagged ios",
"url": "/tag/ios/.html",
"summary": ""
}
,
"tag-node": {
"title": "Posts Tagged node",
"url": "/tag/node/.html",
"summary": ""
}
,
"tag-b4rn": {
"title": "Posts Tagged b4rn",
"url": "/tag/b4rn/.html",
"summary": ""
}
,
"tag-typescript": {
"title": "Posts Tagged typescript",
"url": "/tag/typescript/.html",
"summary": ""
}
,
"tag-deployments": {
"title": "Posts Tagged deployments",
"url": "/tag/deployments/.html",
"summary": ""
}
,
"tag-group-policy": {
"title": "Posts Tagged group-policy",
"url": "/tag/group-policy/.html",
"summary": ""
}
,
"tag-office-2016": {
"title": "Posts Tagged office-2016",
"url": "/tag/office-2016/.html",
"summary": ""
}
,
"tag-windows-10": {
"title": "Posts Tagged windows-10",
"url": "/tag/windows-10/.html",
"summary": ""
}
,
"tag-gatsby": {
"title": "Posts Tagged gatsby",
"url": "/tag/gatsby/.html",
"summary": ""
}
,
"tag-windows": {
"title": "Posts Tagged windows",
"url": "/tag/windows/.html",
"summary": ""
}
,
"tag-tools": {
"title": "Posts Tagged tools",
"url": "/tag/tools/.html",
"summary": ""
}
,
"tag-netlify": {
"title": "Posts Tagged netlify",
"url": "/tag/netlify/.html",
"summary": ""
}
,
"tag-work": {
"title": "Posts Tagged work",
"url": "/tag/work/.html",
"summary": ""
}
,
"tag-deploymets": {
"title": "Posts Tagged deploymets",
"url": "/tag/deploymets/.html",
"summary": ""
}
,
"tag-wix": {
"title": "Posts Tagged wix",
"url": "/tag/wix/.html",
"summary": ""
}
,
"tag-blog": {
"title": "Posts Tagged blog",
"url": "/tag/blog/.html",
"summary": ""
}
,
"tag-chrome": {
"title": "Posts Tagged chrome",
"url": "/tag/chrome/.html",
"summary": ""
}
,
"tag-javascript": {
"title": "Posts Tagged javascript",
"url": "/tag/javascript/.html",
"summary": ""
}
,
"tag-css": {
"title": "Posts Tagged css",
"url": "/tag/css/.html",
"summary": ""
}
,
"tag-gpo": {
"title": "Posts Tagged gpo",
"url": "/tag/gpo/.html",
"summary": ""
}
,
"tag-wds": {
"title": "Posts Tagged wds",
"url": "/tag/wds/.html",
"summary": ""
}
,
"tag-next-js": {
"title": "Posts Tagged next-js",
"url": "/tag/next-js/.html",
"summary": ""
}
,
"tag-tailwindcss": {
"title": "Posts Tagged tailwindcss",
"url": "/tag/tailwindcss/.html",
"summary": ""
}
,
"tag-mdx": {
"title": "Posts Tagged mdx",
"url": "/tag/mdx/.html",
"summary": ""
}
,
"tag-azure": {
"title": "Posts Tagged azure",
"url": "/tag/azure/.html",
"summary": ""
}
,
"tag-adsync": {
"title": "Posts Tagged adsync",
"url": "/tag/adsync/.html",
"summary": ""
}
,
"tag-windows-update": {
"title": "Posts Tagged windows-update",
"url": "/tag/windows-update/.html",
"summary": ""
}
,
"tag-papercut": {
"title": "Posts Tagged papercut",
"url": "/tag/papercut/.html",
"summary": ""
}
,
"tag-net-doc": {
"title": "Posts Tagged net-doc",
"url": "/tag/net-doc/.html",
"summary": ""
}
,
"tag-intune": {
"title": "Posts Tagged intune",
"url": "/tag/intune/.html",
"summary": ""
}
}
I had issues getting the content safe for JSON, mainly with gists adding html etc… it got messy and I ended up truncating the number of words to 50 hoping that I wouldn’t have any special content in my posts in the first 50 words.
With lunr added to the template I added loadSearch()
to the documents ready event to load search after the page has loaded.
function loadSearch(){
// Create a new Index
idx = lunr(function(){
this.field('id')
this.field('title', { boost: 10 })
this.field('summary')
})
// Send a request to get the content json file
$.getJSON('/content.json', function(data){
// Put the data into the window global so it can be used later
window.searchData = data
// Loop through each entry and add it to the index
$.each(data, function(index, entry){
idx.add($.extend({"id": index}, entry))
})
})
// When search is pressed on the menu toggle the search box
$('#search').on('click', function(){
$('.searchForm').toggleClass('show')
})
// When the search form is submitted
$('#searchForm').on('submit', function(e){
// Stop the default action
e.preventDefault()
// Find the results from lunr
results = idx.search($('#searchField').val())
// Empty #content and put a list in for the results
$('#content').html('<h1>Search Results (' + results.length + ')</h1>')
$('#content').append('<ul id="searchResults"></ul>')
// Loop through results
$.each(results, function(index, result){
// Get the entry from the window global
entry = window.searchData[result.ref]
// Append the entry to the list.
$('#searchResults').append('<li><a href="' + entry.url + '">' + entry.title + '</li>')
})
})
}
A fair bit of that is unique to this site but the principle is the same for any site. On page load a new index is created and populate when the request for /content.json
completes. Binding a couple of events to make the UI work how I wanted and to handle a user making a search.
The search is pretty simple the lunr index has a search
method which you pass the search string to. It returns an array of results which I loop though and append to a list.
The order is set by the relevance of the result with the closer matches at the top.
This is a great feature which should help users find content easier.