personal website

Commit 0238a317

0238a317c3b8Merged

Justin Dorfman <[email protected]> · 1 year ago · 1 file · ~1 modified

Description

feat: Redesign homepage with updated bio and metadata (#45)

This commit updates the homepage (index.html) with a new design, focusing on Justin Dorfman's role as an Open Source Sustainer & Community Manager.

Key changes include:

  • Updated title and metadata for improved SEO and social sharing.
  • Added description and keywords meta tags.
  • Implemented Open Graph (og:) and Twitter card meta tags.
  • Moved theme toggle script to the bottom of the body for better performance.
  • Added a media query to hide the theme toggle on mobile devices.
  • Removed the manual page title.

Details

Commit
0238a317c3b8
Parent
5435746d9239

index.htmlmodifiedView file

@@ -3,49 +3,16 @@
33 <head>
44 <meta charset="UTF-8">
55 <meta name="viewport" content="width=device-width, initial-scale=1.0">
6- <title>JUSTIN DORFMAN(1) - User Manual</title>
7- <script>
8- // Theme mode functionality
9- function setTheme(theme) {
10- if (theme === 'system') {
11- const isDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
12- document.documentElement.setAttribute('data-theme', isDarkMode ? 'dark' : 'light');
13- } else {
14- document.documentElement.setAttribute('data-theme', theme);
15- }
16- localStorage.setItem('theme', theme);
17- updateActiveThemeButton(theme);
18- }
19-
20- function updateActiveThemeButton(theme) {
21- document.querySelectorAll('.theme-toggle button').forEach(button => {
22- button.classList.remove('active');
23- if (button.getAttribute('data-theme') === theme) {
24- button.classList.add('active');
25- }
26- });
27- }
28-
29- // Initialize theme
30- function initTheme() {
31- const savedTheme = localStorage.getItem('theme');
32- if (savedTheme) {
33- setTheme(savedTheme);
34- } else {
35- setTheme('system');
36- }
37-
38- // Listen for system theme changes
39- window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', e => {
40- if (localStorage.getItem('theme') === 'system') {
41- setTheme('system');
42- }
43- });
44- }
45-
46- // Run theme initialization after DOM is loaded
47- document.addEventListener('DOMContentLoaded', initTheme);
48- </script>
6+ <title>JUSTIN DORFMAN - Open Source Sustainer & Community Manager</title>
7+ <meta name="description" content="Justin Dorfman: Sourcegraph's Open Source Community Manager, SustainOSS co-founder, and OSS contributor to Bootstrap, Font Awesome, jQuery, and more.">
8+ <meta name="keywords" content="Justin Dorfman, Open Source, Sourcegraph, SustainOSS, Community Manager, Open Source Collective">
9+ <meta property="og:title" content="Justin Dorfman - Open Source Sustainer & Community Manager">
10+ <meta property="og:description" content="Sourcegraph's Open Source Community Manager, SustainOSS co-founder, OSS contributor and advocate.">
11+ <meta property="og:type" content="website">
12+ <meta property="og:url" content="https://jdorfman.com">
13+ <meta name="twitter:card" content="summary">
14+ <meta name="twitter:site" content="@jdorfman">
15+ <meta name="twitter:creator" content="@jdorfman">
4916 <style>
5017 :root {
5118 --bg-color: #f8f8f8;
@@ -123,12 +90,19 @@
12390 }
12491
12592 /* Theme toggle styles */
126- .theme-container {
127- position: fixed;
128- top: 10px;
129- right: 10px;
130- z-index: 999;
131- }
93+.theme-container {
94+ position: fixed;
95+ top: 10px;
96+ right: 10px;
97+ z-index: 999;
98+}
99+
100+/* Hide theme toggle on mobile devices */
101+@media (max-width: 768px) {
102+ .theme-container {
103+ display: none;
104+ }
105+}
132106
133107 .theme-toggle {
134108 display: flex;
@@ -276,5 +250,47 @@
276250 <footer>
277251 <p>Justin Dorfman Manual Page - Last updated May 2025</p>
278252 </footer>
253+ <script>
254+ // Theme mode functionality
255+ function setTheme(theme) {
256+ if (theme === 'system') {
257+ const isDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
258+ document.documentElement.setAttribute('data-theme', isDarkMode ? 'dark' : 'light');
259+ } else {
260+ document.documentElement.setAttribute('data-theme', theme);
261+ }
262+ localStorage.setItem('theme', theme);
263+ updateActiveThemeButton(theme);
264+ }
265+
266+ function updateActiveThemeButton(theme) {
267+ document.querySelectorAll('.theme-toggle button').forEach(button => {
268+ button.classList.remove('active');
269+ if (button.getAttribute('data-theme') === theme) {
270+ button.classList.add('active');
271+ }
272+ });
273+ }
274+
275+ // Initialize theme
276+ function initTheme() {
277+ const savedTheme = localStorage.getItem('theme');
278+ if (savedTheme) {
279+ setTheme(savedTheme);
280+ } else {
281+ setTheme('system');
282+ }
283+
284+ // Listen for system theme changes
285+ window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', e => {
286+ if (localStorage.getItem('theme') === 'system') {
287+ setTheme('system');
288+ }
289+ });
290+ }
291+
292+ // Run theme initialization after DOM is loaded
293+ document.addEventListener('DOMContentLoaded', initTheme);
294+ </script>
279295 </body>
280296 </html>