Skip to content
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
105 changes: 88 additions & 17 deletions apps/docs/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
import { filter } from 'rxjs';
// `?no-inline`: Vite would inline an asset this small as a data: URI, which NgOptimizedImage rejects.
import logo from '@angular-ssr-stream/press-kit/symbol/angular-ssr-stream-symbol.svg?no-inline';
import pushBased from '@angular-ssr-stream/design-system/pushbased-logo.svg?no-inline';
import { ALL_PAGES, DOCS, type DocSection } from './docs/nav';
import { DEMO, MOVIES, REPO } from './links';
import { trackPageHead } from './page-head';
Expand All @@ -36,24 +37,40 @@ import { DocsSearch } from './search/search';
<a class="brand text-card-title" routerLink="/">
<!-- Decorative: the name is the text next to it. -->
<img [ngSrc]="logo" alt="" width="32" height="32" priority />
angular-ssr-stream <span>docs</span>
angular-ssr-stream
</a>
<docs-search />
<nav class="top-nav text-link-mono" aria-label="Site">
<a routerLink="/docs/getting-started/introduction">Docs</a>
<a [href]="demo">Demo</a>
<a [href]="repo">GitHub</a>
<a class="top-link" routerLink="/docs/getting-started/introduction">Docs</a>
<a class="top-link" [href]="demo">Demo</a>
<a class="icon-btn" [href]="repo" aria-label="angular-ssr-stream on GitHub">
<svg viewBox="0 0 16 16" width="20" height="20" aria-hidden="true" focusable="false">
<path
fill="currentColor"
d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"
/>
</svg>
</a>
</nav>
<!-- On a phone or a tablet, the sidebar is a menu this opens over the page. -->
<!--
On a phone or a tablet, the sidebar is a menu this opens over the page.
Its name stays "Menu": aria-expanded says whether it is open, and the
three lines turn into a cross.
-->
<button
type="button"
class="menu-toggle pb-btn pb-btn-ghost"
class="menu-toggle icon-btn"
aria-controls="docs-contents"
[attr.aria-expanded]="menuOpen()"
(click)="menuOpen() ? closeMenu() : openMenu()"
#menuButton
>
{{ menuOpen() ? 'Close' : 'Menu' }}
<svg class="menu-icon" viewBox="0 0 20 20" width="20" height="20" aria-hidden="true">
<path d="M3 5h14" />
<path d="M3 10h14" />
<path d="M3 15h14" />
</svg>
<span class="visually-hidden">Menu</span>
</button>
</div>
</header>
Expand Down Expand Up @@ -95,7 +112,8 @@ import { DocsSearch } from './search/search';
}
</details>
}
<!-- The header's links, which have no room next to the menu button. -->
<!-- The header's links: the menu button takes their place, and on the
narrowest phones the repository's too. -->
<div class="sidebar-section sidebar-elsewhere">
<p class="sidebar-title text-subtitle" id="nav-elsewhere">Elsewhere</p>
<ul aria-labelledby="nav-elsewhere">
Expand All @@ -111,16 +129,53 @@ import { DocsSearch } from './search/search';
</div>
<footer class="bottom" [attr.inert]="menuOpen() ? '' : null">
<div class="bottom-inner">
<p>Streamed server-side rendering for Angular.</p>
<nav aria-label="Elsewhere">
<a [href]="demo">The demo</a>
<a [href]="movies">Angular Movies, a real app</a>
<a [href]="repo">Source on GitHub</a>
<a routerLink="/docs/reference/press-kit">Press kit</a>
<!-- The contents for a language model; the build writes it (scripts/prerender.ts). -->
<a href="llms.txt">llms.txt</a>
<a href="https://push-based.io/">PushBased</a>
<div class="bottom-about">
<a class="brand text-card-title" routerLink="/">
<img [ngSrc]="logo" alt="" width="32" height="32" />
angular-ssr-stream
</a>
<p>
Streamed server-side rendering for Angular: the page goes out at once, and its slow
parts follow in the same response.
</p>
</div>
<nav class="bottom-nav" aria-label="Footer">
<div class="bottom-docs">
<p class="bottom-title text-subtitle" id="footer-docs">Docs</p>
<ul aria-labelledby="footer-docs">
@for (section of footerSections; track section.title) {
<li>
<a [routerLink]="section.link" [fragment]="section.fragment">{{
section.title
}}</a>
</li>
}
</ul>
</div>
<div class="bottom-live">
<p class="bottom-title text-subtitle" id="footer-live">See it run</p>
<ul aria-labelledby="footer-live">
<li><a [href]="demo">The live demo</a></li>
<li><a [href]="movies">Angular Movies</a></li>
</ul>
</div>
<div class="bottom-project">
<p class="bottom-title text-subtitle" id="footer-project">Project</p>
<ul aria-labelledby="footer-project">
<li><a [href]="repo">Source on GitHub</a></li>
<li><a [href]="issues">Report an issue</a></li>
<li><a routerLink="/docs/reference/press-kit">Press kit</a></li>
<!-- The contents for a language model; the build writes it (scripts/prerender.ts). -->
<li><a href="llms.txt">llms.txt</a></li>
</ul>
</div>
</nav>
<p class="bottom-by">
<a href="https://push-based.io/">
Built by
<img [ngSrc]="pushBased" alt="PushBased" width="86" height="32" />
</a>
</p>
</div>
</footer>
`,
Expand All @@ -129,10 +184,26 @@ import { DocsSearch } from './search/search';
})
export class App {
protected readonly logo = logo;
protected readonly pushBased = pushBased;
protected readonly docs = DOCS;
protected readonly demo = DEMO;
protected readonly movies = MOVIES;
protected readonly repo = REPO;
protected readonly issues = REPO + '/issues';

/**
* The footer's way into each section: its first page, or, where the pages
* are alternatives, the choice between them on the home page. The press kit
* is listed with the project.
*/
protected readonly footerSections = DOCS.filter((section) => section.id !== 'about').map(
(section) => {
const first = section.groups[0].pages[0];
return section.alternatives
? { title: section.title, link: ['/'], fragment: 'home-' + section.id }
: { title: section.title, link: ['/docs', first.dir, first.slug], fragment: undefined };
},
);

/** The sidebar as a menu over the page, below `MENU_BREAKPOINT`. */
protected readonly menuOpen = signal(false);
Expand Down
Loading
Loading