Skip to content

Commit

Permalink
Merge pull request #5 from GDSC-DEU/3-카테고리-기능-및-검색-기능
Browse files Browse the repository at this point in the history
카테고리 기능 및 검색 기능
  • Loading branch information
cmsong111 authored May 19, 2024
2 parents 9ea4993 + 510c884 commit b7e6412
Show file tree
Hide file tree
Showing 40 changed files with 746 additions and 157 deletions.
1 change: 1 addition & 0 deletions _data/members.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
chore:
- 3기
status: active
github: leejyohan
email: [email protected]

- name: 최범준
Expand Down
2 changes: 2 additions & 0 deletions _data/navigation.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
- name: Notice
link: /notice/
- name: About Us
link: /about-us/
- name: Member
Expand Down
11 changes: 7 additions & 4 deletions _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
{% include navigation.html %}
</ul>
<form class="d-flex" role="search">
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success" type="submit">Search</button>
</form>
<ul class="navbar-nav">
<form class="d-flex" action="/search" method="get">
<input class="form-control me-2" id="search-input" type="search" placeholder="Search"
aria-label="Search" name="q">
<button class="btn btn-outline-success" type="submit">Search</button>
</form>
</ul>
</div>
</div>
</nav>
11 changes: 9 additions & 2 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@
max-width: 100% !important;
}
</style>
<h1>{{ page.title }}</h1>
<p>{{ page.date | date_to_string }} - {{ page.author }}</p>
<span style="font-size: 2em; font-weight: bold;">{{ page.title }}</span>

<p><b>{{ page.author }}</b> - {{ page.date | date: "%Y년 %m월 %-d일" }}</p>

{% for tag in page.tags %}
<span class="badge bg-secondary">{{ tag }}</span>
{% endfor %}

<h1></h1>

{{ content }}

Expand Down
53 changes: 21 additions & 32 deletions _pages/member.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,34 @@
permalink: /member/
---

<script>
// Axios를 활용해서 https://api.github.com/users/<username>에서 데이터를 가져오는 함수를 작성해줘
function getGithubProfile(githubId) {
const response = axios.get("https://api.github.com/users/" + githubId);
console.log(response)
}
</script>

<style>
/* 추가적인 미디어 쿼리를 통한 반응형 조정 */
@media (min-width: 576px) {
.row-cols-sm-2>.col {
flex: 0 0 50%;
max-width: 50%;
<head>
<script>
// Axios를 활용해서 https://api.github.com/users/<username>에서 데이터를 가져오는 함수를 작성해줘
function getGithubProfile(githubId) {
const response = axios.get("https://api.github.com/users/" + githubId);
console.log(response)
}
}
</script>

@media (min-width: 768px) {
.row-cols-md-3>.col {
flex: 0 0 33.333%;
max-width: 33.333%;
<style>
.article.body {
width: 100%;
padding: 32px;
}
}

@media (min-width: 992px) {
.row-cols-lg-4>.col {
flex: 0 0 25%;
max-width: 25%;
@media (min-width: 978px) {
.article.body {
width: 978px;
}
}
}

@media (min-width: 1200px) {
.row-cols-xl-5>.col {
flex: 0 0 20%;
max-width: 20%;
@media (min-width: 600px) and (max-width: 977px) {
article.body {
width: 90%;
}
}
}
</style>

</style>
</head>


<div id="member-wrap" class="container">
Expand Down
5 changes: 5 additions & 0 deletions _pages/notice.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
layout: default
title: Member
permalink: /notice/
---
48 changes: 48 additions & 0 deletions _pages/search.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
layout: default
title: Search
permalink: /search
---

<head>
<script src="{{ site.url }}/assets/js/simple-jekyll-search.js" type="text/javascript"></script>
<script>
function getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split('&');
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split('=');
if (decodeURIComponent(pair[0]) == variable) {
return decodeURIComponent(pair[1]);
}
}
}
// Set the value of the search input to the query string
document.getElementById('search-input').value = getQueryVariable('q');

// Fetch the JSON data and create the search
var searchJson = axios.get('{{ site.baseurl }}/search.json')
.then(function (response) {
console.log(response.data);
console.log('Search data loaded');
var sjs = SimpleJekyllSearch({
searchInput: document.getElementById('search-input'),
resultsContainer: document.getElementById('results-container'),
json: response.data,
noResultsText: '검색결과가 존재하지 않습니다.',
searchResultTemplate: '<li><a href="{url}">{title}</a></li>',
limit: 1000,
fuzzy: true
});
sjs.search(getQueryVariable('q'));
})
.catch(function (error) {
console.log(error);
});

</script>
</head>


<h1>🔍 Search</h1>
<ul id="results-container"></ul>
2 changes: 1 addition & 1 deletion _pages/study.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h4 class="card-title">

</div>
<div class="card-footer bg-transparent ">
{% for tag in study.categories %}
{% for tag in study.tags %}
<span class="badge bg-secondary">{{ tag }}</span>
{% endfor %}
</div>
Expand Down
File renamed without changes
20 changes: 19 additions & 1 deletion assets/img/site.webmanifest
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
{
"name": "",
"short_name": "",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
Loading

0 comments on commit b7e6412

Please sign in to comment.