Skip to content

Commit

Permalink
Merge pull request #245 from timwis/v2
Browse files Browse the repository at this point in the history
Version 2.0
  • Loading branch information
timwis committed Mar 30, 2023
2 parents 372e65d + 758556e commit e1bbde6
Show file tree
Hide file tree
Showing 92 changed files with 5,013 additions and 10,190 deletions.
6 changes: 0 additions & 6 deletions .babelrc

This file was deleted.

2 changes: 2 additions & 0 deletions .github/super-linter.env
@@ -1,9 +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
70 changes: 70 additions & 0 deletions .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
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -4,3 +4,6 @@ _site
_config.dev.yml
node_modules
*.map
_config.ci.yml
.parcel-cache
vendor
1 change: 1 addition & 0 deletions .ruby-version
@@ -0,0 +1 @@
3.1.2
24 changes: 24 additions & 0 deletions 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"]
1 change: 1 addition & 0 deletions Gemfile
@@ -1,4 +1,5 @@
source "https://rubygems.org"

gem "github-pages", group: :jekyll_plugins
gem "jekyll", "~> 3.9"
gem "webrick", "~> 1.7"
6 changes: 6 additions & 0 deletions Gemfile.lock
Expand Up @@ -214,6 +214,10 @@ GEM
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)
Expand Down Expand Up @@ -259,9 +263,11 @@ GEM
PLATFORMS
ruby
x64-mingw32
x86_64-linux

DEPENDENCIES
github-pages
jekyll (~> 3.9)
webrick (~> 1.7)

BUNDLED WITH
Expand Down
42 changes: 7 additions & 35 deletions README.md
@@ -1,44 +1,16 @@
# 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 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 Options

1. See [Get Started](https://jkan.io/#get-started) on [jkan.io](https://jkan.io) for an installation wizard,
2. follow the [manual installation](https://github.com/timwis/jkan/wiki/Manual-Installation) instructions yourself.
3. Do a manual fork and do not install gatekeeper at all (login bits won't work, but Heroku is no longer free)

For configuration details, see the [wiki](https://github.com/timwis/jkan/wiki)

## Development
The recommended to build the site for development or making changes is docker compose. Just run ```docker compose up```

```bash
$ docker compose up
[+] Running 1/0
⠿ Container jkan-jekyll-1 Created 0.0s
Attaching to jkan-jekyll-1
jkan-jekyll-1 | ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux-musl]
jkan-jekyll-1 | Configuration file: /srv/jekyll/_config.yml
jkan-jekyll-1 | Source: /srv/jekyll
jkan-jekyll-1 | Destination: /srv/jekyll/_site
jkan-jekyll-1 | Incremental build: enabled
jkan-jekyll-1 | Generating...
jkan-jekyll-1 | done in 0.025 seconds.
jkan-jekyll-1 | Auto-regeneration: enabled for '/srv/jekyll'
jkan-jekyll-1 | Server address: http://0.0.0.0:4000/jkan/
jkan-jekyll-1 | Server running... press ctrl-c to stop.
```

Then connect to http://0.0.0.0:4000/jkan/ via a web browser.

Read more about the [Architecture](https://github.com/timwis/jkan/wiki/Architecture) on the Wiki.
## 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)
26 changes: 19 additions & 7 deletions _config.yml
@@ -1,16 +1,12 @@
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

# Site theme
jkan_theme: Default

# Authentication
github_client_id:
gatekeeper_host:

# Dataset schema
schema: default

Expand All @@ -20,6 +16,8 @@ navigation:
url: /datasets/
- title: Organizations
url: /organizations/
- title: Categories
url: /categories/

# Collections
collections:
Expand All @@ -29,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
Expand Down Expand Up @@ -76,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
52 changes: 0 additions & 52 deletions _data/categories.yml

This file was deleted.

25 changes: 17 additions & 8 deletions _data/licenses.yml
@@ -1,8 +1,17 @@
'https://creativecommons.org/licenses/by/4.0/': Creative Commons Attribution
'https://creativecommons.org/licenses/by-sa/4.0/': Creative Commons Attribution Share-Alike
'https://creativecommons.org/publicdomain/zero/1.0/': Creative Commons CCZero
'https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/': UK Open Government Licence
'http://www.opendefinition.org/licenses/odc-by': Open Data Commons Attribution License
'http://www.opendefinition.org/licenses/odc-odbl': Open Data Commons Open Database License (ODbL)
'http://www.opendefinition.org/licenses/odc-pddl': Open Data Commons Public Domain Dedication and Licence (PDDL)
'': Not Applicable
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: ""
6 changes: 0 additions & 6 deletions _data/schemas/default.yml
Expand Up @@ -6,19 +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
form_template: form/license.html
datajson: license
- field_name: category
label: Category
form_template: form/category.html
display_template: display/category.html
datajson: category
- field_name: maintainer
Expand All @@ -38,7 +34,6 @@ resource_fields:
- field_name: format
label: Format
datajson: distribution.format
form_template: form/dropdown.html
values:
- api
- csv
Expand Down Expand Up @@ -67,4 +62,3 @@ category_fields:
label: Logo Credit
- field_name: featured
label: Featured on Homepage
form_template: form/checkbox.html
5 changes: 5 additions & 0 deletions _dataset_categories/arts-culture-history.md
@@ -0,0 +1,5 @@
---
name: Arts / Culture / History
logo: "/img/categories/arts-culture-history.svg"
featured: true
---
6 changes: 6 additions & 0 deletions _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
---

0 comments on commit e1bbde6

Please sign in to comment.