Browse Source

make opensearch optional

pull/376/head
castdrian 2 years ago
parent
commit
855ed60e37
No known key found for this signature in database
  1. 1
      example.env
  2. 2
      index.html
  3. 8
      vite.config.ts

1
example.env

@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
# make sure the cors proxy url does NOT have a slash at the end
VITE_CORS_PROXY_URL=...
VITE_TMDB_READ_API_KEY=...
VITE_OPENSEARCH_ENABLED=false
VITE_APP_DOMAIN="http://localhost:5173"

2
index.html

@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
<title>movie-web</title>
<!-- OpenSearch -->
<link rel="search" type="application/opensearchdescription+xml" title="movie-web" href="src/assets/opensearch.xml">
{{{ opensearch }}}
<!-- Google Sitelinks -->
<script type="application/ld+json">

8
vite.config.ts

@ -8,12 +8,14 @@ import { handlebars } from "./plugins/handlebars"; @@ -8,12 +8,14 @@ import { handlebars } from "./plugins/handlebars";
import { loadEnv } from "vite"
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd())
return {
plugins:[
handlebars({
vars: {
appdomain: loadEnv(mode, process.cwd()).VITE_APP_DOMAIN,
},
vars: {
opensearch: env.VITE_OPENSEARCH_ENABLED ? '<link rel="search" type="application/opensearchdescription+xml" title="movie-web" href="src/assets/opensearch.xml">' : "",
appdomain: env.VITE_APP_DOMAIN,
},
}),
react({
babel: {

Loading…
Cancel
Save