Skip to content

Commit

Permalink
Expand .env to HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasKarz committed Jan 23, 2023
1 parent 2e3d7e4 commit 3178026
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
10 changes: 9 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
VITE_WEBSITE_NAME=mYReact Template
VITE_WEBSITE_DESCRIPTION=This is the description to my Website
VITE_WEBSITE_KEYWORDS=kword1, keyword2, keyword3
VITE_WEBSITE_AUTHOR=mc2 advertising
VITE_OPENING_HOURS=[{"dayOfWeek": 1,"opens": "09:00","closes": "13:00"}]
VITE_PHONE=+41 77 814 44 46
VITE_MAIL=[email protected]
VITE_INSTAGRAM=https://www.instagram.com/swissactivetravelcouple/
VITE_FACEBOOK=https://www.facebook.com/
VITE_WHATSAPP=+41 77 814 44 46
VITE_TELEGRAM=https://t.me/AndreaKarz
VITE_ADDRESS={"NAME": "mc2-media", "STREET": "Spinnereiplatz 3","ZIP": "8041","CITY": "Zürich"}
VITE_ADDRESS_NAME=mc2-media
VITE_ADDRESS_STREET=Spinnereiplatz 3
VITE_ADDRESS_ZIP=8041
VITE_ADDRESS_CITY=Zürich
VITE_ADDRESS_REGION=ZH
VITE_ADDRESS_COUNTRY=Switzerland
26 changes: 13 additions & 13 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<title>
<{VITE_WEBSITE_NAME}>
</title>
<description></description>
<keywords></keywords>
<meta name="author" content="John Doe">
<meta name="description" content="<{VITE_WEBSITE_DESCRIPTION}>">
<meta name="keywords" content="<{VITE_WEBSITE_KEYWORDS}>">
<meta name="author" content="<{VITE_WEBSITE_AUTHOR}>">
<script type="application/ld+json">
{
"@context": "https://schema.org",
Expand All @@ -20,16 +20,16 @@
"https://picsum.photos/id/1013/800/600",
"https://picsum.photos/id/1013/1920/1080"
],
"name": "{title}",
"title": "{title}",
"description": "{description}",
"name": "<{VITE_WEBSITE_NAME}>",
"title": "<{VITE_WEBSITE_NAME}>",
"description": "<{VITE_WEBSITE_DESCRIPTION}>",
"address": {
"@type": "PostalAddress",
"streetAddress": "{street}",
"addressLocality": "{city}",
"addressRegion": "{region}",
"postalCode": "{zip}",
"addressCountry": "{country}"
"streetAddress": "<{VITE_ADDRESS_STREET}>",
"addressLocality": "<{VITE_ADDRESS_CITY}>",
"addressRegion": "<{VITE_ADDRESS_REGION}>",
"postalCode": "<{VITE_ADDRESS_ZIP}>",
"addressCountry": "<{VITE_ADDRESS_COUNTRY}>"
},
"review": {
"@type": "Review",
Expand All @@ -40,7 +40,7 @@
},
"author": {
"@type": "Company",
"name": "mc2-advertising"
"name": "<{VITE_WEBSITE_AUTHOR}>"
}
},
"geo": {
Expand All @@ -50,7 +50,7 @@
},
"brand": {brands},
"url": "{url}",
"telephone": "{phone}",
"telephone": "<{VITE_PHONE}>",
"paymentAccepted": "{paymentAccepted}",
"currenciesAccepted": "{currenciesAccepted}",
"priceRange": "{priceRange}",
Expand Down
3 changes: 1 addition & 2 deletions src/pages/Services.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ function Services() {
useDocumentTitle(`${import.meta.env.VITE_WEBSITE_NAME}${location}`);

let openingHours = JSON.parse(import.meta.env.VITE_OPENING_HOURS);
let address = JSON.parse(import.meta.env.VITE_ADDRESS);

return (
<>
<h1>Services</h1>
<div>{import.meta.env.VITE_OPENING_HOURS}</div>
<p>{openingHours[0]['dayOfWeek']}</p>
<p>{address['NAME']}</p>
<p>{import.meta.env.VITE_ADDRESS_STREET}</p>
</>
);
}
Expand Down

0 comments on commit 3178026

Please sign in to comment.