-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Profile head elements will require a refactor
Ignoring for now as Astro is likely the better fit
- Loading branch information
1 parent
2915c34
commit be56a7d
Showing
4 changed files
with
50 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<script lang="ts"> | ||
/** | ||
* TODO This will be moved to SvelteKit layout | ||
* See notes in [ein]/+page.svelte | ||
*/ | ||
import type { GrantmakersExtractedDataObj } from '@shared/typings/grantmakers/grants'; | ||
type Title = GrantmakersExtractedDataObj['organization_name']; | ||
type Description = Pick<GrantmakersExtractedDataObj, 'organization_name' | 'city' | 'state' | 'ein' | 'filings'>; | ||
export let profile: GrantmakersExtractedDataObj; | ||
const { organization_name, city, state, ein, filings } = profile; | ||
const title = createTitle(organization_name); | ||
const description = createDescription({ organization_name, city, state, ein, filings }); | ||
function createTitle(organization_name: Title): string { | ||
return `Grantmakers.io Profile - ${organization_name}`; | ||
} | ||
function createDescription({ organization_name, city, state, ein, filings }: Description): string { | ||
const firstTaxYear = filings[0].tax_year; | ||
const stringifiedTaxYr = firstTaxYear.toString(); | ||
const description = `Profile for ${organization_name} (${city}, ${state} - EIN ${ein}) including grantees and board members as of ${stringifiedTaxYr} tax year.`; | ||
return description; | ||
} | ||
// console.log('Post-Hydration Page Title:', title); | ||
// console.log('Post-Hydration Page Description:', description); | ||
</script> | ||
|
||
<svelte:head> | ||
<title>{title}</title> | ||
<meta name="description" content={description} /> | ||
</svelte:head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters