This commit is contained in:
parent
279ab4c602
commit
1fad8f2b49
5
_sass/minimal-mistakes/_custom_styles.scss
Normal file
5
_sass/minimal-mistakes/_custom_styles.scss
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
// Custom styling for skill badges to add vertical space between wrapped lines
|
||||||
|
img[src^="https://img.shields.io/badge/"] {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
margin-right: 4px;
|
||||||
|
}
|
@ -7,3 +7,5 @@ search: false
|
|||||||
|
|
||||||
@import "minimal-mistakes/skins/{{ site.minimal_mistakes_skin | default: 'default' }}"; // skin
|
@import "minimal-mistakes/skins/{{ site.minimal_mistakes_skin | default: 'default' }}"; // skin
|
||||||
@import "minimal-mistakes"; // main partials
|
@import "minimal-mistakes"; // main partials
|
||||||
|
// Import custom styles
|
||||||
|
@import "_custom-styles";
|
@ -1,57 +1,43 @@
|
|||||||
# Map to check if client is capable of handling webp
|
# Define the root directory for your website files
|
||||||
map $http_accept $webp_suffix {
|
root /usr/share/nginx/html;
|
||||||
default "";
|
|
||||||
"~*webp" ".webp"; # Sets suffix to .webp if Accept header contains webp
|
# Location block specifically for JPG, JPEG, and PNG images
|
||||||
|
location ~* \.(jpe?g|png)$ {
|
||||||
|
# Add Vary header tells caches that response depends on Accept header
|
||||||
|
add_header Vary Accept;
|
||||||
|
|
||||||
|
# Set cache expiration headers for images
|
||||||
|
expires 180d;
|
||||||
|
add_header Pragma "public";
|
||||||
|
add_header Cache-Control "public";
|
||||||
|
|
||||||
|
# Try to serve the .webp file first if browser supports it
|
||||||
|
# $image_path_without_ext comes from the map above
|
||||||
|
# $webp_suffix comes from the map above (.webp or empty)
|
||||||
|
# If $image_path_without_ext$webp_suffix exists (e.g., /path/image.webp), serve it.
|
||||||
|
# Otherwise, try the original $uri (e.g., /path/image.png).
|
||||||
|
# If neither exists, return 404.
|
||||||
|
try_files $image_path_without_ext$webp_suffix $uri =404;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Map to capture the image path *without* the file extension
|
# Default location block for other requests (HTML, CSS, JS, etc.)
|
||||||
# This regex captures everything before the last dot and jpg/jpeg/png extension
|
location / {
|
||||||
map $uri $image_path_without_ext {
|
index index.html index.htm;
|
||||||
default ""; # Good practice to have a default
|
try_files $uri $uri/ /index.html; # Common pattern for SPAs/frameworks
|
||||||
~*^(?<captured_path>.+)\.(?:jpe?g|png)$ $captured_path; # Use ~* for case-insensitive extension match
|
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
# Error pages
|
||||||
listen 80;
|
error_page 404 /404.html;
|
||||||
listen [::]:80;
|
location = /404.html {
|
||||||
server_name localhost; # Replace localhost with your actual domain if needed
|
internal; # Prevents direct access to the error page
|
||||||
|
}
|
||||||
|
|
||||||
# Define the root directory for your website files
|
error_page 500 502 503 504 /50x.html; # Optional: generic 50x error page
|
||||||
root /usr/share/nginx/html;
|
location = /50x.html {
|
||||||
|
internal;
|
||||||
|
}
|
||||||
|
|
||||||
# Location block specifically for JPG, JPEG, and PNG images
|
# Gzip settings (keep as they are)
|
||||||
location ~* \.(jpe?g|png)$ {
|
gzip on;
|
||||||
# Add Vary header tells caches that response depends on Accept header
|
gzip_comp_level 4;
|
||||||
add_header Vary Accept;
|
gzip_types text/html text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
||||||
|
|
||||||
# Set cache expiration headers for images
|
|
||||||
expires 180d;
|
|
||||||
add_header Pragma "public";
|
|
||||||
add_header Cache-Control "public";
|
|
||||||
|
|
||||||
# Try to serve the .webp file first if browser supports it
|
|
||||||
try_files $image_path_without_ext$webp_suffix $uri =404;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Default location block for other requests (HTML, CSS, JS, etc.)
|
|
||||||
location / {
|
|
||||||
index index.html index.htm;
|
|
||||||
try_files $uri $uri/ /index.html; # Common pattern for SPAs/frameworks
|
|
||||||
}
|
|
||||||
|
|
||||||
# Error pages
|
|
||||||
error_page 404 /404.html;
|
|
||||||
location = /404.html {
|
|
||||||
internal; # Prevents direct access to the error page
|
|
||||||
}
|
|
||||||
|
|
||||||
error_page 500 502 503 504 /50x.html; # Optional: generic 50x error page
|
|
||||||
location = /50x.html {
|
|
||||||
internal;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Gzip settings
|
|
||||||
gzip on;
|
|
||||||
gzip_comp_level 4;
|
|
||||||
gzip_types text/html text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user