From ce00e4366dd2f857bd432d6d9085fcfd59670a4f Mon Sep 17 00:00:00 2001 From: Aaron Gutierrez Date: Sun, 30 Dec 2018 10:27:51 -0800 Subject: [PATCH] Versioned uploads, opengraph data --- src/components/root.tsx | 2 +- src/model.ts | 7 ++++++- template.html | 17 +++++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 template.html diff --git a/src/components/root.tsx b/src/components/root.tsx index 901bb04..4626934 100644 --- a/src/components/root.tsx +++ b/src/components/root.tsx @@ -36,7 +36,7 @@ export class Root extends React.PureComponent { componentDidMount() { window - .fetch(Model.URL) + .fetch(Model.dataUrl()) .then(data => data.json()) .then(json => this.setState({ data: json })) .then(this._loadHash) diff --git a/src/model.ts b/src/model.ts index 5134342..0770f9b 100644 --- a/src/model.ts +++ b/src/model.ts @@ -1,5 +1,10 @@ export const SIZES = [1600, 1200, 800, 600, 400, 200]; -export const URL = "img/data.json"; + +export function dataUrl() { + return (window.location.host === "ski.aarongutierrez.com") + ? "https://s3-us-west-2.amazonaws.com/ski.aarongutierrez.com/img/data.json" + : "img/data.json"; +} export interface Data { sets: ImageSet[]; diff --git a/template.html b/template.html new file mode 100644 index 0000000..afc6dcf --- /dev/null +++ b/template.html @@ -0,0 +1,17 @@ + + + + Skiing - Aaron Gutierrez + + + + + + + + + +
+ + +