-
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.
Use encodeURIComponent to avoid image collisions when non-alphanumeri…
…c characters are used
- Loading branch information
Showing
12 changed files
with
162 additions
and
130 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
{ | ||
"title": "Image", | ||
"description": "An image for my personal website's filterable gallery", | ||
"type": "array", | ||
"items": { | ||
"anyOf": [ | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"href", | ||
"artist", | ||
"tags", | ||
"title" | ||
], | ||
"properties": { | ||
"src": { | ||
"description": "The source URL for the image", | ||
"type": "string" | ||
}, | ||
"href": { | ||
"description": "The link to direct the viewer to upon clicking the image", | ||
"type": "string" | ||
}, | ||
"thumbnailUrl": { | ||
"description": "The link to the smaller version of the image to display on the gallery", | ||
"type": "string" | ||
}, | ||
"title": { | ||
"description": "A title for the image for display on the gallery", | ||
"type": "string" | ||
}, | ||
"artist": { | ||
"description": "The social media handle of the artist, usually prefixed with an @, displayed on the gallery", | ||
"type": "string" | ||
}, | ||
"artistURL": { | ||
"description": "A link to the artist's social media page", | ||
"type": "string" | ||
}, | ||
"published": { | ||
"description": "The date when the artwork was published", | ||
"type": "string", | ||
"format": "date" | ||
}, | ||
"webp": { | ||
"description": "A link to the webp version of the image, used by image display modal if available", | ||
"type": "string" | ||
}, | ||
"tags": { | ||
"description": "An array of tags for the art", | ||
"type": "array", | ||
"minItems": 1, | ||
"uniqueItems": true, | ||
"items": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"parent", | ||
"href", | ||
"tags", | ||
"src" | ||
], | ||
"properties": { | ||
"src": { | ||
"description": "The source URL for the image", | ||
"type": "string" | ||
}, | ||
"href": { | ||
"description": "The link to direct the viewer to upon clicking the image", | ||
"type": "string" | ||
}, | ||
"thumbnailUrl": { | ||
"description": "The link to the smaller version of the image to display on the gallery", | ||
"type": "string" | ||
}, | ||
"parent": { | ||
"description": "The name of the parent image that this image is an alt for", | ||
"type": "string" | ||
}, | ||
"webp": { | ||
"description": "A link to the webp version of the image, used by image display modal if available", | ||
"type": "string" | ||
}, | ||
"tags": { | ||
"description": "An array of tags for the art", | ||
"type": "array", | ||
"minItems": 1, | ||
"uniqueItems": true, | ||
"items": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} |
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import {snakeCase} from "lodash"; | ||
|
||
export function prepareFileName(title: string) { | ||
return encodeURIComponent(snakeCase(title)); | ||
} |
Oops, something went wrong.