Skip to content

Commit a0d568c

Browse files
Updated the build config
1 parent 64791f6 commit a0d568c

File tree

3 files changed

+70
-46
lines changed

3 files changed

+70
-46
lines changed

scripts/js/sitemap.ts

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,35 @@ const processArguments = process.argv;
1616

1717
const env = getArguments(processArguments, '--env-file');
1818

19-
const envFile = env
20-
? env === 'local'
21-
? fs.existsSync('.env.local')
22-
? '.env.local'
23-
: fs.existsSync(`.env.${env}.local`)
24-
? `.env.${env}.local`
25-
: fs.existsSync(`.env.${env}`)
26-
? `.env.${env}`
27-
: '.env'
28-
: '.env'
29-
: '.env';
30-
31-
try {
32-
if (!fs.existsSync(envFile)) {
33-
throw new Error(`
34-
Environment files are not there in the workspace.
35-
Create the .env file with required properties defined in it.
36-
Create .env.local for local environment properties.
37-
Create .env.{development | qa | production }.local to check application with environment specific properties.
38-
If you create a new environment specific .env file add it in the .gitignore and do not commit that file.
39-
`);
40-
}
41-
} catch (error) {
42-
console.error(error);
43-
}
44-
45-
dotenv.config({
46-
path: envFile,
47-
});
19+
// const envFile = env
20+
// ? env === 'local'
21+
// ? fs.existsSync('.env.local')
22+
// ? '.env.local'
23+
// : fs.existsSync(`.env.${env}.local`)
24+
// ? `.env.${env}.local`
25+
// : fs.existsSync(`.env.${env}`)
26+
// ? `.env.${env}`
27+
// : '.env'
28+
// : '.env'
29+
// : '.env';
30+
31+
// try {
32+
// if (!fs.existsSync(envFile)) {
33+
// throw new Error(`
34+
// Environment files are not there in the workspace.
35+
// Create the .env file with required properties defined in it.
36+
// Create .env.local for local environment properties.
37+
// Create .env.{development | qa | production }.local to check application with environment specific properties.
38+
// If you create a new environment specific .env file add it in the .gitignore and do not commit that file.
39+
// `);
40+
// }
41+
// } catch (error) {
42+
// console.error(error);
43+
// }
44+
45+
// dotenv.config({
46+
// path: envFile,
47+
// });
4848

4949
const project = getArguments(processArguments, '--project');
5050

@@ -59,7 +59,7 @@ const routes = workspace['projects'][project]['routes'];
5959
const assets = workspace['projects'][project]['assets'];
6060

6161
const URL = process.env.VITE_BASE_URL;
62-
const baseURL = URL ? URL : 'https://localhost:3000';
62+
const baseURL = URL ? URL : '/';
6363
const pages = [''];
6464

6565
fs.readdirSync(`${root}/${routes}`).forEach((file) => {

src/lib/shared/components/seo/SEO.svelte

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,40 @@
2222
title: metaData.title,
2323
description: metaData.description,
2424
url: metaData.url
25-
? `${environment.launchURL}${metaData.url}`
26-
: environment.launchURL,
25+
? environment.launchURL
26+
? `${environment.launchURL}${metaData.url}`
27+
: `${metaData.url}`
28+
: environment.launchURL
29+
? environment.launchURL
30+
: '/',
2731
locale: 'en_US',
2832
},
2933
twitter: {
3034
...metaData.twitter,
3135
title: metaData.title,
3236
description: metaData.description,
3337
site: metaData.url
34-
? `${environment.launchURL}${metaData.url}`
35-
: environment.launchURL,
38+
? environment.launchURL
39+
? `${environment.launchURL}${metaData.url}`
40+
: `${metaData.url}`
41+
: environment.launchURL
42+
? environment.launchURL
43+
: '/',
3644
},
3745
url: metaData.url
38-
? `${environment.launchURL}${metaData.url}`
39-
: environment.launchURL,
40-
searchUrl: metaData.searchUrl
41-
? `${environment.launchURL}${metaData.searchUrl}`
42-
: environment.launchURL,
46+
? environment.launchURL
47+
? `${environment.launchURL}${metaData.url}`
48+
: `${metaData.url}`
49+
: environment.launchURL
50+
? environment.launchURL
51+
: '/',
52+
searchUrl: metaData.url
53+
? environment.launchURL
54+
? `${environment.launchURL}${metaData.url}`
55+
: `${metaData.url}`
56+
: environment.launchURL
57+
? environment.launchURL
58+
: '/',
4359
};
4460
4561
const jsonLd = (content) => `<${'script'} type="application/ld+json">${JSON.stringify(content)}</${'script'}>`;
@@ -59,17 +75,25 @@
5975
metaData.openGraph = {
6076
...metaData.openGraph,
6177
image: metaData.url
62-
? `${environment.launchURL}${metaData.url}`
63-
: environment.launchURL,
78+
? environment.launchURL
79+
? `${environment.launchURL}${metaData.url}`
80+
: `${metaData.url}`
81+
: environment.launchURL
82+
? environment.launchURL
83+
: '/',
6484
'image:width': metaData.image.width,
6585
'image:height': metaData.image.height,
6686
'image:alt': metaData.image.alt || metaData.title,
6787
};
6888
metaData.twitter = {
6989
...metaData.twitter,
7090
image: metaData.url
71-
? `${environment.launchURL}${metaData.url}`
72-
: environment.launchURL,
91+
? environment.launchURL
92+
? `${environment.launchURL}${metaData.url}`
93+
: `${metaData.url}`
94+
: environment.launchURL
95+
? environment.launchURL
96+
: '/',
7397
'image:alt': metaData.image.alt || metaData.title,
7498
};
7599
}
@@ -136,7 +160,7 @@
136160
'@context': 'https://schema.org',
137161
'@type': 'Organization',
138162
url: metaData.url,
139-
logo: `${environment.launchURL}/favicon.ico`,
163+
logo: `/favicon.ico`,
140164
})}
141165
{/if}
142166

src/routes/projects/index.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
const metaData: Partial<IMetaTagProperties> = {
3232
title: 'Project | Sveltekit Blog',
3333
description: 'Project page of Sveltekit blog starter project',
34-
url: '/project',
34+
url: '/projects',
3535
keywords: ['sveltekit', 'sveltekit starter', 'sveltekit starter about'],
36-
searchUrl: '/project',
36+
searchUrl: '/projects',
3737
};
3838
// End: Local component properties
3939
</script>

0 commit comments

Comments
 (0)