File tree Expand file tree Collapse file tree 3 files changed +61
-5
lines changed Expand file tree Collapse file tree 3 files changed +61
-5
lines changed Original file line number Diff line number Diff line change @@ -9,10 +9,10 @@ export default defineConfig({
9
9
output : 'static' ,
10
10
site : 'https://miroiu.github.io' ,
11
11
base : '/nodify' ,
12
- // build: {
13
- // format: 'file',
14
- // },
15
- // trailingSlash: 'never',
12
+ build : {
13
+ format : 'file' ,
14
+ } ,
15
+ trailingSlash : 'never' ,
16
16
integrations : [
17
17
starlight ( {
18
18
title : 'Nodify' ,
@@ -27,6 +27,7 @@ export default defineConfig({
27
27
} ,
28
28
components : {
29
29
EditLink : './src/components/EditLink.astro' ,
30
+ SiteTitle : './src/components/SiteTitle.astro' ,
30
31
} ,
31
32
social : [
32
33
{
@@ -38,7 +39,6 @@ export default defineConfig({
38
39
customCss : [ './src/styles/starlight.css' ] ,
39
40
} ) ,
40
41
] ,
41
-
42
42
vite : {
43
43
plugins : [ tailwindcss ( ) ] ,
44
44
} ,
Original file line number Diff line number Diff line change
1
+ ---
2
+ const { siteTitle } = Astro .locals .starlightRoute ;
3
+ import Logo from ' ../assets/logo.svg' ;
4
+ ---
5
+
6
+ <a href =" /nodify" class =" site-title sl-flex" >
7
+ <Logo />
8
+ <span translate =" no" >
9
+ { siteTitle }
10
+ </span >
11
+ </a >
12
+
13
+ <style >
14
+ @layer starlight.core {
15
+ .site-title {
16
+ align-items: center;
17
+ gap: var(--sl-nav-gap);
18
+ font-size: var(--sl-text-h4);
19
+ font-weight: 600;
20
+ color: var(--sl-color-text-accent);
21
+ text-decoration: none;
22
+ white-space: nowrap;
23
+ min-width: 0;
24
+ }
25
+ span {
26
+ overflow: hidden;
27
+ }
28
+ img {
29
+ height: calc(var(--sl-nav-height) - 2 * var(--sl-nav-pad-y));
30
+ width: auto;
31
+ max-width: 100%;
32
+ object-fit: contain;
33
+ object-position: 0 50%;
34
+ }
35
+ }
36
+ </style >
Original file line number Diff line number Diff line change
1
+ import type { MiddlewareHandler } from 'astro' ;
2
+
3
+ /**
4
+ * This middleware converts the pathname to lowercase and adds .html to the final path for documentation pages and redirects the request to the URL with a 301 status code.
5
+ */
6
+ export const onRequest : MiddlewareHandler = async ( { request } , next ) => {
7
+ const url = new URL ( request . url ) ;
8
+
9
+ if ( url . pathname . includes ( 'wiki/' ) && ! url . pathname . includes ( '.html' ) ) {
10
+ const redirectUrl = `${ url . pathname . toLocaleLowerCase ( ) } .html` ;
11
+ return new Response ( null , {
12
+ status : 301 ,
13
+ headers : {
14
+ Location : redirectUrl ,
15
+ } ,
16
+ } ) ;
17
+ }
18
+
19
+ return next ( ) ;
20
+ } ;
You can’t perform that action at this time.
0 commit comments