Rendering changes & small improvements

This commit is contained in:
Filip Znachor 2024-05-30 22:00:47 +02:00
parent 4a114678eb
commit 6b26f7db9b
4 changed files with 11 additions and 5 deletions

View file

@ -4,5 +4,8 @@ import icon from "astro-icon";
// https://astro.build/config
export default defineConfig({
integrations: [icon()]
trailingSlash: "never",
integrations: [
icon()
]
});

View file

@ -4,4 +4,8 @@ RewriteCond %{HTTP_HOST} !^www.codespace.cz$
RewriteRule (.*)$ http://www.codespace.cz/$1 [R=301,L]
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{REQUEST_FILENAME}/index.html -f
RewriteRule ^(.*)$ /$1/index.html [L]

View file

@ -6,8 +6,7 @@ type Props = HTMLAttributes<'a'>;
const { href, class: className, ...props } = Astro.props;
const { pathname } = Astro.url;
const subpath = pathname.match(/[^\/]+/g);
const isActive = href === pathname || href === '/' + subpath?.[0];
const isActive = href === pathname;
---
<a href={href} class:list={[className, { active: isActive }]} {...props}>

View file

@ -46,4 +46,4 @@ nav ul li.right {margin-left: auto;}
}
:not(#menu-toggle:checked) + nav + header.under-nav {margin-top: calc(0px - var(--nav-height)); padding-top: var(--nav-height);}
:not(#menu-toggle:checked) + nav + header.under-nav {margin-top: calc(-1px - var(--nav-height)); padding-top: calc(1px + var(--nav-height));}