Skip to content

Commit 839370f

Browse files
committed
Add News
1 parent 4159d92 commit 839370f

14 files changed

Lines changed: 136 additions & 4 deletions

File tree

_data/news.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
- date: "2025-06-18"
2+
title: "Visiting Researcher at UIUC"
3+
content: "Beginning a 3-month research visit at the University of Illinois Urbana-Champaign."
4+
tags: [uiuc, research, visit, academic trip]
5+
images:
6+
- url: "/assets/news/uiuc/3.jpeg"
7+
alt: "UIUC Cloths"
8+
- url: "/assets/news/uiuc/4.jpeg"
9+
alt: "UIUC Card"
10+
- url: "/assets/news/uiuc/2.jpeg"
11+
alt: "UIUC Union"
12+
- url: "/assets/news/uiuc/1.jpeg"
13+
alt: "UIUC Gym"
14+
- date: "2022-03-01"
15+
title: "Graduated First in Class, Dept. of Computer Science & Engineering"
16+
content: "Honored to graduate as the top student (First in Class) for the Class of 2022 from the Department of Computer Science & Engineering at POSTECH."
17+
tags: [graduation, postech, first in class, academics]
18+
images:
19+
- url: "/assets/news/graduate/specific.jpeg"
20+
alt: "현판"
21+
- url: "/assets/news/graduate/overall.jpeg"
22+
alt: "근접샷"

_layouts/latest-news.html

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
layout: default
3+
---
4+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css"/>
5+
<script src="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js"></script>
6+
7+
<div class="news-container">
8+
<header class="news-header">
9+
<h1>Latest News</h1>
10+
<div class="news-search-wrapper">
11+
<i class="fas fa-search"></i>
12+
<input type="search" class="news-search-input" placeholder="Search in news (e.g., award, conference)...">
13+
</div>
14+
</header>
15+
16+
<div class="news-feed">
17+
{% for item in site.data.news %}
18+
{% capture search_terms %}{{ item.title }} {{ item.content }} {{ item.tags | join: ' ' }}{% endcapture %}
19+
<div class="news-entry" data-search-terms="{{ search_terms | downcase }}">
20+
<p class="news-date">{{ item.date | date: "%B %d, %Y" }}</p>
21+
<h3 class="news-title">{{ item.title }}</h3>
22+
<div class="news-content">
23+
<p>{{ item.content }}</p>
24+
</div>
25+
26+
{% if item.images %}
27+
<div class="swiper news-slider-{{ forloop.index }}">
28+
<div class="swiper-wrapper">
29+
{% for image in item.images %}
30+
<div class="swiper-slide">
31+
<img src="{{ image.url | relative_url }}" alt="{{ image.alt | default: 'News image' }}">
32+
</div>
33+
{% endfor %}
34+
</div>
35+
<div class="swiper-button-next"></div>
36+
<div class="swiper-button-prev"></div>
37+
</div>
38+
{% endif %}
39+
</div>
40+
{% endfor %}
41+
</div>
42+
</div>
43+
44+
<script>
45+
document.addEventListener('DOMContentLoaded', function() {
46+
// Initialize all Swiper sliders
47+
const sliders = document.querySelectorAll('[class^="swiper news-slider-"]');
48+
sliders.forEach(slider => {
49+
new Swiper(slider, {
50+
navigation: {
51+
nextEl: ".swiper-button-next",
52+
prevEl: ".swiper-button-prev",
53+
},
54+
loop: true,
55+
});
56+
});
57+
58+
// Live Search Logic
59+
const searchInput = document.querySelector('.news-search-input');
60+
const newsEntries = document.querySelectorAll('.news-entry');
61+
62+
searchInput.addEventListener('input', e => {
63+
const searchTerm = e.target.value.toLowerCase();
64+
newsEntries.forEach(entry => {
65+
const searchData = entry.getAttribute('data-search-terms');
66+
if (searchData.includes(searchTerm)) {
67+
entry.style.display = 'block';
68+
} else {
69+
entry.style.display = 'none';
70+
}
71+
});
72+
});
73+
});
74+
</script>

_pages/main/news.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
permalink: /news/
3+
title: "Latest News"
4+
layout: latest-news
5+
---

_sass/custom/_homepage.scss

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ body.page--homepage #main {
5050
display: flex;
5151
justify-content: center;
5252
gap: 1rem;
53+
flex-wrap: wrap; /* Add this line */
5354
}
55+
5456
.gateway-card {
5557
display: flex;
5658
align-items: center;
@@ -62,8 +64,14 @@ body.page--homepage #main {
6264
color: #333;
6365
font-weight: 600;
6466
transition: background-color 0.2s ease;
65-
i { font-size: 1.2em; }
66-
&:hover { background-color: #e0e0e0; }
67+
}
68+
69+
.gateway-card i {
70+
font-size: 1.2em;
71+
}
72+
73+
.gateway-card:hover {
74+
background-color: #e0e0e0;
6775
}
6876

6977
/* --- Section 2: Research & Career --- */

_sass/custom/_latest-news.scss

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/* --- Latest News Page Styles --- */
2+
.news-container { max-width: 900px; margin: 0 auto; padding: 4rem 2rem; }
3+
.news-header { text-align: center; margin-bottom: 3rem; }
4+
.news-header h1 { font-size: 3.5em; font-weight: 800; margin-bottom: 2rem; }
5+
6+
.news-search-wrapper { position: relative; }
7+
.news-search-wrapper .fa-search { position: absolute; top: 50%; left: 1rem; transform: translateY(-50%); color: #aaa; }
8+
.news-search-input { width: 100%; padding: 0.8rem 1rem 0.8rem 3rem; font-size: 1em; border-radius: 12px; border: 1px solid #ddd; background-color: #f8f8fa; }
9+
10+
.news-entry { padding-bottom: 2.5rem; margin-bottom: 2.5rem; border-bottom: 1px solid #e5e5e5; }
11+
.news-entry:last-child { border-bottom: none; margin-bottom: 0; }
12+
13+
.news-date { font-size: 0.9em; font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem; }
14+
.news-title { font-size: 2em; font-weight: 700; line-height: 1.3; margin: 0 0 1rem 0; }
15+
.news-content { font-size: 1.1em; line-height: 1.7; color: #333; }
16+
17+
/* --- Image Slider Styles --- */
18+
.swiper { width: 100%; height: 500px; border-radius: 16px; margin-top: 2rem; box-shadow: 0 5px 25px rgba(0,0,0,0.1); }
19+
.swiper-slide { display: flex; justify-content: center; align-items: center; background: #eee; }
20+
.swiper-slide img { display: block; width: 100%; height: 100%; object-fit: cover; }
21+
.swiper-button-next, .swiper-button-prev { color: #fff; filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5)); }
22+
@media (max-width: 768px) { .swiper { height: 400px; } }

assets/css/main.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@
1515
@import "custom/homepage";
1616
@import "custom/knowledge-base";
1717
@import "custom/kb-post";
18-
@import "custom/hobby-details";
18+
@import "custom/hobby-details";
19+
@import "custom/latest-news";

assets/news/uiuc/1.jpeg

3.14 MB
Loading

assets/news/uiuc/2.jpeg

4.38 MB
Loading

0 commit comments

Comments
 (0)