Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use vite to build the mirador website. #33

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,9 @@ This repository contains the Mirador website.

### Run locally

To run locally, use a http server
```sh
$ python -m SimpleHTTPServer
```

or
To run locally, use vite:

```sh
$ http-server # require npm i -g http-server
```


$ npm install
$ npm run dev
```
2 changes: 0 additions & 2 deletions _redirects

This file was deleted.

19 changes: 19 additions & 0 deletions demo/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<title>Mirador</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500">
<link rel="shortcut icon" type="image/svg" href="/img/mirador-logo.svg"/>
</head>
<body>
<div id="mirador" style="position: absolute; top: 0; bottom: 0; left: 0; right: 0;"></div>
<script type="module">
import Mirador from 'mirador';
import config from './mirador-configs/default.js';
var miradorInstance = Mirador.viewer(config);
</script>
</body>
</html>
31 changes: 31 additions & 0 deletions demo/mirador-configs/default.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// has 2 windows, one gaugin and one bodleian
export default {
catalog: [
{ manifestId: 'https://iiif.bodleian.ox.ac.uk/iiif/manifest/e32a277e-91e2-4a6d-8ba6-cc4bad230410.json' },
{ manifestId: 'https://iiif.harvardartmuseums.org/manifests/object/299843' },
{ manifestId: 'https://media.nga.gov/public/manifests/nga_highlights.json', provider: 'National Gallery of Art' },
{ manifestId: 'https://data.ucd.ie/api/img/manifests/ucdlib:33064', provider: 'Irish Architectural Archive' },
{ manifestId: 'https://wellcomelibrary.org/iiif/b18035723/manifest', provider: 'Wellcome Library' },
{ manifestId: 'https://demos.biblissima.fr/iiif/metadata/florus-dispersus/manifest.json', provider: 'Biblissima' },
{ manifestId: 'https://www.e-codices.unifr.ch/metadata/iiif/gau-Fragment/manifest.json', provider: 'e-codices - Virtual Manuscript Library of Switzerland' },
{ manifestId: 'https://wellcomelibrary.org/iiif/collection/b18031511', provider: 'Wellcome Library' },
{ manifestId: 'https://gallica.bnf.fr/iiif/ark:/12148/btv1b10022508f/manifest.json', provider: 'Bibliothèque nationale de France' },
{ manifestId: 'https://manifests.britishart.yale.edu/Osbornfa1', provider: 'Beinecke Rare Book and Manuscript Library, Yale University' },
{ manifestId: 'https://iiif.biblissima.fr/chateauroux/B360446201_MS0005/manifest.json', provider: 'Biblissima' },
{ manifestId: 'https://iiif.durham.ac.uk/manifests/trifle/32150/t1/m4/q7/t1m4q77fr328/manifest', provider: 'Durham University Library' },
{ manifestId: 'https://zavicajna.digitalna.rs/iiif/api/presentation/3/96571949-03d6-478e-ab44-a2d5ad68f935%252F00000001%252Fostalo01%252F00000071/manifest', provider: "Библиотека 'Милутин Бојић'" },
],
id: 'mirador',
theme: {
transitions: {},
},
windows: [{
canvasId: 'https://iiif.harvardartmuseums.org/manifests/object/299843/canvas/canvas-47174892',
manifestId: 'https://iiif.harvardartmuseums.org/manifests/object/299843',
},
{
canvasId: 'https://iiif.bodleian.ox.ac.uk/iiif/canvas/e58b8c60-005c-4c41-a22f-07d49cb25ede.json',
manifestId: 'https://iiif.bodleian.ox.ac.uk/iiif/manifest/e32a277e-91e2-4a6d-8ba6-cc4bad230410.json',
thumbnailNavigationPosition: 'far-bottom',
}],
};
5 changes: 3 additions & 2 deletions embed/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
</head>
<body>
<div id="mirador" style="position: absolute; top: 0; bottom: 0; left: 0; right: 0;"></div>
<script>document.write("<script type='text/javascript' src='https://unpkg.com/mirador@latest/dist/mirador.min.js'><\/script>");</script>
<script type="text/javascript">
<script type="module">
import Mirador from 'mirador';

var params = new URL(document.location).searchParams;
var manifest = params.get('iiif-content') || params.get('manifest');
var windows = [];
Expand Down
38 changes: 38 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import js from '@eslint/js'
import globals from 'globals'
import react from 'eslint-plugin-react'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'

export default [
{ ignores: ['dist'] },
{
files: ['**/*.{js,jsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
ecmaVersion: 'latest',
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
},
settings: { react: { version: '18.3' } },
plugins: {
react,
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...js.configs.recommended.rules,
...react.configs.recommended.rules,
...react.configs['jsx-runtime'].rules,
...reactHooks.configs.recommended.rules,
'react/jsx-no-target-blank': 'off',
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
},
]
11 changes: 5 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
<nav>
<ul>
<li class="current">
<a href="/index.html">Home</a>
<a href="/">Home</a>
</li>
<li class="">
<a href="https://mirador-dev.netlify.app/__tests__/integration/mirador">Demo</a>
<a href="/demo/">Demo</a>
</li>
<li class="">
<a href="https://github.com/projectmirador/mirador/wiki">Docs</a>
Expand All @@ -43,7 +43,7 @@
<section id="banner">
<div class="inner">
<header>
<img src="img/mirador-logo.png" alt="Mirador">
<img src="/img/mirador-logo.png" alt="Mirador">
<h2>mirador</h2>
</header>
<p>
Expand All @@ -54,7 +54,7 @@ <h2>mirador</h2>
</p>
</div>
<div>
<a class="button button-primary" href="https://mirador-dev.netlify.app/__tests__/integration/mirador">Try a Live Demo</a>
<a class="button button-primary" href="/demo/">Try a Live Demo</a>
</div>
</section>

Expand Down Expand Up @@ -151,7 +151,7 @@ <h3>Open Source, Community-Driven Software</h3>
</header>

<section class="wrapper container special-alt">
<iframe src="https://mirador-dev.netlify.app/__tests__/integration/mirador/" width="800" height="600" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" id="frame" allowfullscreen="">You need an iFrame capable browser to view this.</iframe>
<iframe src="/demo/" width="800" height="600" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" id="frame" allowfullscreen="">You need an iFrame capable browser to view this.</iframe>
</section>

<header id="participate" class="special container">
Expand All @@ -172,6 +172,5 @@ <h2>Current Mirador Status</h2>
</header>
<p/>
</article>
<script src="js/jquery.min.js"></script>
</body>
</html>
4 changes: 0 additions & 4 deletions js/jquery.min.js

This file was deleted.

6 changes: 6 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This is the configuration file for the netlify preview deploys
# See https://www.netlify.com/docs/netlify-toml-reference/ for more

[build]
command = "npm run build"
publish = "dist/"
Loading