Skip to content

Commit 5d1ccbd

Browse files
author
Arthur Evans
authored
Merge pull request #1187 from Polymer/lit-dev-banner
Add version banner & landing page redirect.
2 parents b212f87 + 28effaa commit 5d1ccbd

File tree

5 files changed

+65
-4
lines changed

5 files changed

+65
-4
lines changed

docs/_includes/version-banner.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<div class="version-banner">
2+
<img src="/images/flame.svg">
3+
<p>
4+
LitElement is now part of the Lit library–see the new site at <a href="https://lit.dev">lit.dev</a>.
5+
This site documents LitElement 2.0, no longer the current version.
6+
</p>
7+
</div>

docs/_layouts/guide.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
</nav>
2424

2525
<article>
26+
{% include version-banner.html %}
2627
<h1>{{page.title}}</h1>
2728
{{ content }}
2829
</article>

docs/css/main.css

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,16 +218,34 @@ main {
218218
}
219219

220220
.hero .blm-banner {
221-
position: relative;
222221
background: #000;
223222
height: 60px;
223+
}
224+
225+
.hero .lit-banner {
226+
background-color: #fff;
227+
color: #000;
228+
}
229+
230+
.hero .lit-banner a {
231+
font-weight: bold;
232+
}
233+
234+
.hero #lit-logo {
235+
height: 2em;
236+
padding-top: 1.5em;
237+
padding-right: 1.5em;
238+
}
239+
240+
.hero .banner {
241+
position: relative;
224242
display: flex;
225243
justify-content: center;
226244
align-content: center;
227245
padding: 0 20px 0 20px;
228246
}
229247

230-
.hero .blm-banner p {
248+
.hero .banner p,{
231249
margin: auto;
232250
text-align: center;
233251
}
@@ -237,8 +255,8 @@ main {
237255
}
238256

239257
.hero .wrapper {
240-
padding-top: 21vh;
241-
padding-bottom: 24vh;
258+
padding-top: 20vh;
259+
padding-bottom: 22vh;
242260
}
243261

244262
.hero-title {
@@ -454,6 +472,22 @@ article ol li {
454472
margin: 4px 0;
455473
}
456474

475+
.version-banner {
476+
padding: 0px 20px;
477+
border: 1px solid #000;
478+
max-width: 640px;
479+
display: flex;
480+
align-items: center;
481+
}
482+
483+
.version-banner a {
484+
font-weight: bold;
485+
}
486+
487+
.version-banner img {
488+
height: 36px;
489+
margin-right: 16px;
490+
}
457491

458492
.alert {
459493
position: relative;

docs/images/flame.svg

Lines changed: 13 additions & 0 deletions
Loading

docs/main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
extensions=['jinja2.ext.autoescape'],
88
autoescape=True)
99

10+
# Skip old landing page, go direct to guides.
11+
HOME_PAGE = '/guide'
12+
1013
# Match HTML pages from path; similar to behavior of Jekyll on GitHub Pages.
1114
def find_template(path):
1215
if path.endswith('/'):
@@ -25,6 +28,9 @@ def find_template(path):
2528

2629
class MainPage(webapp2.RequestHandler):
2730
def get(self):
31+
if (self.request.path == '/'):
32+
self.redirect(HOME_PAGE, permanent=True)
33+
return
2834
try:
2935
template = find_template(self.request.path)
3036
self.response.headers['Cache-Control'] = 'public, max-age=60'

0 commit comments

Comments
 (0)