generated from canopy-iiif/canopy-iiif
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8bdd1a2
Showing
191 changed files
with
20,998 additions
and
0 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,4 @@ | ||
{ | ||
"presets": ["next/babel", "@babel/preset-typescript"], | ||
"plugins": [] | ||
} |
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 @@ | ||
NEXT_PUBLIC_URL="https://canopy-iiif.github.io" | ||
NEXT_PUBLIC_BASE_PATH="/canopy-iiif" |
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,28 @@ | ||
{ | ||
"plugins": ["@typescript-eslint", "testing-library"], | ||
"extends": [ | ||
"plugin:@typescript-eslint/recommended", | ||
"next", | ||
"next/core-web-vitals", | ||
"prettier" | ||
], | ||
"overrides": [ | ||
// Only uses Testing Library lint rules in test files | ||
{ | ||
"files": [ | ||
"**/__tests__/**/*.[jt]s?(x)", | ||
"**/?(*.)+(spec|test).[jt]s?(x)" | ||
], | ||
"extends": ["plugin:testing-library/react"] | ||
} | ||
], | ||
"rules": { | ||
// "sort-keys": "error", | ||
// "sort-imports": "error", | ||
"@typescript-eslint/no-var-requires": "off", | ||
"@typescript-eslint/no-unused-vars": "error", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/sort-type-union-intersection-members": "error", | ||
"@typescript-eslint/ban-ts-comment": "off" | ||
} | ||
} |
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,27 @@ | ||
--- | ||
name: Bug | ||
about: Report an issue | ||
title: '' | ||
labels: bug | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Screenshots** | ||
If applicable, add screenshots to help explain your problem. | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
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,14 @@ | ||
--- | ||
name: Feature/Enhancement | ||
about: New feature or enhancement | ||
title: '' | ||
labels: enhancement | ||
assignees: '' | ||
|
||
--- | ||
|
||
## Description | ||
|
||
## Done Looks Like | ||
- [ ] to do 1 | ||
- [ ] to do 2 |
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 @@ | ||
# What does this do? | ||
|
||
_Please include a summary of the changes and the related issue. Please also include relevant motivation and context._ | ||
|
||
## What type of change is this? | ||
|
||
- [ ] 🐛 **Bug fix** (non-breaking change addressing an issue) | ||
- [ ] ✨ **New feature or enhancement** (non-breaking change which adds functionality) | ||
- [ ] 🧨 **Breaking change** (fix or feature that would cause existing functionality to not work as expected) | ||
- [ ] 🚧 **Maintenance or refinement of codebase structur**e (ex: dependency updates) | ||
- [ ] 📘 **Documentation update** | ||
|
||
## Additional Notes | ||
|
||
_Please include any extra notes here._ |
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,29 @@ | ||
name: Test IIIF Collection Build | ||
on: push | ||
jobs: | ||
test-build: | ||
runs-on: ubuntu-latest | ||
# Only run if the repository is canopy-iiif/canopy-iiif | ||
if: github.repository == 'canopy-iiif/canopy-iiif' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Unit testing | ||
run: npm run test:ci | ||
- name: 2.x Collection (Aggregation) | ||
run: npm run prebuild -- --path=./config/.fixtures/canopy.presentation-2.json | ||
- name: 2.x Collection (Build) | ||
run: npm run test-build | ||
- name: 3.0 Collection (Aggregation) | ||
run: npm run prebuild -- --path=./config/.fixtures/canopy.presentation-3.json | ||
- name: 3.0 Collection (Build) | ||
run: npm run test-build | ||
- name: Customize Search (Aggregation) | ||
run: npm run prebuild -- --path=./config/.fixtures/canopy.customize-search.json | ||
- name: Customize Search (Build) | ||
run: npm run test-build | ||
- name: Minimal Configuration (Aggregation) | ||
run: npm run prebuild -- --path=./config/.fixtures/canopy.minimal.json | ||
- name: Minimal Configuration (Build) | ||
run: npm run test-build |
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,43 @@ | ||
name: Deploy to GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [18.x] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Load NEXT_PUBLIC_URL and NEXT_PUBLIC_BASE_PATH from .env | ||
run: | | ||
set -o allexport | ||
source .env | ||
set +o allexport | ||
- name: Install | ||
run: npm ci | ||
|
||
- name: Build | ||
run: npm run build:static | ||
|
||
- name: Bypass Jekyll | ||
run: touch ./out/.nojekyll | ||
|
||
- name: Deploy | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
branch: gh-pages | ||
folder: out |
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,41 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# local env files | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
# vercel | ||
.vercel | ||
|
||
.canopy | ||
.vscode | ||
|
||
public/api | ||
public/robots.txt | ||
public/sitemap* |
Empty file.
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,4 @@ | ||
{ | ||
"installDependencies": true, | ||
"startCommand": "npm run dev" | ||
} |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Mat Jordan | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,50 @@ | ||
# Canopy IIIF | ||
|
||
An open-source static site generator designed for fast creation, contextualization, and customization of a discovery-focused digital scholarship and collections website using [IIIF](https://iiif.io/) APIs. | ||
|
||
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz_small.svg)](https://stackblitz.com/fork/github/canopy-iiif/canopy-iiif) | ||
|
||
- [Demo (Static)](https://canopy-iiif.github.io/canopy-iiif/) | ||
- [Demo (Vercel)](https://canopy-iiif.vercel.app/) | ||
- [Documentation](https://canopy-iiif.github.io/docs/) | ||
|
||
![collage of canopy iiif views](https://github.com/canopy-iiif/canopy-iiif/assets/7376450/1779a0ce-1f62-4e9b-8186-110264c81bba) | ||
|
||
## Setup | ||
|
||
### Install Dependencies | ||
|
||
```shell | ||
# installation | ||
npm i | ||
``` | ||
|
||
### Running in Development | ||
|
||
```shell | ||
# development | ||
npm run dev | ||
``` | ||
|
||
### Building in Production | ||
|
||
```shell | ||
# build | ||
npm run build | ||
``` | ||
|
||
## Tests | ||
|
||
To run Jest unit tests: | ||
|
||
```shell | ||
npm run test | ||
``` | ||
|
||
## Configuration | ||
|
||
Canopy IIIF uses a default configuration `config/.default/canopy.default.json` for demonstration purposes if a custom one is not set. The build process will read from a custom configuration file at `config/canopy.json` if it exists. See the [Create a Canopy Project guide](https://canopy-iiif.github.io/docs/get-started) for detailed step-by-step instructions. | ||
|
||
## License | ||
|
||
This project is [licensed](https://github.com/canopy-iiif/canopy-iiif/blob/main/LICENSE) under the MIT License. |
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,32 @@ | ||
require("dotenv").config(); | ||
const buildConfig = require("./src/lib/build/config"); | ||
const aggregate = require("./src/lib/build/aggregate"); | ||
|
||
const args = process.argv; | ||
|
||
(() => { | ||
const path = args | ||
.find((value) => value.includes("--path=")) | ||
?.split("=") | ||
?.pop(); | ||
|
||
const isDev = args.includes("dev"); | ||
const config = buildConfig.getConfig(path, isDev); | ||
|
||
const url = isDev ? `http://localhost:5001` : process.env.NEXT_PUBLIC_URL; | ||
const basePath = isDev ? `` : process.env.NEXT_PUBLIC_BASE_PATH; | ||
const baseUrl = basePath ? `${url}${basePath}` : url; | ||
const assetPrefix = basePath; | ||
|
||
const env = { | ||
CANOPY_CONFIG: { | ||
...config, | ||
url, | ||
assetPrefix, | ||
basePath, | ||
baseUrl, | ||
}, | ||
}; | ||
|
||
aggregate.build(env.CANOPY_CONFIG); | ||
})(); |
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,72 @@ | ||
{ | ||
"collection": "https://api.dc.library.northwestern.edu/api/v2/search?query=%22nez%20perce%22&as=iiif&size=125", | ||
"metadata": ["Subject", "Date", "Dimensions"], | ||
"featured": [ | ||
"https://api.dc.library.northwestern.edu/api/v2/works/cd5e1b9c-370b-40e5-b3d9-defc1d8e0777?as=iiif", | ||
"https://api.dc.library.northwestern.edu/api/v2/works/14a6aa15-9e12-47a7-9617-91f430d4f47b?as=iiif" | ||
], | ||
"locales": [ | ||
{ | ||
"config": "locales/en.json", | ||
"label": "English", | ||
"lang": "en" | ||
} | ||
], | ||
"map": { | ||
"defaultBounds": [[51.505, -0.09]], | ||
"enabled": false, | ||
"icon": { | ||
"iconUrl": "images/marker-icon.png", | ||
"iconSize": [24, 36], | ||
"iconAnchor": [12, 36] | ||
}, | ||
"tileLayers": [ | ||
{ | ||
"name": "OpenStreetMap", | ||
"url": "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", | ||
"attribution": "© <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors" | ||
} | ||
] | ||
}, | ||
"search": { | ||
"enabled": true, | ||
"flexSearch": { | ||
"charset": "latin:extra", | ||
"optimize": true, | ||
"tokenize": "strict", | ||
"bidirectional": false, | ||
"document": { | ||
"index": [ | ||
{ | ||
"field": "label", | ||
"tokenize": "full", | ||
"resolution": 9, | ||
"depth": 3, | ||
"bidirectional": true | ||
}, | ||
{ | ||
"field": "metadata", | ||
"resolution": 2 | ||
}, | ||
{ | ||
"field": "summary", | ||
"resolution": 1 | ||
} | ||
] | ||
} | ||
}, | ||
"index": { | ||
"metadata": { | ||
"enabled": true, | ||
"all": false | ||
}, | ||
"summary": { | ||
"enabled": false | ||
} | ||
} | ||
}, | ||
"theme": { | ||
"defaultTheme": "light", | ||
"toggleEnabled": false | ||
} | ||
} |
Oops, something went wrong.