diff --git a/_config.yml b/_config.yml
index d30a6ac..61c2d98 100644
--- a/_config.yml
+++ b/_config.yml
@@ -51,14 +51,13 @@ exclude: [
]
# The production_url is only used when full-domain names are needed
-# such as sitemap.txt
+# such as sitemap.txt, atom.xml, rss.xml, search.json
# Most places will/should use BASE_PATH to make the urls
#
# If you have set a CNAME (pages.github.com) set your custom domain here.
# Else if you are pushing to username.github.io, replace with your username.
# Finally if you are pushing to a GitHub project page, include the project name at the end.
-#
-production_url : https://bpkg.sh/
+production_url : https://bpkg.sh
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Jekyll-Bootstrap specific configurations
diff --git a/_includes/themes/the-program/default.html b/_includes/themes/the-program/default.html
index 594308c..b00b9fd 100644
--- a/_includes/themes/the-program/default.html
+++ b/_includes/themes/the-program/default.html
@@ -27,9 +27,12 @@
{{ site.title }}
- packages by name
- packages by tag
- packages by category
+ Packages by Name
+ Packages by Tag
+ Packages by Category
+
+
+ Search Packages
diff --git a/assets/js/search.js b/assets/js/search.js
new file mode 100644
index 0000000..f77ac1d
--- /dev/null
+++ b/assets/js/search.js
@@ -0,0 +1,61 @@
+class PackageData {
+ title;
+ date;
+ author;
+ description;
+ category;
+ tags;
+ url;
+
+ constructor(data) {
+ this.title = data.title;
+ this.date = data.date;
+ this.author = data.author;
+ this.description = data.description;
+ this.category = data.category;
+ this.tags = data.tags;
+ this.url = data.url;
+ }
+}
+
+document.addEventListener('DOMContentLoaded', function (event) {
+ const search = document.getElementById('search');
+ const results = document.getElementById('results');
+ let generated = '';
+ let data = [];
+ let search_term = '';
+
+ fetch('/feed/search.json')
+ .then((response) => response.json())
+ .then((data_server) => {
+ generated = data_server.generated;
+ data = data_server.posts.map(post => new PackageData(post));
+ });
+
+ search.addEventListener('input', (event) => {
+ search_term = event.target.value.toLowerCase();
+ showList();
+ });
+
+ const showList = () => {
+ results.innerHTML = '';
+
+ if (search_term.length == 0) return;
+
+ const match = new RegExp(`${search_term}`, 'gi');
+ let result = data.filter((name) => match.test(name.title));
+
+ if (result.length == 0) {
+ const li = document.createElement('li');
+ li.innerHTML = `Zero results found`;
+ results.appendChild(li);
+ }
+
+ result.forEach((package) => {
+ const li = document.createElement('li');
+ li.innerHTML = `${package.title} `;
+ results.appendChild(li);
+ });
+ };
+
+});
diff --git a/feed/atom.xml b/feed/atom.xml
index 28ebcb5..9b1a866 100644
--- a/feed/atom.xml
+++ b/feed/atom.xml
@@ -5,23 +5,21 @@ title : Atom Feed
{{ site.title }}
-
+
- {{ site.time | date_to_xmlschema }}
{{ site.production_url }}
+ {{ site.time | date_to_xmlschema }}
{{ site.author.name }}
{{ site.author.email }}
-
{% for post in site.posts %}
{{ post.title }}
- {{ post.date | date_to_xmlschema }}
{{ site.production_url }}{{ post.id }}
+ {{ post.date | date_to_xmlschema }}
{{ post.content | xml_escape }}
{% endfor %}
-
diff --git a/feed/rss.xml b/feed/rss.xml
index 329c830..d1f58af 100644
--- a/feed/rss.xml
+++ b/feed/rss.xml
@@ -4,24 +4,22 @@ title : RSS Feed
-
- {{ site.title }}
- {{ site.title }} - {{ site.author.name }}
- {{ site.production_url }}{{ site.rss_path }}
- {{ site.production_url }}
- {{ site.time | date_to_xmlschema }}
- {{ site.time | date_to_xmlschema }}
- 1800
-
-{% for post in site.posts %}
- -
-
{{ post.title }}
- {{ post.content | xml_escape }}
- {{ site.production_url }}{{ post.url }}
- {{ site.production_url }}{{ post.id }}
- {{ post.date | date_to_xmlschema }}
-
-{% endfor %}
-
-
+
+ {{ site.title }}
+ {{ site.title }} - {{ site.author.name }}
+ {{ site.production_url }}{{ site.JB.rss_path }}
+ {{ site.production_url }}
+ {{ site.time | date_to_xmlschema }}
+ {{ site.time | date_to_xmlschema }}
+ 1800
+ {% for post in site.posts %}
+ -
+
{{ post.title }}
+ {{ site.production_url }}{{ post.url }}
+ {{ site.production_url }}{{ post.id }}
+ {{ post.date | date_to_xmlschema }}
+ {{ post.content | xml_escape }}
+
+ {% endfor %}
+
diff --git a/feed/search.json b/feed/search.json
new file mode 100644
index 0000000..19edf11
--- /dev/null
+++ b/feed/search.json
@@ -0,0 +1,21 @@
+---
+title : JavaScript Search
+permalink : '/feed/search.json'
+---
+
+{
+ "generated":"{{ site.time | date_to_xmlschema }}",
+ "posts":[
+ {% for post in site.posts %}{
+ "title":"{{ post.title }}",
+ "date":"{{ post.date | date: '%Y-%m-%d' }}",
+ "author":"{{ post.author }}",
+ "description":"{{ post.description }}",
+ "category":"{{ post.category }}",
+ "tags":{{ post.tags | jsonify }},
+ "repository":"{{ post.repository }}",
+ "url":"{{ site.production_url }}{{ post.url }}"
+ }{% if forloop.last == false %},{% endif %}
+ {% endfor %}
+ ]
+}
diff --git a/search/index.html b/search/index.html
new file mode 100644
index 0000000..f28bc25
--- /dev/null
+++ b/search/index.html
@@ -0,0 +1,16 @@
+---
+layout: page
+title: Search
+header: Search Packages
+group: navigation
+permalink: /search/
+---
+
+{% include JB/setup %}
+
+
+
diff --git a/sitemap.txt b/sitemap.txt
index 086abb1..0db534a 100644
--- a/sitemap.txt
+++ b/sitemap.txt
@@ -3,7 +3,7 @@
title : Sitemap
---
-{% for page in site.pages %}
-{{site.production_url}}{{ page.url }}{% endfor %}
-{% for post in site.posts %}
-{{site.production_url}}{{ post.url }}{% endfor %}
+{% assign pages = site.pages | sort:"url" %}{% for page in pages %}{{site.production_url}}{{ page.url }}
+{% endfor %}
+{% assign posts = site.posts | sort:"url" %}{% for post in posts %}{{site.production_url}}{{ post.url }}
+{% endfor %}