|
8 | 8 | <title>{% if page.title %}{{ page.title | escape }}{% else %}{{ site.title | escape }}{% endif %}</title> |
9 | 9 | <meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}"> |
10 | 10 |
|
11 | | - <link rel="stylesheet" href="{{ '/assets/css/style.css' | relative_url }}"> |
12 | 11 | <link rel="canonical" href="{{ page.url | replace:'index.html','' | relative_url }}"> |
13 | 12 | <link rel="alternate" type="application/rss+xml" title="{{ site.title | escape }}" href="{{ '/feed.xml' | relative_url }}"> |
14 | 13 |
|
15 | | - <!-- Custom CSS for sidebar --> |
| 14 | + <!-- Custom CSS --> |
16 | 15 | <style> |
| 16 | + * { |
| 17 | + box-sizing: border-box; |
| 18 | + } |
| 19 | + |
17 | 20 | body { |
18 | 21 | margin: 0; |
19 | 22 | padding: 0; |
20 | 23 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; |
21 | 24 | line-height: 1.6; |
22 | 25 | color: #24292e; |
| 26 | + background-color: #ffffff; |
23 | 27 | } |
24 | 28 |
|
25 | 29 | .container { |
|
124 | 128 | margin-bottom: 0.8em; |
125 | 129 | } |
126 | 130 |
|
| 131 | + .main-content h4 { |
| 132 | + font-size: 1.2em; |
| 133 | + font-weight: 600; |
| 134 | + color: #24292e; |
| 135 | + margin-top: 1.2em; |
| 136 | + margin-bottom: 0.6em; |
| 137 | + } |
| 138 | + |
| 139 | + .main-content p { |
| 140 | + margin-bottom: 1em; |
| 141 | + } |
| 142 | + |
| 143 | + .main-content ul, .main-content ol { |
| 144 | + margin-bottom: 1em; |
| 145 | + padding-left: 2em; |
| 146 | + } |
| 147 | + |
| 148 | + .main-content li { |
| 149 | + margin-bottom: 0.5em; |
| 150 | + } |
| 151 | + |
127 | 152 | .main-content code { |
128 | 153 | background-color: #f6f8fa; |
129 | 154 | border: 1px solid #e1e4e8; |
130 | 155 | border-radius: 3px; |
131 | 156 | padding: 2px 4px; |
132 | 157 | font-size: 0.9em; |
| 158 | + font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; |
133 | 159 | } |
134 | 160 |
|
135 | 161 | .main-content pre { |
|
138 | 164 | border-radius: 6px; |
139 | 165 | padding: 16px; |
140 | 166 | overflow-x: auto; |
| 167 | + margin-bottom: 1em; |
141 | 168 | } |
142 | 169 |
|
143 | 170 | .main-content pre code { |
144 | 171 | background: none; |
145 | 172 | border: none; |
146 | 173 | padding: 0; |
| 174 | + font-size: 0.9em; |
| 175 | + } |
| 176 | + |
| 177 | + .main-content blockquote { |
| 178 | + border-left: 4px solid #dfe2e5; |
| 179 | + padding-left: 16px; |
| 180 | + margin: 1em 0; |
| 181 | + color: #6a737d; |
| 182 | + } |
| 183 | + |
| 184 | + .main-content table { |
| 185 | + border-collapse: collapse; |
| 186 | + width: 100%; |
| 187 | + margin-bottom: 1em; |
| 188 | + } |
| 189 | + |
| 190 | + .main-content th, .main-content td { |
| 191 | + border: 1px solid #dfe2e5; |
| 192 | + padding: 8px 12px; |
| 193 | + text-align: left; |
| 194 | + } |
| 195 | + |
| 196 | + .main-content th { |
| 197 | + background-color: #f6f8fa; |
| 198 | + font-weight: 600; |
| 199 | + } |
| 200 | + |
| 201 | + .main-content a { |
| 202 | + color: #0366d6; |
| 203 | + text-decoration: none; |
| 204 | + } |
| 205 | + |
| 206 | + .main-content a:hover { |
| 207 | + text-decoration: underline; |
| 208 | + } |
| 209 | + |
| 210 | + .main-content img { |
| 211 | + max-width: 100%; |
| 212 | + height: auto; |
147 | 213 | } |
148 | 214 |
|
149 | 215 | @media (max-width: 768px) { |
|
164 | 230 | padding: 20px; |
165 | 231 | max-width: 100%; |
166 | 232 | } |
| 233 | + |
| 234 | + .main-content h1 { |
| 235 | + font-size: 2em; |
| 236 | + } |
| 237 | + |
| 238 | + .main-content h2 { |
| 239 | + font-size: 1.5em; |
| 240 | + } |
167 | 241 | } |
168 | 242 | </style> |
169 | 243 | </head> |
|
231 | 305 |
|
232 | 306 | links.forEach(function(link) { |
233 | 307 | const href = link.getAttribute('href'); |
234 | | - if (href && currentPath.includes(href.replace('#', '').replace(/\//g, ''))) { |
235 | | - link.classList.add('active'); |
| 308 | + if (href) { |
| 309 | + // Check if this is the current page |
| 310 | + if (href.includes('#') && currentPath.includes(href.split('#')[0].replace(/\//g, ''))) { |
| 311 | + link.classList.add('active'); |
| 312 | + } else if (!href.includes('#') && currentPath.includes(href.replace(/\//g, ''))) { |
| 313 | + link.classList.add('active'); |
| 314 | + } |
236 | 315 | } |
237 | 316 | }); |
238 | 317 | }); |
|
0 commit comments