-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refine configuration and content sections. (#16)
* Refine configuration and content sections. * Add tooltip component, use for defaultTheme enum. --------- Co-authored-by: Mark Baggett <[email protected]>
- Loading branch information
1 parent
1bb225e
commit c98d2ec
Showing
15 changed files
with
554 additions
and
113 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,35 @@ | ||
import { Flex, IconButton, Tooltip } from "@radix-ui/themes"; | ||
|
||
import { InfoCircledIcon } from "@radix-ui/react-icons"; | ||
|
||
interface SharedTooltipProps { | ||
children: React.ReactNode; | ||
content: string; | ||
} | ||
|
||
export const SharedTooltip: React.FC<SharedTooltipProps> = ({ | ||
content, | ||
children, | ||
}) => { | ||
return ( | ||
<Flex align="center" gap="2"> | ||
{children} | ||
<Tooltip content={content}> | ||
<IconButton | ||
radius="full" | ||
style={{ | ||
background: "none", | ||
color: "var(--gray-12)", | ||
padding: "0 !important", | ||
height: "1em", | ||
width: "1em", | ||
}} | ||
> | ||
<InfoCircledIcon /> | ||
</IconButton> | ||
</Tooltip> | ||
</Flex> | ||
); | ||
}; | ||
|
||
export default SharedTooltip; |
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 |
---|---|---|
@@ -1 +1,113 @@ | ||
import { Callout, Cards, Card } from "nextra/components"; | ||
|
||
# Configuration | ||
|
||
The Canopy IIIF build process will read from a custom configuration file at config/canopy.json if it exists. If this configuration file does not exist, the default configuration `config/.default/canopy.default.json` will be used as a fallback for demonstration purposes. | ||
|
||
<Callout type="info"> | ||
See the **[Create a Project guide](/get-started)** for a step-by-step guide | ||
illustrating the setup of Canopy IIIF project. | ||
</Callout> | ||
|
||
## Configuration Options | ||
|
||
Canopy IIIF is a highly configurable application that can be tailored to the needs of a project. Canopy configurations fallback to default options if not customized. | ||
|
||
<Cards> | ||
<Card title="Basic" href="/configuration#basic-configuration" /> | ||
<Card title="Search" href="/configuration/search" /> | ||
<Card title="Locale" href="/configuration/locale" /> | ||
<Card title="Map" href="/configuration/map" /> | ||
<Card title="Theme" href="/configuration/theme" /> | ||
</Cards> | ||
|
||
## Basic Configuration | ||
|
||
A custom Canopy configuration file can be created with the following steps: | ||
|
||
1. Find your `config/` directory | ||
2. Copy `canopy.sample.json` to `canopy.json` | ||
3. Make updates to both the **prod** and **dev** configurations | ||
|
||
## Properties | ||
|
||
| Property | Type | Description | | ||
| ------------ | --------------- | -------------------------------------- | | ||
| `collection` | `string` | IIIF Collection URI | | ||
| `label` | `label ` | IIIF Presentation 3.0 label property | | ||
| `summary` | `summary` | IIIF Presentation 3.0 summary property | | ||
| `featured` | `Array<string>` | Array of IIIF Manifest URIs | | ||
| `metadata` | `Array<string>` | Array of `metadata` labels | | ||
|
||
### collection | ||
|
||
The `collection` property is required and must be the id of the referenced source IIIF Collection manifest. Collections referencing other Collections in their `items` property are not currently supported. | ||
|
||
```json | ||
"collection": "https://iiif.bodleian.ox.ac.uk/iiif/collection/hobhouse" | ||
``` | ||
|
||
### label _and_ summary | ||
|
||
The Canopy IIIF site **title** and **description** are respectively the `label` and `summary` IIIF Presentation API properties of the set IIIF Collection resource. You can optionally override this by providing a valid Presentation 3.0 [label](https://iiif.io/api/presentation/3.0/#label) and/or [summary](https://iiif.io/api/presentation/3.0/#summary) property. These values are transformed to meta elements in the `<head>` of the HTML document. | ||
|
||
```json | ||
"label": { "none": ["Hobhouse"] }, | ||
"summary": { "none": ["Manuscripts from the archive of Emily Hobhouse."] } | ||
``` | ||
|
||
### featured | ||
|
||
You can inform Canopy IIIF of featured Manifests by providing an array of ids. These must be within the referenced collection resource and the Manifest URIs must be an exact match. These Manifests will render throughout the interface in featured components. | ||
|
||
**Warning:** In the current pre-release, featured Manifests must have an Image body on the first Canvas. | ||
|
||
```json | ||
"featured": [ | ||
"https://iiif.bodleian.ox.ac.uk/iiif/manifest/8da97e8c-4e12-457d-aad8-3327b3aec183.json", | ||
"https://iiif.bodleian.ox.ac.uk/iiif/manifest/2968d5c7-3718-44ef-92ea-ee4cc58cc677.json" | ||
] | ||
``` | ||
|
||
### metadata | ||
|
||
Curating Metadata allows implementers of Canopy IIIF to select metadata fields that provide additional access points to end users. The fields can be specified by listing the labels of each metadata property found in the `metadata` property of the manifest. Metadata labels that are curated will be automatically included as featured elements on the homepage, the metadata page, linking from works, and as facets on the search page. An optimal case is a label common to all or most manifests with some in diversity of values across those resources. | ||
|
||
**Note:** Metadata labels are not yet BCP 47 language code aware; however, aggregation processes will make exact string comparisons regardless of language code. | ||
|
||
```json | ||
"metadata": ["Extent", "Title", "Date Statement", "Language"] | ||
``` | ||
|
||
## Production and Development | ||
|
||
Both the `prod` and `dev` environments have a configuration. These configurations can match each other; however in some cases, development speed can be aided by targeting a smaller IIIF Collection id as a fixture. | ||
|
||
## Example Configuration | ||
|
||
The following is an example configuration for the [Bodleian Libraries' Emily Hobhouse collection](https://archives.bodleian.ox.ac.uk/repositories/2/resources/2830). Two Manifests are featured and four metadata labels are curated. | ||
|
||
```json copy filename="config/canopy.json" | ||
{ | ||
"prod": { | ||
"label": { "none": ["Hobhouse"] }, | ||
"summary": { "none": ["Manuscripts from the archive of Emily Hobhouse."] }, | ||
"collection": "https://iiif.bodleian.ox.ac.uk/iiif/collection/hobhouse", | ||
"featured": [ | ||
"https://iiif.bodleian.ox.ac.uk/iiif/manifest/8da97e8c-4e12-457d-aad8-3327b3aec183.json", | ||
"https://iiif.bodleian.ox.ac.uk/iiif/manifest/2968d5c7-3718-44ef-92ea-ee4cc58cc677.json" | ||
], | ||
"metadata": ["Extent", "Title", "Date Statement", "Language"] | ||
}, | ||
"dev": { | ||
"label": { "none": ["Hobhouse"] }, | ||
"summary": { "none": ["Manuscripts from the archive of Emily Hobhouse."] }, | ||
"collection": "https://iiif.bodleian.ox.ac.uk/iiif/collection/hobhouse", | ||
"featured": [ | ||
"https://iiif.bodleian.ox.ac.uk/iiif/manifest/8da97e8c-4e12-457d-aad8-3327b3aec183.json", | ||
"https://iiif.bodleian.ox.ac.uk/iiif/manifest/2968d5c7-3718-44ef-92ea-ee4cc58cc677.json" | ||
], | ||
"metadata": ["Extent", "Title", "Date Statement", "Language"] | ||
} | ||
} | ||
``` |
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 |
---|---|---|
|
@@ -4,6 +4,5 @@ | |
"breadcrumb": true | ||
} | ||
}, | ||
"basic": "Basic", | ||
"search": "Search" | ||
} |
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.