Skip to content

Commit

Permalink
Update: Add banner (eslint#735)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaicataldo authored Jun 6, 2020
1 parent a2d66e0 commit 645036d
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 6 deletions.
5 changes: 5 additions & 0 deletions _data/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ function calculateUrl() {
module.exports = {
title: "ESLint - Pluggable JavaScript linter",
description: "A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.",
banner: {
text: null,
foregroundColor: "#ffffff",
backgroundColor: "#000000"
},
url: calculateUrl(),
links: {
chat: "/chat",
Expand Down
5 changes: 5 additions & 0 deletions _includes/menu.liquid
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<input type="checkbox" id="eslint-toggle-search" class="eslint-toggle-search-checkbox" />
<header class="navbar navbar-default navbar-demo navbar-fixed-top eslint-nav" id="top" role="banner">
{% if site.banner.text %}
<div class="eslint-banner" style="color: {{ site.banner.foregroundColor }}; background-color: {{ site.banner.backgroundColor }}">
<p>{{ site.banner.text }}</p>
</div>
{% endif %}
<div class="container">
<a href="/" class="navbar-brand"><img alt="ESLint" src="/assets/img/logo.svg" itemprop="image">ESLint</a>
<div class="eslint-navbar-toggles">
Expand Down
6 changes: 5 additions & 1 deletion _layouts/default.liquid
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<!DOCTYPE html>
<html lang="en" class="no-js">
{% include head %}
<body>
{% if site.banner.text %}
<body class="banner-displayed">
{% else %}
<body>
{% endif %}
<div itemscope itemtype="http://schema.org/SoftwareApplication">
{% include menu %}
{% include jumbotron %}
Expand Down
6 changes: 5 additions & 1 deletion _layouts/demo.liquid
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<!DOCTYPE html>
<html lang="en" class="no-js">
{% include head %}
<body>
{% if site.banner.text %}
<body class="banner-displayed">
{% else %}
<body>
{% endif %}
{% include menu %}
<main class="container">
{{ content }}
Expand Down
6 changes: 5 additions & 1 deletion _layouts/doc.liquid
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<!DOCTYPE html>
<html lang="en" class="no-js">
{% include head %}
<body>
{% if site.banner.text %}
<body class="banner-displayed">
{% else %}
<body>
{% endif %}
{% include menu %}
<main class="doc">
<article class="container">
Expand Down
6 changes: 5 additions & 1 deletion _layouts/post.liquid
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<!DOCTYPE html>
<html lang="en" class="no-js">
{% include head %}
<body>
{% if site.banner.text %}
<body class="banner-displayed">
{% else %}
<body>
{% endif %}
{% include menu %}
<div class="container">
<div class="row">
Expand Down
6 changes: 5 additions & 1 deletion _layouts/rule.liquid
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<!DOCTYPE html>
<html lang="en" class="no-js">
{% include head %}
<body>
{% if site.banner.text %}
<body class="banner-displayed">
{% else %}
<body>
{% endif %}
{% include menu %}
<main class="rule doc">
<article class="container">
Expand Down
6 changes: 5 additions & 1 deletion _layouts/rules.liquid
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<!DOCTYPE html>
<html lang="en" class="no-js">
{% include head %}
<body>
{% if site.banner.text %}
<body class="banner-displayed">
{% else %}
<body>
{% endif %}
{% include menu %}
<main class="rules doc">
<article class="container">
Expand Down
21 changes: 21 additions & 0 deletions src/styles/lib/banner.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
body.banner-displayed {
padding-top: 160px;
}

.eslint-banner {
font-size: 24px;
font-weight: bold;
text-align: center;
margin: 0 auto;
background-color: #000000;
color: #ffffff;
height: 80px;
display: flex;
align-items: center;
justify-content: center;

p {
margin: 0;
padding: 0;
}
}
1 change: 1 addition & 0 deletions src/styles/lib/overrides.less
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
body {
padding-top: 80px;
}

/* Allow anchors to not be hidden by the fixed header */
:target:before {
content: "";
Expand Down
1 change: 1 addition & 0 deletions src/styles/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
@import "lib/syntax_highlighting.less";
@import "lib/rules_index.less";
@import "lib/404.less";
@import "lib/banner.less";

0 comments on commit 645036d

Please sign in to comment.