From 59f953ba8bb55870bed925201daaa38608590d77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=84=ED=98=84?= Date: Sat, 10 Dec 2022 01:28:16 +0900 Subject: [PATCH 1/9] =?UTF-8?q?fix:=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=8A=A4=ED=83=80=EC=9D=BC=EC=9D=B4=20=ED=8A=80=EC=96=B4?= =?UTF-8?q?=EB=82=98=EC=98=A4=EB=8A=94=20=EC=98=A4=EB=A5=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/components/common/Content/styled.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/components/common/Content/styled.ts b/frontend/components/common/Content/styled.ts index 955335f8..5f4a2a29 100644 --- a/frontend/components/common/Content/styled.ts +++ b/frontend/components/common/Content/styled.ts @@ -40,6 +40,11 @@ export const ContentBody = styled.div` margin: 16px 0 8px 0; } + ol, + ul { + padding-left: 16px; + } + ol { list-style-type: decimal; } From 8fcd100e95b7d87235c7c6ae604981fae48c2deb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=84=ED=98=84?= Date: Sat, 10 Dec 2022 01:46:03 +0900 Subject: [PATCH 2/9] =?UTF-8?q?fix:=20=EA=B8=80=20=EA=B2=80=EC=83=89=20?= =?UTF-8?q?=EB=82=B4=EC=9A=A9=EC=9D=B4=20=ED=8A=80=EC=96=B4=EB=82=98?= =?UTF-8?q?=EC=98=A4=EB=8A=94=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/components/search/ArticleItem/styled.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/components/search/ArticleItem/styled.ts b/frontend/components/search/ArticleItem/styled.ts index d59040dc..c840312d 100644 --- a/frontend/components/search/ArticleItem/styled.ts +++ b/frontend/components/search/ArticleItem/styled.ts @@ -25,6 +25,7 @@ export const ItemTitle = styled(TextMedium)` `; export const ItemContent = styled(TextSmall)` + word-break: break-all; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; From 4d7018231bbf4205f66a479ad86986a800b53015 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=84=ED=98=84?= Date: Sat, 10 Dec 2022 01:46:22 +0900 Subject: [PATCH 3/9] =?UTF-8?q?feat:=20=EA=B8=80=20=EA=B2=80=EC=83=89=20?= =?UTF-8?q?=EC=A0=9C=EB=AA=A9=20=EB=A7=90=EC=A4=84=EC=9E=84=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/components/search/ArticleItem/styled.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/components/search/ArticleItem/styled.ts b/frontend/components/search/ArticleItem/styled.ts index c840312d..bd4965d0 100644 --- a/frontend/components/search/ArticleItem/styled.ts +++ b/frontend/components/search/ArticleItem/styled.ts @@ -22,6 +22,11 @@ export const ItemGroup = styled.div` export const ItemTitle = styled(TextMedium)` margin-bottom: 16px; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; `; export const ItemContent = styled(TextSmall)` From 18022e39c3230ffe9a22cdcd9816117bdde74de5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=84=ED=98=84?= Date: Sat, 10 Dec 2022 01:54:05 +0900 Subject: [PATCH 4/9] =?UTF-8?q?feat:=20=EA=B8=80=20=EC=A0=9C=EB=AA=A9=20?= =?UTF-8?q?=EC=8A=A4=ED=83=80=EC=9D=BC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/components/viewer/ArticleContent/index.tsx | 4 +--- frontend/components/viewer/ArticleContent/styled.ts | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/components/viewer/ArticleContent/index.tsx b/frontend/components/viewer/ArticleContent/index.tsx index 67c2bf61..c24df606 100644 --- a/frontend/components/viewer/ArticleContent/index.tsx +++ b/frontend/components/viewer/ArticleContent/index.tsx @@ -115,9 +115,7 @@ export default function Article({ {!article.deleted_at ? ( - - {article.title} - + {article.title} diff --git a/frontend/components/viewer/ArticleContent/styled.ts b/frontend/components/viewer/ArticleContent/styled.ts index 0fe75bc2..6d5ced7f 100644 --- a/frontend/components/viewer/ArticleContent/styled.ts +++ b/frontend/components/viewer/ArticleContent/styled.ts @@ -45,11 +45,13 @@ export const ArticleMain = styled(Flex)` padding: 50px 16px; } `; -export const ArticleTitle = styled.div` +export const ArticleTitle = styled.h1` width: 100%; border-bottom: 1px solid black; padding: 25px 0; text-align: left; + font-size: 24px; + font-weight: 700; `; export const ArticleTitleBtnBox = styled(Flex)` flex-wrap: wrap; From b0701ec0315e8ea30fe33b2c430689633a970e81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=84=ED=98=84?= Date: Sat, 10 Dec 2022 02:55:55 +0900 Subject: [PATCH 5/9] =?UTF-8?q?feat:=20=EA=B2=80=EC=83=89=EB=90=9C=20?= =?UTF-8?q?=EA=B8=80=EC=9D=98=20=EB=82=B4=EC=9A=A9=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EA=B2=80=EC=83=89=EC=96=B4=EA=B0=80=20=EB=82=98=ED=83=80?= =?UTF-8?q?=EB=82=A0=20=EC=88=98=20=EC=9E=88=EB=8F=84=EB=A1=9D=20=EB=AC=B8?= =?UTF-8?q?=EC=9E=90=EC=97=B4=20=ED=8C=8C=EC=8B=B1=20-=20#164?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/pages/search.tsx | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/frontend/pages/search.tsx b/frontend/pages/search.tsx index bb174894..50a2c8bc 100644 --- a/frontend/pages/search.tsx +++ b/frontend/pages/search.tsx @@ -37,7 +37,7 @@ export default function Search() { const [isArticleNoResult, setIsArticleNoResult] = useState(false); const [isBookNoResult, setIsBookNoResult] = useState(false); - const highlightWord = (text: string, words: string[]): React.ReactNode => { + const highlightWord = (text: string, words: string[], isFirst = false): React.ReactNode => { let wordIndexList = words.map((word) => text.toLowerCase().indexOf(word.toLowerCase())); const filteredWords = words.filter((_, index) => wordIndexList[index] !== -1); @@ -51,11 +51,19 @@ export default function Search() { const endIndex = startIndex + targetWord.length; + let paddingIndex = 0; + + if (isFirst) { + const regex = /(<([^>]+)>)/g; + + while (regex.test(text.slice(0, startIndex))) paddingIndex = regex.lastIndex; + } + return ( <> - {text.slice(0, startIndex)} + {text.slice(paddingIndex, startIndex)} {text.slice(startIndex, endIndex)} - {highlightWord(text.slice(endIndex), words)} + {highlightWord(text.slice(endIndex).replace(/(<([^>]+)>)/gi, ''), words)} ); }; @@ -140,8 +148,11 @@ export default function Search() { ...article, title: highlightWord(article.title, keywords), content: highlightWord( - article.content.slice(0, 400).replace(/(<([^>]+)>)/gi, ''), - keywords + // article.content.replace(/(<([^>]+)>)/gi, ''), + // article.content.slice(0, 400).replace(/(<([^>]+)>)/gi, ''), + article.content, + keywords, + true ), }; }); From 98b49eaef094aeda3612ca29df7e1e74b4516bab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=84=ED=98=84?= Date: Sat, 10 Dec 2022 11:54:57 +0900 Subject: [PATCH 6/9] =?UTF-8?q?fix:=20=EA=B2=80=EC=83=89=20=EC=8B=9C=20?= =?UTF-8?q?=EB=8B=A8=EC=96=B4=20=EC=82=AC=EC=9D=B4=EC=97=90=20=EA=B3=B5?= =?UTF-8?q?=EB=B0=B1=EC=9D=B4=20=EB=91=90=20=EA=B0=9C=20=EC=9D=B4=EC=83=81?= =?UTF-8?q?=20=EB=93=A4=EC=96=B4=EA=B0=88=20=EB=95=8C=20=EB=B0=9C=EC=83=9D?= =?UTF-8?q?=ED=95=98=EB=8A=94=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/pages/search.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/frontend/pages/search.tsx b/frontend/pages/search.tsx index 50a2c8bc..137e8e64 100644 --- a/frontend/pages/search.tsx +++ b/frontend/pages/search.tsx @@ -142,18 +142,15 @@ export default function Search() { setIsArticleNoResult(false); const newArticlesHighlighted = newArticles.data.map((article: IArticle) => { - const keywords = debouncedKeyword.trim().split(' '); + const keywords = debouncedKeyword + .trim() + .split(' ') + .filter((word: string) => word); return { ...article, title: highlightWord(article.title, keywords), - content: highlightWord( - // article.content.replace(/(<([^>]+)>)/gi, ''), - // article.content.slice(0, 400).replace(/(<([^>]+)>)/gi, ''), - article.content, - keywords, - true - ), + content: highlightWord(article.content, keywords, true), }; }); @@ -178,7 +175,10 @@ export default function Search() { setIsBookNoResult(false); const newBooksHighlighted = newBooks.data.map((book: IBook) => { - const keywords = debouncedKeyword.trim().split(' '); + const keywords = debouncedKeyword + .trim() + .split(' ') + .filter((word: string) => word); return { ...book, From d5943c99613ee33038d8d0014868b90a12b8bd3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=84=ED=98=84?= Date: Sat, 10 Dec 2022 12:17:58 +0900 Subject: [PATCH 7/9] =?UTF-8?q?feat:=20=EA=B5=AC=EA=B8=80=20=EA=B2=80?= =?UTF-8?q?=EC=83=89=EB=B4=87=20Ping=20=EC=9A=94=EC=B2=AD=20=EC=8A=A4?= =?UTF-8?q?=EC=BC=80=EC=A4=84=EB=9F=AC=20=EC=B6=94=EA=B0=80=20-=20#245?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/sitemap-ping.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/sitemap-ping.yml diff --git a/.github/workflows/sitemap-ping.yml b/.github/workflows/sitemap-ping.yml new file mode 100644 index 00000000..ffe0811b --- /dev/null +++ b/.github/workflows/sitemap-ping.yml @@ -0,0 +1,15 @@ +name: Sitemap Ping Schedule + +on: + schedule: + - cron: '0 0 * * *' + +jobs: + cron: + name: Cron + + runs-on: ubuntu-latest + + steps: + - run: | + curl https://www.google.com/ping\?sitemap\=https://www.knoticle.app/sitemap.xml \ No newline at end of file From 835b0d32df86ff9e70deb8554225428b19dba856 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=84=ED=98=84?= Date: Sat, 10 Dec 2022 12:28:23 +0900 Subject: [PATCH 8/9] =?UTF-8?q?feat:=20=EA=B5=AC=EA=B8=80=20=EA=B2=80?= =?UTF-8?q?=EC=83=89=EB=B4=87=20Ping=20=EC=9A=94=EC=B2=AD=20=EC=8A=A4?= =?UTF-8?q?=EC=BC=80=EC=A4=84=EB=9F=AC=20=EC=88=98=EC=A0=95=20-=20#245?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/sitemap-ping.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sitemap-ping.yml b/.github/workflows/sitemap-ping.yml index ffe0811b..4cfa1bb6 100644 --- a/.github/workflows/sitemap-ping.yml +++ b/.github/workflows/sitemap-ping.yml @@ -12,4 +12,4 @@ jobs: steps: - run: | - curl https://www.google.com/ping\?sitemap\=https://www.knoticle.app/sitemap.xml \ No newline at end of file + curl https://www.google.com/ping\?sitemap\=https://www.knoticle.app/sitemap.xml From cbfcf451da139258d0ac2cdad9b093bf9966066b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=84=ED=98=84?= Date: Sat, 10 Dec 2022 12:30:36 +0900 Subject: [PATCH 9/9] =?UTF-8?q?feat:=20=EA=B5=AC=EA=B8=80=20=EA=B2=80?= =?UTF-8?q?=EC=83=89=EB=B4=87=20Ping=20=EC=9A=94=EC=B2=AD=20=EC=8A=A4?= =?UTF-8?q?=EC=BC=80=EC=A4=84=EB=9F=AC=20=EC=88=98=EC=A0=95=20-=20#245?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/sitemap-ping.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/sitemap-ping.yml b/.github/workflows/sitemap-ping.yml index 4cfa1bb6..468f1fac 100644 --- a/.github/workflows/sitemap-ping.yml +++ b/.github/workflows/sitemap-ping.yml @@ -11,5 +11,4 @@ jobs: runs-on: ubuntu-latest steps: - - run: | - curl https://www.google.com/ping\?sitemap\=https://www.knoticle.app/sitemap.xml + - run: curl https://www.google.com/ping\?sitemap\=https://www.knoticle.app/sitemap.xml