-
Notifications
You must be signed in to change notification settings - Fork 0
overhaul: 05 app shell #19
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
Open
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,29 @@ | ||
| # Routes the app shell links to that do not exist yet. | ||
| # | ||
| # The header, footer, and 404 page are built in Phase 05 but link to the full site's routes, | ||
| # which Phase 07 builds. Until then the offline link check would fail on every page carrying the | ||
| # chrome — so these ten routes are excluded, and nothing else is. | ||
| # | ||
| # **Delete each entry as its page lands.** `tools/checks/stale-link-ignores.mjs` runs in CI and | ||
| # fails if an excluded route exists in `dist`, so an entry cannot quietly outlive its purpose and | ||
| # start hiding a real 404. Phase 07 is done when this file is gone. | ||
| # | ||
| # Anchored on purpose: /dist/programs$ must not also swallow /dist/programs/frc. | ||
|
|
||
| # Phase 07 group A | ||
| /dist/about$ | ||
| /dist/sponsors$ | ||
|
|
||
| # Phase 07 group B | ||
| /dist/contact$ | ||
| /dist/donate$ | ||
| /dist/get-involved$ | ||
|
|
||
| # Phase 07 group C | ||
| /dist/programs$ | ||
| /dist/programs/fll$ | ||
| /dist/programs/frc$ | ||
| /dist/programs/frc/robots$ | ||
|
|
||
| # Phase 07 group D | ||
| /dist/calendar/sc2$ |
This file contains hidden or 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 hidden or 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 hidden or 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
This file contains hidden or 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,15 @@ | ||
| --- | ||
| import type { JsonLdObject } from "@/lib/jsonld"; | ||
|
|
||
| /** | ||
| * Serializes one structured-data object into the document. The data always comes from | ||
| * `src/lib/jsonld.ts`, i.e. from us, so `set:html` carries no untrusted input. | ||
| */ | ||
| interface Props { | ||
| data: JsonLdObject; | ||
| } | ||
|
|
||
| const { data } = Astro.props; | ||
| --- | ||
|
|
||
| <script is:inline type="application/ld+json" set:html={JSON.stringify(data)} /> |
This file contains hidden or 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,90 @@ | ||
| --- | ||
| import type { ImageMetadata } from "astro"; | ||
|
|
||
| import { site } from "@/data/site"; | ||
|
|
||
| /** | ||
| * Everything that goes in `<head>` for discoverability. Rendered by BaseLayout, which passes | ||
| * these props straight through — so **`description` being required here is what stops a page | ||
| * from shipping without one.** Omitting it is a type error, not a review catch. | ||
| * | ||
| * No `keywords` meta: legacy carried a 22-term list, and search engines have ignored the signal | ||
| * for years. | ||
| */ | ||
| interface Props { | ||
| title: string; | ||
| /** 50–160 characters, written for a human deciding whether to click. */ | ||
| description: string; | ||
| /** | ||
| * Defaults to the site-wide card image. These are declared `| undefined` because layouts | ||
| * forward them straight through, and `exactOptionalPropertyTypes` treats an explicitly | ||
| * passed `undefined` as distinct from an absent prop. | ||
| */ | ||
| ogImage?: ImageMetadata | string | undefined; | ||
| ogType?: "website" | "article" | undefined; | ||
| /** Defaults to this page's own URL. Set it when two routes serve the same content. */ | ||
| canonical?: URL | string | undefined; | ||
| noindex?: boolean | undefined; | ||
| } | ||
|
|
||
| const { | ||
| title, | ||
| description, | ||
| ogImage = site.ogImage.path, | ||
| ogType = "website", | ||
| canonical, | ||
| noindex = false, | ||
| } = Astro.props; | ||
|
|
||
| /** The homepage is the site; anywhere else is a page *of* it. */ | ||
| const isHome = Astro.url.pathname === "/"; | ||
| const fullTitle = isHome ? site.name : site.titleTemplate.replace("%s", title); | ||
|
|
||
| const canonicalUrl = new URL(canonical ?? Astro.url.pathname, site.url); | ||
|
|
||
| /** | ||
| * The default card is a fixed-size file, so its dimensions travel with its path in `site.ts` — | ||
| * this block used to be dead for every page, since `imageDimensions` was only set for an imported | ||
| * `ImageMetadata` and no page passes one. Without the pair a scraper must fetch the whole 466 KB | ||
| * image just to learn its aspect ratio. | ||
| */ | ||
| const imageUrl = new URL(typeof ogImage === "string" ? ogImage : ogImage.src, site.url); | ||
|
|
||
| /** Known for an imported asset, and for the site default; unknown for any other bare path. */ | ||
| const imageSize = | ||
| typeof ogImage === "string" | ||
| ? ogImage === site.ogImage.path | ||
| ? { width: site.ogImage.width, height: site.ogImage.height } | ||
| : undefined | ||
| : { width: ogImage.width, height: ogImage.height }; | ||
| --- | ||
|
|
||
| <title>{fullTitle}</title> | ||
| <meta content={description} name="description" /> | ||
| <link href={canonicalUrl.href} rel="canonical" /> | ||
|
|
||
| {noindex && <meta content="noindex, nofollow" name="robots" />} | ||
|
|
||
| <meta content={fullTitle} property="og:title" /> | ||
| <meta content={description} property="og:description" /> | ||
| <meta content={ogType} property="og:type" /> | ||
| <meta content={canonicalUrl.href} property="og:url" /> | ||
| <meta content={site.name} property="og:site_name" /> | ||
| <meta content="en_US" property="og:locale" /> | ||
| <meta content={imageUrl.href} property="og:image" /> | ||
| <meta content={`${site.name} logo over a photo of the team`} property="og:image:alt" /> | ||
| { | ||
| imageSize !== undefined && ( | ||
| <> | ||
| <meta content={String(imageSize.width)} property="og:image:width" /> | ||
| <meta content={String(imageSize.height)} property="og:image:height" /> | ||
| </> | ||
| ) | ||
| } | ||
|
|
||
| <meta content="summary_large_image" name="twitter:card" /> | ||
| <meta content={fullTitle} name="twitter:title" /> | ||
| <meta content={description} name="twitter:description" /> | ||
| <meta content={imageUrl.href} name="twitter:image" /> | ||
|
|
||
| <meta content={site.chrome.themeColor} name="theme-color" /> | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.