mirror of
https://github.com/movie-web/movie-web.git
synced 2024-12-26 10:56:06 +00:00
use handlebars if statements in templating
This commit is contained in:
parent
386afd21ea
commit
7d6d41fb48
|
@ -1,5 +1,8 @@
|
|||
# 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"
|
||||
|
||||
# make sure the cors proxy url does NOT have a slash at the end
|
||||
VITE_CORS_PROXY_URL=...
|
||||
|
||||
# make sure the domain does NOT have a slash at the end
|
||||
VITE_APP_DOMAIN=http://localhost:5173
|
||||
|
|
38
index.html
38
index.html
|
@ -34,25 +34,27 @@
|
|||
|
||||
<title>movie-web</title>
|
||||
|
||||
<!-- OpenSearch -->
|
||||
{{{ opensearch }}}
|
||||
{{#if opensearchEnabled }}
|
||||
<!-- OpenSearch -->
|
||||
<link rel="search" type="application/opensearchdescription+xml" title="movie-web" href="/opensearch.xml">
|
||||
|
||||
<!-- Google Sitelinks -->
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "WebSite",
|
||||
"url": "https://movie-web.app/",
|
||||
"potentialAction": {
|
||||
"@type": "SearchAction",
|
||||
"target": {
|
||||
"@type": "EntryPoint",
|
||||
"urlTemplate": "https://movie-web.app/browse/{search_term_string}"
|
||||
},
|
||||
"query-input": "required name=search_term_string"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!-- Google Sitelinks -->
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "WebSite",
|
||||
"url": "{{ routeDomain }}",
|
||||
"potentialAction": {
|
||||
"@type": "SearchAction",
|
||||
"target": {
|
||||
"@type": "EntryPoint",
|
||||
"urlTemplate": "{{ routeDomain }}/browse/?q={search_term_string}"
|
||||
},
|
||||
"query-input": "required name=search_term_string"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{{/if}}
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
<ShortName>movie-web</ShortName>
|
||||
<Description>The place for your favorite movies & shows</Description>
|
||||
<InputEncoding>UTF-8</InputEncoding>
|
||||
<Url type="text/html" template="{{ appdomain }}/browse/{searchTerms}" />
|
||||
<Url type="text/html" template="{{ routeDomain }}/browse/?q={searchTerms}" />
|
||||
</OpenSearchDescription>
|
||||
|
|
|
@ -13,8 +13,10 @@ export default defineConfig(({ mode }) => {
|
|||
plugins: [
|
||||
handlebars({
|
||||
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,
|
||||
opensearchEnabled: env.VITE_OPENSEARCH_ENABLED === "true",
|
||||
routeDomain: env.VITE_APP_DOMAIN + (env.VITE_NORMAL_ROUTER !== 'true' ? "/#" : ""),
|
||||
domain: env.VITE_APP_DOMAIN,
|
||||
env,
|
||||
},
|
||||
}),
|
||||
react({
|
||||
|
|
Loading…
Reference in a new issue