Skip to content

Commit

Permalink
Merge pull request #96 from significa/minor-improvements
Browse files Browse the repository at this point in the history
Minor improvements
  • Loading branch information
tofran authored May 12, 2023
2 parents 96a747a + ae3db5c commit c37a7a2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
30 changes: 16 additions & 14 deletions scripts/datasources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ import { apiPlugin, storyblokInit } from '@storyblok/js';

dotenv.config();

const PUBLIC_STORYBLOK_TOKEN = process.env.PUBLIC_STORYBLOK_TOKEN;

if (!PUBLIC_STORYBLOK_TOKEN) {
throw new Error('Missing required env var: PUBLIC_STORYBLOK_TOKEN');
}

const { storyblokApi } = storyblokInit({
accessToken: process.env.PUBLIC_STORYBLOK_TOKEN,
accessToken: PUBLIC_STORYBLOK_TOKEN,
use: [apiPlugin],
apiOptions: {
https: true
Expand All @@ -33,19 +39,15 @@ const entries: Config[] = [
fetcher: async () => {
const strings: Record<string, string> = {};

try {
const translationsRes = await storyblok.get('cdn/datasource_entries', {
datasource: 'strings',
per_page: 1000,
cv: Date.now()
});
const entries: Datasource[] = translationsRes.data.datasource_entries;
entries.forEach((entry) => {
strings[entry.name] = entry.value;
});
} catch (error) {
throw new Error(`Failed to get strings`);
}
const translationsRes = await storyblok.get('cdn/datasource_entries', {
datasource: 'strings',
per_page: 1000,
cv: Date.now()
});
const entries: Datasource[] = translationsRes.data.datasource_entries;
entries.forEach((entry) => {
strings[entry.name] = entry.value;
});

return {
keys: Object.keys(strings),
Expand Down
4 changes: 2 additions & 2 deletions src/lib/i18n/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
"tictactoe.draw": "It's a Draw!",
"tictactoe.your-turn": "Your turn",
"tictactoe.wait": "Wait for your turn",
"handbook.draft.title": "This is a draft",
"handbook.draft.description": "We're working on this page and it's due to be updated soon. Please check again later for some fresh new content.",
"handbook.draft.title": "This is a draft.",
"handbook.draft.description": "Our team is currently cracking away at creating more content to make our Handbook something increggdible. Soon, you'll be able to explore it fully. In the meantime, think of it as a carton of eggs, each section packed with the potential to deliver something eggceptional.",
"draw-segg.title": "Your very own Segg?",
"draw-segg.description": "Head over to our careers page, release your inner Basquiat and start your own Significa egg from scratch.",
"draw-segg.cta": "Get my Segg",
Expand Down
3 changes: 3 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"installCommand": "npm ci --prefer-offline --no-audit --no-fund",
"buildCommand": "npm run build",
"framework": "sveltekit",
"redirects": [
{ "source": "/showcase/:path", "destination": "/projects/:path", "permanent": true },
{
Expand Down

0 comments on commit c37a7a2

Please sign in to comment.