This repository was archived by the owner on Aug 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#94091132] Admin can render help text on search.digitalgov.gov
- also upgrade jekyll
- Loading branch information
1 parent
cbf73aa
commit f091cd2
Showing
22 changed files
with
275 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--color | ||
--require spec_helper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
language: ruby | ||
rvm: | ||
- 2.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'rake' | ||
gem 'jekyll' | ||
gem 'sass' | ||
gem 'compass' | ||
gem 'jekyll' | ||
gem 'rake' | ||
gem 'rdiscount' | ||
gem 'RedCloth' | ||
gem 'rspec' | ||
gem 'sass', '~> 3.2.19' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,97 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
RedCloth (4.2.9) | ||
blankslate (2.1.2.4) | ||
celluloid (0.16.0) | ||
timers (~> 4.0.0) | ||
chunky_png (1.2.7) | ||
classifier (1.3.3) | ||
fast-stemmer (>= 1.0.0) | ||
classifier-reborn (2.0.3) | ||
fast-stemmer (~> 1.0) | ||
coffee-script (2.4.1) | ||
coffee-script-source | ||
execjs | ||
coffee-script-source (1.9.1.1) | ||
colorator (0.1) | ||
compass (0.12.2) | ||
chunky_png (~> 1.2) | ||
fssm (>= 0.2.7) | ||
sass (~> 3.1) | ||
directory_watcher (1.4.1) | ||
diff-lcs (1.2.5) | ||
execjs (2.5.2) | ||
fast-stemmer (1.0.2) | ||
ffi (1.9.8) | ||
fssm (0.2.10) | ||
jekyll (0.12.1) | ||
classifier (~> 1.3) | ||
directory_watcher (~> 1.1) | ||
kramdown (~> 0.14) | ||
liquid (~> 2.3) | ||
maruku (~> 0.5) | ||
pygments.rb (~> 0.3.2) | ||
kramdown (0.14.2) | ||
liquid (2.5.0) | ||
maruku (0.6.1) | ||
syntax (>= 1.0.0) | ||
posix-spawn (0.3.6) | ||
pygments.rb (0.3.7) | ||
hitimes (1.2.2) | ||
jekyll (2.5.3) | ||
classifier-reborn (~> 2.0) | ||
colorator (~> 0.1) | ||
jekyll-coffeescript (~> 1.0) | ||
jekyll-gist (~> 1.0) | ||
jekyll-paginate (~> 1.0) | ||
jekyll-sass-converter (~> 1.0) | ||
jekyll-watch (~> 1.1) | ||
kramdown (~> 1.3) | ||
liquid (~> 2.6.1) | ||
mercenary (~> 0.3.3) | ||
pygments.rb (~> 0.6.0) | ||
redcarpet (~> 3.1) | ||
safe_yaml (~> 1.0) | ||
toml (~> 0.1.0) | ||
jekyll-coffeescript (1.0.1) | ||
coffee-script (~> 2.2) | ||
jekyll-gist (1.2.1) | ||
jekyll-paginate (1.1.0) | ||
jekyll-sass-converter (1.3.0) | ||
sass (~> 3.2) | ||
jekyll-watch (1.2.1) | ||
listen (~> 2.7) | ||
kramdown (1.7.0) | ||
liquid (2.6.2) | ||
listen (2.10.0) | ||
celluloid (~> 0.16.0) | ||
rb-fsevent (>= 0.9.3) | ||
rb-inotify (>= 0.9) | ||
mercenary (0.3.5) | ||
parslet (1.5.0) | ||
blankslate (~> 2.0) | ||
posix-spawn (0.3.11) | ||
pygments.rb (0.6.3) | ||
posix-spawn (~> 0.3.6) | ||
yajl-ruby (~> 1.1.0) | ||
yajl-ruby (~> 1.2.0) | ||
rake (10.0.3) | ||
rdiscount (2.0.7.1) | ||
sass (3.2.7) | ||
syntax (1.0.0) | ||
yajl-ruby (1.1.0) | ||
rb-fsevent (0.9.4) | ||
rb-inotify (0.9.5) | ||
ffi (>= 0.5.0) | ||
rdiscount (2.1.7) | ||
redcarpet (3.2.3) | ||
rspec (3.2.0) | ||
rspec-core (~> 3.2.0) | ||
rspec-expectations (~> 3.2.0) | ||
rspec-mocks (~> 3.2.0) | ||
rspec-core (3.2.3) | ||
rspec-support (~> 3.2.0) | ||
rspec-expectations (3.2.1) | ||
diff-lcs (>= 1.2.0, < 2.0) | ||
rspec-support (~> 3.2.0) | ||
rspec-mocks (3.2.1) | ||
diff-lcs (>= 1.2.0, < 2.0) | ||
rspec-support (~> 3.2.0) | ||
rspec-support (3.2.2) | ||
safe_yaml (1.0.4) | ||
sass (3.2.19) | ||
timers (4.0.1) | ||
hitimes | ||
toml (0.1.2) | ||
parslet (~> 1.5.0) | ||
yajl-ruby (1.2.1) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
RedCloth | ||
compass | ||
jekyll | ||
rake | ||
rdiscount | ||
sass | ||
rspec | ||
sass (~> 3.2.19) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# DO NOT MODIFY KEYS | ||
|
||
# https://search.usa.gov/sites/1/collections/new | ||
# https://search.usa.gov/sites/1/collections/8/edit | ||
document_collection: | ||
name: | ||
url_prefixes: | ||
prefix: Enter the folder where the files to be searched are stored. Don't add an index page. | ||
|
||
|
||
# https://search.usa.gov/sites/1/domains/8/new | ||
# https://search.usa.gov/sites/1/domains/8/edit | ||
site_domain: | ||
domain: Leave off www to include all subdomains. Use www for results from www.agency.gov only. | ||
|
||
|
||
# https://search.usa.gov/sites/1/users/new | ||
user: | ||
contact_name: Please enter first and last name. | ||
email: Users you add will receive an email to complete their registration. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module HashFilter | ||
def concat_hash_keys(input, current_parent = '', hash = {}) | ||
return hash[current_parent] = input unless input.is_a? Hash | ||
|
||
input.each do |key, value| | ||
parent = current_parent.clone | ||
parent << '.' unless parent.empty? | ||
parent << key | ||
concat_hash_keys value, parent, hash | ||
end | ||
hash | ||
end | ||
end | ||
|
||
Liquid::Template.register_filter HashFilter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module Jekyll | ||
class HintTag < Liquid::Tag | ||
|
||
def initialize(tag_name, markup, tokens) | ||
super | ||
@keys = markup.split('.').map(&:strip).freeze | ||
end | ||
|
||
def render(context) | ||
hints = context.registers[:site].data['hints'].freeze | ||
@keys.inject(hints) { |h, key| h[key] } | ||
end | ||
end | ||
end | ||
|
||
Liquid::Template.register_tag('hint', Jekyll::HintTag) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
--- | ||
layout: nil | ||
--- | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<feed xmlns="http://www.w3.org/2005/Atom"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
layout: default | ||
--- | ||
# Hints | ||
|
||
Syntax | Output | ||
:------------------------------------------------------------------------------------- | :----- | ||
{% raw %}`{% hint document_collection.name %}`{% endraw %} | {% hint document_collection.name %} | ||
{% raw %}`{% hint document_collection.url_prefixes.prefix %}`{% endraw %} | {% hint document_collection.url_prefixes.prefix %} | ||
{% raw %}`{% hint site_domain.domain %}`{% endraw %} | {% hint site_domain.domain %} | ||
{% raw %}`{% hint user.contact_name %}`{% endraw %} | {% hint user.contact_name %} | ||
{% raw %}`{% hint user.email %}`{% endraw %} | {% hint user.email %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
{ | ||
"document_collection.name": null, | ||
"document_collection.url_prefixes.prefix": "Enter the folder where the files to be searched are stored. Don't add an index page.", | ||
"site_domain.domain": "Leave off www to include all subdomains. Use www for results from www.agency.gov only.", | ||
"user.contact_name": "Please enter first and last name.", | ||
"user.email": "Users you add will receive an email to complete their registration." | ||
} | ||
--- | ||
--- | ||
{{ site.data.hints | concat_hash_keys | jsonify }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
require 'yaml' | ||
|
||
RSpec.describe "hints file" do | ||
let(:filename) { File.absolute_path('_data/hints.yml') } | ||
|
||
it 'contains valid YAML' do | ||
expect(YAML.load_file(filename)).not_to be_empty | ||
end | ||
end |
Oops, something went wrong.