diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 9d8d516562..0000000000 --- a/.babelrc +++ /dev/null @@ -1 +0,0 @@ -{ "presets": ["es2015"] } diff --git a/.github/super-linter.env b/.github/super-linter.env new file mode 100644 index 0000000000..7ce7647b48 --- /dev/null +++ b/.github/super-linter.env @@ -0,0 +1,11 @@ +VALIDATE_ALL_CODEBASE=true +VALIDATE_CSS=false +VALIDATE_DOCKERFILE_HADOLINT=false +VALIDATE_EDITORCONFIG=false +VALIDATE_GITLEAKS=false +VALIDATE_HTML=false +VALIDATE_JAVASCRIPT_STANDARD=false +VALIDATE_JSCPD=false +VALIDATE_JSON=false +VALIDATE_MARKDOWN=false +VALIDATE_NATURAL_LANGUAGE=false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..213783ab7a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,18 @@ +--- +name: CI + +on: + pull_request: + +jobs: + lint: + # Run GH Super-Linter against code base + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: cat .github/super-linter.env >> "$GITHUB_ENV" + - name: Lint Code Base + uses: github/super-linter@v4 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DEFAULT_BRANCH: develop \ No newline at end of file diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml new file mode 100644 index 0000000000..3d9580b2e0 --- /dev/null +++ b/.github/workflows/github-pages.yml @@ -0,0 +1,70 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +# Sample workflow for building and deploying a Jekyll site to GitHub Pages +name: Deploy Jekyll site to Pages + +on: + # Runs on pushes targeting this branch + push: + branches: [gh-pages] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Ruby + uses: ruby/setup-ruby@ee2113536afb7f793eed4ce60e8d3b26db912da4 # v1.127.0 + with: + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + cache-version: 0 # Increment this number if you need to re-download cached gems + - name: Setup Pages + id: pages + uses: actions/configure-pages@v3 + - name: Write metadata to a file Jekyll can use + env: + BRANCH: ${{ github.ref_name }} + run: | + echo "branch: $BRANCH" > _config.ci.yml + - name: Build with Jekyll + # Outputs to the './_site' directory by default + run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}" --config _config.ci.yml,_config.yml + env: + JEKYLL_ENV: production + PAGES_REPO_NWO: ${{ github.repository }} + JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload artifact + # Automatically uploads an artifact from the './_site' directory by default + uses: actions/upload-pages-artifact@v1 + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 diff --git a/.gitignore b/.gitignore index f200ceadcb..5351f96936 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ _site _config.dev.yml node_modules *.map +_config.ci.yml +.parcel-cache +vendor diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000000..ef538c2810 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.1.2 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8b98567512..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: ruby -rvm: - - 2.1 - -script: bundle exec jekyll build --destination _site/jkan && bundle exec htmlproof ./_site --disable-external --allow-hash-href - -branches: - only: - - gh-pages - -env: - global: - - NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..24a812eeb0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM ruby:3.1-bullseye + +ENV NODE_MAJOR_VERSION 18 + +RUN curl --silent --show-error --location --retry 5 --retry-connrefuse --retry-delay 4 https://deb.nodesource.com/setup_${NODE_MAJOR_VERSION}.x | bash - \ + && apt-get update \ + && apt-get install -y --quiet --no-install-recommends \ + nodejs + +ENV GEM_HOME=/usr/gem +ENV PATH="$GEM_HOME/bin/:$PATH" + +RUN gem install bundler -v '2.4.3' +# throw errors if Gemfile has been modified since Gemfile.lock +RUN bundle config --global frozen 1 + +WORKDIR /srv/jekyll +COPY Gemfile Gemfile.lock ./ +RUN bundle install + +# Add so gh-pages can detect git remotes +RUN git config --global --add safe.directory /srv/jekyll + +CMD ["/bin/bash"] diff --git a/Gemfile b/Gemfile index d8777ee274..5b2f5313d9 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,5 @@ source "https://rubygems.org" -gem "jekyll" -gem "html-proofer" \ No newline at end of file +gem "github-pages", group: :jekyll_plugins +gem "jekyll", "~> 3.9" +gem "webrick", "~> 1.7" diff --git a/Gemfile.lock b/Gemfile.lock index 6a9e84229e..063613c996 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,72 +1,274 @@ GEM remote: https://rubygems.org/ specs: - activesupport (4.2.5.2) - i18n (~> 0.7) - json (~> 1.7, >= 1.7.7) + activesupport (6.0.6) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - addressable (2.4.0) - colorator (0.1) - colored (1.2) - ethon (0.8.1) - ffi (>= 1.3.0) - ffi (1.9.10) - html-proofer (2.6.4) - activesupport (~> 4.2) + zeitwerk (~> 2.2, >= 2.2.2) + addressable (2.8.1) + public_suffix (>= 2.0.2, < 6.0) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.11.1) + colorator (1.1.0) + commonmarker (0.23.6) + concurrent-ruby (1.1.10) + dnsruby (1.61.9) + simpleidn (~> 0.1) + em-websocket (0.5.3) + eventmachine (>= 0.12.9) + http_parser.rb (~> 0) + ethon (0.16.0) + ffi (>= 1.15.0) + eventmachine (1.2.7) + eventmachine (1.2.7-x64-mingw32) + execjs (2.8.1) + faraday (2.7.2) + faraday-net_http (>= 2.0, < 3.1) + ruby2_keywords (>= 0.0.4) + faraday-net_http (3.0.2) + ffi (1.15.5) + ffi (1.15.5-x64-mingw32) + forwardable-extended (2.6.0) + gemoji (3.0.1) + github-pages (227) + github-pages-health-check (= 1.17.9) + jekyll (= 3.9.2) + jekyll-avatar (= 0.7.0) + jekyll-coffeescript (= 1.1.1) + jekyll-commonmark-ghpages (= 0.2.0) + jekyll-default-layout (= 0.1.4) + jekyll-feed (= 0.15.1) + jekyll-gist (= 1.5.0) + jekyll-github-metadata (= 2.13.0) + jekyll-include-cache (= 0.2.1) + jekyll-mentions (= 1.6.0) + jekyll-optional-front-matter (= 0.3.2) + jekyll-paginate (= 1.1.0) + jekyll-readme-index (= 0.3.0) + jekyll-redirect-from (= 0.16.0) + jekyll-relative-links (= 0.6.1) + jekyll-remote-theme (= 0.4.3) + jekyll-sass-converter (= 1.5.2) + jekyll-seo-tag (= 2.8.0) + jekyll-sitemap (= 1.4.0) + jekyll-swiss (= 1.0.0) + jekyll-theme-architect (= 0.2.0) + jekyll-theme-cayman (= 0.2.0) + jekyll-theme-dinky (= 0.2.0) + jekyll-theme-hacker (= 0.2.0) + jekyll-theme-leap-day (= 0.2.0) + jekyll-theme-merlot (= 0.2.0) + jekyll-theme-midnight (= 0.2.0) + jekyll-theme-minimal (= 0.2.0) + jekyll-theme-modernist (= 0.2.0) + jekyll-theme-primer (= 0.6.0) + jekyll-theme-slate (= 0.2.0) + jekyll-theme-tactile (= 0.2.0) + jekyll-theme-time-machine (= 0.2.0) + jekyll-titles-from-headings (= 0.5.3) + jemoji (= 0.12.0) + kramdown (= 2.3.2) + kramdown-parser-gfm (= 1.1.0) + liquid (= 4.0.3) + mercenary (~> 0.3) + minima (= 2.5.1) + nokogiri (>= 1.13.6, < 2.0) + rouge (= 3.26.0) + terminal-table (~> 1.4) + github-pages-health-check (1.17.9) addressable (~> 2.3) - colored (~> 1.2) - mercenary (~> 0.3.2) - nokogiri (~> 1.5) - parallel (~> 1.3) - typhoeus (~> 0.7) - yell (~> 2.0) - i18n (0.7.0) - jekyll (3.1.1) - colorator (~> 0.1) + dnsruby (~> 1.60) + octokit (~> 4.0) + public_suffix (>= 3.0, < 5.0) + typhoeus (~> 1.3) + html-pipeline (2.14.3) + activesupport (>= 2) + nokogiri (>= 1.4) + http_parser.rb (0.8.0) + i18n (0.9.5) + concurrent-ruby (~> 1.0) + jekyll (3.9.2) + addressable (~> 2.4) + colorator (~> 1.0) + em-websocket (~> 0.5) + i18n (~> 0.7) jekyll-sass-converter (~> 1.0) - jekyll-watch (~> 1.1) - kramdown (~> 1.3) - liquid (~> 3.0) + jekyll-watch (~> 2.0) + kramdown (>= 1.17, < 3) + liquid (~> 4.0) mercenary (~> 0.3.3) - rouge (~> 1.7) + pathutil (~> 0.9) + rouge (>= 1.7, < 4) safe_yaml (~> 1.0) - jekyll-sass-converter (1.4.0) + jekyll-avatar (0.7.0) + jekyll (>= 3.0, < 5.0) + jekyll-coffeescript (1.1.1) + coffee-script (~> 2.2) + coffee-script-source (~> 1.11.1) + jekyll-commonmark (1.4.0) + commonmarker (~> 0.22) + jekyll-commonmark-ghpages (0.2.0) + commonmarker (~> 0.23.4) + jekyll (~> 3.9.0) + jekyll-commonmark (~> 1.4.0) + rouge (>= 2.0, < 4.0) + jekyll-default-layout (0.1.4) + jekyll (~> 3.0) + jekyll-feed (0.15.1) + jekyll (>= 3.7, < 5.0) + jekyll-gist (1.5.0) + octokit (~> 4.2) + jekyll-github-metadata (2.13.0) + jekyll (>= 3.4, < 5.0) + octokit (~> 4.0, != 4.4.0) + jekyll-include-cache (0.2.1) + jekyll (>= 3.7, < 5.0) + jekyll-mentions (1.6.0) + html-pipeline (~> 2.3) + jekyll (>= 3.7, < 5.0) + jekyll-optional-front-matter (0.3.2) + jekyll (>= 3.0, < 5.0) + jekyll-paginate (1.1.0) + jekyll-readme-index (0.3.0) + jekyll (>= 3.0, < 5.0) + jekyll-redirect-from (0.16.0) + jekyll (>= 3.3, < 5.0) + jekyll-relative-links (0.6.1) + jekyll (>= 3.3, < 5.0) + jekyll-remote-theme (0.4.3) + addressable (~> 2.0) + jekyll (>= 3.5, < 5.0) + jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0) + rubyzip (>= 1.3.0, < 3.0) + jekyll-sass-converter (1.5.2) sass (~> 3.4) - jekyll-watch (1.3.1) + jekyll-seo-tag (2.8.0) + jekyll (>= 3.8, < 5.0) + jekyll-sitemap (1.4.0) + jekyll (>= 3.7, < 5.0) + jekyll-swiss (1.0.0) + jekyll-theme-architect (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-cayman (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-dinky (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-hacker (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-leap-day (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-merlot (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-midnight (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-minimal (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-modernist (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-primer (0.6.0) + jekyll (> 3.5, < 5.0) + jekyll-github-metadata (~> 2.9) + jekyll-seo-tag (~> 2.0) + jekyll-theme-slate (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-tactile (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-time-machine (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-titles-from-headings (0.5.3) + jekyll (>= 3.3, < 5.0) + jekyll-watch (2.2.1) listen (~> 3.0) - json (1.8.3) - kramdown (1.9.0) - liquid (3.0.6) - listen (3.0.6) - rb-fsevent (>= 0.9.3) - rb-inotify (>= 0.9.7) - mercenary (0.3.5) - mini_portile2 (2.0.0) - minitest (5.8.4) - nokogiri (1.6.7.2) - mini_portile2 (~> 2.0.0.rc2) - parallel (1.6.2) - rb-fsevent (0.9.7) - rb-inotify (0.9.7) - ffi (>= 0.5.0) - rouge (1.10.1) - safe_yaml (1.0.4) - sass (3.4.21) - thread_safe (0.3.5) - typhoeus (0.8.0) - ethon (>= 0.8.0) - tzinfo (1.2.2) + jemoji (0.12.0) + gemoji (~> 3.0) + html-pipeline (~> 2.2) + jekyll (>= 3.0, < 5.0) + kramdown (2.3.2) + rexml + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) + liquid (4.0.3) + listen (3.8.0) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + mercenary (0.3.6) + mini_portile2 (2.8.1) + minima (2.5.1) + jekyll (>= 3.5, < 5.0) + jekyll-feed (~> 0.9) + jekyll-seo-tag (~> 2.1) + minitest (5.17.0) + nokogiri (1.13.9-x64-mingw32) + racc (~> 1.4) + nokogiri (1.13.9-x86_64-linux) + racc (~> 1.4) + nokogiri (1.14.0) + mini_portile2 (~> 2.8.0) + racc (~> 1.4) + octokit (4.25.1) + faraday (>= 1, < 3) + sawyer (~> 0.9) + pathutil (0.16.2) + forwardable-extended (~> 2.6) + public_suffix (4.0.7) + racc (1.6.2) + rb-fsevent (0.11.2) + rb-inotify (0.10.1) + ffi (~> 1.0) + rexml (3.2.5) + rouge (3.26.0) + ruby2_keywords (0.0.5) + rubyzip (2.3.2) + safe_yaml (1.0.5) + sass (3.7.4) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + sawyer (0.9.2) + addressable (>= 2.3.5) + faraday (>= 0.17.3, < 3) + simpleidn (0.2.1) + unf (~> 0.1.4) + terminal-table (1.8.0) + unicode-display_width (~> 1.1, >= 1.1.1) + thread_safe (0.3.6) + typhoeus (1.4.0) + ethon (>= 0.9.0) + tzinfo (1.2.10) thread_safe (~> 0.1) - yell (2.0.5) + unf (0.1.4) + unf_ext + unf_ext (0.0.8.2) + unicode-display_width (1.8.0) + webrick (1.7.0) + zeitwerk (2.6.6) PLATFORMS ruby + x64-mingw32 + x86_64-linux DEPENDENCIES - html-proofer - jekyll + github-pages + jekyll (~> 3.9) + webrick (~> 1.7) BUNDLED WITH - 1.11.2 + 2.4.3 diff --git a/README.md b/README.md index ac31057635..403c9ddaec 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,16 @@ -![JKAN logo, made by @JJediny](https://raw.githubusercontent.com/timwis/jkan/gh-pages/img/jkan.png) - -# JKAN [![Build Status](https://travis-ci.org/timwis/jkan.svg?branch=gh-pages)](https://travis-ci.org/timwis/jkan) [![Join the chat at https://gitter.im/timwis/jkan](https://badges.gitter.im/timwis/jkan.svg)](https://gitter.im/timwis/jkan?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +# JKAN A lightweight, backend-free open data portal, powered by Jekyll -Open-source data portals can be [really](https://twitter.com/waldojaquith/status/282599673569619969). -[hard](https://twitter.com/chris_whong/status/669207423719235584). to install and maintain. But their +Open-source data portals can be really hard to install and maintain. But their basic purpose of providing links to download data really isn't that complicated. JKAN is a proof-of-concept that allows a small, resource-strapped government agency to stand-up an open data portal by simply [clicking the fork button](https://help.github.com/articles/fork-a-repo/). -Please note this is still a work in progress! Check out the [issues](https://github.com/timwis/jkan/issues) to help -out or give feedback. - [Demo site](https://demo.jkan.io) -## Installation -See [Get Started](https://jkan.io/#get-started) on [jkan.io](https://jkan.io) for an installation wizard, -or follow the [manual installation](https://github.com/timwis/jkan/wiki/Manual-Installation) instructions yourself. - -For configuration details, see the [wiki](https://github.com/timwis/jkan/wiki) - -## Development -Please see the [Architecture](https://github.com/timwis/jkan/wiki/Architecture) page in the wiki. \ No newline at end of file +## Documentation +* [Installation](docs/installation.md) +* [Upgrading](docs/upgrading.md) +* [Schema customization](docs/schema-customization.md) +* [Running locally](docs/running-locally.md) +* [Architecture](docs/architecture.md) diff --git a/_config.yml b/_config.yml index 8f85bcb098..5c3fc02405 100644 --- a/_config.yml +++ b/_config.yml @@ -1,41 +1,23 @@ title: JKAN +greeting: Welcome to JKAN description: A lightweight, backend-free open data portal, powered by Jekyll. -baseurl: /jkan logo: /img/jkan.png +hero_image: /img/homepage-hero.jpg -# Authentication -github_client_id: -gatekeeper_host: +# Site theme +jkan_theme: Default # Dataset schema schema: default -# Categories -category_list: - - Arts / Culture / History - - Budget / Finance - - Economy - - Education - - Elections / Politics - - Environment - - Food - - Health / Human Services - - Parks / Recreation - - Planning / Zoning - - Public Safety - - Real Estate / Land Records - - Transportation - - Uncategorized - -# Link for the "fork me on github" banner. Remove this line to suppress banner. -fork_me_url: https://github.com/timwis/jkan - # Nav bar navigation: - title: Datasets url: /datasets/ - title: Organizations url: /organizations/ + - title: Categories + url: /categories/ # Collections collections: @@ -45,9 +27,17 @@ collections: organizations: output: true permalink: /organizations/:path/ + dataset_categories: + output: true + permalink: /categories/:path/ # Collections (cont'd) defaults: + - scope: + path: "" + type: dataset_categories + values: + layout: category - scope: path: "" type: datasets @@ -92,13 +82,19 @@ opengraph: # Exclude these files from the build exclude: + - CONTRIBUTING.md + - Dockerfile + - docker-compose.yml - Gemfile - Gemfile.lock - vendor - - .travis.yml - node_modules - scripts/src - package.json - - webpack.config.js + - package-lock.json - README.md - LICENSE + - netlify + - netlify.toml + - .parcel-cache + - docs diff --git a/_data/licenses.yml b/_data/licenses.yml new file mode 100644 index 0000000000..e9b14ce709 --- /dev/null +++ b/_data/licenses.yml @@ -0,0 +1,17 @@ +items: + - name: Creative Commons Attribution + url: https://creativecommons.org/licenses/by/4.0/ + - name: Creative Commons Attribution Share-Alike + url: https://creativecommons.org/licenses/by-sa/4.0/ + - name: Creative Commons CCZero + url: https://creativecommons.org/publicdomain/zero/1.0/ + - name: UK Open Government Licence + url: https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/ + - name: Open Data Commons Attribution License + url: http://www.opendefinition.org/licenses/odc-by + - name: Open Data Commons Open Database License (ODbL) + url: http://www.opendefinition.org/licenses/odc-odbl + - name: Open Data Commons Public Domain Dedication and Licence (PDDL) + url: http://www.opendefinition.org/licenses/odc-pddl + - name: Not Applicable + url: "" diff --git a/_data/schemas/default.yml b/_data/schemas/default.yml index ce3d6a0041..3b800edb10 100644 --- a/_data/schemas/default.yml +++ b/_data/schemas/default.yml @@ -6,15 +6,15 @@ dataset_fields: datajson: title - field_name: organization label: Organization - form_template: form/organization.html datajson: publisher.name - field_name: notes label: Description - form_template: form/textarea.html datajson: description + - field_name: license + label: License + datajson: license - field_name: category label: Category - form_template: form/category.html display_template: display/category.html datajson: category - field_name: maintainer @@ -34,7 +34,6 @@ resource_fields: - field_name: format label: Format datajson: distribution.format - form_template: form/dropdown.html values: - api - csv @@ -53,3 +52,13 @@ organization_fields: label: Description - field_name: logo label: Logo + +category_fields: + - field_name: name + label: Name + - field_name: logo + label: Logo + - field_name: logo_credit + label: Logo Credit + - field_name: featured + label: Featured on Homepage diff --git a/_data/themes.yml b/_data/themes.yml new file mode 100644 index 0000000000..6cbcd59aea --- /dev/null +++ b/_data/themes.yml @@ -0,0 +1,39 @@ +- name: Default + logo: /img/themes/default.png + src: '' +- name: Cerulean + logo: /img/themes/cerulean.png + src: https://stackpath.bootstrapcdn.com/bootswatch/4.2.1/cerulean/bootstrap.min.css +- name: Cosmo + logo: /img/themes/cosmo.png + src: https://maxcdn.bootstrapcdn.com/bootswatch/4.2.1/cosmo/bootstrap.min.css +- name: Cyborg + logo: /img/themes/cyborg.png + src: https://maxcdn.bootstrapcdn.com/bootswatch/4.2.1/cyborg/bootstrap.min.css +- name: Darkly + logo: /img/themes/darkly.png + src: https://maxcdn.bootstrapcdn.com/bootswatch/4.2.1/darkly/bootstrap.min.css +- name: Flatly + logo: /img/themes/flatly.png + src: https://maxcdn.bootstrapcdn.com/bootswatch/4.2.1/flatly/bootstrap.min.css +- name: Journal + logo: /img/themes/journal.png + src: https://maxcdn.bootstrapcdn.com/bootswatch/4.2.1/journal/bootstrap.min.css +- name: Lumen + logo: /img/themes/lumen.png + src: https://maxcdn.bootstrapcdn.com/bootswatch/4.2.1/lumen/bootstrap.min.css +- name: Sandstone + logo: /img/themes/sandstone.png + src: https://maxcdn.bootstrapcdn.com/bootswatch/4.2.1/sandstone/bootstrap.min.css +- name: Simplex + logo: /img/themes/simplex.png + src: https://maxcdn.bootstrapcdn.com/bootswatch/4.2.1/simplex/bootstrap.min.css +- name: Slate + logo: /img/themes/slate.png + src: https://maxcdn.bootstrapcdn.com/bootswatch/4.2.1/slate/bootstrap.min.css +- name: Spacelab + logo: /img/themes/spacelab.png + src: https://maxcdn.bootstrapcdn.com/bootswatch/4.2.1/spacelab/bootstrap.min.css +- name: Superhero + logo: /img/themes/superhero.png + src: https://maxcdn.bootstrapcdn.com/bootswatch/4.2.1/superhero/bootstrap.min.css diff --git a/_dataset_categories/arts-culture-history.md b/_dataset_categories/arts-culture-history.md new file mode 100644 index 0000000000..50c7bef65e --- /dev/null +++ b/_dataset_categories/arts-culture-history.md @@ -0,0 +1,5 @@ +--- +name: Arts / Culture / History +logo: "/img/categories/arts-culture-history.svg" +featured: true +--- diff --git a/_dataset_categories/budget-finance.md b/_dataset_categories/budget-finance.md new file mode 100644 index 0000000000..ae075090e8 --- /dev/null +++ b/_dataset_categories/budget-finance.md @@ -0,0 +1,6 @@ +--- +name: Budget / Finance +logo: "/img/categories/budget-finance.svg" +logo_credit: Renan Ferreira Santos from the Noun Project +featured: true +--- diff --git a/_dataset_categories/economy.md b/_dataset_categories/economy.md new file mode 100644 index 0000000000..e5c335b80b --- /dev/null +++ b/_dataset_categories/economy.md @@ -0,0 +1,6 @@ +--- +name: Economy +logo: "/img/categories/economy.svg" +logo_credit: Vectors Market from the Noun Project +featured: true +--- diff --git a/_dataset_categories/education.md b/_dataset_categories/education.md new file mode 100644 index 0000000000..46412a366d --- /dev/null +++ b/_dataset_categories/education.md @@ -0,0 +1,6 @@ +--- +name: Education +logo: "/img/categories/education.svg" +logo_credit: Sergey Patutin from the Noun Project +featured: true +--- diff --git a/_dataset_categories/elections-politics.md b/_dataset_categories/elections-politics.md new file mode 100644 index 0000000000..61e5f59f87 --- /dev/null +++ b/_dataset_categories/elections-politics.md @@ -0,0 +1,6 @@ +--- +name: Elections / Politics +logo: "/img/categories/elections-politics.svg" +logo_credit: Jean Soo from the Noun Project +featured: true +--- diff --git a/_dataset_categories/environment.md b/_dataset_categories/environment.md new file mode 100644 index 0000000000..82886e4f8a --- /dev/null +++ b/_dataset_categories/environment.md @@ -0,0 +1,5 @@ +--- +name: Environment +logo: "/img/categories/environment.svg" +featured: true +--- diff --git a/_dataset_categories/food.md b/_dataset_categories/food.md new file mode 100644 index 0000000000..e70afa9794 --- /dev/null +++ b/_dataset_categories/food.md @@ -0,0 +1,6 @@ +--- +name: Food +logo: "/img/categories/food.svg" +logo_credit: Creative Stall from the Noun Project +featured: true +--- diff --git a/_dataset_categories/health-human-services.md b/_dataset_categories/health-human-services.md new file mode 100644 index 0000000000..227b550124 --- /dev/null +++ b/_dataset_categories/health-human-services.md @@ -0,0 +1,6 @@ +--- +name: Health / Human Services +logo: "/img/categories/health-human-services.svg" +logo_credit: Timothy Miller from the Noun Project +featured: true +--- diff --git a/_dataset_categories/parks-recreation.md b/_dataset_categories/parks-recreation.md new file mode 100644 index 0000000000..5000b1d8c7 --- /dev/null +++ b/_dataset_categories/parks-recreation.md @@ -0,0 +1,6 @@ +--- +name: Parks / Recreation +logo: "/img/categories/parks-recreation.svg" +logo_credit: Pipe Rosas Licht from the Noun Project +featured: true +--- diff --git a/_dataset_categories/planning-zoning.md b/_dataset_categories/planning-zoning.md new file mode 100644 index 0000000000..2e470b15cb --- /dev/null +++ b/_dataset_categories/planning-zoning.md @@ -0,0 +1,5 @@ +--- +name: Planning / Zoning +logo: "/img/categories/planning-zoning.svg" +featured: true +--- diff --git a/_dataset_categories/public-safety.md b/_dataset_categories/public-safety.md new file mode 100644 index 0000000000..973bab061d --- /dev/null +++ b/_dataset_categories/public-safety.md @@ -0,0 +1,6 @@ +--- +name: Public Safety +logo: "/img/categories/public-safety.svg" +logo_credit: Rohith M S from the Noun Project +featured: true +--- diff --git a/_dataset_categories/real-estate-land-records.md b/_dataset_categories/real-estate-land-records.md new file mode 100644 index 0000000000..404ef6d143 --- /dev/null +++ b/_dataset_categories/real-estate-land-records.md @@ -0,0 +1,5 @@ +--- +name: Real Estate / Land Records +logo: "/img/categories/real-estate-land-records.svg" +featured: true +--- diff --git a/_dataset_categories/transportation.md b/_dataset_categories/transportation.md new file mode 100644 index 0000000000..adab1d1539 --- /dev/null +++ b/_dataset_categories/transportation.md @@ -0,0 +1,6 @@ +--- +name: Transportation +logo: "/img/categories/transportation.svg" +logo_credit: Dmitry Baranovskiy from the Noun Project +featured: true +--- diff --git a/_dataset_categories/uncategorized.md b/_dataset_categories/uncategorized.md new file mode 100644 index 0000000000..eb39e19d67 --- /dev/null +++ b/_dataset_categories/uncategorized.md @@ -0,0 +1,6 @@ +--- +name: Uncategorized +logo: "/img/categories/uncategorized.svg" +logo_credit: Edward Boatman from the Noun Project +featured: true +--- diff --git a/_datasets/sample-dataset.md b/_datasets/sample-dataset.md index 2f7af41390..141964abd3 100644 --- a/_datasets/sample-dataset.md +++ b/_datasets/sample-dataset.md @@ -4,18 +4,18 @@ title: Sample dataset organization: Sample Department notes: This is an example dataset that comes with a new installation of JKAN resources: - - url: http://data.phl.opendata.arcgis.com/datasets/1839b35258604422b0b520cbb668df0d_0.csv - name: Air Monitoring Stations CSV + - name: Air Monitoring Stations CSV + url: 'http://data.phl.opendata.arcgis.com/datasets/1839b35258604422b0b520cbb668df0d_0.csv' format: csv - description: Compatible with Excel - - url: http://data.phl.opendata.arcgis.com/datasets/1839b35258604422b0b520cbb668df0d_0.zip - name: Air Monitoring Stations Shapefile + - name: Air Monitoring Stations Shapefile + url: 'http://data.phl.opendata.arcgis.com/datasets/1839b35258604422b0b520cbb668df0d_0.zip' format: shp - - url: https://services.arcgis.com/fLeGjb7u4uXqeF9q/arcgis/rest/services/Air_Monitoring_Stations/FeatureServer/0/query - name: Air Monitoring Stations GeoService + - name: Air Monitoring Stations GeoService + url: 'https://services.arcgis.com/fLeGjb7u4uXqeF9q/arcgis/rest/services/Air_Monitoring_Stations/FeatureServer/0/query' format: api - description: Esri Geoservice to interact programmatically with the data -category: Education +license: 'https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/' +category: + - Education maintainer: Tim Wisniewski maintainer_email: tim@timwis.com --- diff --git a/_includes/breadcrumbs.html b/_includes/breadcrumbs.html index 4997f56ef2..961d26ce6e 100644 --- a/_includes/breadcrumbs.html +++ b/_includes/breadcrumbs.html @@ -1,14 +1,14 @@ \ No newline at end of file + diff --git a/_includes/dataset-form-resource.html b/_includes/dataset-form-resource.html deleted file mode 100644 index b3b27b18b2..0000000000 --- a/_includes/dataset-form-resource.html +++ /dev/null @@ -1,11 +0,0 @@ -
-
- {% for field in resource_fields %} - {% assign template = field.form_template | default: "form/text.html" %} - {% capture field_name %}resources[][{{ field.field_name }}]{% endcapture %} - {% assign value = resource[field[field_name]] %} - {% include {{ template }} field=field field_name=field_name value=value %} - {% endfor %} -
- -
\ No newline at end of file diff --git a/_includes/dataset-form.html b/_includes/dataset-form.html deleted file mode 100644 index b12056419e..0000000000 --- a/_includes/dataset-form.html +++ /dev/null @@ -1,49 +0,0 @@ -{% assign schema = include.dataset.schema | default: site.schema %} -{% assign dataset_fields = site.data.schemas[schema].dataset_fields %} -{% assign resource_fields = site.data.schemas[schema].resource_fields %} -{% assign dataset_system_fields = "title|organization|notes" | split: "|" %} -
- - -
- {% for field in dataset_fields %} - {% if dataset_system_fields contains field.field_name %} - {% assign template = field.form_template | default: "form/text.html" %} - {% assign field_name = field.field_name %} - {% assign value = include.dataset[field_name] %} - {% include {{ template }} field=field field_name=field_name value=value %} - {% endif %} - {% endfor %} -
- -

Resources

-
- {% for resource in include.dataset.resources %} - {% include dataset-form-resource.html %} - {% endfor %} -
- - -
-

Additional Info

- - {% for field in dataset_fields %} - {% unless dataset_system_fields contains field.field_name %} - {% assign template = field.form_template | default: "form/text.html" %} - {% assign field_name = field.field_name %} - {% assign value = include.dataset[field_name] %} - {% include {{ template }} field=field field_name=field_name value=value %} - {% endunless %} - {% endfor %} - -
- - - {% if include.dataset %} - - {% endif %} -
- - \ No newline at end of file diff --git a/_includes/datasets.html b/_includes/datasets.html index a31d66dda8..b0d8264b3c 100644 --- a/_includes/datasets.html +++ b/_includes/datasets.html @@ -3,4 +3,4 @@

{{ dataset.title }}

{{ dataset.notes | truncate: 300, '...' }} -{% endfor %} \ No newline at end of file +{% endfor %} diff --git a/_includes/display/category.html b/_includes/display/category.html index c5f13b2457..962318f5c3 100644 --- a/_includes/display/category.html +++ b/_includes/display/category.html @@ -3,9 +3,9 @@ {% if include.value.size %} {% for category in include.value %} - {{ category }}{% unless forloop.last %}, {% endunless %} + {{ category }}{% unless forloop.last %}, {% endunless %} {% endfor %} {% else %} - {{ include.value }} + {{ include.value }} {% endif %} \ No newline at end of file diff --git a/_includes/footer.html b/_includes/footer.html index f02cf966c9..54dd9ebe52 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -1,5 +1,5 @@ - - + + diff --git a/_includes/form/category.html b/_includes/form/category.html deleted file mode 100644 index eba61618d3..0000000000 --- a/_includes/form/category.html +++ /dev/null @@ -1,8 +0,0 @@ -
- - -
\ No newline at end of file diff --git a/_includes/form/dropdown.html b/_includes/form/dropdown.html deleted file mode 100644 index baa01eab6d..0000000000 --- a/_includes/form/dropdown.html +++ /dev/null @@ -1,9 +0,0 @@ -
- - -
\ No newline at end of file diff --git a/_includes/form/organization.html b/_includes/form/organization.html deleted file mode 100644 index 0c5b5fad9b..0000000000 --- a/_includes/form/organization.html +++ /dev/null @@ -1,14 +0,0 @@ -
- -
- - - - -
-
\ No newline at end of file diff --git a/_includes/form/text.html b/_includes/form/text.html deleted file mode 100644 index e6703da070..0000000000 --- a/_includes/form/text.html +++ /dev/null @@ -1,4 +0,0 @@ -
- - -
\ No newline at end of file diff --git a/_includes/form/textarea.html b/_includes/form/textarea.html deleted file mode 100644 index 0441d89cfb..0000000000 --- a/_includes/form/textarea.html +++ /dev/null @@ -1,4 +0,0 @@ -
- - -
\ No newline at end of file diff --git a/_includes/head.html b/_includes/head.html index 77ff00c873..9d837226dd 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -6,10 +6,10 @@ {% if page.title %}{{ page.title }} - {% endif %}{{ site.title }} - + + - - + {% if site.digital_analytics_program.enabled == true %} @@ -37,20 +37,15 @@ {% include addons/twittercard.html %} {% endif %} - {% assign datasets = site.collections | where:"label","datasets" | first %} - {% assign organizations = site.collections | where: "label", "organizations" | first %} diff --git a/_includes/header.html b/_includes/header.html index 8a356c008b..6ab67cbf1a 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -1,42 +1,21 @@ - diff --git a/_includes/organization-form.html b/_includes/organization-form.html deleted file mode 100644 index 2ca3feee19..0000000000 --- a/_includes/organization-form.html +++ /dev/null @@ -1,21 +0,0 @@ -{% assign schema = page.schema | default: site.schema %} -{% assign organization_fields = site.data.schemas[schema].organization_fields %} -{% assign organization_system_fields = "title|description|logo" | split: "|" %} - -
- - -
- {% for field in organization_fields %} - {% assign template = field.form_template | default: "form/text.html" %} - {% assign field_name = field.field_name %} - {% assign value = include.organization[field_name] %} - {% include {{ template }} field=field field_name=field_name value=value %} - {% endfor %} -
- - - {% if include.organization %} - - {% endif %} -
\ No newline at end of file diff --git a/_layouts/category.html b/_layouts/category.html new file mode 100644 index 0000000000..9a30af85ae --- /dev/null +++ b/_layouts/category.html @@ -0,0 +1,42 @@ +--- +layout: default +--- +{% include breadcrumbs.html parent="Categories" %} +{% assign datasets = site.datasets | where: "category", page.name %} +{% assign datasets_count = datasets | size %} + +
+
+ {% if page.logo and page.logo != empty %} +
+ {{ page.title }} logo +
+
+ {% else %} +
+ {% endif %} +

+ {{ page.name }} + Edit +

+

{{ page.description }}

+
+

{{ datasets_count }} + {% if datasets_count == 1 %}dataset{% else %}datasets{% endif %}

+ +
+ {% for dataset in datasets %} + +

{{ dataset.title }}

+ {{ dataset.notes }} + +
+ {% endfor %} +
+
+
+ +
+
diff --git a/_layouts/dataset.html b/_layouts/dataset.html index 47bba6e28f..9fa13ff34e 100644 --- a/_layouts/dataset.html +++ b/_layouts/dataset.html @@ -4,62 +4,93 @@ {% include breadcrumbs.html parent="Datasets" %} {% assign schema = page.schema | default: site.schema %} {% assign dataset_fields = site.data.schemas[schema].dataset_fields %} -{% assign dataset_system_fields = "title|organization|notes" | split: "|" %} +{% assign dataset_system_fields = "title|organization|notes|license" | split: "|" %} {% assign resource_fields = site.data.schemas[schema].resource_fields %} {% assign resource_system_fields = "name|url|format|description" | split: "|" %} - - - - {% assign organization = site.organizations | where:"title",page.organization | first %} -{% capture organization_url %}{{ site.baseurl }}/datasets/?organization={{ organization.title | slugify }}{% endcapture %} - -
- {% if organization %} -
-
-
- {% if organization.logo != "" %} - {{ organization.title }} logo - {% endif %} -
-
-

- - {{ organization.title }} - -

- {{ organization.description }} +{% capture organization_url %}{{ site.baseurl }}{{ organization.url }}{% endcapture %} +
+
+
+ {% if organization %} +
+
+
+ {% if organization.logo and organization.logo != empty %} + {{ organization.title }} logo + {% endif %} +
+ +
+ {{ organization.description }} +
+ +
-
-
-
- {% else %} -
- {% endif %} -

- {{ page.title }} - Edit -

-

{{ page.notes }}

+
+ {% else %} +
+ {% endif %} +

+ {{ page.title }} + Edit +

+

{{ page.notes }}

+ +

Resources

+
    + {% for resource in page.resources %} +
  • + {{ resource.name }} + {% if resource.format %}{{ resource.format}}{% endif %} + (Details) + {% if resource.description %}
    {{ resource.description }}
    {% endif %} + + {% for field in resource_fields %} + {% unless resource_system_fields contains field.field_name %} + {% assign value = resource[field[field_name]] %} + {% if value %} + {% if field.display_template %} + {% include {{ field.display_template }} field=field value=value %} + {% else %} + + + + + {% endif %} + {% endif %} + {% endunless %} + {% endfor %} +
    {{ field.label }}{{ value }}
    +
  • + {% endfor %} +
-

Resources

-
    - {% for resource in page.resources %} -
  • - {{ resource.name }} - {% if resource.format %}{{ resource.format}}{% endif %} - (Details) - {% if resource.description %}
    {{ resource.description }}
    {% endif %} - - {% for field in resource_fields %} - {% unless resource_system_fields contains field.field_name %} - {% assign value = resource[field[field_name]] %} +

    Additional Info

    +
    + {% if page.license and page.license != empty %} + {% assign license = site.data.licenses.items | where:"url",page.license | first %} + + + + + {% endif %} + {% for field in dataset_fields %} + {% unless dataset_system_fields contains field.field_name %} + {% assign value = page[field[field_name]] %} {% if value %} {% if field.display_template %} {% include {{ field.display_template }} field=field value=value %} @@ -72,39 +103,10 @@

    Resources

    {% endif %} {% endunless %} {% endfor %} -
    License + + {{ license.name }} + +
    -
  • - {% endfor %} -
- -

Additional Info

- - - {% for field in dataset_fields %} - {% unless dataset_system_fields contains field.field_name %} - {% assign value = page[field[field_name]] %} - {% if value %} - {% if field.display_template %} - {% include {{ field.display_template }} field=field value=value %} - {% else %} - - - - - {% endif %} - {% endif %} - {% endunless %} - {% endfor %} -
{{ field.label }}{{ value }}
+ +
+
- - diff --git a/_layouts/default.html b/_layouts/default.html index fc554d33b0..7fffd71865 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -1,5 +1,5 @@ - diff --git a/_layouts/organization.html b/_layouts/organization.html index d04d65236e..39edf04c2c 100644 --- a/_layouts/organization.html +++ b/_layouts/organization.html @@ -2,39 +2,41 @@ layout: default --- {% include breadcrumbs.html parent="Organizations" %} +{% assign datasets = site.datasets | where:"organization", page.title %} +{% assign datasets_count = datasets | size %} -