Skip to content

Commit bb7f183

Browse files
committed
General Docs Improvments
1 parent becf4bd commit bb7f183

File tree

12 files changed

+142
-149
lines changed

12 files changed

+142
-149
lines changed

next.config.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ const nextConfig = {
130130
destination: '/manage/access-control/endpoint-detection-and-response/sentinelone-edr',
131131
permanent: true,
132132
},
133+
{
134+
source: '/how-to/huntress-edr',
135+
destination: '/manage/access-control/endpoint-detection-and-response/huntress-edr',
136+
permanent: true,
137+
},
133138
{
134139
source: '/how-to/intune-mdm',
135140
destination: '/manage/access-control/endpoint-detection-and-response/intune-mdm',

src/components/ImageZoom.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ export function ImageZoom() {
2020
target.tagName === 'IMG' &&
2121
(target.classList.contains('imagewrapper') ||
2222
target.classList.contains('imagewrapper-big') ||
23+
target.classList.contains('imagewrapper-medium') ||
2324
target.closest('.imagewrapper') ||
24-
target.closest('.imagewrapper-big'))
25+
target.closest('.imagewrapper-big') ||
26+
target.closest('.imagewrapper-medium'))
2527
) {
2628
e.preventDefault()
2729
setZoomedImage(target.src)

src/components/Layout.jsx

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ function GitHubIcon(props) {
8585

8686
function useTableOfContents(tableOfContents) {
8787
let [currentSection, setCurrentSection] = useState(tableOfContents[0]?.id)
88+
let [showJumpToTop, setShowJumpToTop] = useState(false)
8889

8990
let getHeadings = useCallback((tableOfContents) => {
9091
return tableOfContents
@@ -105,7 +106,10 @@ function useTableOfContents(tableOfContents) {
105106
if (tableOfContents.length === 0) return
106107
let headings = getHeadings(tableOfContents)
107108
function onScroll() {
108-
let top = window.scrollY + 10;
109+
let scrollTop = window.scrollY
110+
setShowJumpToTop(scrollTop > 400)
111+
112+
let top = scrollTop + 10;
109113
let current = headings[0]?.id
110114
for (let heading of headings) {
111115
if (top >= heading?.top) {
@@ -123,7 +127,7 @@ function useTableOfContents(tableOfContents) {
123127
}
124128
}, [getHeadings, tableOfContents])
125129

126-
return currentSection
130+
return { currentSection, showJumpToTop }
127131
}
128132

129133
export function Layout({ children, title, tableOfContents }) {
@@ -156,7 +160,12 @@ export function Layout({ children, title, tableOfContents }) {
156160
position: toast.POSITION.BOTTOM_RIGHT,
157161
});
158162
};
159-
let currentSection = useTableOfContents(tableOfContents)
163+
164+
const scrollToTop = () => {
165+
window.scrollTo({ top: 0, behavior: 'smooth' })
166+
}
167+
168+
let { currentSection, showJumpToTop } = useTableOfContents(tableOfContents)
160169

161170
function isActive(section) {
162171
if (section.id === currentSection) {
@@ -228,12 +237,26 @@ export function Layout({ children, title, tableOfContents }) {
228237
<nav aria-labelledby="on-this-page-title" className="w-80">
229238
{tableOfContents.length > 0 && (
230239
<>
231-
<h2
232-
id="on-this-page-title"
233-
className="font-display text-sm font-medium text-slate-900 dark:text-white"
234-
>
235-
On this page
236-
</h2>
240+
<div className="flex items-center justify-between mb-4">
241+
<h2
242+
id="on-this-page-title"
243+
className="font-display text-sm font-medium text-slate-900 dark:text-white"
244+
>
245+
On this page
246+
</h2>
247+
{showJumpToTop && (
248+
<button
249+
onClick={scrollToTop}
250+
className="text-xs text-slate-500 hover:text-orange-500 dark:text-slate-400 dark:hover:text-orange-400 transition-colors flex items-center gap-1"
251+
aria-label="Jump to top"
252+
>
253+
<svg className="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
254+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M5 10l7-7m0 0l7 7m-7-7v18" />
255+
</svg>
256+
Top
257+
</button>
258+
)}
259+
</div>
237260
<ol role="list" className="mt-4 space-y-3 text-sm">
238261
{tableOfContents.map((section) => (
239262
<li key={section.id}>

src/pages/_app.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import * as mdxComponents from '@/components/mdx'
66
import { useMobileNavigationStore } from '@/components/MobileNavigation'
77

88
import '@/styles/tailwind.css'
9-
import '@/styles/global.css';
109
import 'focus-visible'
1110
import {Layout} from "@/components/Layout";
1211
import {slugifyWithCounter} from "@sindresorhus/slugify";

src/pages/about-netbird/faq.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {Note} from "@/components/mdx";
22

3-
export const title = 'FAQ'
3+
# FAQ
44

55
## What firewall ports should I open to use NetBird (Network Firewalls)?
66

src/pages/about-netbird/how-netbird-works.mdx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import {Note} from "@/components/mdx";
22

3-
export const title = 'How NetBird Works'
3+
# How NetBird Works
44

5-
## Architecture
6-
7-
### Overview
85
NetBird is an open source platform consisting of a collection of components, responsible for handling peer-to-peer
96
connections, tunneling, authentication, and network management (IPs, keys, ACLs, etc).
107

@@ -35,7 +32,7 @@ In this case, [groups and access controls](/manage/access-control/manage-network
3532

3633
Let's now take a closer look at each of NetBird's components.
3734

38-
### Management Service
35+
## Management Service
3936

4037
The Management service is the central coordination component for NetBird with a UI dashboard.
4138
It keeps the network state, public WireGuard keys of the peers, authenticates and distributes network changes to peers.
@@ -61,7 +58,7 @@ The Management service runs in the cloud NetBird-managed. It can also be self-ho
6158
<img src="/docs-static/img/about-netbird/management.png" alt="management-dia" className="imagewrapper-big"/>
6259
</p>
6360

64-
### Client Application
61+
## Client Application
6562

6663
The NetBird Client application (or agent) is a software that is installed on the machines within a NetBird network.
6764
It is an entry point to your private network that makes it possible for machines to communicate with each other.
@@ -88,7 +85,7 @@ The client also applies other DNS settings that are received from the Management
8885
The **private key**, generated by the NetBird client, **never leaves the machine**, ensuring that only the machine that owns the key can decrypt traffic addressed to it.
8986
</Note>
9087

91-
### Signal Service
88+
## Signal Service
9289

9390
The Signal Service, or simply Signal, is a lightweight piece of software that helps peers to negotiate direct connections.
9491
It does not store any data and no traffic passes through it.
@@ -109,7 +106,7 @@ This is done through Signal. After a connection has been established, Signal ste
109106
NetBird Signal is very similar to the signaling servers used in [WebRTC](https://developer.mozilla.org/en-US/Web/API/WebRTC_API/Signaling_and_video_calling#the_signaling_server).
110107
It runs in the cloud NetBird-managed and can be self-hosted.
111108

112-
### Relay Service
109+
## Relay Service
113110

114111
The Relay service is a [TURN server](https://webrtc.org/getting-started/turn-server) in WebRTC terminology.
115112
In fact, we use an open-source implementation called [Coturn](https://github.com/coturn/coturn).

src/pages/get-started/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {Note} from "@/components/mdx";
22

3-
export const title = 'Getting Started'
3+
# Getting Started
44

55
## Quickstart Guide
66

src/pages/how-to/huntress-edr.mdx

Lines changed: 0 additions & 98 deletions
This file was deleted.

src/pages/use-cases/examples.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
export const title = 'Examples'
2+
# Examples
33

44
## NetBird Client on AWS ECS (Terraform)
55

src/styles/global.css

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)