Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn site into a bunch of redirects #3

Merged
merged 1 commit into from
Jan 27, 2025
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
21 changes: 2 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
# Docs Website

See https://github.com/bpftrace/website for instructions on working with a Docusaurus site.

## Directory Structure

The `docs` directory holds documentation for the in-development, unreleased bpftrace version. It should regularly pull in the docs from the bpftrace source repository.

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.

## Updating Docs

1. Update the versioned documentation snapshots:
```
rm -rf versioned_docs/version-latest
cp -r docs versioned_docs/version-latest
cp -r docs versioned_docs/version-x.y
```

2. Add the new version to `versions.json`, directly underneath `"latest"`.
3. In `docusaurus.config.js`, update the version number in `config.presets.docs.versions` to refer to the new release.
All this site does is redirect to bptrace.org until we update the
DNS entry for docs.bpftrace.org to point to https://bpftrace.org/docs
111 changes: 1 addition & 110 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,6 @@
// See: https://docusaurus.io/docs/api/docusaurus-config

import {themes as prismThemes} from 'prism-react-renderer';
import versions from './versions.json';

// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)

function getLatestVersion() {
// versions[0] is "latest", versions[1] will contain the actual version number
// of the latest version
return versions[1];
}
const latestVersion = getLatestVersion();

/** @type {import('@docusaurus/types').Config} */
const config = {
Expand Down Expand Up @@ -48,32 +38,13 @@ const config = {
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
routeBasePath: '/',
editUrl: 'https://github.com/bpftrace/bpftrace',
versions: {
current: {
label: 'pre-release',
},
'latest': {
path: 'latest',
label: `latest (${getLatestVersion()})`,
},
'0.22': {
banner: 'none',
},
},
},
blog: false,
theme: {
customCss: './src/css/custom.css',
},
}),
],
],
customFields: {
latestVersion,
},

themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
Expand All @@ -87,90 +58,10 @@ const config = {
href: 'https://bpftrace.org',
target: '_self',
},
items: [
{
to: 'https://bpftrace.org/learn',
label: 'Learn',
target: '_self',
position: 'left',
},
{
to: `${getLatestVersion()}`,
label: 'Docs',
target: '_self', // open external link in current window
position: 'left',
className: 'navbar__link--active',
},
{
to: 'https://bpftrace.org/blog',
label: 'Blog',
target: '_self',
position: 'left',
},
{
href: 'https://github.com/bpftrace/bpftrace/discussions',
label: 'Discussions',
target: '_self',
position: 'left',
},
{
type: 'docsVersionDropdown',
position: 'right',
},
{
href: 'https://github.com/bpftrace/bpftrace',
label: 'GitHub',
position: 'right',
},
],
items: [],
},
footer: {
style: 'dark',
links: [
{
title: 'Docs + Tutorials',
items: [
{
label: 'Documentation',
to: `${getLatestVersion()}`,
target: '_self',
},
{
label: 'One-Liner Introduction Tutorial',
to: 'https://bpftrace.org/tutorial-one-liners',
target: '_self',
},
],
},
{
title: 'Community',
items: [
{
label: 'IRC',
href: 'https://webchat.oftc.net/?nick=&channels=%23bpftrace',
},
{
label: 'Talks',
href: 'https://bpftrace.org/videos',
target: '_self',
},
],
},
{
title: 'More',
items: [
{
label: 'Blog',
to: 'https://bpftrace.org/blog',
target: '_self',
},
{
label: 'GitHub',
href: 'https://github.com/bpftrace/bpftrace',
},
],
},
],
copyright: `Copyright © 2019 Alastair Robertson.`,
},
prism: {
Expand Down
38 changes: 0 additions & 38 deletions src/pages/index.js

This file was deleted.

12 changes: 12 additions & 0 deletions static/0.22
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<!-- This is used as a redirect for the old docs website. We can probably remove at some point -->
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="0; url=https://bpftrace.org/docs/0.22">
<link rel="canonical" href="https://bpftrace.org/docs/0.22" />
</head>
<script>
window.location.href = 'https://bpftrace.org/docs/0.22' + window.location.search + window.location.hash;
</script>
</html>
12 changes: 12 additions & 0 deletions static/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<!-- This is used as a redirect for the old docs website. We can probably remove at some point -->
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="0; url=https://bpftrace.org/docs/0.22">
<link rel="canonical" href="https://bpftrace.org/docs/0.22" />
</head>
<script>
window.location.href = 'https://bpftrace.org/docs/0.22' + window.location.search + window.location.hash;
</script>
</html>
12 changes: 12 additions & 0 deletions static/latest
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<!-- This is used as a redirect for the old docs website. We can probably remove at some point -->
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="0; url=https://bpftrace.org/docs/0.22">
<link rel="canonical" href="https://bpftrace.org/docs/0.22" />
</head>
<script>
window.location.href = 'https://bpftrace.org/docs/0.22' + window.location.search + window.location.hash;
</script>
</html>
12 changes: 12 additions & 0 deletions static/next
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<!-- This is used as a redirect for the old docs website. We can probably remove at some point -->
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="0; url=https://bpftrace.org/docs/pre-release">
<link rel="canonical" href="https://bpftrace.org/docs/pre-release" />
</head>
<script>
window.location.href = 'https://bpftrace.org/docs/pre-release' + window.location.search + window.location.hash;
</script>
</html>
Loading
Loading