Skip to content

Commit e148d6c

Browse files
[Learn] Land the learn page (#1258)
Co-authored-by: Augustine Kim <[email protected]>
1 parent f922f36 commit e148d6c

File tree

44 files changed

+35
-13
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+35
-13
lines changed

packages/lit-dev-content/site/_includes/article.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
— Updated <time datetime="{{ lastUpdated }}">{{ lastUpdated | readableDate }}</time>
88
{% endif %}
99
</div>
10+
<!-- TODO: Remove comment once tag support is enabled
1011
<div class="tags">
1112
{% for tag in tags %}
1213
{% if tag != 'articles-nav' %}
1314
<a href="{{ site.baseurl }}/articles/tags/{{ tag }}/" aria-label="{{ tag }} tag">{{ tag }}</a>
1415
{% endif %}
1516
{% endfor %}
1617
</div>
18+
-->
1719
<div class="authors">
1820
{% for authorId in author or defaultAuthor %}
1921
{% set authorData = authors[authorId] %}

packages/lit-dev-content/site/_includes/site-nav.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
</litdev-version-selector>
1818
</li>
1919

20-
<li class="navItem{% if page.url.includes('/tutorials') %} active{% endif %}">
21-
<a href="{{ site.baseurl }}/tutorials/">Tutorials</a></li>
20+
<li class="navItem{% if page.url.includes('/learn') %} active{% endif %}">
21+
<a href="{{ site.baseurl }}/learn/">Learn</a></li>
2222
<li class="navItem{% if page.url.includes('/playground') %} active{% endif %}">
2323
<a href="{{ site.baseurl }}/playground/">Playground</a></li>
2424
<li class="navItem{% if page.url.includes('/blog') %} active{% endif %}">

packages/lit-dev-content/site/css/articles.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,6 @@ article {
200200

201201
.articleHeader .tags {
202202
display: flex;
203-
/* TODO(emarquez): remove once we launch tags */
204-
display: none;
205203
}
206204

207205
.articleHeader .tags a {

packages/lit-dev-content/site/home/6-explore.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ <h1 class="homeSectionHeading">Explore Lit</h1>
44
<div id="exploreItems">
55
<div>
66
<h2>Try our live tutorials — no installation needed</h2>
7-
<a href="{{site.baseurl}}/tutorials/">Tutorials</a>
7+
<a href="{{site.baseurl}}/learn/#filter=tutorial">Tutorials</a>
88
</div>
99

1010
<div>

packages/lit-dev-server/src/redirects.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ export const pageRedirects = new Map([
3434
// Old release-notes redirects to new v2 location.
3535
['/docs/releases/release-notes/1.3.0/', '/docs/v2/releases/release-notes/1.3.0/'],
3636
['/docs/releases/release-notes/1.2.0/', '/docs/v2/releases/release-notes/1.2.0/'],
37-
// Old Lit tutorial redirect to new tutorial catalog
38-
['/tutorial/', '/tutorials/'],
37+
// Old Lit tutorial redirect to new learn catalog
38+
['/tutorial/', '/learn/#filter=tutorial'],
39+
['/tutorials/', '/learn/#filter=tutorial'],
3940
].map(([path, redir]) => [
4041
// Trailing slashes are required because this redirect map is consulted after
4142
// standard lit.dev path canonicalization.
@@ -96,12 +97,12 @@ export const oldLitElementSiteRedirects = new Map([
9697
['/guide/build', '/docs/v1/tools/build/'],
9798
['/guide/community', '/docs/v1/resources/community/'],
9899

99-
['/try', '/tutorials/'],
100-
['/try/create', '/tutorials/'],
101-
['/try/properties', '/tutorials/'],
102-
['/try/logic', '/tutorials/'],
103-
['/try/events', '/tutorials/'],
104-
['/try/style', '/tutorials/'],
100+
['/try', '/learn/#filter=tutorial'],
101+
['/try/create', '/learn/#filter=tutorial'],
102+
['/try/properties', '/learn/#filter=tutorial'],
103+
['/try/logic', '/learn/#filter=tutorial'],
104+
['/try/events', '/learn/#filter=tutorial'],
105+
['/try/style', '/learn/#filter=tutorial'],
105106

106107
['/api/index.html', '/docs/v1/api/lit-element/LitElement/'],
107108
['/api/globals.html', '/docs/v1/api/lit-element/LitElement/'],

packages/lit-dev-tests/known-good-urls.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ https://lit.dev/docs/templates/expressions/#static-expressions
463463
https://lit.dev/docs/tools/development/#development-and-production-builds
464464
https://lit.dev/docs/getting-started/
465465
https://lit.dev/tutorials/
466+
https://lit.dev/learn/
466467
https://lit.dev/playground/
467468
https://github.com/lit/lit/pull/2034
468469
https://github.com/lit/lit/blob/main/packages/lit/CHANGELOG.md

packages/lit-dev-tests/src/check-redirects.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ const checkRedirect = async (
8181
Searched for file ${indexHtmlPath} or ${directPath}`;
8282
}
8383
if (hash) {
84+
if (pathname === '/learn/' && hash.includes('filter')) {
85+
return OK;
86+
}
8487
// Another hack. Just do a regexp search for e.g. id="somesection" instead
8588
// of DOM parsing. Should be good enough, especially given how regular our
8689
// Markdown generated HTML is.
377 KB
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* @license
3+
* Copyright 2023 Google LLC
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
import {test, expect} from '@playwright/test';
8+
import {preventGDPRBanner} from './util.js';
9+
10+
test.describe('Learn catalog page', () => {
11+
test('smoke test', async ({browser}) => {
12+
const page = await browser.newPage({viewport: {width: 1920, height: 1080}});
13+
await preventGDPRBanner(page);
14+
await page.goto('/learn/');
15+
await expect(await page.screenshot()).toMatchSnapshot('learnCatalog.png');
16+
});
17+
});

0 commit comments

Comments
 (0)