Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Blog meta description and fix linting #259

Merged
merged 4 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
with:
npm_scope: '@significa'
install_registry_url: 'https://npm.pkg.github.com/'
# FIXME: We cannot run `npm run validate` because `svelte-check` requires runtime env vars to be set
lint_command: 'npm run lint'
staging_domain: ${{ vars.STAGING_DOMAIN }}
production_domain: ${{ vars.PRODUCTION_DOMAIN }}
secrets:
Expand Down
2 changes: 1 addition & 1 deletion .lintstagedrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"*.{js,ts,json,svelte}": ["eslint", "prettier --write"]
"*.{js,ts,json,svelte}": ["eslint", "prettier --write", "svelte-check --tsconfig ./tsconfig.json"]
}
7 changes: 3 additions & 4 deletions src/components/pages/blog-index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,9 @@

<Seo
title={getPageTitle(tags)}
description={`${$page.data.page?.story?.content?.seo_description} ${t(
'blog.meta-description-prefix',
{ tags: tags.join(', ') }
)}`}
description={tags.length
? t('blog.tag-meta-description', { tags: tags.join(', ') })
: $page.data.page?.story?.content?.seo_description}
/>

<main>
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/handbook.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
</div>
{/if}

{#if story.content.body?.content.length}
{#if story.content.body?.content && story.content.body?.content.length}
<div class="container mx-auto max-w-3xl px-container">
{#if story.content.body}
<div
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
</script>

{#each story.content.page || [] as page}
{#if page.component === 'static-page'}
{#if page.component === 'static-page' && page.body}
<StaticPage body={page.body} />
{:else if page.component === 'about-page' && isAboutPage(page)}
<About data={page} />
Expand Down
2 changes: 1 addition & 1 deletion src/lib/i18n/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,5 @@
"a11y.physics-add": "Create new physics block",
"a11y.see-post": "See post",
"a11y.see-career": "Se career",
"blog.meta-description-prefix": "Here you can find articles that are tagged with any of the following tags: {{tags}}."
"blog.tag-meta-description": "We design, we code, and we write about it too! Discover our blog with articles about: {{tags}}"
}
2 changes: 1 addition & 1 deletion src/lib/i18n/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const TranslationKeys = [
'a11y.physics-add',
'a11y.see-post',
'a11y.see-career',
'blog.meta-description-prefix'
'blog.tag-meta-description'
] as const;

export type TranslationKey = (typeof TranslationKeys)[number];
Expand Down