Skip to content

Commit 12b8e90

Browse files
committed
Decouple the data source population code to a separate repo.
1 parent fa5faf2 commit 12b8e90

File tree

7 files changed

+7
-56
lines changed

7 files changed

+7
-56
lines changed

.gitignore

-3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,3 @@ dist
1919

2020
# Environment variables
2121
.env
22-
23-
# Captions Metadata from Jamstack TV
24-
data/

algolia.config.js

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ require('dotenv').config();
33
module.exports = {
44
appId: 'VGOL4P01VV',
55
indexName: 'jamstack',
6-
apiKey: process.env.ALGOLIA_API_KEY,
76
// It’s okay to have this in the repo, it’s used in the clientside JS
87
searchOnlyApiKey: "a457b566acbf454a61eaaae2e4fee0bf",
98
};

netlify.toml

-12
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,6 @@
66
NODE_VERSION = "12.16.2"
77
NODE_ENV = "production"
88

9-
# This requires YOUTUBE_API_KEY and ALGOLIA_API_KEY
10-
[context.production]
11-
command = "npm run build:production"
12-
13-
# TODO remove this, this is just for testing
14-
[context.deploy-preview]
15-
command = "npm run build:production"
16-
17-
# TODO remove this, this is just for testing
18-
[context.branch-deploy]
19-
command = "npm run build:production"
20-
219
[dev]
2210
command = "npm run start"
2311
publish = "dist"

package.json

+2-5
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@
1515
"build": "npm-run-all build:html build:css",
1616
"build:html": "eleventy",
1717
"build:css": "postcss src/css/tailwind.css -o dist/css/styles.css",
18-
"data:jamstacktv": "youtinx pull && youtinx push",
1918
"watch:html": "ELEVENTY_ENV=dev eleventy --watch --quiet",
2019
"watch:css": "postcss src/css/tailwind.css -o dist/css/styles.css --watch",
2120
"serve": "live-server dist --quiet --port=8090",
2221
"start": "npm-run-all --parallel watch:html watch:css serve",
23-
"clean": "rm -rf dist",
24-
"build:production": "npm run data:jamstacktv && npm run build"
22+
"clean": "rm -rf dist"
2523
},
2624
"dependencies": {
2725
"@11ty/eleventy": "^0.11.1",
@@ -47,8 +45,7 @@
4745
"postcss-cli": "^8.3.1",
4846
"postcss-import": "^13.0.0",
4947
"spdx-correct": "^3.1.1",
50-
"tailwindcss": "^2.0.3",
51-
"youtinx": "^0.4.1"
48+
"tailwindcss": "^2.0.3"
5249
},
5350
"devDependencies": {
5451
"live-server": "^1.2.1"

src/site/_data/algolia.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const algoliaConfig = require("../../../algolia.config.js");
22

3-
// make sure we don’t leak algoliaConfig.apiKey
3+
// don’t hardcode anything here, make the config variables opt-in
44
module.exports = {
55
appId: algoliaConfig.appId,
66
indexName: algoliaConfig.indexName,

src/site/tv.njk

+4-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ layout: layouts/base.njk
99
<div id="searchbox"></div>
1010
<div id="hits"></div>
1111
</div>
12-
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/algoliasearch-lite.umd.js" integrity="sha256-EXPXz4W6pQgfYY3yTpnDa3OH8/EPn16ciVsPQ/ypsjk=" crossorigin="anonymous"></script>
13-
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/instantsearch.production.min.js" integrity="sha256-LAGhRRdtVoD6RLo2qDQsU2mp+XVSciKRC8XPOBWmofM=" crossorigin="anonymous"></script>
14-
<script>
12+
13+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/algoliasearch-lite.umd.js" integrity="sha256-EXPXz4W6pQgfYY3yTpnDa3OH8/EPn16ciVsPQ/ypsjk=" crossorigin="anonymous" defer></script>
14+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/instantsearch.production.min.js" integrity="sha256-LAGhRRdtVoD6RLo2qDQsU2mp+XVSciKRC8XPOBWmofM=" crossorigin="anonymous" defer></script>
15+
<script defer>
1516
const searchClient = algoliasearch('{{ algolia.appId }}', '{{ algolia.searchOnlyApiKey }}');
1617
1718
const search = instantsearch({

youtinx.config.js

-31
This file was deleted.

0 commit comments

Comments
 (0)