Skip to content

Commit aae3f9d

Browse files
committed
Simplify URLs to remove explicit use of index.html
- Oomph's http server has been augmented to transparently serve the index.html when it exists. - This removal is especially helpful to shorten markdown URIs.
1 parent 263da0c commit aae3f9d

9 files changed

+30
-29
lines changed

eclipse-charter.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<body>
1212

1313
<div data-generate="generateDefaultBreadcrumb(this)">
14-
<a href="index.html">Eclipse</a>
14+
<a href=".">Eclipse</a>
1515
<span>Charter</span>
1616
</div>
1717

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</div>
1616

1717
<div data-generate="generateDefaultNav(this)">
18-
<a class=" highlight fa-wpforms" href="development/index.html" title="More: Plans, Notes, Guides">
18+
<a class=" highlight fa-wpforms" href="development/" title="More: Plans, Notes, Guides">
1919
<div>More&mldr;<p>Plans, Notes, Guides&mldr;</p>
2020
</div>
2121
</a>
@@ -57,7 +57,7 @@ <h3>
5757
as a rich client platform (<a href="https://github.com/eclipse-platform/eclipse.platform.ui/blob/master/docs/Rich_Client_Platform.md">RCP</a>),
5858
and as a comprehensive tool integration platform.
5959
These services and frameworks include a standard workbench user interface model
60-
and a portable native widget toolkit (<a href="swt/index.html">SWT</a>),
60+
and a portable native widget toolkit (<a href="swt">SWT</a>),
6161
a project model for managing resources,
6262
automatic resource delta management for incremental compilers and builders,
6363
language-independent debug infrastructure,

markdown/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696

9797
<body>
9898
<div data-generate="generateDefaultBreadcrumb(this)">
99-
<a href="../index.html">Eclipse</a>
99+
<a href="../">Eclipse</a>
100100
</div>
101101

102102
<div data-generate="generateDefaults(this)">
@@ -130,7 +130,7 @@
130130
const selfHosted = repo == 'www.eclipse.org-eclipse';
131131
const repoName = parts == null ? '' : repoNames[`${org}/${repo}`];
132132

133-
const localSiteNavigator = isLocalHost ? `<a href="${scriptBase}markdown/index.html?file=eclipse-platform/www.eclipse.org-eclipse/master/">Eclipse Website Navigator</a>` : '';
133+
const localSiteNavigator = isLocalHost ? `<a href="${markdownBase}eclipse-platform/www.eclipse.org-eclipse/master/">Eclipse Website Navigator</a>` : '';
134134
defaultAside = toElements(`${markdownAside}${localSiteNavigator}`);
135135

136136
if (parts != null && parts.groups.path.endsWith('.md')) {
@@ -297,8 +297,8 @@ <h2>Table of Contents</h2>
297297
const filename = parts.groups.filename;
298298
const lastPart = filename == 'index' ? '' : `<li>${niceName(filename)}</li>`;
299299
breadcrumb.append(...toElements(`
300-
<li><a href="${scriptBase}news/index.html">News</a></li>
301-
<li><a href="${scriptBase}markdown/index.html?file=eclipse-platform/www.eclipse.org-eclipse/master/news/${version}/index.md">${version}</a></li>
300+
<li><a href="${scriptBase}news/">News</a></li>
301+
<li><a href="${markdownBase}eclipse-platform/www.eclipse.org-eclipse/master/news/${version}/index.md">${version}</a></li>
302302
${lastPart}
303303
`));
304304
return true;

news/news.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</div>
2525

2626
<div data-generate="generateDefaultBreadcrumb(this)">
27-
<a href="../index.html">Eclipse</a>
27+
<a href="..">Eclipse</a>
2828
<a href="news.html">News</a>
2929
</div>
3030

project.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ window.onscroll = function() {
77

88
const scriptBase = new URL(".", document.currentScript.src).href
99
const apiGitHub = 'https://api.github.com/repos/eclipse-platform/www.eclipse.org-eclipse/contents/';
10-
const markdownBase = `${scriptBase}markdown/index.html?file=`;
11-
const selfHostedMarkdownBase = `${markdownBase}eclipse-platform/www.eclipse.org-eclipse/master/`;
10+
const markdownBase = `${scriptBase}markdown/?file=`;
1211
const newsBase = `${scriptBase}news/news.html?file=`;
12+
const selfHostedMarkdownBase = `${markdownBase}eclipse-platform/www.eclipse.org-eclipse/master/`;
1313

1414
let meta = toElements(`
1515
<meta charset="utf-8">
@@ -46,7 +46,7 @@ let defaultNav = toElements(`
4646
title="Support: Discussions">
4747
Support<p>Discussions</p>
4848
</a>
49-
<a class="fa-newspaper-o" href="${scriptBase}news/news.html"
49+
<a class="fa-newspaper-o" href="${scriptBase}news/"
5050
title="News: Noteworthy">
5151
News<p>Noteworthy</p>
5252
</a>
@@ -57,7 +57,7 @@ let projectAside = `
5757
<a class="separator" href="https://projects.eclipse.org/projects/eclipse"><i class='fa fa-cube'></i> Eclipse Project</a>
5858
<a href="https://projects.eclipse.org/projects/eclipse.equinox">Equinox</a>
5959
<a href="https://projects.eclipse.org/projects/eclipse.platform">Platform</a>
60-
<a href="${scriptBase}swt/index.html">&nbsp;&nbsp;&bullet;&nbsp;SWT</a>
60+
<a href="${scriptBase}swt">&nbsp;&nbsp;&bullet;&nbsp;SWT</a>
6161
<a href="https://projects.eclipse.org/projects/eclipse.jdt">Java Development Tools</a>
6262
<a href="https://projects.eclipse.org/projects/eclipse.pde">Plug-in Development Environment</a>
6363
`;
@@ -72,11 +72,11 @@ let githubAside = `
7272

7373
let markdownAside = `
7474
<span class="separator"><i class='fa fa-edit'></i> Markdown</span>
75-
<a href="${scriptBase}markdown/index.html?file=eclipse-platform/eclipse.platform/master/docs">Platform</a>
76-
<a href="${scriptBase}markdown/index.html?file=eclipse-platform/eclipse.platform.ui/master/docs">Platform UI</a>
77-
<a href="${scriptBase}markdown/index.html?file=eclipse-pde/eclipse.pde/master/docs">PDE</a>
78-
<a href="${scriptBase}markdown/index.html?file=eclipse-equinox/p2/master/docs">Equinox p2</a>
79-
<a href="${scriptBase}markdown/index.html?file=eclipse-ide/.github/main/">Eclipse IDE</a>
75+
<a href="${markdownBase}eclipse-platform/eclipse.platform/master/docs">Platform</a>
76+
<a href="${markdownBase}eclipse-platform/eclipse.platform.ui/master/docs">Platform UI</a>
77+
<a href="${markdownBase}eclipse-pde/eclipse.pde/master/docs">PDE</a>
78+
<a href="${markdownBase}eclipse-equinox/p2/master/docs">Equinox p2</a>
79+
<a href="${markdownBase}eclipse-ide/.github/main/">Eclipse IDE</a>
8080
`;
8181

8282
let defaultAside = toElements(`
@@ -90,9 +90,9 @@ let tableOfContentsAside = '';
9090
let selfContent = document.documentElement.outerHTML;
9191

9292
function redirect(href) {
93-
const location = href != null ? href : new URL(`${scriptBase}markdown/index.html?file=eclipse-platform/www.eclipse.org-eclipse/master${window.location.pathname.replace(/^\/eclipse/, '').replace(/\.html$/, '.md')}`);
93+
const location = href != null ? `${href}${window.location.search}${window.location.hash}` : new URL(`${markdownBase}eclipse-platform/www.eclipse.org-eclipse/master${window.location.pathname.replace(/^\/eclipse/, '').replace(/\.html$/, '.md')}`);
9494
const body = document.querySelector('body')
95-
replaceChildren(body, "body", ...toElements(`<div>If you are not redirected automatically, follow this <a href='${location}'>link</a>.</div>`));
95+
replaceChildren(body, "body", ...toElements(`<div style="display: none">If you are not redirected automatically, follow this <a href='${location}'>link</a>.</div>`));
9696
window.location = location;
9797
}
9898

@@ -377,7 +377,7 @@ function generateNav() {
377377
return `
378378
<div class="header_nav">
379379
<div class="col-xs-24 col-md-10 vcenter">
380-
<a href="${scriptBase}index.html">
380+
<a href="${scriptBase}">
381381
<img src="${scriptBase}eclipse.svg" alt="The Main Index Page" xwidth="50%" xheight="auto" class="img-responsive header_nav_logo"/>
382382
</a>
383383
</div><!-- NO SPACES

templates/custom-content.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@
1818
<div id="breadcrumb">
1919
<a href="https://eclipseide.org/">Home</a>
2020
<a href="https://eclipseide.org/projects/">Projects</a>
21-
<a href="../index.html">Eclipse</a <a href="index.html">Templates</a>
21+
<a href="..">Eclipse</a>
22+
<a href=".">Templates</a>
2223
<span class="highlight">Custom</spanclass="highlight">
2324
</div>
2425

2526
<div id="aside">
26-
<a href="index.html" class="separator"><i class='fa fa-pencil'></i> Templates</a>
27+
<a href="." class="separator"><i class='fa fa-pencil'></i> Templates</a>
2728
<a href="extended-content.html">Extended Scaffolding</a>
2829
<a href="custom-content.html">Custom Scaffolding</a>
2930
<a href="icons.html">Navigation Icons</a>

templates/extended-content.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
</div>
2222

2323
<div data-generate="generateDefaultBreadcrumb(this)">
24-
<a href="../index.html">Eclipse</a>
25-
<a href="index.html">Templates</a>
24+
<a href="..">Eclipse</a>
25+
<a href=".">Templates</a>
2626
<span class="highlight">Extended</span">
2727
</div>
2828

2929
<div data-generate="generateDefaultAside(this)">
30-
<a href="index.html" class="separator"><i class='fa fa-pencil'></i> Templates</a>
30+
<a href="." class="separator"><i class='fa fa-pencil'></i> Templates</a>
3131
<a href="extended-content.html">Extended Scaffolding</a>
3232
<a href="custom-content.html">Custom Scaffolding</a>
3333
<a href="icons.html">Navigation Icons</a>

templates/icons.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<body>
1212

1313
<div data-generate="generateDefaultBreadcrumb(this)">
14-
<a href="../index.html">Eclipse</a>
15-
<a href="index.html">Templates</a>
14+
<a href="..">Eclipse</a>
15+
<a href=".">Templates</a>
1616
</div>
1717

1818
<div data-generate="generateDefaultHeader(this)">

templates/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
<body>
1212

1313
<div data-generate="generateDefaultBreadcrumb(this)">
14-
<a href="../index.html">Eclipse</a>
14+
<a href="..">Eclipse</a>
1515
<span>Templates</span>
1616
</div>
1717

1818
<div data-generate="generateDefaultAside(this)">
19-
<a href="index.html" class="separator"><i class='fa fa-pencil'></i> Templates</a>
19+
<a href="." class="separator"><i class='fa fa-pencil'></i> Templates</a>
2020
<a href="extended-content.html">Extended Scaffolding</a>
2121
<a href="custom-content.html">Custom Scaffolding</a>
2222
<a href="icons.html">Navigation Icons</a>

0 commit comments

Comments
 (0)