Skip to content

Commit 4101d4f

Browse files
ManuelColomboclaude
andcommitted
Fix: correct CSS path in blog post template for staging
- Add url filter to assets paths in blog_post.njk - Add staging indicators (purple bar, STG prefix) to blog posts - This fixes CSS not loading in /preview Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 770b17d commit 4101d4f

1 file changed

Lines changed: 19 additions & 5 deletions

File tree

_includes/blog_post.njk

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,30 @@
33
<head>
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1" />
6-
<title>{{ title or "Il mio sito" }}</title>
6+
<title>{% if isStaging %}STG :: {% endif %}{{ title or "Il mio sito" }}</title>
77
<meta name="description" content="{{ description or 'CV · Portfolio · Blog' }}">
8-
<link rel="stylesheet" href="/assets/style.css" />
9-
<link rel="icon" href="/assets/favicon.ico" />
10-
<meta property="og:title" content="{{ title or 'Il mio sito' }}">
8+
<link rel="stylesheet" href="{{ '/assets/style.css' | url }}" />
9+
<link rel="icon" href="{{ '/assets/favicon.ico' | url }}" />
10+
<meta property="og:title" content="{% if isStaging %}STG :: {% endif %}{{ title or 'Il mio sito' }}">
1111
<meta property="og:description" content="{{ description or 'CV · Portfolio · Blog' }}">
1212
<meta property="og:type" content="website">
1313
<meta property="og:url" content="{{ page.url }}">
14+
{% if isStaging %}
15+
<style>
16+
body::before {
17+
content: '';
18+
position: fixed;
19+
top: 0;
20+
left: 0;
21+
right: 0;
22+
height: 4px;
23+
background: #8b00ff;
24+
z-index: 9999;
25+
}
26+
</style>
27+
{% endif %}
1428
</head>
15-
<body>
29+
<body{% if isStaging %} class="staging"{% endif %}>
1630
{% include "breadcrumb.njk" %}
1731
<main>
1832
{{ content | safe }}

0 commit comments

Comments
 (0)