|
1 | | -{%- assign site_url = "https://cb341.dev" -%} |
| 1 | +{%- assign site_url = site.url -%} |
2 | 2 | {%- assign site_name = "cb341.dev" -%} |
3 | | -{%- assign default_title = site.title | default: "Dani Bengl - Full-Stack Developer" -%} |
4 | | -{%- assign default_description = site.description | default: "Full-stack software developer specializing in Ruby on Rails, web applications, and modern development practices. Portfolio, blog, and projects." -%} |
5 | 3 | {%- if page.url == "/" -%} |
6 | 4 | {%- assign page_title = "Dani Bengl (cb341) - Full-Stack Developer" -%} |
7 | 5 | {%- elsif page.title and page.title != site_name -%} |
8 | 6 | {%- assign page_title = page.title | append: " | " | append: site_name -%} |
9 | 7 | {%- else -%} |
10 | | - {%- assign page_title = default_title -%} |
| 8 | + {%- assign page_title = site.title -%} |
| 9 | +{%- endif -%} |
| 10 | +{%- if page.layout == "gallery" and page.description == nil -%} |
| 11 | + {%- assign page_description = page.content | markdownify | strip_html | normalize_whitespace | truncate: 160 -%} |
| 12 | +{%- else -%} |
| 13 | + {%- assign page_description = page.description | default: site.description -%} |
11 | 14 | {%- endif -%} |
12 | | -{%- assign page_description = page.description | default: default_description -%} |
13 | 15 | {%- assign current_url = site_url | append: page.url -%} |
14 | | -{%- assign social_image = site_url | append: "/assets/about/avatar.webp" -%} |
| 16 | +{%- if page.image -%} |
| 17 | + {%- assign social_image = site_url | append: page.image -%} |
| 18 | +{%- else -%} |
| 19 | + {%- assign social_image = site_url | append: "/assets/about/avatar.webp" -%} |
| 20 | +{%- endif -%} |
15 | 21 | <!DOCTYPE html> |
16 | 22 | <html lang="en"> |
17 | 23 | <head> |
|
24 | 30 | <link rel="canonical" href="{{ current_url | escape }}"> |
25 | 31 | <link rel="icon" href="/favicon.svg" type="image/svg+xml"> |
26 | 32 | <link rel="alternate" type="application/rss+xml" title="cb341.dev RSS Feed" href="/rss.xml"> |
27 | | - {% if page.layout == "gallery" %} |
28 | | - {%- assign gallery_description = page.description | default: page.content | markdownify | strip_html | normalize_whitespace | truncate: 160 -%} |
29 | | - <meta property="og:description" content="{{ gallery_description | escape }}"> |
30 | | - {%- endif %} |
31 | | - {% if page.image %} |
32 | | - <meta property="og:image" content="{{ site_url }}{{ page.image | escape }}"> |
| 33 | + <meta property="og:site_name" content="{{ site_name }}"> |
| 34 | + <meta property="og:title" content="{{ page_title | escape }}"> |
| 35 | + <meta property="og:description" content="{{ page_description | escape }}"> |
| 36 | + <meta property="og:url" content="{{ current_url | escape }}"> |
| 37 | + <meta property="og:type" content="{% if page.collection == 'posts' %}article{% else %}website{% endif %}"> |
| 38 | + <meta property="og:image" content="{{ social_image | escape }}"> |
33 | 39 | {%- if page.alt %} |
34 | 40 | <meta property="og:image:alt" content="{{ page.alt | escape }}"> |
35 | 41 | {%- endif %} |
36 | | - {%- endif %} |
| 42 | + <meta name="twitter:card" content="{% if page.image %}summary_large_image{% else %}summary{% endif %}"> |
37 | 43 | <script type="application/ld+json"> |
38 | 44 | { |
39 | 45 | "@context": "https://schema.org", |
|
79 | 85 | </script> |
80 | 86 | {%- endif %} |
81 | 87 | <style> |
| 88 | + {% include shared.css %} |
| 89 | + |
| 90 | + /* site-specific below; shared tokens/elements come from _includes/shared.css */ |
82 | 91 | html, body { margin: 0; padding: 0; } |
83 | | - body { |
84 | | - overflow-y: scroll; |
85 | | - color: #1c1c1a; |
86 | | - font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, ui-serif, serif; |
87 | | - font-size: 15px; |
88 | | - } |
| 92 | + |
| 93 | + .skip-link { position: absolute; left: -999px; } |
| 94 | + .skip-link:focus { position: static; } |
89 | 95 |
|
90 | 96 | .wrapper { |
91 | 97 | max-width: 67ch; |
|
105 | 111 | margin: .25em 0 1em 1.25em; |
106 | 112 | border-radius: 4px; |
107 | 113 | } |
108 | | - blockquote { margin: 1.2em 2em; font-style: italic; } |
109 | | - |
110 | | - hr { border: 0; border-top: 1px solid #e6e6e2; margin: .6em 0; } |
111 | | - |
112 | | - table { |
113 | | - width: 100%; |
114 | | - border-collapse: collapse; |
115 | | - } |
116 | | - |
117 | | - th, |
118 | | - td { |
119 | | - padding: .1em .5em; |
120 | | - border-top: 1px solid black; |
121 | | - border: 0; |
122 | | - text-align: left; |
123 | | - } |
124 | | - |
125 | | - tr { |
126 | | - border-top: 1px solid black; |
127 | | - } |
128 | 114 |
|
129 | | - @media (max-width: 600px) { |
130 | | - table { |
131 | | - display: block; |
132 | | - overflow-x: auto; |
133 | | - max-width: 100%; |
134 | | - } |
135 | | - |
136 | | - th, |
137 | | - td { |
138 | | - min-width: 9rem; |
139 | | - } |
140 | | - |
141 | | - th:last-child, |
142 | | - td:last-child { |
143 | | - min-width: 18rem; |
144 | | - } |
145 | | - } |
146 | | - |
147 | | - code { |
148 | | - font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; |
149 | | - font-size: .88em; |
150 | | - background: #f1f1ee; |
151 | | - padding: 1px 4px; |
152 | | - border-radius: 2px; |
153 | | - } |
154 | | - pre { |
155 | | - overflow-x: auto; |
156 | | - border: 1px dashed #e6e6e2; |
157 | | - padding: 10px 12px; |
158 | | - font-size: .88em; |
159 | | - line-height: 1; |
160 | | - } |
161 | | - pre code { background: transparent; padding: 0; } |
162 | 115 | main :is(h2,h3,h4,h5,h6)[id] > a { color: inherit; text-decoration: none; } |
163 | | - main :is(h2,h3,h4,h5,h6)[id] > a:hover::after { content: " #"; color: #bbb; } |
| 116 | + main :is(h2,h3,h4,h5,h6)[id] > a:hover::after { content: " #"; color: var(--muted); } |
164 | 117 | </style> |
165 | 118 | {%- if page.math -%} |
166 | 119 | <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.21/dist/katex.min.css" crossorigin="anonymous"> |
|
169 | 122 | {%- endif -%} |
170 | 123 | </head> |
171 | 124 | <body> |
| 125 | + <a class="skip-link" href="#main-content">Skip to content</a> |
172 | 126 | <div class="wrapper"> |
173 | 127 | <header role="banner"> |
174 | 128 | <nav> |
|
0 commit comments