Skip to content

Commit 36aef84

Browse files
committed
auto update copyright year
1 parent 45a48b3 commit 36aef84

4 files changed

Lines changed: 19 additions & 5 deletions

File tree

File renamed without changes.
File renamed without changes.

index.html

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
66
<meta name="description" content="Junwoo Lee's personal website">
77
<title>Junwoo Lee</title>
8-
<link rel="icon" href="favicon-32x32.png" type="image/png">
9-
<link rel="icon" href="favicon.ico"/>
8+
<link rel="icon" href="images/favicon-32x32.png" type="image/png">
9+
<link rel="icon" href="images/favicon.ico"/>
1010
<link rel="apple-touch-icon" href="favicon.png">
1111
<link rel="stylesheet" href="./css/style.css"/>
1212
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css">
1313
</head>
1414

1515
<body>
16-
<script src="./js/experiments.js"></script>
1716
<header>
1817
<nav>
1918
<a href="index.html">Home</a>
@@ -50,8 +49,11 @@ <h2>Projects</h2>
5049
</main>
5150

5251
<footer>
53-
&copy; 2025 Junwoo Lee
52+
&copy;&nbsp;<span id="year"></span>&nbsp;Junwoo Lee
5453
</footer>
55-
54+
55+
<!-- script link just before <\body> tag in order to have html render before the script runs or errors -->
56+
<script src="./js/experiments.js"></script>
57+
<script src="./js/script.js"></script>
5658
</body>
5759
</html>

js/script.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Set the footer year automatically to the current calendar year.
2+
document.addEventListener('DOMContentLoaded', function () {
3+
try {
4+
var current_year = document.getElementById('year');
5+
if (current_year) {
6+
current_year.textContent = new Date().getFullYear();
7+
}
8+
} catch (e) {
9+
// Fail silently
10+
console.error('Error setting footer year:', e);
11+
}
12+
});

0 commit comments

Comments
 (0)