Skip to content

Commit

Permalink
update temporary message
Browse files Browse the repository at this point in the history
* remove hard-coded agencies
* remove _agencies and _data-pages collections in favor of _data/agencies.json
* add page-generator-gem
* add page-generator plugin shim from avillafiorita/jekyll-datapage_gen#57
* generate a sitemap
  • Loading branch information
ryanwoldatwork committed Jun 10, 2023
1 parent adb6ede commit 80f6f6b
Show file tree
Hide file tree
Showing 65 changed files with 11,029 additions and 577 deletions.
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ gem 'bourbon', '~> 4.3.4'
gem 'kramdown-parser-gfm'
gem 'sass', '~> 3.4.24'
gem 'neat', '~> 2.1.0'

group :jekyll_plugins do
gem 'jekyll-datapage-generator'
gem 'jekyll-redirect-from'
gem 'jekyll-sitemap'
end
8 changes: 8 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@ GEM
pathutil (~> 0.9)
rouge (>= 1.7, < 4)
safe_yaml (~> 1.0)
jekyll-datapage-generator (1.4.0)
jekyll-redirect-from (0.16.0)
jekyll (>= 3.3, < 5.0)
jekyll-sass-converter (1.5.2)
sass (~> 3.4)
jekyll-sitemap (1.4.0)
jekyll (>= 3.7, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (2.3.1)
Expand Down Expand Up @@ -64,6 +69,9 @@ PLATFORMS
DEPENDENCIES
bourbon (~> 4.3.4)
jekyll (~> 3.9.0)
jekyll-datapage-generator
jekyll-redirect-from
jekyll-sitemap
kramdown-parser-gfm
neat (~> 2.1.0)
sass (~> 3.4.24)
Expand Down
26 changes: 3 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Other organizations who have reused this project for their analytics dashboard:
| [The City of Omaha, NE](https://analytics.cityofomaha.org/) | [The City of San Francisco, CA](http://analytics.sfgov.org/)
| [The City of Sacramento, CA](http://analytics.cityofsacramento.org/) | [Carbarrus County, NC](http://analytics.cabarruscounty.us/)
| [Cook County, IL](http://opendocs.cookcountyil.gov/analytics/) | [data.jerseycitynj.gov](http://datajerseycitynj.seamlessreports.com/) |
| [City of Seattle](https://www.seattle.gov/about-our-digital-properties/web-analytics) | [Douglas County, NE](http://analytics.douglascounty-ne.gov/)
| [Washington State University](https://analytics.wsu.edu/) | [State of Indiana](https://analytics.in.gov/)
| [City of Seattle](https://www.seattle.gov/about-our-digital-properties/web-analytics) | [Douglas County, NE](http://analytics.douglascounty-ne.gov/)
| [Washington State University](https://analytics.wsu.edu/) | [State of Indiana](https://analytics.in.gov/)
| [The States of Jersey](http://webanalytics.gov.je/) | [The City of Pittsburgh](http://webstats.pittsburghpa.gov/) |
| [U.S. Department of Education](http://www2.ed.gov/analytics) | [U.S. Department of Veterans Affairs](http://www.oit.va.gov/analytics/) |
| [USA.gov - General Services Administration](https://www.usa.gov/website-analytics/) | [Government of Canada](https://gcanalyticsapp.com/gca-dashboard/dashboard-index) |
Expand Down Expand Up @@ -64,32 +64,12 @@ npm run build-dev
### Adding Additional Agencies

1. Ensure that data is being collected for a specific agency's Google Analytics ID. Visit [18F's analytics-reporter](https://github.com/18F/analytics-reporter) for more information. Save the url path for the data collection path.
1. Create a new html file in the `_agencies` directory. The name of the file will be the url path.
```bash
touch _agencies/agencyx.html
```
1. Create a new html file in the `_data_pages` directory. Use the same name you used in step 2. This will be the data download page for this agency
```bash
touch _data_pages/agencyx.html
```
1. Set the required data for for the new files. (Both files need this data.) example:
```yaml
---
name: Agency X # Name of the page
slug: agencyx # Same as the name of the html files. Used to generate data page links.
layout: default # type of layout used. available layouts are in `_layouts`
---
```
1. Agency page: Below the data you just entered, include the page content you want. The `_agencies` page will use the `charts.html` partial and the `_data_pages` pages will use the `data_download.html` partial. example:
```yaml
{% include charts.html %}
```
1. Create a new json object in the `/_data/agencies.json` file. The `slug` attribute of the object will be the url path. The `name` attribute is the Agency's name.

### Developing with local data

The development settings assume data is available at `/fakedata`. You can change this in `_development.yml`.


### Developing with real live data from `analytics-reporter`

If also working off of local data, e.g. using `analytics-reporter`, you will need to make the data available over HTTP _and_ through CORS.
Expand Down
6 changes: 0 additions & 6 deletions _agencies/agency-international-development.html

This file was deleted.

6 changes: 0 additions & 6 deletions _agencies/agriculture.html

This file was deleted.

6 changes: 0 additions & 6 deletions _agencies/commerce.html

This file was deleted.

6 changes: 0 additions & 6 deletions _agencies/defense.html

This file was deleted.

6 changes: 0 additions & 6 deletions _agencies/education.html

This file was deleted.

6 changes: 0 additions & 6 deletions _agencies/energy.html

This file was deleted.

6 changes: 0 additions & 6 deletions _agencies/environmental-protection-agency.html

This file was deleted.

6 changes: 0 additions & 6 deletions _agencies/executive-office-president.html

This file was deleted.

6 changes: 0 additions & 6 deletions _agencies/general-services-administration.html

This file was deleted.

6 changes: 0 additions & 6 deletions _agencies/health-human-services.html

This file was deleted.

6 changes: 0 additions & 6 deletions _agencies/homeland-security.html

This file was deleted.

6 changes: 0 additions & 6 deletions _agencies/housing-urban-development.html

This file was deleted.

6 changes: 0 additions & 6 deletions _agencies/interior.html

This file was deleted.

6 changes: 0 additions & 6 deletions _agencies/justice.html

This file was deleted.

6 changes: 0 additions & 6 deletions _agencies/labor.html

This file was deleted.

6 changes: 0 additions & 6 deletions _agencies/national-aeronautics-space-administration.html

This file was deleted.

6 changes: 0 additions & 6 deletions _agencies/national-archives-records-administration.html

This file was deleted.

6 changes: 0 additions & 6 deletions _agencies/national-science-foundation.html

This file was deleted.

6 changes: 0 additions & 6 deletions _agencies/nuclear-regulatory-commission.html

This file was deleted.

6 changes: 0 additions & 6 deletions _agencies/office-personnel-management.html

This file was deleted.

6 changes: 0 additions & 6 deletions _agencies/postal-service.html

This file was deleted.

6 changes: 0 additions & 6 deletions _agencies/small-business-administration.html

This file was deleted.

6 changes: 0 additions & 6 deletions _agencies/social-security-administration.html

This file was deleted.

6 changes: 0 additions & 6 deletions _agencies/state.html

This file was deleted.

6 changes: 0 additions & 6 deletions _agencies/transportation.html

This file was deleted.

6 changes: 0 additions & 6 deletions _agencies/treasury.html

This file was deleted.

6 changes: 0 additions & 6 deletions _agencies/veterans-affairs.html

This file was deleted.

42 changes: 32 additions & 10 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

baseurl: ""

# Don't exclude nginx.conf, needs to be copied into _site for
# cloud.gov to pick up on it.
exclude:
Expand All @@ -23,6 +25,9 @@ exclude:
- docker-compose.yml
- bin/
- docs/
- fake-data/
- node_modules/
- spec/

# defaults
defaults:
Expand All @@ -33,14 +38,6 @@ defaults:
values:
layout: default

collections:
agencies:
output: true
permalink: /:path/
data_pages:
output: true
permalink: /:path/data/

# Site title and description
title: "analytics.usa.gov | The US government's web traffic."
description: "Official data on web traffic to hundreds of US federal government websites. Published by the Digital Analytics Program."
Expand All @@ -60,8 +57,33 @@ twitter: usgsa
# Site wide error message
site_wide_error:
display: true
title: "Realtime data may not be accurate"
body: "The Google Analytics account that powers analytics.usa.gov is experiencing issues with realtime reporting. Realtime data may be inaccurate."
title: "Realtime data currently not available"
body: 'The Google Analytics account that powers analytics.usa.gov is in the process of migrating from Universal Analytics to GA4. Realtime data will become available post migration in the upcoming weeks. Stay tuned as we work hard to bring you the next generation GA4 data.<br><br>For immediate questions about your specific use case, please contact us at <a href="mailto:[email protected]">[email protected]</a>'
sass:
sass_dir: sass
style: nested

plugins:
- jekyll-datapage-generator
- jekyll-redirect-from

page_gen:
# Write /agency.slug pages
- data: "agencies"
template: "data"
dir_expr: "record['slug']"
index_files: false
name_expr: "'index'"
title_expr: "record['name']"
# debug: true

# Write /agency.slug/data pages
- data: "agencies"
template: "data_download"
dir_expr: "record['slug'] + '/data/'"
index_files: false
# name: "index"
# name_expr: "record['slug']"
name_expr: "'index'"
title_expr: "record['name']"
debug: true
Loading

0 comments on commit 80f6f6b

Please sign in to comment.