Skip to content

Commit 0951874

Browse files
committed
Fix: Embed CSS in sidebar to apply styles on ALL pages
1 parent f430121 commit 0951874

File tree

2 files changed

+45
-11
lines changed

2 files changed

+45
-11
lines changed

_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ theme_mode: # [light | dark]
106106
cdn: "https://chirpy-img.netlify.app"
107107

108108
# the avatar on sidebar, support local or CORS resources
109-
avatar: "/assets/img/avatar.jpg"
109+
avatar: "/assets/img/avatar.webp"
110110

111111
# The URL of the site-wide social preview image used in SEO `og:image` meta tag.
112112
# It can be overridden by a customized `page.image` in front matter.

_includes/sidebar.html

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,46 @@
1-
<!-- The Side Bar -->
1+
<style>
2+
/* 1. 사이드바 배경 이미지 변경 */
3+
#sidebar {
4+
/* 배경 이미지 경로 (assets/img/bg.jpg 파일이 있어야 함) */
5+
background: url('/assets/img/bg.jpg') no-repeat center center !important;
6+
background-size: cover !important;
7+
8+
/* 배경이 어두울 경우를 대비해 글씨를 잘 보이게 처리 */
9+
position: relative;
10+
z-index: 1;
11+
}
212

13+
/* 2. 배경 위에 검은색/남색 필터 씌우기 (글씨 가독성 확보) */
14+
#sidebar::before {
15+
content: "";
16+
position: absolute;
17+
top: 0;
18+
left: 0;
19+
width: 100%;
20+
height: 100%;
21+
/* 0.7 숫자를 조절하면 배경 밝기가 변합니다 (0:투명 ~ 1:완전검정) */
22+
background-color: rgba(20, 25, 40, 0.7);
23+
backdrop-filter: blur(10px); /* 흐림 효과 */
24+
z-index: -1;
25+
}
26+
27+
/* 3. 아바타(프로필 사진) 스타일 */
28+
#avatar img {
29+
/* 이미지는 _config.yml의 avatar 설정을 따라갑니다 */
30+
border-radius: 50% !important; /* 동그랗게 */
31+
border: 3px solid rgba(255, 255, 255, 0.3); /* 테두리 */
32+
box-shadow: 0 0 15px rgba(255, 100, 100, 0.5); /* 붉은 빛 효과 */
33+
}
34+
35+
/* 4. 글씨 색상 하얗게 고정 (배경이 들어갔으므로) */
36+
#sidebar .site-title, #sidebar .site-subtitle, #sidebar .nav-link {
37+
color: rgba(255, 255, 255, 0.95) !important;
38+
text-shadow: 0 1px 2px rgba(0,0,0,0.5);
39+
}
40+
#sidebar .nav-item.active .nav-link {
41+
color: #63c0f5 !important; /* 선택된 메뉴 색상 (하늘색) */
42+
}
43+
</style>
344
<aside aria-label="Sidebar" id="sidebar" class="d-flex flex-column align-items-end">
445
<header class="profile-wrapper">
546
<a href="{{ '/' | relative_url }}" id="avatar" class="rounded-circle">
@@ -14,18 +55,14 @@
1455
<a class="site-title d-block" href="{{ '/' | relative_url }}">{{ site.title }}</a>
1556
<p class="site-subtitle fst-italic mb-0">{{ site.tagline }}</p>
1657
</header>
17-
<!-- .profile-wrapper -->
18-
1958
<nav class="flex-column flex-grow-1 w-100 ps-0">
2059
<ul class="nav">
21-
<!-- home -->
2260
<li class="nav-item{% if page.layout == 'home' %}{{ " active" }}{% endif %}">
2361
<a href="{{ '/' | relative_url }}" class="nav-link">
2462
<i class="fa-fw fas fa-home"></i>
2563
<span>{{ site.data.locales[include.lang].tabs.home | upcase }}</span>
2664
</a>
2765
</li>
28-
<!-- the real tabs -->
2966
{% for tab in site.tabs %}
3067
<li class="nav-item{% if tab.url == page.url %}{{ " active" }}{% endif %}">
3168
<a href="{{ tab.url | relative_url }}" class="nav-link">
@@ -35,8 +72,7 @@
3572
<span>{{ site.data.locales[include.lang].tabs.[tab_name] | default: tab.title | upcase }}</span>
3673
</a>
3774
</li>
38-
<!-- .nav-item -->
39-
{% endfor %}
75+
{% endfor %}
4076
</ul>
4177
</nav>
4278

@@ -100,6 +136,4 @@
100136
{% endif %}
101137
{% endfor %}
102138
</div>
103-
<!-- .sidebar-bottom -->
104-
</aside>
105-
<!-- #sidebar -->
139+
</aside>

0 commit comments

Comments
 (0)