@@ -8,7 +8,9 @@ import sidebarsUnversioned from "./sidebarsUnversioned";
88
99const extractPreprocessor = require ( "./plugins/extract-preprocessor" ) ;
1010
11- const generateCurrentAndNextRedirects = ( s ) => [
11+ const generateCurrentAndNextRedirects = (
12+ s : string ,
13+ ) : { from : string ; to : string } [ ] => [
1214 {
1315 from : `/docs/${ s } ` ,
1416 to : `/u/${ s } ` ,
@@ -19,7 +21,7 @@ const generateCurrentAndNextRedirects = (s) => [
1921 } ,
2022] ;
2123
22- function handleSidebarItems ( items ) {
24+ function handleSidebarItems ( items : any [ ] ) : any [ ] {
2325 const arr = [ ] ;
2426 for ( const item of items ) {
2527 if ( typeof item === "string" ) {
@@ -32,7 +34,7 @@ function handleSidebarItems(items) {
3234}
3335
3436// This function generates redirects for all items in the unversioned sidebars, so that if we move a doc from versioned to unversioned, we don't break existing links. It handles both string items (doc ids) and nested objects (categories with their own items).
35- const backportRedirect = ( s ) => {
37+ const backportRedirect = ( s : any ) : any [ ] => {
3638 const arr = [ ] ;
3739 if ( typeof s === "string" ) {
3840 arr . push ( ...generateCurrentAndNextRedirects ( s ) ) ;
@@ -54,7 +56,9 @@ const backportRedirect = (s) => {
5456const currentYear = new Date ( ) . getFullYear ( ) ;
5557
5658const ACADEMY_URL = `https://academy.crowdsec.net/courses?${
57- process . env . NODE_ENV === "production" ? "utm_source=docs&utm_medium=menu&utm_campaign=top-menu&utm_id=academydocs" : ""
59+ process . env . NODE_ENV === "production"
60+ ? "utm_source=docs&utm_medium=menu&utm_campaign=top-menu&utm_id=academydocs"
61+ : ""
5862} `;
5963
6064/** IF you make significant changes to the nav bar or side bars
@@ -153,7 +157,7 @@ const FOOTER_LINKS = [
153157 } ,
154158 { label : "Discourse" , href : "https://discourse.crowdsec.net/" } ,
155159 { label : "Discord" , href : "https://discord.gg/crowdsec" } ,
156- { label : "Twitter " , href : "https://twitter .com/crowd_security" } ,
160+ { label : "X " , href : "https://x .com/crowd_security" } ,
157161 { label : "LinkedIn" , href : "https://www.linkedin.com/company/crowdsec/" } ,
158162 { label : "YouTube" , href : "https://www.youtube.com/@crowdsec" } ,
159163 ] ,
@@ -169,7 +173,10 @@ const FOOTER_LINKS = [
169173 href : "https://crowdsec.net/blog/category/tutorial/" ,
170174 } ,
171175 { label : "Academy" , href : "https://academy.crowdsec.net/" } ,
172- { label : "Custom GPT" , href : "https://chatgpt.com/g/g-682c3a61a78081918417571116c2b563-crowdsec-documentation" } ,
176+ {
177+ label : "Custom GPT" ,
178+ href : "https://chatgpt.com/g/g-682c3a61a78081918417571116c2b563-crowdsec-documentation" ,
179+ } ,
173180 ] ,
174181 } ,
175182] ;
@@ -202,21 +209,43 @@ const redirects = [
202209 } ,
203210 // CTI Web UI pages moved to console/ip_reputation
204211 { from : "/u/cti_api/getting_started" , to : "/u/console/ip_reputation/intro" } ,
205- { from : "/u/cti_api/api_getting_started" , to : "/u/console/ip_reputation/api_keys" } ,
212+ {
213+ from : "/u/cti_api/api_getting_started" ,
214+ to : "/u/console/ip_reputation/api_keys" ,
215+ } ,
206216 { from : "/u/cti_api/ip_report" , to : "/u/console/ip_reputation/ip_report" } ,
207- { from : "/u/cti_api/search_queries" , to : "/u/console/ip_reputation/search_ui" } ,
208- { from : "/u/cti_api/advanced_search" , to : "/u/console/ip_reputation/search_ui_advanced" } ,
209- { from : "/u/cti_api/cve_explorer" , to : "/u/console/ip_reputation/intro#live-exploit-tracker" } ,
217+ {
218+ from : "/u/cti_api/search_queries" ,
219+ to : "/u/console/ip_reputation/search_ui" ,
220+ } ,
221+ {
222+ from : "/u/cti_api/advanced_search" ,
223+ to : "/u/console/ip_reputation/search_ui_advanced" ,
224+ } ,
225+ {
226+ from : "/u/cti_api/cve_explorer" ,
227+ to : "/u/console/ip_reputation/intro#live-exploit-tracker" ,
228+ } ,
210229 // other CTI pages redirect / fixes
211230 { from : "/next/cti_api/intro" , to : "/u/console/ip_reputation/api_keys" } ,
212- { from : "/next/cti_api/getting_started" , to : "/u/console/ip_reputation/api_keys" } ,
213- { from : "/u/console/ip_reputation/api_keys_premium" , to : "/u/console/ip_reputation/api_keys" } ,
231+ {
232+ from : "/next/cti_api/getting_started" ,
233+ to : "/u/console/ip_reputation/api_keys" ,
234+ } ,
235+ {
236+ from : "/u/console/ip_reputation/api_keys_premium" ,
237+ to : "/u/console/ip_reputation/api_keys" ,
238+ } ,
214239] ;
215240
216241function redirectsGlobalDataPlugin ( ) {
217242 return {
218243 name : "redirects-global-data" ,
219- async contentLoaded ( { actions } : { actions : { setGlobalData : ( data : unknown ) => void } } ) {
244+ async contentLoaded ( {
245+ actions,
246+ } : {
247+ actions : { setGlobalData : ( data : unknown ) => void } ;
248+ } ) {
220249 actions . setGlobalData ( { redirects } ) ;
221250 } ,
222251 } ;
@@ -230,7 +259,8 @@ const config: Config = {
230259 experimental_faster : true ,
231260 } ,
232261 title : "CrowdSec" ,
233- tagline : "CrowdSec - Real-time & crowdsourced protection against aggressive IPs" ,
262+ tagline :
263+ "CrowdSec - Real-time & crowdsourced protection against aggressive IPs" ,
234264 url : "https://docs.crowdsec.net" ,
235265 baseUrl : "/" ,
236266 onBrokenLinks : "warn" ,
@@ -311,7 +341,8 @@ const config: Config = {
311341 {
312342 docs : {
313343 sidebarPath : "./sidebars.ts" ,
314- editUrl : "https://github.com/crowdsecurity/crowdsec-docs/edit/main/crowdsec-docs/" ,
344+ editUrl :
345+ "https://github.com/crowdsecurity/crowdsec-docs/edit/main/crowdsec-docs/" ,
315346 lastVersion : "current" ,
316347 versions : {
317348 "v1.7" : {
@@ -329,7 +360,8 @@ const config: Config = {
329360 } ,
330361 blog : {
331362 showReadingTime : true ,
332- editUrl : "https://github.com/crowdsecurity/crowdsec-docs/edit/main/crowdsec-docs/" ,
363+ editUrl :
364+ "https://github.com/crowdsecurity/crowdsec-docs/edit/main/crowdsec-docs/" ,
333365 } ,
334366 theme : {
335367 customCss : "./src/css/custom.css" ,
@@ -380,12 +412,14 @@ const config: Config = {
380412 {
381413 title : "CrowdSec Hub" ,
382414 url : "https://hub.crowdsec.net/" ,
383- description : "Browse and install parsers, scenarios, collections, and remediation components" ,
415+ description :
416+ "Browse and install parsers, scenarios, collections, and remediation components" ,
384417 } ,
385418 {
386419 title : "CrowdSec Console" ,
387420 url : "https://app.crowdsec.net/" ,
388- description : "Manage your CrowdSec deployments and access the community blocklist" ,
421+ description :
422+ "Manage your CrowdSec deployments and access the community blocklist" ,
389423 } ,
390424 {
391425 title : "GitHub Repository" ,
0 commit comments