Skip to content

Commit 5ffacbc

Browse files
authored
Merge pull request #3 from jordalgo/redirects
Turn site into a bunch of redirects
2 parents 60710fb + 08627d2 commit 5ffacbc

File tree

10 files changed

+51
-7623
lines changed

10 files changed

+51
-7623
lines changed

README.md

+2-19
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,4 @@
11
# Docs Website
22

3-
See https://github.com/bpftrace/website for instructions on working with a Docusaurus site.
4-
5-
## Directory Structure
6-
7-
The `docs` directory holds documentation for the in-development, unreleased bpftrace version. It should regularly pull in the docs from the bpftrace source repository.
8-
9-
The `versioned_docs` directory holds snapshots of the docs from each released version. The latest version should be duplicated as both `version-x.y` and `version-latest`, to facilitate permalinks.
10-
11-
## Updating Docs
12-
13-
1. Update the versioned documentation snapshots:
14-
```
15-
rm -rf versioned_docs/version-latest
16-
cp -r docs versioned_docs/version-latest
17-
cp -r docs versioned_docs/version-x.y
18-
```
19-
20-
2. Add the new version to `versions.json`, directly underneath `"latest"`.
21-
3. In `docusaurus.config.js`, update the version number in `config.presets.docs.versions` to refer to the new release.
3+
All this site does is redirect to bptrace.org until we update the
4+
DNS entry for docs.bpftrace.org to point to https://bpftrace.org/docs

docusaurus.config.js

+1-110
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,6 @@
55
// See: https://docusaurus.io/docs/api/docusaurus-config
66

77
import {themes as prismThemes} from 'prism-react-renderer';
8-
import versions from './versions.json';
9-
10-
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
11-
12-
function getLatestVersion() {
13-
// versions[0] is "latest", versions[1] will contain the actual version number
14-
// of the latest version
15-
return versions[1];
16-
}
17-
const latestVersion = getLatestVersion();
188

199
/** @type {import('@docusaurus/types').Config} */
2010
const config = {
@@ -48,32 +38,13 @@ const config = {
4838
'classic',
4939
/** @type {import('@docusaurus/preset-classic').Options} */
5040
({
51-
docs: {
52-
routeBasePath: '/',
53-
editUrl: 'https://github.com/bpftrace/bpftrace',
54-
versions: {
55-
current: {
56-
label: 'pre-release',
57-
},
58-
'latest': {
59-
path: 'latest',
60-
label: `latest (${getLatestVersion()})`,
61-
},
62-
'0.22': {
63-
banner: 'none',
64-
},
65-
},
66-
},
6741
blog: false,
6842
theme: {
6943
customCss: './src/css/custom.css',
7044
},
7145
}),
7246
],
7347
],
74-
customFields: {
75-
latestVersion,
76-
},
7748

7849
themeConfig:
7950
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
@@ -87,90 +58,10 @@ const config = {
8758
href: 'https://bpftrace.org',
8859
target: '_self',
8960
},
90-
items: [
91-
{
92-
to: 'https://bpftrace.org/learn',
93-
label: 'Learn',
94-
target: '_self',
95-
position: 'left',
96-
},
97-
{
98-
to: `${getLatestVersion()}`,
99-
label: 'Docs',
100-
target: '_self', // open external link in current window
101-
position: 'left',
102-
className: 'navbar__link--active',
103-
},
104-
{
105-
to: 'https://bpftrace.org/blog',
106-
label: 'Blog',
107-
target: '_self',
108-
position: 'left',
109-
},
110-
{
111-
href: 'https://github.com/bpftrace/bpftrace/discussions',
112-
label: 'Discussions',
113-
target: '_self',
114-
position: 'left',
115-
},
116-
{
117-
type: 'docsVersionDropdown',
118-
position: 'right',
119-
},
120-
{
121-
href: 'https://github.com/bpftrace/bpftrace',
122-
label: 'GitHub',
123-
position: 'right',
124-
},
125-
],
61+
items: [],
12662
},
12763
footer: {
12864
style: 'dark',
129-
links: [
130-
{
131-
title: 'Docs + Tutorials',
132-
items: [
133-
{
134-
label: 'Documentation',
135-
to: `${getLatestVersion()}`,
136-
target: '_self',
137-
},
138-
{
139-
label: 'One-Liner Introduction Tutorial',
140-
to: 'https://bpftrace.org/tutorial-one-liners',
141-
target: '_self',
142-
},
143-
],
144-
},
145-
{
146-
title: 'Community',
147-
items: [
148-
{
149-
label: 'IRC',
150-
href: 'https://webchat.oftc.net/?nick=&channels=%23bpftrace',
151-
},
152-
{
153-
label: 'Talks',
154-
href: 'https://bpftrace.org/videos',
155-
target: '_self',
156-
},
157-
],
158-
},
159-
{
160-
title: 'More',
161-
items: [
162-
{
163-
label: 'Blog',
164-
to: 'https://bpftrace.org/blog',
165-
target: '_self',
166-
},
167-
{
168-
label: 'GitHub',
169-
href: 'https://github.com/bpftrace/bpftrace',
170-
},
171-
],
172-
},
173-
],
17465
copyright: `Copyright © 2019 Alastair Robertson.`,
17566
},
17667
prism: {

src/pages/index.js

-38
This file was deleted.

static/0.22

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<!-- This is used as a redirect for the old docs website. We can probably remove at some point -->
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta http-equiv="refresh" content="0; url=https://bpftrace.org/docs/0.22">
7+
<link rel="canonical" href="https://bpftrace.org/docs/0.22" />
8+
</head>
9+
<script>
10+
window.location.href = 'https://bpftrace.org/docs/0.22' + window.location.search + window.location.hash;
11+
</script>
12+
</html>

static/index.html

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<!-- This is used as a redirect for the old docs website. We can probably remove at some point -->
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta http-equiv="refresh" content="0; url=https://bpftrace.org/docs/0.22">
7+
<link rel="canonical" href="https://bpftrace.org/docs/0.22" />
8+
</head>
9+
<script>
10+
window.location.href = 'https://bpftrace.org/docs/0.22' + window.location.search + window.location.hash;
11+
</script>
12+
</html>

static/latest

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<!-- This is used as a redirect for the old docs website. We can probably remove at some point -->
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta http-equiv="refresh" content="0; url=https://bpftrace.org/docs/0.22">
7+
<link rel="canonical" href="https://bpftrace.org/docs/0.22" />
8+
</head>
9+
<script>
10+
window.location.href = 'https://bpftrace.org/docs/0.22' + window.location.search + window.location.hash;
11+
</script>
12+
</html>

static/next

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<!-- This is used as a redirect for the old docs website. We can probably remove at some point -->
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta http-equiv="refresh" content="0; url=https://bpftrace.org/docs/pre-release">
7+
<link rel="canonical" href="https://bpftrace.org/docs/pre-release" />
8+
</head>
9+
<script>
10+
window.location.href = 'https://bpftrace.org/docs/pre-release' + window.location.search + window.location.hash;
11+
</script>
12+
</html>

0 commit comments

Comments
 (0)