Skip to content

Commit b46444c

Browse files
committed
commit everything but _docs, images, and _learn
0 parents  commit b46444c

File tree

1,908 files changed

+151842
-0
lines changed

Some content is hidden

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

1,908 files changed

+151842
-0
lines changed

404.html

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
---
2+
layout: error
3+
title: Page not found
4+
---
5+
6+
<!-- TEMP -->
7+
8+
<!-- Reload page -->
9+
<script data-prettify-ignore>
10+
11+
function redirectFrom404(theLocation) {
12+
// trailing slash
13+
if (theLocation.pathname[theLocation.pathname.length - 1] === '/') {
14+
return `${theLocation.pathname.slice(0, -1)}${theLocation.search}${theLocation.hash}`;
15+
}
16+
17+
// trailing /index.html
18+
if (theLocation.pathname.indexOf('/index.html') > -1) {
19+
return `${theLocation.pathname.replace('/index.html', '')}${theLocation.search}${theLocation.hash}`;
20+
}
21+
22+
return null;
23+
}
24+
25+
function is404(err) {
26+
if (err) {
27+
window.Sentry.captureException(err, {
28+
tags: {
29+
section: '404'
30+
}
31+
});
32+
}
33+
else {
34+
window.Sentry.captureMessage(location.href, {
35+
tags: {
36+
section: '404'
37+
}
38+
});
39+
}
40+
41+
// error message
42+
document
43+
.getElementById('error-404')
44+
.classList.remove("hide");
45+
46+
// latest documentation link
47+
if (window
48+
.location
49+
.href
50+
.includes('/docs/')) {
51+
document
52+
.getElementById('notfound-docs')
53+
.classList.remove("hide");
54+
}
55+
}
56+
57+
window.addEventListener('DOMContentLoaded', () => {
58+
var redirectToUrl = redirectFrom404(window.location);
59+
60+
// Trailing slash
61+
if (redirectToUrl) {
62+
fetch(redirectToUrl, {
63+
method: 'HEAD'
64+
}).then(() => {
65+
try {
66+
window.location.replace(redirectToUrl);
67+
} catch (err) {
68+
window.location.href = redirectToUrl;
69+
} finally {
70+
window.history.replaceState({}, '', redirectToUrl);
71+
}
72+
}).catch((err) => {
73+
is404(err);
74+
});
75+
}
76+
// 404
77+
else {
78+
is404();
79+
}
80+
});
81+
82+
</script>
83+
84+
<script>
85+
/**
86+
* Lops off the last point so that point releases will overwrite (i.e., update) the
87+
* existing docs for that major release. So docs for 40.3 will update the existing docs for 40.
88+
* @param {String} version
89+
* @returns {String}
90+
*/
91+
function squashVersion(version) {
92+
const versionPattern = new RegExp(/v\d+\.\d+\./);
93+
if (version.search(versionPattern) < 0) {
94+
return version;
95+
}
96+
else {
97+
return version
98+
.split('.')
99+
.slice(0, 2)
100+
.join('.');
101+
}
102+
}
103+
104+
// Redirect EE versions to latest
105+
if (window
106+
.location
107+
.href
108+
.includes('/docs/v1.')) {
109+
window.location.replace(window
110+
.location
111+
.href
112+
.replace(/docs\/v1\.[^\/]+/, 'docs/latest'));
113+
}
114+
115+
// Redirect links to old docs versions (v0.x.x) to the corresponding major version.
116+
// E.g., v0.40.2 or v0.40.0-SNAPSHOT to v0.40
117+
const pointVersionFormat = new RegExp(/\/docs\/v\d+\.\d+\.[^\/]+/);
118+
const version = window
119+
.location
120+
.href
121+
.match(pointVersionFormat);
122+
if (version && version.length > 0) {
123+
const majorVersion = squashVersion(version[0]);
124+
window.location.replace(window
125+
.location
126+
.href
127+
.replace(version, majorVersion));
128+
}
129+
</script>
130+
131+
<div class="text-center">
132+
<img
133+
height="128"
134+
src="/images/not_found.svg"
135+
width="128"
136+
title="Not found" />
137+
138+
<div id="error-404" class="text-center hide">
139+
<h1 class="fs-5 m-0 mt-3">We're a little lost...</h1>
140+
<p class="m-0 mt-2">The page you asked for couldn't be found</p>
141+
<div class="align-center d-flex flex-column justify-center mt-7 w-100">
142+
<a
143+
class="Button hide"
144+
href="/docs/latest/"
145+
id="notfound-docs">Go to the latest version of the documentation</a>
146+
<a class="Button m-0 mt-2" href="/">Go to Metabase homepage</a>
147+
</div>
148+
</div>
149+
</div>

CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
www.metabase.com

CONTRIBUTING.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Contributing to docs.metabase.com
2+
3+
:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
4+
5+
The following is a set of guidelines for contributing to docs.metabase.com on GitHub. These are just guidelines, not rules, use your best judgment and feel free to propose changes to this document in a pull request.
6+
7+
## Issues & Pull Requests
8+
9+
* If you're not sure about adding something, open an issue to discuss it.
10+
* Feel free to open a Pull Request early so that a discussion can be had as changes are developed.
11+
* Include screenshots and animated gifs of your changes whenever possible.
12+
* End files with a newline.
13+
14+
## Documentation
15+
16+
The documentation on this site is pulled directly from the `metabase/metabase-init` repository's `docs` directory. Contributions to the documentation should be made there: [atom/electron](https://github.com/metabase/metabase-init/tree/master/docs).

Gemfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
source 'https://rubygems.org'
2+
3+
ruby '~> 3.3.2'
4+
5+
gem "jekyll", "~> 4.3.3", group: :jekyll_plugins
6+
gem "jekyll-redirect-from", "~> 0.16.0", group: :jekyll_plugins
7+
gem "jekyll_include_plugin", "~> 1.3.0", group: :jekyll_plugins
8+
gem 'html-proofer'
9+
gem "webrick", "~> 1.7"
10+
11+
gem 'rspec-rails', '~> 7.1.1', group: :test

0 commit comments

Comments
 (0)