Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

Add a 404 page and an “Edit this page” link, as well as some other polish #367

Merged
merged 16 commits into from
Sep 4, 2017
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
10 changes: 10 additions & 0 deletions 404.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: 404
layout: doc
---

# 4![0](/img/logo.svg)4
{:.four-oh-four-header}
## Something’s missing
### [Go home](/) or [check out the rules](/docs/rules)?
[Get Started with ESLint »](/docs/user-guide/getting-started){:.btn.btn-default.btn-lg.btn-block.btn-getting-started role="button"}
10 changes: 8 additions & 2 deletions _includes/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

<footer>
<ul class="list-inline">
{% if page.edit_link %}
<li><a href="{{ page.edit_link }}">Edit this page</a></li>
{% else %}
<li><a href="https://github.com/eslint/eslint.github.io/edit/master/{{ page.path }}">Edit this page</a></li>
{% endif %}
<li><a href="https://groups.google.com/group/eslint">Mailing List</a></li>
<li><a href="https://github.com/eslint/eslint">GitHub</a></li>
<li><a href="https://twitter.com/geteslint">Twitter</a></li>
Expand Down Expand Up @@ -32,10 +37,11 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/1.1.1/anchor.min.js"></script>
<script src="/js/app/search.js"></script>
<script src="{{ site.url }}/js/app/search.js"></script>
<script>
$(document).ready(function() {
anchors.add('.doc h2, .doc h3, .doc h4, .blog h2, .blog h3, .blog h4');

{% if page.homepage %}
function shuffleArray(array) {
for (var i = array.length - 1; i > 0; i--) {
Expand All @@ -47,7 +53,7 @@
return array;
}

var logos = [{% for logo in site.data.logos %}{ url: '{{ logo.url }}', src: '{{ logo.src }}', name: '{{ logo.name }}' }{% unless forloop.last %},{% endunless %}{% endfor %}];
var logos = [{% for logo in site.data.logos %}{ url: '{{ logo.url }}', src: '{{ site.url }}{{ logo.src }}', name: '{{ logo.name }}' }{% unless forloop.last %},{% endunless %}{% endfor %}];
logos = shuffleArray(logos);
for (var i = 0, l = logos.length; i<l; i++) {
var logo = $('<div class="slide col-sm-4"><a href="' + logos[i].url + '"><img src="' + logos[i].src + '" alt="' + logos[i].name + '"></a></div>');
Expand Down
6 changes: 3 additions & 3 deletions _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<meta property="og:title" content="{{ page.title }}">
<meta property="og:url" content="{{ site.url }}{{ page.url }}">
<meta property="og:image" content="{{ site.url }}/img/favicon.512x512.png">

<meta name="twitter:site" content="@geteslint">
<meta name="twitter:title" content="{{ page.title }}">
<meta name="twitter:description" content="{{ site.description }}">
Expand All @@ -29,8 +29,8 @@
{% endif %}

<link href="{{ site.url }}{{ page.url }}" rel="canonical" />
<link rel="stylesheet" href="/styles/main.css"/>
<link rel="icon" href="/img/favicon.512x512.png">
<link rel="stylesheet" href="{{ site.url }}/styles/main.css"/>
<link rel="icon" href="{{ site.url }}/img/favicon.512x512.png">
<link rel="alternate" type="application/rss+xml" title="{{ site.name }}" href="{{ site.url }}/feed.xml">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
Expand Down
2 changes: 1 addition & 1 deletion _includes/jumbotron.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h2 itemprop="description">The pluggable linting <span itemprop="applicationCate
</div>
<div class="row">
<div class="col-sm-4 col-sm-offset-4">
<a class="btn btn-default btn-lg btn-block btn-getting-started" href="/docs/user-guide/getting-started" role="button">Get Started »</a>
<a class="btn btn-default btn-lg btn-block btn-getting-started" href="{{ site.url }}/docs/user-guide/getting-started" role="button">Get Started »</a>
</div>
</div>
</div>
Expand Down
60 changes: 30 additions & 30 deletions _includes/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<header class="navbar navbar-default navbar-demo navbar-fixed-top eslint-nav" id="top" role="banner">
<div class="container">

<a href="/" class="navbar-brand"><img alt="ESLint" src="/img/logo.svg" itemprop="image">ESLint</a>
<a href="{{ site.url }}/" class="navbar-brand"><img alt="ESLint" src="{{ site.url }}/img/logo.svg" itemprop="image">ESLint</a>
Copy link
Member

@ilyavolodin ilyavolodin Jul 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for changing everything to use absolute paths? While they will be gzipped, they will still add to download size of the page, and I'm not sure I know the advantages of using them in this case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When editing a forked version, the site isn’t hosted at the root of the domain, so adding these allows the site to load the assets properly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But all of those path are starting with / so if you forked the whole repo, you probably have all of the assets in that repo as well, right? I guess all of us always just used local install of Jekyll to work on the site, and never tried it in a fork.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, because the site would end up at https://<username>.github.io/eslint.github.io, so the path /img/logo.svg would load the image from https://<username>.github.io/img/logo.svg, rather than https://<username>.github.io/eslint.github.io/img/logo.svg.

I've also encountered this issue when trying to demo things for this repo.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, got it. Thanks. As I mentioned, I always used local Jekyll, and that's not a problem there, since it's always http://localhost:port/ in that case, I'm 👍 for adding that in.


<div class="eslint-navbar-toggles">
<button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target="#eslint-navbar" aria-controls="eslint-navbar" aria-expanded="false">
Expand All @@ -21,47 +21,47 @@
<nav id="eslint-navbar" class="collapse navbar-collapse eslint-navbar">
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="/docs/user-guide" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">User guide<span class="caret"></span></a>
<a href="{{ site.url }}/docs/user-guide" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">User guide<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="/docs/user-guide/getting-started">Getting Started</a></li>
<li><a href="/docs/user-guide/configuring">Configuring ESLint</a></li>
<li><a href="/docs/user-guide/command-line-interface">Command Line Interface</a></li>
<li><a href="/docs/rules/">Rules</a></li>
<li><a href="/docs/user-guide/formatters">Formatters</a></li>
<li><a href="{{ site.url }}/docs/user-guide/getting-started">Getting Started</a></li>
<li><a href="{{ site.url }}/docs/user-guide/configuring">Configuring ESLint</a></li>
<li><a href="{{ site.url }}/docs/user-guide/command-line-interface">Command Line Interface</a></li>
<li><a href="{{ site.url }}/docs/rules/">Rules</a></li>
<li><a href="{{ site.url }}/docs/user-guide/formatters">Formatters</a></li>
<li class="divider"></li>
<li><a href="/docs/user-guide/migrating-to-1.0.0">Migrating to v1.0.0</a></li>
<li><a href="/docs/user-guide/migrating-to-2.0.0">Migrating to v2.0.0</a></li>
<li><a href="/docs/user-guide/migrating-to-3.0.0">Migrating to v3.0.0</a></li>
<li><a href="/docs/user-guide/migrating-to-4.0.0">Migrating to v4.0.0</a></li>
<li><a href="/docs/user-guide/migrating-from-jscs">Migrating from JSCS</a></li>
<li><a href="/docs/user-guide/integrations">Integrations</a></li>
<li><a href="{{ site.url }}/docs/user-guide/migrating-to-1.0.0">Migrating to v1.0.0</a></li>
<li><a href="{{ site.url }}/docs/user-guide/migrating-to-2.0.0">Migrating to v2.0.0</a></li>
<li><a href="{{ site.url }}/docs/user-guide/migrating-to-3.0.0">Migrating to v3.0.0</a></li>
<li><a href="{{ site.url }}/docs/user-guide/migrating-to-4.0.0">Migrating to v4.0.0</a></li>
<li><a href="{{ site.url }}/docs/user-guide/migrating-from-jscs">Migrating from JSCS</a></li>
<li><a href="{{ site.url }}/docs/user-guide/integrations">Integrations</a></li>
</ul>
</li>
<li class="dropdown">
<a href="/docs/developer-guide" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Developer guide<span class="caret"></span></a>
<a href="{{ site.url }}/docs/developer-guide" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Developer guide<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="/docs/developer-guide/architecture">Architecture</a></li>
<li><a href="/docs/developer-guide/contributing">Contributing</a></li>
<li><a href="/docs/developer-guide/source-code">Get the Source Code</a></li>
<li><a href="/docs/developer-guide/development-environment">Set up a Development Environment</a></li>
<li><a href="/docs/developer-guide/unit-tests">Run the Unit Tests</a></li>
<li><a href="/docs/developer-guide/working-with-rules">Working with Rules</a></li>
<li><a href="/docs/developer-guide/working-with-plugins">Working with Plugins</a></li>
<li><a href="/docs/developer-guide/working-with-custom-formatters">Working with Custom Formatters</a></li>
<li><a href="/docs/developer-guide/shareable-configs">Shareable Configs</a></li>
<li><a href="/docs/developer-guide/nodejs-api">Node.js API</a></li>
<li><a href="/docs/maintainer-guide">Maintainer guide</a></li>
<li><a href="{{ site.url }}/docs/developer-guide/architecture">Architecture</a></li>
<li><a href="{{ site.url }}/docs/developer-guide/contributing">Contributing</a></li>
<li><a href="{{ site.url }}/docs/developer-guide/source-code">Get the Source Code</a></li>
<li><a href="{{ site.url }}/docs/developer-guide/development-environment">Set up a Development Environment</a></li>
<li><a href="{{ site.url }}/docs/developer-guide/unit-tests">Run the Unit Tests</a></li>
<li><a href="{{ site.url }}/docs/developer-guide/working-with-rules">Working with Rules</a></li>
<li><a href="{{ site.url }}/docs/developer-guide/working-with-plugins">Working with Plugins</a></li>
<li><a href="{{ site.url }}/docs/developer-guide/working-with-custom-formatters">Working with Custom Formatters</a></li>
<li><a href="{{ site.url }}/docs/developer-guide/shareable-configs">Shareable Configs</a></li>
<li><a href="{{ site.url }}/docs/developer-guide/nodejs-api">Node.js API</a></li>
<li><a href="{{ site.url }}/docs/maintainer-guide">Maintainer guide</a></li>
</ul>
</li>
<li><a href="/blog/">Blog</a></li>
<li><a href="{{ site.url }}/blog/">Blog</a></li>
<li class="dropdown">
<a href="/demo" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Demo<span class="caret"></span></a>
<a href="{{ site.url }}/demo" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Demo<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="/demo/">ESLint Demo</a></li>
<li><a href="/parser/">Espree Demo</a></li>
<li><a href="{{ site.url }}/demo/">ESLint Demo</a></li>
<li><a href="{{ site.url }}/parser/">Espree Demo</a></li>
</ul>
</li>
<li><a href="/docs/about/">About</a></li>
<li><a href="{{ site.url }}/docs/about/">About</a></li>
</ul>

<label for="eslint-toggle-search" class="navbar-toggle eslint-toggle-search-open">
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/formatters/html-formatter-example.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ <h1>ESLint Report</h1>
<tbody>
<tr class="bg-2" data-group="f-0">
<th colspan="4">
[+] /var/lib/jenkins/workspace/Releases/ESLint Release/eslint/fullOfProblems.js
[+] /Users/hayfields/Documents/Jed_Folder/github-clones/Forks/eslint/fullOfProblems.js
<span>9 problems (5 errors, 4 warnings)</span>
</th>
</tr>
Expand Down
Loading