Skip to content
This repository was archived by the owner on Sep 25, 2024. It is now read-only.

Commit ecb90b9

Browse files
authored
Use asset pipeline and cross platform builds (#42)
Use asset pipeline and cross platform builds
2 parents 8eba541 + 8d2e680 commit ecb90b9

28 files changed

+429
-318
lines changed

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@ _site
22
.sass-cache
33
.jekyll-metadata
44
node_modules
5-
assets/js
6-
assets/uswds
7-
_sass/uswds
85
.bundle
6+
.jekyll-cache/

Gemfile

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ source "https://rubygems.org"
88
#
99
# This will help ensure the proper Jekyll version is running.
1010
# Happy Jekylling!
11-
gem "jekyll", "~> 3.8.4"
11+
gem "jekyll", "~> 3.8"
1212

1313

1414
# If you have any plugins, put them here!
@@ -18,20 +18,13 @@ group :jekyll_plugins do
1818
gem 'jekyll-paginate-v2', "2.0"
1919
gem 'jekyll-sitemap'
2020
gem 'jekyll-seo-tag'
21-
22-
# jekyll_pages_api_search is useful gem, but needs updating
23-
# to support the latest version of Jekyll
24-
# gem 'jekyll_pages_api_search'
25-
21+
gem "jekyll-assets", "~> 3.0", group: :jekyll_plugins
2622
end
2723

28-
29-
3024
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
3125
gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
3226

3327
# Performance-booster for watching directories on Windows
3428
gem "wdm", "~> 0.1.0" if Gem.win_platform?
3529

36-
3730
gem "html-proofer", "~> 3.10"

Gemfile.lock

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,17 @@ GEM
1717
ethon (0.12.0)
1818
ffi (>= 1.3.0)
1919
eventmachine (1.2.7)
20+
eventmachine (1.2.7-java)
21+
eventmachine (1.2.7-x64-mingw32)
22+
eventmachine (1.2.7-x86-mingw32)
23+
execjs (2.7.0)
24+
extras (0.3.0)
25+
forwardable-extended (~> 2.5)
26+
fastimage (2.1.7)
2027
ffi (1.10.0)
28+
ffi (1.10.0-java)
29+
ffi (1.10.0-x64-mingw32)
30+
ffi (1.10.0-x86-mingw32)
2131
forwardable-extended (2.6.0)
2232
html-proofer (3.10.1)
2333
activesupport (>= 4.2, < 6.0)
@@ -29,6 +39,7 @@ GEM
2939
typhoeus (~> 1.3)
3040
yell (~> 2.0)
3141
http_parser.rb (0.6.0)
42+
http_parser.rb (0.6.0-java)
3243
i18n (0.9.5)
3344
concurrent-ruby (~> 1.0)
3445
jekyll (3.8.5)
@@ -44,12 +55,25 @@ GEM
4455
pathutil (~> 0.9)
4556
rouge (>= 1.7, < 4)
4657
safe_yaml (~> 1.0)
58+
jekyll-assets (3.0.12)
59+
activesupport (~> 5.0)
60+
execjs (~> 2.7)
61+
extras (~> 0.2)
62+
fastimage (~> 2.0, >= 1.8)
63+
jekyll (>= 3.5, < 4.0)
64+
jekyll-sanity (~> 1.2)
65+
liquid-tag-parser (~> 1.0)
66+
nokogiri (~> 1.8)
67+
pathutil (~> 0.16)
68+
sprockets (>= 3.3, < 4.1.beta)
4769
jekyll-feed (0.11.0)
4870
jekyll (~> 3.3)
4971
jekyll-paginate-v2 (2.0.0)
5072
jekyll (~> 3.0)
5173
jekyll-redirect-from (0.14.0)
5274
jekyll (~> 3.3)
75+
jekyll-sanity (1.2.0)
76+
jekyll (~> 3.1)
5377
jekyll-sass-converter (1.5.2)
5478
sass (~> 3.4)
5579
jekyll-seo-tag (2.6.0)
@@ -60,6 +84,9 @@ GEM
6084
listen (~> 3.0)
6185
kramdown (1.17.0)
6286
liquid (4.0.1)
87+
liquid-tag-parser (1.9.0)
88+
extras (~> 0.3)
89+
liquid (>= 3.0, < 5.0)
6390
listen (3.1.5)
6491
rb-fsevent (~> 0.9, >= 0.9.4)
6592
rb-inotify (~> 0.9, >= 0.9.7)
@@ -69,10 +96,16 @@ GEM
6996
minitest (5.11.3)
7097
nokogiri (1.10.4)
7198
mini_portile2 (~> 2.4.0)
99+
nokogiri (1.10.4-java)
100+
nokogiri (1.10.4-x64-mingw32)
101+
mini_portile2 (~> 2.4.0)
102+
nokogiri (1.10.4-x86-mingw32)
103+
mini_portile2 (~> 2.4.0)
72104
parallel (1.13.0)
73105
pathutil (0.16.2)
74106
forwardable-extended (~> 2.6)
75107
public_suffix (3.0.3)
108+
rack (2.0.7)
76109
rb-fsevent (0.10.3)
77110
rb-inotify (0.10.0)
78111
ffi (~> 1.0)
@@ -84,19 +117,30 @@ GEM
84117
sass-listen (4.0.0)
85118
rb-fsevent (~> 0.9, >= 0.9.4)
86119
rb-inotify (~> 0.9, >= 0.9.7)
120+
sprockets (3.7.2)
121+
concurrent-ruby (~> 1.0)
122+
rack (> 1, < 3)
87123
thread_safe (0.3.6)
124+
thread_safe (0.3.6-java)
88125
typhoeus (1.3.1)
89126
ethon (>= 0.9.0)
90127
tzinfo (1.2.5)
91128
thread_safe (~> 0.1)
129+
tzinfo-data (1.2019.3)
130+
tzinfo (>= 1.0.0)
92131
yell (2.0.7)
93132

94133
PLATFORMS
134+
java
95135
ruby
136+
x64-mingw32
137+
x86-mingw32
138+
x86-mswin32
96139

97140
DEPENDENCIES
98141
html-proofer (~> 3.10)
99-
jekyll (~> 3.8.4)
142+
jekyll (~> 3.8)
143+
jekyll-assets (~> 3.0)
100144
jekyll-feed (~> 0.6)
101145
jekyll-paginate-v2 (= 2.0)
102146
jekyll-redirect-from

README.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,27 @@ searchgov:
7272

7373

7474
## How to edit
75-
- We try to keep configuration options to a minimum so you can easily remove functionality, but you can review `_config.yml` to see the options that are available to you. There are a few values on top that you **need** to change. They make reference to the agency name and contact information. The advanced options at the bottom should be changed only if you know what you know what you're doing.
76-
- Do not edit files in the `assets/` folder. This folder is reserved for serving assets once the sites is compiled. If you want add your own custom code, add and edit files in `src/`, ideally mirroring the `assets/` folder structure. This will keep the code repository small and not include unneccessary files.
77-
- If you look at `package.json` you will see that the `npm run federalist` command will copy the contents from `src/` and move it over to `assets/` folder during the build process. If you want more advanced functionality, you should look into using [Webpack](https://webpack.js.org/concepts/configuration/).
78-
- Do not edit files in the `_site/` folder. These files are automatically generated and changes you make there will be destroyed.
79-
- You will most certainly need to edit files in `_includes/`, which include the primary menu, side navigation, logos etc
75+
- Non-developers should focus on editing markdown content in the `_posts` and `_pages` folder
76+
77+
- We try to keep configuration options to a minimum so you can easily change functionality. You should review `_config.yml` to see the options that are available to you. There are a few values on top that you **need** to change. They refer to the agency name and contact information. The rest of `_config.yml` has a range of more advanced options.
78+
79+
- The contents inside `assets/` folder store your Javascript, SCSS/CSS, images, and other media assets are managed by [jekyll-assets](https://github.com/envygeeks/jekyll-assets). Assets are combined, compressed, and automatically available in your theme
80+
81+
- If you look at `package.json` you will see that the `npm run federalist` command that will run when running on the Federalist platform.
82+
83+
- Do not edit files in the `_site/` folder. These files are auto-generated, and any change you make in the folder will be overwritten.
84+
85+
- To edit the look and feel of the site, you need to edit files in `_includes/` folder, which render key components, like the menu, side navigation, and logos.
86+
8087
- `index.html` may not require much editing, depending on how you customize `hero.html` and `highlights.html`.
88+
8189
- `_layouts/` may require the least amount of editing of all the files since they are primarily responsible for printing the content.
82-
- `blog/search.html` is by search.gov. If you need to stylize results page, this is where you will do it.
83-
- `blog/index.html` can be edited, but be careful. It will impact the pagination system for the posts. If you do edit the file, be prepared to edit `_config.yml`. You should also familiarize yourself with [jekyll-paginate-v2](https://github.com/sverrirs/jekyll-paginate-v2)
84-
- Non-developers should focus only on `_posts` and `_pages`
90+
91+
- `blog/index.html` can be edited, but be careful. It will impact the pagination system for the posts. If you do edit the file, be prepared to edit `_config.yml`. For example, you may need go change configurations for [jekyll-paginate-v2](https://github.com/sverrirs/jekyll-paginate-v2)
92+
93+
- `search/index.html` is used by search.gov.
94+
95+
8596

8697

8798
## Installation

_config.yml

Lines changed: 27 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
##########################################################################################
2020

2121
title: Agency Name
22-
email: contact@example.gov
22+
email: contact@example.gov
2323
description: >- # this means to ignore newlines until "baseurl:"
2424
Agency Name (EAC) Lorem ipsum dolor sit amet, consectetur adipiscing elit.
2525
Aenean et sapien a leo auctor scelerisque quis nec magna. Sed dictum ante a risus vehicula facilisis.
@@ -48,26 +48,26 @@ primary_navigation:
4848
- name: Document submenu
4949
children:
5050
- name: Navigation link
51-
url: '#main-content'
51+
url: "#main-content"
5252
- name: Navigation link
53-
url: '#main-content'
53+
url: "#main-content"
5454
- name: Navigation link
55-
url: '#main-content'
55+
url: "#main-content"
5656

5757
secondary_navigation:
5858
- name: Secondary link
59-
url: '#main-content'
59+
url: "#main-content"
6060
- name: Another secondary link
61-
url: '#main-content'
61+
url: "#main-content"
6262

6363
# Search.gov configuration
6464
#
6565
# 1. Create an account with Search.gov https://search.usa.gov/signup
6666
# 2. Add a new site.
6767
# 3. Add your site/affiliate name here.
6868
searchgov:
69-
endpoint: https://search.usa.gov # You should not change this.
70-
affiliate: federalist-uswds-example # replace this with your search.gov account
69+
endpoint: https://search.usa.gov # You should not change this.
70+
affiliate: federalist-uswds-example # replace this with your search.gov account
7171
access_key: xX1gtb2RcnLbIYkHAcB6IaTRr4ZfN-p16ofcyUebeko= # This is placeholder. Not private.
7272
inline: true #this renders the results on the same domain. Otherwise, it will render the results in the search.gov domain
7373

@@ -76,15 +76,13 @@ searchgov:
7676
# changed if you know what they do
7777
##########################################################################################
7878

79-
8079
collections:
8180
pages:
8281
output: true
8382
permalink: /:path/
8483

8584
permalink: pretty
8685

87-
8886
markdown: kramdown
8987
plugins:
9088
- jekyll-feed
@@ -97,91 +95,45 @@ plugins:
9795
# Site configuration for the Jekyll 3 Pagination Gem
9896
# The values here represent the defaults if nothing is set
9997
pagination:
100-
10198
# Site-wide kill switch, disabled here it doesn't run at all
10299
enabled: true
103-
104100
# Set to 'true' to enable pagination debugging. This can be enabled in the site config or only for individual pagination pages
105101
debug: false
106-
107102
# The default document collection to paginate if nothing is specified ('posts' is default)
108-
collection: 'posts'
109-
103+
collection: "posts"
110104
# How many objects per paginated page, used to be `paginate` (default: 0, means all)
111105
per_page: 3
112-
113106
# The permalink structure for the paginated pages (this can be any level deep)
114-
permalink: '/page/:num/' # Pages are index.html inside this folder (default)
107+
permalink: "/page/:num/" # Pages are index.html inside this folder (default)
115108
#permalink: '/page/:num.html' # Pages are simple html files
116109
#permalink: '/page/:num' # Pages are html files, linked jekyll extensionless permalink style.
117-
118110
# Optional the title format for the paginated pages (supports :title for original page title, :num for pagination page number, :max for total number of pages)
119-
title: ':title - page :num'
120-
111+
title: ":title - page :num"
121112
# Limit how many pagenated pages to create (default: 0, means all)
122113
limit: 0
123-
124114
# Optional, defines the field that the posts should be sorted on (omit to default to 'date')
125-
sort_field: 'date'
126-
115+
sort_field: "date"
127116
# Optional, sorts the posts in reverse order (omit to default decending or sort_reverse: true)
128117
sort_reverse: true
129-
130118
# Optional, the default category to use, omit or just leave this as 'posts' to get a backwards-compatible behavior (all posts)
131-
category: 'posts'
132-
119+
category: "posts"
133120
# Optional, the default tag to use, omit to disable
134-
tag: ''
135-
121+
tag: ""
136122
# Optional, the default locale to use, omit to disable (depends on a field 'locale' to be specified in the posts,
137123
# in reality this can be any value, suggested are the Microsoft locale-codes (e.g. en_US, en_GB) or simply the ISO-639 language code )
138-
locale: ''
139-
140-
# Optional,omit or set both before and after to zero to disable.
141-
# Controls how the pagination trail for the paginated pages look like.
124+
locale: ""
125+
# Optional,omit or set both before and after to zero to disable.
126+
# Controls how the pagination trail for the paginated pages look like.
142127
trail:
143128
before: 2
144129
after: 2
145-
146130
# Optional, the default file extension for generated pages (e.g html, json, xml).
147131
# Internally this is set to html by default
148132
extension: html
149-
150133
# Optional, the default name of the index file for generated pages (e.g. 'index.html')
151134
# Without file extension
152-
indexpage: 'index.html'
153-
154-
155-
156-
# # Configuration for jekyll_pages_api_search plugin gem.
157-
# jekyll_pages_api_search:
158-
# # Uncomment this to speed up site generation while developing.
159-
# #skip_index: true
160-
#
161-
# # Each member of `index_fields` should correspond to a field generated by
162-
# # the jekyll_pages_api. It can hold an optional `boost` member as a signal
163-
# # to Lunr.js to weight the field more highly (default is 1).
164-
# index_fields:
165-
# title:
166-
# boost: 10
167-
# tags:
168-
# boost: 10
169-
# url:
170-
# boost: 5
171-
# body:
172-
#
173-
# # If defined and browserify and uglifyify are installed, the plugin will
174-
# # generate a bundle to define the renderJekyllPagesApiSearchResults
175-
# # function.
176-
# browserify:
177-
# source: js/my-search.js
178-
# target: js/my-search-bundle.js
179-
#
180-
135+
indexpage: "index.html"
181136

182-
# Exclude from processing.
183-
# The following items will not be processed, by default. Create a custom list
184-
# to override the default setting.
185137
exclude:
186138
- Gemfile
187139
- Gemfile.lock
@@ -195,3 +147,12 @@ exclude:
195147
- package-lock.json
196148
- README.md
197149
- src
150+
- CONTRIBUTING.md
151+
- LICENSE.md
152+
- assets
153+
154+
assets:
155+
sources:
156+
- node_modules/uswds/dist/img
157+
- node_modules/uswds/dist/js
158+
- node_modules/uswds/dist/scss

0 commit comments

Comments
 (0)