Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ group :jekyll_plugins do
gem 'jekyll-sitemap'
gem 'jekyll_frontmatter_tests', '~> 0.1.0'
gem 'jekyll_oembed'
gem 'jekyll_pages_api'
gem 'jekyll_pages_api', git: 'https://github.com/18F/jekyll_pages_api.git'
gem 'jekyll_pages_api_search', '~> 0.5.0'
end

Expand Down
13 changes: 9 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
GIT
remote: https://github.com/18F/jekyll_pages_api.git
revision: b6de4f6f5e69226840d237133e1928a7ab1508b0
specs:
jekyll_pages_api (0.1.6)
htmlentities (~> 4.3)
jekyll (>= 2.0, < 4.0)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -98,9 +106,6 @@ GEM
jekyll_oembed (0.0.3)
jekyll (~> 3)
ruby-oembed (~> 0)
jekyll_pages_api (0.1.6)
htmlentities (~> 4.3)
jekyll (>= 2.0, < 4.0)
jekyll_pages_api_search (0.5.0)
jekyll_pages_api (~> 0.1.4)
sass (~> 3.4)
Expand Down Expand Up @@ -228,7 +233,7 @@ DEPENDENCIES
jekyll-watch (~> 2.2.0)
jekyll_frontmatter_tests (~> 0.1.0)
jekyll_oembed
jekyll_pages_api
jekyll_pages_api!
jekyll_pages_api_search (~> 0.5.0)
jemoji
parallel
Expand Down
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,5 @@ jekyll_pages_api_search:
boost: 10
url:
boost: 5
type:
body:
1 change: 1 addition & 0 deletions _posts/2019-07-30-Testing-Our-Toolkit.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ tags:
- open source
- tech
excerpt: ""
type: blogpost
---

## Tests we run
Expand Down
1 change: 1 addition & 0 deletions _services_projects/20-year-emtech-landscape.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ image: /assets/img/projects/20yr-emtech-landscape-image.png
image_accessibility: Image showing the 20 year landscape. Click on this to view the blogpost and a detailed view of the landscape.
media: "[20 Year EmTech Landscape](/staging-site/assets/media/20-Year-Emtech-Landscape/Emerging-Technology-20Year-Landscape.pdf)"
resources:
type: report
---
<br/>
<span class="subtitle">Led by Hazel Bradshaw, Emerging Tech Lead - Service Innovation Lab</span>
Expand Down
28 changes: 0 additions & 28 deletions assets/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,40 +28,12 @@ $(function() {
},
);

// Mailchimp
var $form = $('#contact-form'),
$newsletter = $('#newsletter'),
$newsletterSuccess = $('#newsletter-success'),
$newsletterEmail = $('#newsletter-email');

var defaultNewsletterText = $newsletter.text();

var newsletterForm = {
response: function() {
var email = $newsletterEmail.val();
$('#newsletter-response').text(email);
$form.hide();
$newsletterSuccess.show();
},
reset: function(argument) {
$newsletter.text(defaultNewsletterText);
$newsletterEmail.val('');
$form.show();
$newsletterSuccess.hide();
$newsletterEmail.focus();
},
};

function callbackFunction(resp) {
if (resp.result === 'success') {
newsletterForm.response();
}
}

$('#button-reset').on('click', function() {
newsletterForm.reset();
});

$('.search-interface').on('submit', function() {
$('#search-loading').show();
});
Expand Down
24 changes: 24 additions & 0 deletions assets/js/jekyll-pages-api-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,30 @@ function renderJekyllPagesApiSearchResults(query, results, doc, resultsElem) {
$('#search-loading').hide();
results.forEach(function(result, index) {
var resultTitle = result.title;
console.log(result);
console.log(result.score);
console.log(result.url);
// console.log(result.matchData);
console.log(result.ref);
// console.log(result.tags);
// console.log(result.categories);
// console.log(result.body);
console.log(results.length);

// if (results.length) { // Are there any results?
// var appendString = '';

// for (var i = 0; i < results.length; i++) { // Iterate over the results
// var item = store[results[i].ref];
// appendString += '<li><a href="' + item.url + '"><h3>' + item.title + '</h3></a>';
// appendString += '<p>' + item.content.substring(0, 150) + '...</p></li>';
// }

// searchResults.innerHTML = appendString;
// } else {
// searchResults.innerHTML = '<li>No results found</li>';
// }

var errorPages =
resultTitle === '404' || resultTitle === '500' || resultTitle === '';

Expand Down
70 changes: 70 additions & 0 deletions pages/search-results-test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
title: search
layout: none
search: exclude
permalink: /search-results-test/
---

<!-- [
{% for page in site.pages %}
{% unless page.search == "exclude" %}
{
"title": "{{ page.title | escape }}",
"tags": "{{ page.tags }}",
"media": "{{ page.media }}",
"keywords": "{{page.keywords}}",
"url": "{{ page.url }}",
"summary": "{{ page.summary | strip }}"
},
{% endunless %}
{% endfor %}

{% for post in site.posts %}

{
"title": "{{ post.title | escape }}",
"tags": "{{ post.tags }}",
"media": "{{ page.media }}",
"keywords": "{{post.keywords}}",
"url": "{{ post.url }}",
"summary": "{{ post.summary | strip }}"
}
{% unless forloop.last %},{% endunless %}
{% endfor %}

] -->
<!-- [
{% for post in site.documents %}
{
"title" : "{{ post.title | escape }}",
"category" : "{{ post.category }}",
"tags" : "{{ post.tags | array_to_sentence_string }}",
"url" : "{{ site.baseurl }}{{ post.url }}",
"date" : "{{ post.date }}"
} {% unless forloop.last %},{% endunless %}
{% endfor %},

{% for post in site.posts %}
{
"title" : "{{ post.title | escape }}",
"category" : "{{ post.category }}",
"tags" : "{{ post.tags | join: ', ' }}",
"url" : "{{ site.baseurl }}{{ post.url }}",
"date" : "{{ post.date }}",
"content" : "{{ post.content | strip_html | strip_newlines }}"
} {% unless forloop.last %},{% endunless %}
{% endfor %}
,
{% for page in site.pages %}
{
{% if page.title != nil %}
"title" : "{{ page.title | escape }}",
"category" : "{{ page.category }}",
"tags" : "{{ page.tags | join: ', ' }}",
"url" : "{{ site.baseurl }}{{ page.url }}",
"date" : "{{ page.date }}",
"content" : "{{ page.content | strip_html | strip_newlines }}"
{% endif %}
} {% unless forloop.last %},{% endunless %}
{% endfor %}
] -->