From 4bfb0a9360040f77eb2b9c7bc64689a31a491b7d Mon Sep 17 00:00:00 2001 From: lensferno Date: Sat, 24 Jun 2023 10:12:22 +0800 Subject: [PATCH] . --- .editorconfig | 11 +++ _config.yml | 22 ++++++ layout/archive.pug | 54 +++++++++++++ layout/category.pug | 11 +++ layout/includes/_partials/button.pug | 8 ++ layout/includes/_partials/footer.pug | 0 layout/includes/_partials/header.pug | 7 ++ .../includes/_partials/left_declaration.pug | 3 + layout/includes/layout.pug | 37 +++++++++ layout/includes/recent-posts.pug | 9 +++ layout/index.pug | 4 + layout/page.pug | 7 ++ layout/post.pug | 7 ++ layout/tag.pug | 11 +++ package.json | 6 ++ source/css/_partials/button.styl | 74 ++++++++++++++++++ source/css/_partials/header/header.styl | 10 +++ source/css/_partials/left_declaration.styl | 11 +++ source/css/common.styl | 29 +++++++ source/css/hexo-theme-yorha.styl | 1 + source/favicon.ico | Bin 0 -> 15086 bytes source/js/hexo-theme-yorha.js | 0 22 files changed, 322 insertions(+) create mode 100644 .editorconfig create mode 100644 _config.yml create mode 100644 layout/archive.pug create mode 100644 layout/category.pug create mode 100644 layout/includes/_partials/button.pug create mode 100644 layout/includes/_partials/footer.pug create mode 100644 layout/includes/_partials/header.pug create mode 100644 layout/includes/_partials/left_declaration.pug create mode 100644 layout/includes/layout.pug create mode 100644 layout/includes/recent-posts.pug create mode 100644 layout/index.pug create mode 100644 layout/page.pug create mode 100644 layout/post.pug create mode 100644 layout/tag.pug create mode 100644 package.json create mode 100644 source/css/_partials/button.styl create mode 100644 source/css/_partials/header/header.styl create mode 100644 source/css/_partials/left_declaration.styl create mode 100644 source/css/common.styl create mode 100644 source/css/hexo-theme-yorha.styl create mode 100644 source/favicon.ico create mode 100644 source/js/hexo-theme-yorha.js diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..beffa30 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,11 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..59a117a --- /dev/null +++ b/_config.yml @@ -0,0 +1,22 @@ + +# html lang +language: zh-cn + +# main menu navigation +menu: + 首页: / + 存档: /archives + 扩展: /extends + nginx文档: /nginx-docs + IPV6: /ipv6 + 传送门: /teleport-public + 大佬们: /giants + +# stylesheets loaded in the +stylesheets: +- /css/hexo-theme-yorha.css +- /css/common.css + +# scripts loaded in the end of the body +scripts: +- /js/hexo-theme-yorha.js diff --git a/layout/archive.pug b/layout/archive.pug new file mode 100644 index 0000000..aa07988 --- /dev/null +++ b/layout/archive.pug @@ -0,0 +1,54 @@ + +extends includes/layout.pug + +block content + - var categoriesList = list_categories({ show_count: false }) + - var tagsList = list_tags({ show_count: false }) + - var archivesList = list_archives({ show_count: false }) + + div.archive + if !is_year() + + h1 Archives + + if theme.atom + p The feed is available via  + a(href=theme.atom) atom + span . + br + + aside + h2 Categories + if categoriesList + != categoriesList + else + p None. + br + + aside + h2 Tags + if tagsList + != tagsList + else + p None. + br + + aside + h2 Archives + if archivesList + != archivesList + else + p None. + br + + else + + h1= page.month + '/' + page.year + + - page.posts.each(function(article){ + .archive-list-item + a(href=url_for(article.path))= article.title + time(datetime=date_xml(article.date))= date(article.date) + - }) + + #paginator!= paginator() diff --git a/layout/category.pug b/layout/category.pug new file mode 100644 index 0000000..f4c34e8 --- /dev/null +++ b/layout/category.pug @@ -0,0 +1,11 @@ +extends includes/layout.pug + +block content + #category + h1= page.category + - page.posts.each(function(article){ + .category-item + a(href=url_for(article.path))= article.title + time(datetime=date_xml(article.date))= date(article.date) + - }) + #paginator!= paginator() diff --git a/layout/includes/_partials/button.pug b/layout/includes/_partials/button.pug new file mode 100644 index 0000000..367fd38 --- /dev/null +++ b/layout/includes/_partials/button.pug @@ -0,0 +1,8 @@ +mixin button (target_href, active, text) + .button-component + .button-component-box + .button-container + a.button-anchor(href=target_href) + .button-anchor-box + .button-item-icon + = text diff --git a/layout/includes/_partials/footer.pug b/layout/includes/_partials/footer.pug new file mode 100644 index 0000000..e69de29 diff --git a/layout/includes/_partials/header.pug b/layout/includes/_partials/header.pug new file mode 100644 index 0000000..94aa764 --- /dev/null +++ b/layout/includes/_partials/header.pug @@ -0,0 +1,7 @@ +include ./button.pug + +#menu-container.menu-container + .menu-items-container + include ./left_declaration.pug + each target, name in theme.menu + +button(target, true, name) diff --git a/layout/includes/_partials/left_declaration.pug b/layout/includes/_partials/left_declaration.pug new file mode 100644 index 0000000..c37e42e --- /dev/null +++ b/layout/includes/_partials/left_declaration.pug @@ -0,0 +1,3 @@ +.left-declaration() + .declaration() + .declaration() \ No newline at end of file diff --git a/layout/includes/layout.pug b/layout/includes/layout.pug new file mode 100644 index 0000000..b46457f --- /dev/null +++ b/layout/includes/layout.pug @@ -0,0 +1,37 @@ + +- var pageTitle = page.title || config.subtitle || '' +- if (is_archive()) pageTitle = 'Archives' +- if (is_tag()) pageTitle = 'Tag: ' + page.tag +- if (is_category()) pageTitle = 'Category: ' + page.category +- if (is_month()) pageTitle += ': ' + page.month + '/' + page.year +- if (is_year()) pageTitle += ': ' + page.year +- pageTitle += ' [ ' + config.title + ' ]' + +doctype html +html(lang='zh-cn') + head + meta(charset='UTF-8') + title= pageTitle + if theme.stylesheets !== undefined && theme.stylesheets.length > 0 + //- stylesheets list from _config.yml + each url in theme.stylesheets + link(rel='stylesheet', href=url) + body + #container.container + header#header.header + .header-box + include ./_partials/header.pug + hr + .bottom-declaration + + main#main.main + .main-box + #content.content + block content + + + + footer#footer.footer + .footer-box + include ./_partials/footer.pug + diff --git a/layout/includes/recent-posts.pug b/layout/includes/recent-posts.pug new file mode 100644 index 0000000..908ab71 --- /dev/null +++ b/layout/includes/recent-posts.pug @@ -0,0 +1,9 @@ + +if page.posts.length > 0 + #recent-posts + h1 Recent Posts + each post in page.posts.sort('date', -1).limit(10).toArray() + .recent-post-item + a(href=url_for(post.path))= post.title + if post.date + time(datetime=post.date.toJSON())= date(post.date, date_format) diff --git a/layout/index.pug b/layout/index.pug new file mode 100644 index 0000000..4d1bb48 --- /dev/null +++ b/layout/index.pug @@ -0,0 +1,4 @@ +extends includes/layout.pug + +block content + diff --git a/layout/page.pug b/layout/page.pug new file mode 100644 index 0000000..29ed3a2 --- /dev/null +++ b/layout/page.pug @@ -0,0 +1,7 @@ +extends includes/layout.pug + +block content + article#page + h1= page.title + != page.content + #paginator!= paginator() diff --git a/layout/post.pug b/layout/post.pug new file mode 100644 index 0000000..df996cd --- /dev/null +++ b/layout/post.pug @@ -0,0 +1,7 @@ +extends includes/layout.pug + +block content + article#post + h1= page.title + != page.content + #paginator!= paginator() diff --git a/layout/tag.pug b/layout/tag.pug new file mode 100644 index 0000000..f561041 --- /dev/null +++ b/layout/tag.pug @@ -0,0 +1,11 @@ +extends includes/layout.pug + +block content + div#tag + h1= 'Tag: ' + page.tag + - page.posts.each(function(article){ + a(href=url_for(article.path))= article.title + time(datetime=date_xml(article.date))= date(article.date) + br.clear + - }) + #paginator!= paginator() diff --git a/package.json b/package.json new file mode 100644 index 0000000..3661af7 --- /dev/null +++ b/package.json @@ -0,0 +1,6 @@ +{ + "name": "hexo-theme-yorha", + "version": "0.1.0", + "description": "", + "private": true +} \ No newline at end of file diff --git a/source/css/_partials/button.styl b/source/css/_partials/button.styl new file mode 100644 index 0000000..2f31918 --- /dev/null +++ b/source/css/_partials/button.styl @@ -0,0 +1,74 @@ +.button-component + width: 100% + .button-component-box + .button-container + padding: 0px; + width: 100%; + height: 100%; + background-color: transparent; + display: flex; + flex-direction: column; + gap: 5px; + border: none; + a.button-anchor + font-size: 1rem; + height: 100%; + width: 100%; + text-decoration: none; + display: flex; + flex-direction: column; + color: rgb(87, 84, 74); + align-items: flex-start; + background-image: linear-gradient(90deg, rgb(180, 175, 154) 50%, rgb(180, 175, 154) 50%, rgb(87, 84, 74) 50%, rgb(87, 84, 74) 100%); + background-size: 200%; + transition: all 0.2s linear 0s; + z-index: 2; + &:hover + background-position: -100% center; + color: rgb(180, 175, 154); + + // line over the button + &::before + background-color: rgb(87, 84, 74); + transition: all 0.2s ease 0s; + &:hover::before + height: 2px; + z-index: -1; + width: 100%; + content: ""; + transform: translate(0px, -8px); + pointer-events: none; + + // line under the button + &::after + background-color: rgb(87, 84, 74); + transition: all 0.2s ease 0s; + &:hover::after + height: 2px; + z-index: -1; + width: 100%; + content: ""; + transform: translate(0px, 8px); + pointer-events: none; + + .button-anchor-box + padding: 10px; + display: flex; + flex-direction: row; + gap: 10px; + -webkit-box-align: center; + align-items: center; + color: inherit; + font-family: Manrope, sans-serif; + font-weight: 500; + font-size: 18px; + .button-item-icon + width: 5%; + height: 5%; + min-width: 20px; + min-height: 20px; + background-image: linear-gradient(90deg, rgb(87, 84, 74) 50%, rgb(87, 84, 74) 50%, rgb(218, 212, 187) 50%, rgb(218, 212, 187) 100%); + background-size: 200%; + transition: all 0.1s linear 0s; + &:hover .button-anchor-box .button-item-icon + background-position: -100% center; diff --git a/source/css/_partials/header/header.styl b/source/css/_partials/header/header.styl new file mode 100644 index 0000000..b4631b0 --- /dev/null +++ b/source/css/_partials/header/header.styl @@ -0,0 +1,10 @@ +.menu-items-container + display: flex; + flex-direction: row; + gap: 1.3rem; + height: 2.5rem; + justify-content: space-between; + position: relative; + width: 100%; + // white-space:nowrap; + diff --git a/source/css/_partials/left_declaration.styl b/source/css/_partials/left_declaration.styl new file mode 100644 index 0000000..be49974 --- /dev/null +++ b/source/css/_partials/left_declaration.styl @@ -0,0 +1,11 @@ +.left-declaration + display: flex + flex-direction: row + height: 100% + .declaration + background-color: rgb(180, 175, 154); + width: 10px; + height: 100%; + margin-right: 5px; + &:nth-child(2) + width: 4px \ No newline at end of file diff --git a/source/css/common.styl b/source/css/common.styl new file mode 100644 index 0000000..e8f04e4 --- /dev/null +++ b/source/css/common.styl @@ -0,0 +1,29 @@ +$backgroundColor=#c6c2a5 + +body + background-color: #c6c2a5 + background-image: + linear-gradient(90deg, #c6c2a5 2px, rgba(255 255 255 0) 0), + linear-gradient(180deg, #c6c2a5 2px, rgb(209 205 178) 0); + background-size: .4rem .4rem + +#container + padding: 1.5% 2% 2% 2% + hr + border: 1.3px solid #000; + margin-left: -4.4%; + margin-right: 4%; + margin-top: 1.5em; + width: 107%; + .bottom-declaration + background-image: linear-gradient(90deg,#333 14%,hsla(0,0%,100%,0) 0); + background-repeat: repeat-x; + background-size: 72px 4px; + width: 100%; + height: 4px; + +* + box-sizing: border-box + +@import '_partials/header/*' +@import '_partials/*' \ No newline at end of file diff --git a/source/css/hexo-theme-yorha.styl b/source/css/hexo-theme-yorha.styl new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/source/css/hexo-theme-yorha.styl @@ -0,0 +1 @@ + diff --git a/source/favicon.ico b/source/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..a60b5fda2456b262393dd748c1ac631410076efe GIT binary patch literal 15086 zcmeHO%WIuQ6hGk#fr3dl-3g7>g3I6wcL|6t&CZ?Bg$w&9=q52;O3_upO*bl(QgG9S z;3gY!(?DCb2rUxSMK{_Dil!1X{(ke#N#{=P+etYI6>Y1lp?+TE%`+k|fCpWWDB6*UfX|wCFD;!1T?quOwgmn~ z&;`(KkPE~z+ZJ}5q?;;#|BDUxc=$7TUn+QmPPVZxlIK`jkw5r* z=pNnsa)j7swO?1h82`&%j^7x+5R(F1l<_!1UKu}%=MYO`lX1=Aa4ddR2lJrkUF7Nd zVcQ7qW4W{pULDgB)>9tV4>v^))OV{0Ood<5ah`&X|#&$yp%yyNbF{?^$3SdKj8rA*wOlrN@0M?dH1m<-25eeUqU zpWpXBeeD>J%CV1U9C?5F`h!XHwOz(Obusb$rHyfMU>p0$!_?bvcm5UUao)xJGp>qp z;!=ri>}xar9$3IO@tq~l)DHe;ZJ%??Io3H(^S0+dUjH%fwA=;$`u%4{`)_pqFy4CR z#5rSAZ6eUY<6k>x#+#T}7B6@u)5I;e{}soU)h3R|>^#CM8S&;`)ZJH_*; zbeJ%QuaG)4*@!9ldT9mv9;PC{u^;B_H`VSj#r0HsZ7`mou#Y$8pH)x2wE@2a#>?z0R^P0A9#cFw z%=;~PTg154@08EBHiGYFjNiTdocr&ZEr+RoQ0OC9z#G$L=DX1)K%zEmmq{uet@ z)%}NaPE3@cI8L*kf3C%oyng%pTYvxL3a+|-d;IkH`M=?Z`+XC?-+AUySA0Lsm#6-I z=iASTeLo2pn&x})g zmY-nC_C|CZ3zIP9{Vw&^Z1p?l3z%wnZPa_~kNvZjn^_y(`<;%j+S+Ij&eudVj5HnM;3X~J&tjv;~%pEsRjzJIpJ`Oy;V z{J4mDpaYRLmiYk^^BsJQ#C!|i86n5_NcbX21m7m%>m>Z|6!Ybio9j4qTsqF9aqB$j Vyl^f&>AdMY>bxGV75xrLtQ(^!B literal 0 HcmV?d00001 diff --git a/source/js/hexo-theme-yorha.js b/source/js/hexo-theme-yorha.js new file mode 100644 index 0000000..e69de29