commit 4bfb0a9360040f77eb2b9c7bc64689a31a491b7d Author: lensferno Date: Sat Jun 24 10:12:22 2023 +0800 . 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 0000000..a60b5fd Binary files /dev/null and b/source/favicon.ico differ diff --git a/source/js/hexo-theme-yorha.js b/source/js/hexo-theme-yorha.js new file mode 100644 index 0000000..e69de29