From f8fbec7f182cf5a22b5159f3d742e841fa6faa7e Mon Sep 17 00:00:00 2001 From: eddy1937 Date: Tue, 23 Apr 2024 23:15:51 +0800 Subject: [PATCH] clone next theme --- package-lock.json | 8 +- package.json | 3 +- themes/next/.editorconfig | 11 + themes/next/.eslintrc.json | 4 + themes/next/.gitattributes | 1 + themes/next/.githooks/install.js | 8 + themes/next/.githooks/pre-commit | 1 + themes/next/.github/CODE_OF_CONDUCT.md | 97 ++ themes/next/.github/CONTRIBUTING.md | 182 ++++ .../.github/ISSUE_TEMPLATE/bug-report.yml | 97 ++ themes/next/.github/ISSUE_TEMPLATE/config.yml | 5 + .../ISSUE_TEMPLATE/feature-request.yml | 60 ++ themes/next/.github/ISSUE_TEMPLATE/other.yml | 33 + themes/next/.github/PULL_REQUEST_TEMPLATE.md | 45 + themes/next/.github/config.yml | 14 + themes/next/.github/issue_label_bot.yaml | 4 + .../next/.github/label-commenter-config.yml | 35 + themes/next/.github/labeler.yml | 26 + themes/next/.github/release.yml | 38 + themes/next/.github/workflows/codeql.yml | 41 + .../.github/workflows/label-commenter.yml | 19 + themes/next/.github/workflows/labeler.yml | 13 + themes/next/.github/workflows/linter.yml | 31 + themes/next/.github/workflows/lock.yml | 19 + themes/next/.github/workflows/tester.yml | 39 + themes/next/.gitignore | 10 + themes/next/.stylelintrc | 20 + themes/next/LICENSE.md | 59 ++ themes/next/README.md | 192 ++++ themes/next/_config.yml | 928 ++++++++++++++++++ themes/next/_vendors.yml | 179 ++++ themes/next/crowdin.yml | 9 + themes/next/docs/AGPL3.md | 649 ++++++++++++ themes/next/docs/AUTHORS.md | 87 ++ themes/next/docs/LICENSE.txt | 52 + themes/next/docs/ru/README.md | 188 ++++ themes/next/docs/zh-CN/CODE_OF_CONDUCT.md | 95 ++ themes/next/docs/zh-CN/CONTRIBUTING.md | 181 ++++ themes/next/docs/zh-CN/README.md | 188 ++++ themes/next/languages/README.md | 39 + themes/next/languages/ar.yml | 103 ++ themes/next/languages/bn.yml | 103 ++ themes/next/languages/de.yml | 103 ++ themes/next/languages/default.yml | 1 + themes/next/languages/en.yml | 120 +++ themes/next/languages/eo.yml | 103 ++ themes/next/languages/es.yml | 103 ++ themes/next/languages/fa.yml | 103 ++ themes/next/languages/fr.yml | 103 ++ themes/next/languages/id.yml | 103 ++ themes/next/languages/it.yml | 103 ++ themes/next/languages/ja.yml | 103 ++ themes/next/languages/ko.yml | 103 ++ themes/next/languages/nl.yml | 103 ++ themes/next/languages/pt-BR.yml | 103 ++ themes/next/languages/pt.yml | 103 ++ themes/next/languages/ru.yml | 103 ++ themes/next/languages/si.yml | 103 ++ themes/next/languages/th.yml | 103 ++ themes/next/languages/tk.yml | 103 ++ themes/next/languages/tr.yml | 103 ++ themes/next/languages/uk.yml | 103 ++ themes/next/languages/vi.yml | 103 ++ themes/next/languages/zh-CN.yml | 103 ++ themes/next/languages/zh-HK.yml | 103 ++ themes/next/languages/zh-tw.yml | 103 ++ themes/next/layout/_layout.njk | 52 + themes/next/layout/_macro/post-collapse.njk | 35 + themes/next/layout/_macro/post.njk | 148 +++ themes/next/layout/_macro/sidebar.njk | 77 ++ themes/next/layout/_partials/comments.njk | 35 + themes/next/layout/_partials/footer.njk | 86 ++ .../layout/_partials/head/head-unique.njk | 22 + themes/next/layout/_partials/head/head.njk | 67 ++ themes/next/layout/_partials/header/brand.njk | 44 + themes/next/layout/_partials/header/index.njk | 7 + .../layout/_partials/header/menu-item.njk | 33 + themes/next/layout/_partials/header/menu.njk | 19 + .../next/layout/_partials/header/sub-menu.njk | 12 + themes/next/layout/_partials/languages.njk | 16 + .../next/layout/_partials/page/breadcrumb.njk | 30 + .../next/layout/_partials/page/categories.njk | 8 + .../layout/_partials/page/page-header.njk | 15 + .../next/layout/_partials/page/schedule.njk | 3 + themes/next/layout/_partials/page/tags.njk | 16 + themes/next/layout/_partials/pagination.njk | 5 + .../layout/_partials/post/post-copyright.njk | 34 + .../layout/_partials/post/post-followme.njk | 32 + .../next/layout/_partials/post/post-meta.njk | 107 ++ .../layout/_partials/post/post-related.njk | 18 + .../layout/_partials/post/post-reward.njk | 18 + .../next/layout/_partials/post/post-share.njk | 8 + .../_partials/search/algolia-search.njk | 14 + themes/next/layout/_partials/search/index.njk | 11 + .../layout/_partials/search/localsearch.njk | 18 + .../_partials/sidebar/site-overview.njk | 81 ++ themes/next/layout/_partials/widgets.njk | 38 + themes/next/layout/_scripts/index.njk | 20 + themes/next/layout/_scripts/vendors.njk | 7 + themes/next/layout/_third-party/addtoany.njk | 3 + .../analytics/baidu-analytics.njk | 4 + .../_third-party/analytics/cloudflare.njk | 3 + .../analytics/google-analytics.njk | 7 + .../_third-party/analytics/growingio.njk | 5 + .../layout/_third-party/analytics/index.njk | 8 + .../layout/_third-party/analytics/matomo.njk | 4 + .../analytics/microsoft-clarity.njk | 9 + .../_third-party/analytics/plausible.njk | 3 + .../layout/_third-party/analytics/umami.njk | 3 + .../next/layout/_third-party/chat/chatra.njk | 3 + .../next/layout/_third-party/chat/tidio.njk | 2 + .../layout/_third-party/comments/changyan.njk | 2 + .../layout/_third-party/comments/disqus.njk | 6 + .../layout/_third-party/comments/disqusjs.njk | 6 + .../layout/_third-party/comments/gitalk.njk | 7 + .../layout/_third-party/comments/isso.njk | 2 + .../layout/_third-party/comments/livere.njk | 1 + .../_third-party/comments/utterances.njk | 2 + themes/next/layout/_third-party/fancybox.njk | 3 + themes/next/layout/_third-party/index.njk | 19 + .../next/layout/_third-party/math/index.njk | 26 + .../next/layout/_third-party/math/katex.njk | 7 + .../next/layout/_third-party/math/mathjax.njk | 4 + themes/next/layout/_third-party/pace.njk | 3 + themes/next/layout/_third-party/quicklink.njk | 7 + .../_third-party/search/algolia-search.njk | 4 + .../_third-party/search/localsearch.njk | 2 + .../statistics/busuanzi-counter.njk | 3 + .../_third-party/statistics/firestore.njk | 6 + .../layout/_third-party/statistics/index.njk | 3 + .../statistics/lean-analytics.njk | 4 + .../next/layout/_third-party/tags/mermaid.njk | 6 + themes/next/layout/_third-party/tags/pdf.njk | 7 + .../layout/_third-party/tags/wavedrom.njk | 9 + themes/next/layout/archive.njk | 48 + themes/next/layout/category.njk | 36 + themes/next/layout/index.njk | 20 + themes/next/layout/page.njk | 54 + themes/next/layout/post.njk | 16 + themes/next/layout/tag.njk | 36 + themes/next/package.json | 46 + themes/next/renovate.json | 5 + themes/next/scripts/events/index.js | 32 + themes/next/scripts/events/lib/config.js | 44 + themes/next/scripts/events/lib/highlight.js | 28 + themes/next/scripts/events/lib/injects.js | 85 ++ themes/next/scripts/events/lib/navigation.js | 57 ++ themes/next/scripts/events/lib/utils.js | 90 ++ themes/next/scripts/events/lib/vendors.js | 55 ++ .../next/scripts/filters/comment/changyan.js | 35 + themes/next/scripts/filters/comment/common.js | 23 + .../scripts/filters/comment/default-config.js | 34 + themes/next/scripts/filters/comment/disqus.js | 39 + .../next/scripts/filters/comment/disqusjs.js | 20 + themes/next/scripts/filters/comment/gitalk.js | 16 + themes/next/scripts/filters/comment/isso.js | 16 + themes/next/scripts/filters/comment/livere.js | 16 + .../scripts/filters/comment/utterances.js | 21 + .../next/scripts/filters/default-injects.js | 24 + themes/next/scripts/filters/locals.js | 37 + themes/next/scripts/filters/minify.js | 152 +++ themes/next/scripts/filters/post.js | 36 + themes/next/scripts/helpers/engine.js | 115 +++ themes/next/scripts/helpers/font.js | 25 + themes/next/scripts/helpers/navigation.js | 19 + themes/next/scripts/helpers/next-config.js | 65 ++ themes/next/scripts/helpers/next-paginator.js | 18 + themes/next/scripts/helpers/next-url.js | 54 + themes/next/scripts/helpers/next-vendors.js | 30 + themes/next/scripts/tags/button.js | 23 + themes/next/scripts/tags/caniuse.js | 16 + themes/next/scripts/tags/center-quote.js | 11 + themes/next/scripts/tags/group-pictures.js | 132 +++ themes/next/scripts/tags/index.js | 59 ++ themes/next/scripts/tags/label.js | 13 + themes/next/scripts/tags/link-grid.js | 20 + themes/next/scripts/tags/mermaid.js | 14 + themes/next/scripts/tags/note.js | 25 + themes/next/scripts/tags/pdf.js | 10 + themes/next/scripts/tags/tabs.js | 47 + themes/next/scripts/tags/video.js | 9 + themes/next/scripts/tags/wavedrom.js | 11 + themes/next/source/css/_colors.styl | 75 ++ .../css/_common/components/back-to-top.styl | 49 + .../source/css/_common/components/index.styl | 6 + .../_common/components/pages/breadcrumb.styl | 21 + .../_common/components/pages/categories.styl | 35 + .../css/_common/components/pages/index.styl | 5 + .../_common/components/pages/schedule.styl | 102 ++ .../_common/components/pages/tag-cloud.styl | 28 + .../css/_common/components/post/index.styl | 53 + .../_common/components/post/post-body.styl | 79 ++ .../components/post/post-collapse.styl | 104 ++ .../components/post/post-followme.styl | 56 ++ .../_common/components/post/post-footer.styl | 53 + .../_common/components/post/post-gallery.styl | 33 + .../_common/components/post/post-header.styl | 120 +++ .../css/_common/components/post/post-nav.styl | 41 + .../_common/components/post/post-reward.styl | 56 ++ .../_common/components/post/post-widgets.styl | 11 + .../_common/components/reading-progress.styl | 27 + .../components/third-party/disqusjs.styl | 39 + .../components/third-party/gitalk.styl | 17 + .../_common/components/third-party/index.styl | 16 + .../_common/components/third-party/math.styl | 9 + .../components/third-party/search.styl | 179 ++++ .../components/third-party/utterances.styl | 5 + .../css/_common/outline/footer/index.styl | 102 ++ .../css/_common/outline/header/bookmark.styl | 24 + .../_common/outline/header/github-banner.styl | 59 ++ .../css/_common/outline/header/index.styl | 29 + .../css/_common/outline/header/menu.styl | 58 ++ .../css/_common/outline/header/site-meta.styl | 49 + .../css/_common/outline/header/site-nav.styl | 24 + .../source/css/_common/outline/index.styl | 5 + .../source/css/_common/outline/mobile.styl | 90 ++ .../css/_common/outline/sidebar/index.styl | 31 + .../outline/sidebar/related-posts.styl | 31 + .../outline/sidebar/sidebar-author-links.styl | 11 + .../outline/sidebar/sidebar-author.styl | 29 + .../outline/sidebar/sidebar-blogroll.styl | 14 + .../outline/sidebar/sidebar-button.styl | 15 + .../_common/outline/sidebar/sidebar-nav.styl | 129 +++ .../_common/outline/sidebar/sidebar-toc.styl | 67 ++ .../outline/sidebar/sidebar-toggle.styl | 21 + .../_common/outline/sidebar/site-state.styl | 28 + .../source/css/_common/scaffolding/base.styl | 99 ++ .../css/_common/scaffolding/buttons.styl | 26 + .../css/_common/scaffolding/comments.styl | 39 + .../scaffolding/highlight/copy-code.styl | 59 ++ .../_common/scaffolding/highlight/fold.styl | 29 + .../_common/scaffolding/highlight/index.styl | 146 +++ .../source/css/_common/scaffolding/index.styl | 12 + .../css/_common/scaffolding/normalize.styl | 289 ++++++ .../css/_common/scaffolding/pagination.styl | 55 ++ .../css/_common/scaffolding/tables.styl | 39 + .../scaffolding/tags/blockquote-center.styl | 34 + .../scaffolding/tags/group-pictures.styl | 20 + .../css/_common/scaffolding/tags/index.styl | 9 + .../css/_common/scaffolding/tags/label.styl | 10 + .../_common/scaffolding/tags/link-grid.styl | 113 +++ .../css/_common/scaffolding/tags/mermaid.styl | 6 + .../css/_common/scaffolding/tags/note.styl | 110 +++ .../css/_common/scaffolding/tags/pdf.styl | 8 + .../css/_common/scaffolding/tags/tabs.styl | 103 ++ .../_common/scaffolding/tags/wavedrom.styl | 6 + .../css/_common/scaffolding/toggles.styl | 30 + themes/next/source/css/_mixins.styl | 274 ++++++ .../source/css/_schemes/Gemini/index.styl | 124 +++ .../source/css/_schemes/Mist/_header.styl | 58 ++ .../source/css/_schemes/Mist/_layout.styl | 39 + .../next/source/css/_schemes/Mist/_menu.styl | 45 + .../css/_schemes/Mist/_posts-expand.styl | 69 ++ .../next/source/css/_schemes/Mist/index.styl | 10 + .../source/css/_schemes/Muse/_header.styl | 18 + .../source/css/_schemes/Muse/_layout.styl | 23 + .../next/source/css/_schemes/Muse/_menu.styl | 56 ++ .../source/css/_schemes/Muse/_sidebar.styl | 134 +++ .../source/css/_schemes/Muse/_sub-menu.styl | 7 + .../next/source/css/_schemes/Muse/index.styl | 5 + .../source/css/_schemes/Pisces/_header.styl | 35 + .../source/css/_schemes/Pisces/_layout.styl | 50 + .../source/css/_schemes/Pisces/_menu.styl | 46 + .../source/css/_schemes/Pisces/_sidebar.styl | 88 ++ .../source/css/_schemes/Pisces/_sub-menu.styl | 28 + .../source/css/_schemes/Pisces/index.styl | 30 + themes/next/source/css/_variables/Gemini.styl | 18 + themes/next/source/css/_variables/Mist.styl | 27 + themes/next/source/css/_variables/Muse.styl | 9 + themes/next/source/css/_variables/Pisces.styl | 69 ++ themes/next/source/css/_variables/base.styl | 389 ++++++++ themes/next/source/css/main.styl | 47 + themes/next/source/css/noscript.styl | 47 + .../source/images/apple-touch-icon-next.png | Bin 0 -> 1544 bytes themes/next/source/images/avatar.gif | Bin 0 -> 1785 bytes .../next/source/images/favicon-16x16-next.png | Bin 0 -> 435 bytes .../next/source/images/favicon-32x32-next.png | Bin 0 -> 640 bytes .../images/logo-algolia-nebula-blue-full.svg | 1 + themes/next/source/images/logo.svg | 1 + themes/next/source/js/bookmark.js | 56 ++ themes/next/source/js/comments-buttons.js | 25 + themes/next/source/js/comments.js | 21 + themes/next/source/js/config.js | 66 ++ themes/next/source/js/motion.js | 140 +++ themes/next/source/js/next-boot.js | 79 ++ themes/next/source/js/pjax.js | 50 + themes/next/source/js/schedule.js | 138 +++ themes/next/source/js/schemes/muse.js | 60 ++ themes/next/source/js/third-party/addtoany.js | 8 + .../third-party/analytics/baidu-analytics.js | 7 + .../third-party/analytics/google-analytics.js | 53 + .../js/third-party/analytics/growingio.js | 10 + .../source/js/third-party/analytics/matomo.js | 19 + .../next/source/js/third-party/chat/chatra.js | 19 + .../next/source/js/third-party/chat/tidio.js | 10 + .../js/third-party/comments/changyan.js | 39 + .../source/js/third-party/comments/disqus.js | 41 + .../js/third-party/comments/disqusjs.js | 23 + .../source/js/third-party/comments/gitalk.js | 24 + .../source/js/third-party/comments/isso.js | 15 + .../source/js/third-party/comments/livere.js | 19 + .../js/third-party/comments/utterances.js | 17 + themes/next/source/js/third-party/fancybox.js | 35 + .../next/source/js/third-party/math/katex.js | 7 + .../source/js/third-party/math/mathjax.js | 36 + themes/next/source/js/third-party/pace.js | 7 + .../next/source/js/third-party/quicklink.js | 37 + .../js/third-party/search/algolia-search.js | 130 +++ .../js/third-party/search/local-search.js | 99 ++ .../js/third-party/statistics/firestore.js | 60 ++ .../third-party/statistics/lean-analytics.js | 107 ++ .../source/js/third-party/tags/mermaid.js | 32 + themes/next/source/js/third-party/tags/pdf.js | 23 + .../source/js/third-party/tags/wavedrom.js | 13 + themes/next/source/js/utils.js | 489 +++++++++ themes/next/test/helpers/font.js | 86 ++ themes/next/test/helpers/index.js | 6 + themes/next/test/helpers/next-url.js | 50 + themes/next/test/index.js | 7 + themes/next/test/tags/button.js | 33 + themes/next/test/tags/caniuse.js | 17 + themes/next/test/tags/center-quote.js | 21 + themes/next/test/tags/group-pictures.js | 63 ++ themes/next/test/tags/index.js | 15 + themes/next/test/tags/label.js | 21 + themes/next/test/tags/link-grid.js | 49 + themes/next/test/tags/mermaid.js | 21 + themes/next/test/tags/note.js | 63 ++ themes/next/test/tags/pdf.js | 23 + themes/next/test/tags/tabs.js | 96 ++ themes/next/test/tags/video.js | 15 + themes/next/test/validate/index.js | 35 + 332 files changed, 17119 insertions(+), 9 deletions(-) create mode 100644 themes/next/.editorconfig create mode 100644 themes/next/.eslintrc.json create mode 100644 themes/next/.gitattributes create mode 100644 themes/next/.githooks/install.js create mode 100755 themes/next/.githooks/pre-commit create mode 100644 themes/next/.github/CODE_OF_CONDUCT.md create mode 100644 themes/next/.github/CONTRIBUTING.md create mode 100644 themes/next/.github/ISSUE_TEMPLATE/bug-report.yml create mode 100644 themes/next/.github/ISSUE_TEMPLATE/config.yml create mode 100644 themes/next/.github/ISSUE_TEMPLATE/feature-request.yml create mode 100644 themes/next/.github/ISSUE_TEMPLATE/other.yml create mode 100644 themes/next/.github/PULL_REQUEST_TEMPLATE.md create mode 100644 themes/next/.github/config.yml create mode 100644 themes/next/.github/issue_label_bot.yaml create mode 100644 themes/next/.github/label-commenter-config.yml create mode 100644 themes/next/.github/labeler.yml create mode 100644 themes/next/.github/release.yml create mode 100644 themes/next/.github/workflows/codeql.yml create mode 100644 themes/next/.github/workflows/label-commenter.yml create mode 100644 themes/next/.github/workflows/labeler.yml create mode 100644 themes/next/.github/workflows/linter.yml create mode 100644 themes/next/.github/workflows/lock.yml create mode 100644 themes/next/.github/workflows/tester.yml create mode 100644 themes/next/.gitignore create mode 100644 themes/next/.stylelintrc create mode 100644 themes/next/LICENSE.md create mode 100644 themes/next/README.md create mode 100644 themes/next/_config.yml create mode 100644 themes/next/_vendors.yml create mode 100644 themes/next/crowdin.yml create mode 100644 themes/next/docs/AGPL3.md create mode 100644 themes/next/docs/AUTHORS.md create mode 100644 themes/next/docs/LICENSE.txt create mode 100644 themes/next/docs/ru/README.md create mode 100644 themes/next/docs/zh-CN/CODE_OF_CONDUCT.md create mode 100644 themes/next/docs/zh-CN/CONTRIBUTING.md create mode 100644 themes/next/docs/zh-CN/README.md create mode 100644 themes/next/languages/README.md create mode 100644 themes/next/languages/ar.yml create mode 100644 themes/next/languages/bn.yml create mode 100644 themes/next/languages/de.yml create mode 120000 themes/next/languages/default.yml create mode 100644 themes/next/languages/en.yml create mode 100644 themes/next/languages/eo.yml create mode 100644 themes/next/languages/es.yml create mode 100644 themes/next/languages/fa.yml create mode 100644 themes/next/languages/fr.yml create mode 100644 themes/next/languages/id.yml create mode 100644 themes/next/languages/it.yml create mode 100644 themes/next/languages/ja.yml create mode 100644 themes/next/languages/ko.yml create mode 100644 themes/next/languages/nl.yml create mode 100644 themes/next/languages/pt-BR.yml create mode 100644 themes/next/languages/pt.yml create mode 100644 themes/next/languages/ru.yml create mode 100644 themes/next/languages/si.yml create mode 100644 themes/next/languages/th.yml create mode 100644 themes/next/languages/tk.yml create mode 100644 themes/next/languages/tr.yml create mode 100644 themes/next/languages/uk.yml create mode 100644 themes/next/languages/vi.yml create mode 100644 themes/next/languages/zh-CN.yml create mode 100644 themes/next/languages/zh-HK.yml create mode 100644 themes/next/languages/zh-tw.yml create mode 100644 themes/next/layout/_layout.njk create mode 100644 themes/next/layout/_macro/post-collapse.njk create mode 100644 themes/next/layout/_macro/post.njk create mode 100644 themes/next/layout/_macro/sidebar.njk create mode 100644 themes/next/layout/_partials/comments.njk create mode 100644 themes/next/layout/_partials/footer.njk create mode 100644 themes/next/layout/_partials/head/head-unique.njk create mode 100644 themes/next/layout/_partials/head/head.njk create mode 100644 themes/next/layout/_partials/header/brand.njk create mode 100644 themes/next/layout/_partials/header/index.njk create mode 100644 themes/next/layout/_partials/header/menu-item.njk create mode 100644 themes/next/layout/_partials/header/menu.njk create mode 100644 themes/next/layout/_partials/header/sub-menu.njk create mode 100644 themes/next/layout/_partials/languages.njk create mode 100644 themes/next/layout/_partials/page/breadcrumb.njk create mode 100644 themes/next/layout/_partials/page/categories.njk create mode 100644 themes/next/layout/_partials/page/page-header.njk create mode 100644 themes/next/layout/_partials/page/schedule.njk create mode 100644 themes/next/layout/_partials/page/tags.njk create mode 100644 themes/next/layout/_partials/pagination.njk create mode 100644 themes/next/layout/_partials/post/post-copyright.njk create mode 100644 themes/next/layout/_partials/post/post-followme.njk create mode 100644 themes/next/layout/_partials/post/post-meta.njk create mode 100644 themes/next/layout/_partials/post/post-related.njk create mode 100644 themes/next/layout/_partials/post/post-reward.njk create mode 100644 themes/next/layout/_partials/post/post-share.njk create mode 100644 themes/next/layout/_partials/search/algolia-search.njk create mode 100644 themes/next/layout/_partials/search/index.njk create mode 100644 themes/next/layout/_partials/search/localsearch.njk create mode 100644 themes/next/layout/_partials/sidebar/site-overview.njk create mode 100644 themes/next/layout/_partials/widgets.njk create mode 100644 themes/next/layout/_scripts/index.njk create mode 100644 themes/next/layout/_scripts/vendors.njk create mode 100644 themes/next/layout/_third-party/addtoany.njk create mode 100644 themes/next/layout/_third-party/analytics/baidu-analytics.njk create mode 100644 themes/next/layout/_third-party/analytics/cloudflare.njk create mode 100644 themes/next/layout/_third-party/analytics/google-analytics.njk create mode 100644 themes/next/layout/_third-party/analytics/growingio.njk create mode 100644 themes/next/layout/_third-party/analytics/index.njk create mode 100644 themes/next/layout/_third-party/analytics/matomo.njk create mode 100644 themes/next/layout/_third-party/analytics/microsoft-clarity.njk create mode 100644 themes/next/layout/_third-party/analytics/plausible.njk create mode 100644 themes/next/layout/_third-party/analytics/umami.njk create mode 100644 themes/next/layout/_third-party/chat/chatra.njk create mode 100644 themes/next/layout/_third-party/chat/tidio.njk create mode 100644 themes/next/layout/_third-party/comments/changyan.njk create mode 100644 themes/next/layout/_third-party/comments/disqus.njk create mode 100644 themes/next/layout/_third-party/comments/disqusjs.njk create mode 100644 themes/next/layout/_third-party/comments/gitalk.njk create mode 100644 themes/next/layout/_third-party/comments/isso.njk create mode 100644 themes/next/layout/_third-party/comments/livere.njk create mode 100644 themes/next/layout/_third-party/comments/utterances.njk create mode 100644 themes/next/layout/_third-party/fancybox.njk create mode 100644 themes/next/layout/_third-party/index.njk create mode 100644 themes/next/layout/_third-party/math/index.njk create mode 100644 themes/next/layout/_third-party/math/katex.njk create mode 100644 themes/next/layout/_third-party/math/mathjax.njk create mode 100644 themes/next/layout/_third-party/pace.njk create mode 100644 themes/next/layout/_third-party/quicklink.njk create mode 100644 themes/next/layout/_third-party/search/algolia-search.njk create mode 100644 themes/next/layout/_third-party/search/localsearch.njk create mode 100644 themes/next/layout/_third-party/statistics/busuanzi-counter.njk create mode 100644 themes/next/layout/_third-party/statistics/firestore.njk create mode 100644 themes/next/layout/_third-party/statistics/index.njk create mode 100644 themes/next/layout/_third-party/statistics/lean-analytics.njk create mode 100644 themes/next/layout/_third-party/tags/mermaid.njk create mode 100644 themes/next/layout/_third-party/tags/pdf.njk create mode 100644 themes/next/layout/_third-party/tags/wavedrom.njk create mode 100644 themes/next/layout/archive.njk create mode 100644 themes/next/layout/category.njk create mode 100644 themes/next/layout/index.njk create mode 100644 themes/next/layout/page.njk create mode 100644 themes/next/layout/post.njk create mode 100644 themes/next/layout/tag.njk create mode 100644 themes/next/package.json create mode 100644 themes/next/renovate.json create mode 100644 themes/next/scripts/events/index.js create mode 100644 themes/next/scripts/events/lib/config.js create mode 100644 themes/next/scripts/events/lib/highlight.js create mode 100644 themes/next/scripts/events/lib/injects.js create mode 100644 themes/next/scripts/events/lib/navigation.js create mode 100644 themes/next/scripts/events/lib/utils.js create mode 100644 themes/next/scripts/events/lib/vendors.js create mode 100644 themes/next/scripts/filters/comment/changyan.js create mode 100644 themes/next/scripts/filters/comment/common.js create mode 100644 themes/next/scripts/filters/comment/default-config.js create mode 100644 themes/next/scripts/filters/comment/disqus.js create mode 100644 themes/next/scripts/filters/comment/disqusjs.js create mode 100644 themes/next/scripts/filters/comment/gitalk.js create mode 100644 themes/next/scripts/filters/comment/isso.js create mode 100644 themes/next/scripts/filters/comment/livere.js create mode 100644 themes/next/scripts/filters/comment/utterances.js create mode 100644 themes/next/scripts/filters/default-injects.js create mode 100644 themes/next/scripts/filters/locals.js create mode 100644 themes/next/scripts/filters/minify.js create mode 100644 themes/next/scripts/filters/post.js create mode 100644 themes/next/scripts/helpers/engine.js create mode 100644 themes/next/scripts/helpers/font.js create mode 100644 themes/next/scripts/helpers/navigation.js create mode 100644 themes/next/scripts/helpers/next-config.js create mode 100644 themes/next/scripts/helpers/next-paginator.js create mode 100644 themes/next/scripts/helpers/next-url.js create mode 100644 themes/next/scripts/helpers/next-vendors.js create mode 100644 themes/next/scripts/tags/button.js create mode 100644 themes/next/scripts/tags/caniuse.js create mode 100644 themes/next/scripts/tags/center-quote.js create mode 100644 themes/next/scripts/tags/group-pictures.js create mode 100644 themes/next/scripts/tags/index.js create mode 100644 themes/next/scripts/tags/label.js create mode 100644 themes/next/scripts/tags/link-grid.js create mode 100644 themes/next/scripts/tags/mermaid.js create mode 100644 themes/next/scripts/tags/note.js create mode 100644 themes/next/scripts/tags/pdf.js create mode 100644 themes/next/scripts/tags/tabs.js create mode 100644 themes/next/scripts/tags/video.js create mode 100644 themes/next/scripts/tags/wavedrom.js create mode 100644 themes/next/source/css/_colors.styl create mode 100644 themes/next/source/css/_common/components/back-to-top.styl create mode 100644 themes/next/source/css/_common/components/index.styl create mode 100644 themes/next/source/css/_common/components/pages/breadcrumb.styl create mode 100644 themes/next/source/css/_common/components/pages/categories.styl create mode 100644 themes/next/source/css/_common/components/pages/index.styl create mode 100644 themes/next/source/css/_common/components/pages/schedule.styl create mode 100644 themes/next/source/css/_common/components/pages/tag-cloud.styl create mode 100644 themes/next/source/css/_common/components/post/index.styl create mode 100644 themes/next/source/css/_common/components/post/post-body.styl create mode 100644 themes/next/source/css/_common/components/post/post-collapse.styl create mode 100644 themes/next/source/css/_common/components/post/post-followme.styl create mode 100644 themes/next/source/css/_common/components/post/post-footer.styl create mode 100644 themes/next/source/css/_common/components/post/post-gallery.styl create mode 100644 themes/next/source/css/_common/components/post/post-header.styl create mode 100644 themes/next/source/css/_common/components/post/post-nav.styl create mode 100644 themes/next/source/css/_common/components/post/post-reward.styl create mode 100644 themes/next/source/css/_common/components/post/post-widgets.styl create mode 100644 themes/next/source/css/_common/components/reading-progress.styl create mode 100644 themes/next/source/css/_common/components/third-party/disqusjs.styl create mode 100644 themes/next/source/css/_common/components/third-party/gitalk.styl create mode 100644 themes/next/source/css/_common/components/third-party/index.styl create mode 100644 themes/next/source/css/_common/components/third-party/math.styl create mode 100644 themes/next/source/css/_common/components/third-party/search.styl create mode 100644 themes/next/source/css/_common/components/third-party/utterances.styl create mode 100644 themes/next/source/css/_common/outline/footer/index.styl create mode 100644 themes/next/source/css/_common/outline/header/bookmark.styl create mode 100644 themes/next/source/css/_common/outline/header/github-banner.styl create mode 100644 themes/next/source/css/_common/outline/header/index.styl create mode 100644 themes/next/source/css/_common/outline/header/menu.styl create mode 100644 themes/next/source/css/_common/outline/header/site-meta.styl create mode 100644 themes/next/source/css/_common/outline/header/site-nav.styl create mode 100644 themes/next/source/css/_common/outline/index.styl create mode 100644 themes/next/source/css/_common/outline/mobile.styl create mode 100644 themes/next/source/css/_common/outline/sidebar/index.styl create mode 100644 themes/next/source/css/_common/outline/sidebar/related-posts.styl create mode 100644 themes/next/source/css/_common/outline/sidebar/sidebar-author-links.styl create mode 100644 themes/next/source/css/_common/outline/sidebar/sidebar-author.styl create mode 100644 themes/next/source/css/_common/outline/sidebar/sidebar-blogroll.styl create mode 100644 themes/next/source/css/_common/outline/sidebar/sidebar-button.styl create mode 100644 themes/next/source/css/_common/outline/sidebar/sidebar-nav.styl create mode 100644 themes/next/source/css/_common/outline/sidebar/sidebar-toc.styl create mode 100644 themes/next/source/css/_common/outline/sidebar/sidebar-toggle.styl create mode 100644 themes/next/source/css/_common/outline/sidebar/site-state.styl create mode 100644 themes/next/source/css/_common/scaffolding/base.styl create mode 100644 themes/next/source/css/_common/scaffolding/buttons.styl create mode 100644 themes/next/source/css/_common/scaffolding/comments.styl create mode 100644 themes/next/source/css/_common/scaffolding/highlight/copy-code.styl create mode 100644 themes/next/source/css/_common/scaffolding/highlight/fold.styl create mode 100644 themes/next/source/css/_common/scaffolding/highlight/index.styl create mode 100644 themes/next/source/css/_common/scaffolding/index.styl create mode 100644 themes/next/source/css/_common/scaffolding/normalize.styl create mode 100644 themes/next/source/css/_common/scaffolding/pagination.styl create mode 100644 themes/next/source/css/_common/scaffolding/tables.styl create mode 100644 themes/next/source/css/_common/scaffolding/tags/blockquote-center.styl create mode 100644 themes/next/source/css/_common/scaffolding/tags/group-pictures.styl create mode 100644 themes/next/source/css/_common/scaffolding/tags/index.styl create mode 100644 themes/next/source/css/_common/scaffolding/tags/label.styl create mode 100644 themes/next/source/css/_common/scaffolding/tags/link-grid.styl create mode 100644 themes/next/source/css/_common/scaffolding/tags/mermaid.styl create mode 100644 themes/next/source/css/_common/scaffolding/tags/note.styl create mode 100644 themes/next/source/css/_common/scaffolding/tags/pdf.styl create mode 100644 themes/next/source/css/_common/scaffolding/tags/tabs.styl create mode 100644 themes/next/source/css/_common/scaffolding/tags/wavedrom.styl create mode 100644 themes/next/source/css/_common/scaffolding/toggles.styl create mode 100644 themes/next/source/css/_mixins.styl create mode 100644 themes/next/source/css/_schemes/Gemini/index.styl create mode 100644 themes/next/source/css/_schemes/Mist/_header.styl create mode 100644 themes/next/source/css/_schemes/Mist/_layout.styl create mode 100644 themes/next/source/css/_schemes/Mist/_menu.styl create mode 100644 themes/next/source/css/_schemes/Mist/_posts-expand.styl create mode 100644 themes/next/source/css/_schemes/Mist/index.styl create mode 100644 themes/next/source/css/_schemes/Muse/_header.styl create mode 100644 themes/next/source/css/_schemes/Muse/_layout.styl create mode 100644 themes/next/source/css/_schemes/Muse/_menu.styl create mode 100644 themes/next/source/css/_schemes/Muse/_sidebar.styl create mode 100644 themes/next/source/css/_schemes/Muse/_sub-menu.styl create mode 100644 themes/next/source/css/_schemes/Muse/index.styl create mode 100644 themes/next/source/css/_schemes/Pisces/_header.styl create mode 100644 themes/next/source/css/_schemes/Pisces/_layout.styl create mode 100644 themes/next/source/css/_schemes/Pisces/_menu.styl create mode 100644 themes/next/source/css/_schemes/Pisces/_sidebar.styl create mode 100644 themes/next/source/css/_schemes/Pisces/_sub-menu.styl create mode 100644 themes/next/source/css/_schemes/Pisces/index.styl create mode 100644 themes/next/source/css/_variables/Gemini.styl create mode 100644 themes/next/source/css/_variables/Mist.styl create mode 100644 themes/next/source/css/_variables/Muse.styl create mode 100644 themes/next/source/css/_variables/Pisces.styl create mode 100644 themes/next/source/css/_variables/base.styl create mode 100644 themes/next/source/css/main.styl create mode 100644 themes/next/source/css/noscript.styl create mode 100644 themes/next/source/images/apple-touch-icon-next.png create mode 100644 themes/next/source/images/avatar.gif create mode 100644 themes/next/source/images/favicon-16x16-next.png create mode 100644 themes/next/source/images/favicon-32x32-next.png create mode 100644 themes/next/source/images/logo-algolia-nebula-blue-full.svg create mode 100644 themes/next/source/images/logo.svg create mode 100644 themes/next/source/js/bookmark.js create mode 100644 themes/next/source/js/comments-buttons.js create mode 100644 themes/next/source/js/comments.js create mode 100644 themes/next/source/js/config.js create mode 100644 themes/next/source/js/motion.js create mode 100644 themes/next/source/js/next-boot.js create mode 100644 themes/next/source/js/pjax.js create mode 100644 themes/next/source/js/schedule.js create mode 100644 themes/next/source/js/schemes/muse.js create mode 100644 themes/next/source/js/third-party/addtoany.js create mode 100644 themes/next/source/js/third-party/analytics/baidu-analytics.js create mode 100644 themes/next/source/js/third-party/analytics/google-analytics.js create mode 100644 themes/next/source/js/third-party/analytics/growingio.js create mode 100644 themes/next/source/js/third-party/analytics/matomo.js create mode 100644 themes/next/source/js/third-party/chat/chatra.js create mode 100644 themes/next/source/js/third-party/chat/tidio.js create mode 100644 themes/next/source/js/third-party/comments/changyan.js create mode 100644 themes/next/source/js/third-party/comments/disqus.js create mode 100644 themes/next/source/js/third-party/comments/disqusjs.js create mode 100644 themes/next/source/js/third-party/comments/gitalk.js create mode 100644 themes/next/source/js/third-party/comments/isso.js create mode 100644 themes/next/source/js/third-party/comments/livere.js create mode 100644 themes/next/source/js/third-party/comments/utterances.js create mode 100644 themes/next/source/js/third-party/fancybox.js create mode 100644 themes/next/source/js/third-party/math/katex.js create mode 100644 themes/next/source/js/third-party/math/mathjax.js create mode 100644 themes/next/source/js/third-party/pace.js create mode 100644 themes/next/source/js/third-party/quicklink.js create mode 100644 themes/next/source/js/third-party/search/algolia-search.js create mode 100644 themes/next/source/js/third-party/search/local-search.js create mode 100644 themes/next/source/js/third-party/statistics/firestore.js create mode 100644 themes/next/source/js/third-party/statistics/lean-analytics.js create mode 100644 themes/next/source/js/third-party/tags/mermaid.js create mode 100644 themes/next/source/js/third-party/tags/pdf.js create mode 100644 themes/next/source/js/third-party/tags/wavedrom.js create mode 100644 themes/next/source/js/utils.js create mode 100644 themes/next/test/helpers/font.js create mode 100644 themes/next/test/helpers/index.js create mode 100644 themes/next/test/helpers/next-url.js create mode 100644 themes/next/test/index.js create mode 100644 themes/next/test/tags/button.js create mode 100644 themes/next/test/tags/caniuse.js create mode 100644 themes/next/test/tags/center-quote.js create mode 100644 themes/next/test/tags/group-pictures.js create mode 100644 themes/next/test/tags/index.js create mode 100644 themes/next/test/tags/label.js create mode 100644 themes/next/test/tags/link-grid.js create mode 100644 themes/next/test/tags/mermaid.js create mode 100644 themes/next/test/tags/note.js create mode 100644 themes/next/test/tags/pdf.js create mode 100644 themes/next/test/tags/tabs.js create mode 100644 themes/next/test/tags/video.js create mode 100644 themes/next/test/validate/index.js diff --git a/package-lock.json b/package-lock.json index c2e9eed..84d9be8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,8 +25,7 @@ "hexo-renderer-marked": "6.0.0", "hexo-renderer-stylus": "3.0.0", "hexo-server": "3.0.0", - "hexo-theme-landscape": "1.0.0", - "hexo-theme-next": "git+https://github.com/eddy1937/hexo-theme-next.git#develop" + "hexo-theme-landscape": "1.0.0" } }, "node_modules/@adobe/css-tools": { @@ -4497,11 +4496,6 @@ "resolved": "https://registry.npmjs.org/hexo-theme-landscape/-/hexo-theme-landscape-1.0.0.tgz", "integrity": "sha512-bWQJWMqQI78wWiJPQZq5pJBH20TM442ShCaHGRetuEgMraxH0OKxB3NTupJzNEkzEk8DV2yrdizkXdKN6i501A==" }, - "node_modules/hexo-theme-next": { - "version": "8.19.2", - "resolved": "git+ssh://git@github.com/eddy1937/hexo-theme-next.git#9300b32e24a205c30c6660064b413f8326c07e7d", - "license": "AGPL-3.0-only" - }, "node_modules/hexo-util": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/hexo-util/-/hexo-util-3.3.0.tgz", diff --git a/package.json b/package.json index a7489a4..2e54376 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,6 @@ "hexo-renderer-marked": "6.0.0", "hexo-renderer-stylus": "3.0.0", "hexo-server": "3.0.0", - "hexo-theme-landscape": "1.0.0", - "hexo-theme-next": "git+https://github.com/eddy1937/hexo-theme-next.git#develop" + "hexo-theme-landscape": "1.0.0" } } diff --git a/themes/next/.editorconfig b/themes/next/.editorconfig new file mode 100644 index 0000000..2305854 --- /dev/null +++ b/themes/next/.editorconfig @@ -0,0 +1,11 @@ +# editorconfig.org + +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = space +indent_size = 2 diff --git a/themes/next/.eslintrc.json b/themes/next/.eslintrc.json new file mode 100644 index 0000000..46b2439 --- /dev/null +++ b/themes/next/.eslintrc.json @@ -0,0 +1,4 @@ +{ + "extends": "@next-theme", + "root": true +} diff --git a/themes/next/.gitattributes b/themes/next/.gitattributes new file mode 100644 index 0000000..ac1222d --- /dev/null +++ b/themes/next/.gitattributes @@ -0,0 +1 @@ +test/* linguist-vendored diff --git a/themes/next/.githooks/install.js b/themes/next/.githooks/install.js new file mode 100644 index 0000000..644c33d --- /dev/null +++ b/themes/next/.githooks/install.js @@ -0,0 +1,8 @@ +const { spawn } = require('child_process'); +const path = require('path'); + +const subprocess = spawn('git', ['config', '--local', 'core.hooksPath', path.join(__dirname, '.githooks/')]); + +subprocess.on('error', () => { + console.error('Failed to install git hook.'); +}); diff --git a/themes/next/.githooks/pre-commit b/themes/next/.githooks/pre-commit new file mode 100755 index 0000000..c56e0af --- /dev/null +++ b/themes/next/.githooks/pre-commit @@ -0,0 +1 @@ +npm run eslint && npm test diff --git a/themes/next/.github/CODE_OF_CONDUCT.md b/themes/next/.github/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..e155045 --- /dev/null +++ b/themes/next/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,97 @@ +
+ Language: + :us: + :cn: + :ru: +
+ +NexT logo + +# NexT + +[NexT](https://theme-next.js.org) is an elegant and powerful theme for [Hexo](https://hexo.io/). With it, you can build a static blog hosted on [GitHub Pages](https://pages.github.com/) to share your life and communicate with new friends. + +A CODE_OF_CONDUCT dictates how conversation during code updates, issue communication, and pull requests should happen within [NexT](https://github.com/next-theme/hexo-theme-next) repository. We expect all users to show respect and courtesy to others through our repositories. Anyone violating these rules will not be reviewed and will be blocked and expelled from our repositories immediately upon discovery. + +## Table Of Contents + +- [Our Pledge](#our-pledge) +- [Our Responsibilities](#our-responsibilities) +- [Our Standards](#our-standards) +- [Scope](#scope) +- [Enforcement](#enforcement) +- [Contacting Maintainers](#contacting-maintainers) +- [Attribution](#attribution) + +## Our Pledge + +As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities. + +In the interest of fostering an open and welcoming environment, we are committed to making participation in our community a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual identity and orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality. + +## Our Responsibilities + +Project maintainers have the right and responsibility to clarify the standards of acceptable behavior and are expected to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to block temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Our Standards + +As a project on GitHub, this project is overed by the [GitHub Community Guidelines](https://help.github.com/articles/github-community-guidelines/). Additionally, as a project hosted on npm, it is covered by [npm Inc's Code of Conduct](https://www.npmjs.com/policies/conduct). + +Examples of behavior that contributes to creating a positive environment include: + +* Using welcoming and inclusive language. +* Being respectful of differing viewpoints and experiences. +* Gracefully accepting constructive feedback. +* Focusing on what is best for the community. +* Showing empathy and kindness towards other community members. + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others’ private information, such as a physical or electronic address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. + +Depending on the violation, the maintainers may decide that violations of this code of conduct that have happened outside of the scope of the community may deem an individual unwelcome, and take appropriate action to maintain the comfort and safety of its members. + +## Enforcement + +If you see a Code of Conduct violation, follow these steps: + +1. Let the person know that what they did is not appropriate and ask them to stop and/or edit their message(s) or commits. That person should immediately stop the behavior and correct the issue. +2. If this doesn’t happen, or if you're uncomfortable speaking up, [contact the maintainers](#contacting-maintainers). When reporting, please include any relevant details, links, screenshots, context, or other information that may be used to better understand and resolve the situation. +3. As soon as available, a maintainer will look into the issue, and take further action. + +Once the maintainers get involved, they will follow a documented series of steps and do their best to preserve the well-being of project members. + +All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. + +Thesehese are the steps maintainers will take for further enforcement, as needed: + +1. Repeat the request to stop. +2. If the person doubles down, they will have offending messages removed or edited by a maintainers given an official warning. The PR or Issue may be locked. +3. If the behavior continues or is repeated later, the person will be blocked from participating for 24 hours. +4. If the behavior continues or is repeated after the temporary block, a long-term (6-12 months) ban will be used. + +On top of this, maintainers may remove any offending messages, images, contributions, etc, as they deem necessary. Maintainers reserve full rights to skip any of these steps, at their discretion, if the violation is considered to be a serious and/or immediate threat to the well-being of members of the community. These include any threats, serious physical or verbal attacks, and other such behavior that would be completely unacceptable in any social setting that puts our members at risk. + +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. + +## Contacting Maintainers + +You may get in touch with the maintainer team through any of the following methods: + +* Through Discussions: + * [GitHub Discussions](https://github.com/next-theme/hexo-theme-next/discussions) + +* Through Chat: + * [Gitter](https://app.gitter.im/#/room/#next:gitter.im) + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/) and [WeAllJS Code of Conduct](https://wealljs.org/code-of-conduct). diff --git a/themes/next/.github/CONTRIBUTING.md b/themes/next/.github/CONTRIBUTING.md new file mode 100644 index 0000000..d951fbf --- /dev/null +++ b/themes/next/.github/CONTRIBUTING.md @@ -0,0 +1,182 @@ +
+ Language: + :us: + :cn: + :ru: +
+ +NexT logo + +# NexT + +First of all, thanks for taking your time to contribute and help make our project even better than it is today! The following is a set of guidelines for contributing to [Theme NexT](https://github.com/next-theme) and its libs submodules. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request. + +## Table Of Contents + +[How Can I Contribute?](#how-can-i-contribute) + + * [Before Submitting An Issue](#before-submitting-an-issue) + * [Read the docs](#read-the-docs) + * [Quick debug instructions](quick-debug-instructions) + * [Reporting Bugs](#reporting-bugs) + * [Reporting Security Bugs](#reporting-security-bugs) + * [Suggesting Enhancements](#suggesting-enhancements) + * [Submitting a Pull Request](#submitting-a-pull-request) + * [Creating Releases](#creating-releases) + +[Guides](#guides) + + * [Coding Rules](#coding-rules) + * [Coding Standards](#coding-standards) + * [Labels Rules](#labels-rules) + * [Commit Messages Rules](#commit-messages-rules) + +## How Can I Contribute? + +### Before Submitting An Issue + +#### Read the docs + +If you just have a question, you'll get faster results by checking the [FAQs for a list of common questions and problems](https://theme-next.js.org/docs/faqs) or the [troubleshooting part of «NexT» Documentation Site](https://theme-next.js.org/docs/troubleshooting). + +Also, you can perform a [cursory search](https://github.com/next-theme/hexo-theme-next/search?q=&type=Issues&utf8=%E2%9C%93) to see if the problem has already been reported or solved. You don't want to duplicate effort. You might be able to find the cause of the problem and fix things yourself, or add comments to the existed issue. + +#### Quick debug instructions + +Before submitting an Issue on GitHub, you can follow our [Quick debug instructions](https://theme-next.js.org/docs/troubleshooting.html#Quick-Debug-Instructions) to debug. + +If you find a bug in the source code, most importantly, please check carefully if you can reproduce the problem [in the latest release version of NexT](https://github.com/next-theme/hexo-theme-next/releases/latest). Then, you can help us by [Reporting Bugs](#reporting-bugs) or [Suggesting Enhancements](#suggesting-enhancements) to our [Repository](https://github.com/next-theme/hexo-theme-next). Even better, you can [submit a Pull Request](#submitting-a-pull-request) with a fix. + +### Reporting Bugs + +Before creating bug reports, please check [this list](#before-submitting-an-issue) as you might find out that you don't need to create one. When creating an issue, following these guidelines helps maintainers and the community understand your report :pencil:, reproduce the behavior, and find related reports: + +* Use a clear and descriptive title for the issue to identify the problem. +* Provide the information as many details as possible by filling in [the required template](ISSUE_TEMPLATE.md). +* Describe the exact steps which reproduce the problem in as many details as possible. When listing steps, don't just say what you did, but explain how you did it, e.g. which command exactly you used. If you're providing snippets in the issue, use [Markdown code blocks](https://help.github.com/articles/creating-and-highlighting-code-blocks/) or [a permanent link to a code snippet](https://help.github.com/articles/creating-a-permanent-link-to-a-code-snippet/), or a [Gist link](https://gist.github.com/). +* Provide specific examples to demonstrate the steps. Include links to files (screenshots or GIFs) or live demo. +* Describe the behavior you observed after following the steps and point out what exactly is the problem with that behavior. +* Explain which behavior you expected to see instead and why. + +#### Reporting Security Bugs + +If you find a security issue, please act responsibly and report it not in the public issue tracker, but directly to us, so we can fix it before it can be exploited. Please send the related information to security@theme-next.com (desirable with using PGP for e-mail encryption). + +We will gladly special thanks to anyone who reports a vulnerability so that we can fix it. If you want to remain anonymous or pseudonymous instead, please let us know that; we will gladly respect your wishes. + +### Suggesting Enhancements + +Before creating enhancement suggestions, please check [this list](#before-submitting-an-issue) as you might find out that you don't need to create one. After you've determined the repository your enhancement suggestion is related to, create an issue on that repository and provide the information as many details as possible by filling in [the required template](ISSUE_TEMPLATE.md). + +Following these guidelines helps maintainers and the community understand your suggestion :pencil: and find related suggestions. + +* Use a clear and descriptive title for the issue to identify the suggestion. +* Describe the current behavior and explain which behavior you expected to see instead and Explain why this enhancement would be useful to most users. +* Provide specific examples to demonstrate the suggestion. Include links to files (screenshots or GIFs) or live demo. + +### Submitting a Pull Request + +Before creating a Pull Request (PR), please check [this list](#before-submitting-an-issue) as you might find out that you don't need to create one. After you've determined the repository your pull request is related to, create a pull request on that repository. The detailed document of creating a pull request can be found [here](https://help.github.com/articles/creating-a-pull-request/). + +Following these guidelines helps maintainers and the community understand your pull request :pencil:: + +* Follow our [Coding Rules](#coding-rules) and [commit message conventions](#commit-messages-rules). +* Use a clear and descriptive title for the issue to identify the pull request. Do not include issue numbers in the PR title. +* Fill in [the required template](PULL_REQUEST_TEMPLATE.md) as many details as possible. +* All features or bug fixes must be tested in all schemes. And provide specific examples to demonstrate the pull request. Include links to files (screenshots or GIFs) or live demo. + +### Creating Releases + +Releases are a great way to ship projects on GitHub to your users. + +1. On GitHub, navigate to the main page of the repository. Under your repository name, click **Releases**. Click **Draft a new release**. +2. Type a version number for your release. Versions are based on [Git tags](https://git-scm.com/book/en/Git-Basics-Tagging). We recommend naming tags that fit within [About Major and Minor NexT versions](https://github.com/theme-next/hexo-theme-next/issues/187). +3. Select a branch that contains the project you want to release. Usually, you'll want to release against your `master` branch, unless you're releasing beta software. +4. Type a title and description that describes your release. + - Use the version as the title. + - The content should be filled in according to the template of the [Release Drafter](https://github.com/release-drafter/release-drafter). + - Use the passive tense and subject-less sentences. + - All changes must be documented in release notes. If commits happen without pull request (minimal changes), just add this commit ID into release notes. If commits happen within pull request alreay, just add the related pull request ID including all possible commits. +5. If you'd like to include binary files along with your release, such as compiled programs, drag and drop or select files manually in the binaries box. +6. If the release is unstable, select **This is a pre-release** to notify users that it's not ready for production. If you're ready to publicize your release, click **Publish release**. Otherwise, click **Save draft** to work on it later. + +## Guides + +### Coding Rules + +This project and everyone participating in it is governed by the [Code of Conduct](CODE_OF_CONDUCT.md) to keep open and inclusive. By participating, you are expected to uphold this code. + +### Coding Standards + +We use ESLint and Stylint for identifying and reporting on patterns in JavaScript and Stylus, with the goal of making code more consistent and avoiding bugs. These specifications should be followed when coding. + +### Labels Rules + +We use "labels" in the issue tracker to help classify Pull requests and Issues. Using labels enables maintainers and users to quickly find issues they should look into, either because they experience them, or because it meets their area of expertise. + +If you are unsure what a label is about or which labels you should apply to a PR or issue, look no further! + +Issues related: + +- By types + - `Bug`: A detected bug that needs to be confirmed + - `Feature Request`: An issue that wants a new feature + - `Question`: An issue about questions + - `Meta`: Denoting a change of usage conditions + - `Support`: An issue labeled as support requests + - `Polls`: An issue that initiated a poll +- By results + - `Duplicate`: An issue which had been mentioned + - `Hexo`: An issue related to Hexo + - `Hexo Plugin`: An issue related to Hexo plugins + - `Browser`: An issue related to browsers + - `Invalid`: An issue that cannot be reproduced + - `Expected Behavior`: An issue that corresponds to expected behavior + - `Need More Info`: Need more information for solving the issue + - `Solved`: An issue that has been solved + - `To Do`: An issue that is to be completed and later compensated + - `Stale`: This issue has been automatically marked as stale because lack of recent activity + +Pull requests related: + +- `Breaking Change`: A pull request that makes breaking change +- `Bug Fix`: A pull request that fixes the related bug +- `New Feature`: A pull request that provides a new feature +- `Feature`: A pull request that provides an option or addition to existing feature +- `i18n`: A pull request that makes new languages translation +- `Dependencies`: A pull request that updates package dependencies +- `Actions`: A pull request that updates the GitHub Actions workflow +- `Skip Release`: A pull request that should be excluded from release note + +Both: + +- `Roadmap`: An issue / pull request about future development +- `Help Wanted`: An issue / pull request that needs help +- `Improvement`: An issue that needs improvement or a pull request that improves NexT +- `Layout`: An issue / pull request related to template engine +- `CSS`: An issue / pull request related to CSS +- `Icons & Fonts`: An issue / pull request related to icons or fonts +- `PJAX`: An issue / pull request related to PJAX +- `3rd Party Plugin`: An issue / pull request related to 3rd party plugins & service +- `Docs`: An issue / pull request related to instruction document +- `Configurations`: An issue / pull request related to configurations + +### Commit Messages Rules + +We have very precise rules over how our git commit messages can be formatted. Each commit message consists of a `type` and a `subject`. This leads to more +readable messages that are easy to follow when looking through the project history. + +- `type` describes the meaning of this commit including but not limited to the following items, and capitalize the first letter. + * `Build`: Changes that affect the build system or external dependencies + * `Ci`: Changes to our CI configuration files and scripts + * `Docs`: Documentation only changes + * `Feat`: A new feature + * `Fix`: A bug fix + * `Perf`: A code change that improves performance + * `Refactor`: A code change that neither fixes a bug nor adds a feature + * `Style`: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) + * `Revert`: Revert some existing commits + * `Release`: Commit a release for a conventional changelog project +- The `subject` contains a succinct description of the change, like `Update code highlighting in README.md`. + * No dot (.) at the end. + * Use the imperative, present tense: "change" not "changed" nor "changes". diff --git a/themes/next/.github/ISSUE_TEMPLATE/bug-report.yml b/themes/next/.github/ISSUE_TEMPLATE/bug-report.yml new file mode 100644 index 0000000..ea76825 --- /dev/null +++ b/themes/next/.github/ISSUE_TEMPLATE/bug-report.yml @@ -0,0 +1,97 @@ +name: Bug report +description: Something isn't working as expected +#title: "" +labels: + - Bug +#assignees: "" +body: + - type: markdown + id: overall + attributes: + value: | + Please follow this Issue template to provide relevant information, such as source code repository, website URL and screenshots, which will help us investigate. + 请按照此 Issue 模版提供相关信息,例如源码仓库、网站链接和屏幕截图,这将有助于我们进行调查。 + - type: checkboxes + id: checklist + attributes: + label: Issue Checklist + description: | + (我确认我已经查看了) + options: + - label: I am using NexT version 8.0 or later. + required: true + - label: I have already read the [Troubleshooting page of Hexo](https://hexo.io/docs/troubleshooting) and [Troubleshooting page of NexT](https://theme-next.js.org/docs/troubleshooting.html). + required: true + - label: I have already searched for current [issues](https://github.com/next-theme/hexo-theme-next/issues), which does not help me. + required: true + - type: textarea + id: expected-behavior + attributes: + label: Expected behavior + description: "(预期行为)" + validations: + required: true + - type: textarea + id: actual-behavior + attributes: + label: Actual behavior + description: | + (实际行为) + Please provide the following information (请同时提供网站链接和屏幕截图) + value: | + - Links to demo site with this issue: + - Links to repository or source code of the blog: + - Screenshots: + validations: + required: true + - type: textarea + id: reproduce + attributes: + label: Steps to reproduce the behavior + description: "(重现步骤)" + validations: + required: true + - type: markdown + id: env + attributes: + value: | + ## Environment Information + - type: textarea + id: nodejs-info + attributes: + label: Node.js and NPM Information + description: "Paste output from `node -v && npm -v` (粘贴 `node -v && npm -v` 输出的信息)" + render: Text + validations: + required: true + - type: textarea + id: dependencies + attributes: + label: Package dependencies Information + description: "Paste output from `npm ls --depth 0` in Hexo root directory (粘贴在 Hexo 根目录下 `npm ls --depth 0` 输出的信息)" + render: Text + validations: + required: true + - type: textarea + id: hexo-config + attributes: + label: Hexo Configuration + description: "Paste configuration from Hexo `_config.yml` (粘贴 Hexo `_config.yml` 中的内容)" + render: YAML + validations: + required: true + - type: textarea + id: next-config + attributes: + label: NexT Configuration + description: "Paste ONLY CHANGED CONFIGURATION from NexT `_config.yml` (只粘贴 NexT 主题配置文件 `_config.yml` 中修改过的部分)" + render: YAML + validations: + required: true + - type: textarea + id: other-info + attributes: + label: Other Information + description: "e.g. Browser, System" + validations: + required: false diff --git a/themes/next/.github/ISSUE_TEMPLATE/config.yml b/themes/next/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..701d65a --- /dev/null +++ b/themes/next/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: GitHub Discussions + url: https://github.com/next-theme/hexo-theme-next/discussions + about: Please ask and answer questions here. diff --git a/themes/next/.github/ISSUE_TEMPLATE/feature-request.yml b/themes/next/.github/ISSUE_TEMPLATE/feature-request.yml new file mode 100644 index 0000000..032ade5 --- /dev/null +++ b/themes/next/.github/ISSUE_TEMPLATE/feature-request.yml @@ -0,0 +1,60 @@ +name: Feature Request +description: Suggest an idea for this project +#title: "" +labels: + - Feature Request +#assignees: "" +body: + - type: markdown + id: overall + attributes: + value: | + Please follow this Issue template to provide relevant information, such as source code repository, website URL and screenshots, which will help us investigate. + 请按照此 Issue 模版提供相关信息,例如源码仓库、网站链接和屏幕截图,这将有助于我们进行调查。 + - type: checkboxes + id: checklist + attributes: + label: Issue Checklist + description: | + (我确认我已经查看了) + options: + - label: I am using NexT version 8.0 or later. + required: true + - label: I have already read the [Troubleshooting page of Hexo](https://hexo.io/docs/troubleshooting) and [Troubleshooting page of NexT](https://theme-next.js.org/docs/troubleshooting.html). + required: true + - label: I have already searched for current [issues](https://github.com/next-theme/hexo-theme-next/issues), which does not help me. + required: true + - type: textarea + id: expected-behavior + attributes: + label: Expected behavior + description: "(预期行为)" + validations: + required: true + - type: textarea + id: actual-behavior + attributes: + label: Actual behavior + description: | + (实际行为) + Please provide the following information (请同时提供网站链接和屏幕截图) + value: | + - Links to demo site with this issue: + - Links to repository or source code of the blog: + - Screenshots: + validations: + required: true + - type: textarea + id: reproduce + attributes: + label: Steps to reproduce the behavior + description: "(重现步骤)" + validations: + required: true + - type: textarea + id: other-info + attributes: + label: Other Information + description: "e.g. Browser, System" + validations: + required: false diff --git a/themes/next/.github/ISSUE_TEMPLATE/other.yml b/themes/next/.github/ISSUE_TEMPLATE/other.yml new file mode 100644 index 0000000..92c30b2 --- /dev/null +++ b/themes/next/.github/ISSUE_TEMPLATE/other.yml @@ -0,0 +1,33 @@ +name: Other +description: Not a feature request or bug report +#title: "" +labels: + - Question +#assignees: "" +body: + - type: markdown + id: overall + attributes: + value: | + Please follow this Issue template to provide relevant information, such as source code repository, website URL and screenshots, which will help us investigate. + 请按照此 Issue 模版提供相关信息,例如源码仓库、网站链接和屏幕截图,这将有助于我们进行调查。 + - type: checkboxes + id: checklist + attributes: + label: Issue Checklist + description: | + (我确认我已经查看了) + options: + - label: I am using NexT version 8.0 or later. + required: true + - label: I have already read the [Troubleshooting page of Hexo](https://hexo.io/docs/troubleshooting) and [Troubleshooting page of NexT](https://theme-next.js.org/docs/troubleshooting.html). + required: true + - label: I have already searched for current [issues](https://github.com/next-theme/hexo-theme-next/issues), which does not help me. + required: true + - type: textarea + id: other-info + attributes: + label: Other Information + description: "e.g. Browser, System" + validations: + required: true diff --git a/themes/next/.github/PULL_REQUEST_TEMPLATE.md b/themes/next/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..efe1942 --- /dev/null +++ b/themes/next/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,45 @@ + + +## PR Checklist + + +- [ ] The commit message follows [guidelines for NexT](https://github.com/next-theme/hexo-theme-next/blob/master/.github/CONTRIBUTING.md). +- [ ] The changes have been tested (for bug fixes / features). +- [ ] [Docs](https://github.com/next-theme/theme-next-docs/tree/master/source/docs) in [NexT website](https://theme-next.js.org/docs/) have been added / updated (for features). + + +## PR Type + + +- [ ] Bugfix. +- [ ] Feature. +- [ ] Improvement. +- [ ] Code style update (formatting, linting). +- [ ] Refactoring (no functional changes). +- [ ] Documentation. +- [ ] Translation. +- [ ] Other... Please describe: + +## What is the current behavior? + + +Issue resolved: + +## What is the new behavior? + + +- Link to demo site with this changes: +- Screenshots with this changes: + +### How to use? + +In NexT `_config.yml`: +```yml + +``` diff --git a/themes/next/.github/config.yml b/themes/next/.github/config.yml new file mode 100644 index 0000000..d2eb157 --- /dev/null +++ b/themes/next/.github/config.yml @@ -0,0 +1,14 @@ +# =============================================================================================== # +# Configuration for welcome - https://github.com/behaviorbot/welcome + +# Comment to be posted to on first time issues +newIssueWelcomeComment: > + Thanks for opening this issue, maintainers will get back to you as soon as possible! + +# Comment to be posted to on PRs from first time contributors in your repository +newPRWelcomeComment: > + Thanks so much for opening your first PR here! + +# Comment to be posted to on pull requests merged by a first time user +firstPRMergeComment: > + Congrats on merging your first pull request here! :tada: How awesome! diff --git a/themes/next/.github/issue_label_bot.yaml b/themes/next/.github/issue_label_bot.yaml new file mode 100644 index 0000000..a0d4c94 --- /dev/null +++ b/themes/next/.github/issue_label_bot.yaml @@ -0,0 +1,4 @@ +label-alias: + bug: 'Bug' + feature_request: 'Feature Request' + question: 'Question' diff --git a/themes/next/.github/label-commenter-config.yml b/themes/next/.github/label-commenter-config.yml new file mode 100644 index 0000000..19a196b --- /dev/null +++ b/themes/next/.github/label-commenter-config.yml @@ -0,0 +1,35 @@ +# Configuration for Label Commenter - https://github.com/peaceiris/actions-label-commenter + +labels: + - name: Invalid + labeled: + issue: + body: This issue has been closed because it does not seem right. + action: close + - name: Need More Info + labeled: + issue: + body: We would appreciate it if you could provide us with more info about this issue! + - name: 🎯 Roadmap + labeled: + issue: + body: | + This issue has been added to the latest roadmap. :tada: + - name: Support + labeled: + issue: + body: | + :wave: Hey there! we use the issue tracker exclusively for bug reports and feature requests. However, this issue appears to be a support request. + Please use our [support channels](https://github.com/next-theme/hexo-theme-next#feedback) to get help with the project. + action: close + - name: Wontfix + labeled: + issue: + body: This will not be worked on but we appreciate your contribution. + action: close + - name: Configurations + labeled: + pr: + body: | + This pull request contains changes to the configuration file. Please make sure the documentation in [NexT website](https://theme-next.js.org/docs/) is changed or added. + Please edit relevant source files here: https://github.com/next-theme/theme-next-docs/tree/master/source/docs and create a pull request with the changes here: https://github.com/next-theme/theme-next-docs/pulls diff --git a/themes/next/.github/labeler.yml b/themes/next/.github/labeler.yml new file mode 100644 index 0000000..a23c799 --- /dev/null +++ b/themes/next/.github/labeler.yml @@ -0,0 +1,26 @@ +# Configuration for labeler - https://github.com/actions/labeler + +📦 Dependencies: +- changed-files: + - any-glob-to-any-file: package.json +Configurations: +- changed-files: + - any-glob-to-any-file: _config.yml +CSS: +- changed-files: + - any-glob-to-any-file: source/css/**/* +📖 Docs: +- changed-files: + - any-glob-to-any-file: docs/**/* +Layout: +- changed-files: + - any-glob-to-any-file: layout/**/* +🌍 i18n: +- changed-files: + - any-glob-to-any-file: languages/**/* +Actions: +- changed-files: + - any-glob-to-any-file: .github/workflows/**/* +🔌 3rd Party Plugin: +- changed-files: + - any-glob-to-any-file: '**/*third-party/**/*' diff --git a/themes/next/.github/release.yml b/themes/next/.github/release.yml new file mode 100644 index 0000000..21799dc --- /dev/null +++ b/themes/next/.github/release.yml @@ -0,0 +1,38 @@ +changelog: + categories: + - title: '💥 Breaking Changes' + labels: + - '💥 Breaking Change' + + - title: '🌟 New Features' + labels: + - '🌟 New Feature' + + - title: '⭐ Features' + labels: + - '⭐ Feature' + + - title: '🐞 Bug Fixes' + labels: + - '🐞 Bug Fix' + + - title: '🛠 Improvements' + labels: + - '🛠 Improvement' + + - title: '🌀 External Changes' + labels: + - '📦 Dependencies' + - 'Actions' + + - title: '📖 Documentation' + labels: + - '📖 Docs' + + - title: '🌍 Localization' + labels: + - '🌍 i18n' + + exclude: + labels: + - 'Skip Release' diff --git a/themes/next/.github/workflows/codeql.yml b/themes/next/.github/workflows/codeql.yml new file mode 100644 index 0000000..fbe049a --- /dev/null +++ b/themes/next/.github/workflows/codeql.yml @@ -0,0 +1,41 @@ +name: "CodeQL" + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + schedule: + - cron: "33 18 * * 0" + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ javascript ] + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + queries: +security-and-quality + + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{ matrix.language }}" diff --git a/themes/next/.github/workflows/label-commenter.yml b/themes/next/.github/workflows/label-commenter.yml new file mode 100644 index 0000000..b7106c3 --- /dev/null +++ b/themes/next/.github/workflows/label-commenter.yml @@ -0,0 +1,19 @@ +name: Label Commenter + +on: + issues: + types: + - labeled + pull_request_target: + types: + - labeled + +jobs: + comment: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: master + - name: Label Commenter + uses: peaceiris/actions-label-commenter@v1 diff --git a/themes/next/.github/workflows/labeler.yml b/themes/next/.github/workflows/labeler.yml new file mode 100644 index 0000000..500ce22 --- /dev/null +++ b/themes/next/.github/workflows/labeler.yml @@ -0,0 +1,13 @@ +name: Pull Request Labeler + +on: + - pull_request_target + +jobs: + triage: + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@v5 + # https://github.com/peaceiris/actions-label-commenter#work-with-other-auto-label-actions + with: + repo-token: "${{ secrets.GH_PAT }}" diff --git a/themes/next/.github/workflows/linter.yml b/themes/next/.github/workflows/linter.yml new file mode 100644 index 0000000..6e4f7c4 --- /dev/null +++ b/themes/next/.github/workflows/linter.yml @@ -0,0 +1,31 @@ +name: Linter + +on: [push, pull_request] + +jobs: + linter: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Use Node.js + uses: actions/setup-node@v4 + - name: Install Dependencies + run: npm install + - run: npm run eslint + - name: Coverage + run: npx c8 --reporter=lcovonly npm test + env: + CI: true + - name: Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + pip install curlylint + - run: curlylint --include .njk layout diff --git a/themes/next/.github/workflows/lock.yml b/themes/next/.github/workflows/lock.yml new file mode 100644 index 0000000..57e0779 --- /dev/null +++ b/themes/next/.github/workflows/lock.yml @@ -0,0 +1,19 @@ +# Configuration for Lock Threads - https://github.com/dessant/lock-threads +name: Lock Threads + +on: + schedule: + - cron: '0 0 * * *' + +jobs: + lock: + runs-on: ubuntu-latest + steps: + - uses: dessant/lock-threads@v5 + with: + github-token: ${{ github.token }} + issue-comment: > + This thread has been automatically locked since there has not been + any recent activity after it was closed. It is possible issue was + solved or at least outdated. Feel free to open new for related bugs. + process-only: 'issues' diff --git a/themes/next/.github/workflows/tester.yml b/themes/next/.github/workflows/tester.yml new file mode 100644 index 0000000..93a9de5 --- /dev/null +++ b/themes/next/.github/workflows/tester.yml @@ -0,0 +1,39 @@ +name: Tester + +on: [push, pull_request] + +jobs: + tester: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + fail-fast: false + steps: + - uses: actions/checkout@v4 + with: + repository: hexojs/hexo-starter + - name: Use Node.js + uses: actions/setup-node@v4 + - name: Install Dependencies + run: npm install + - name: Install hexo-tag-embed + run: npm install hexo-tag-embed + - uses: actions/checkout@v4 + with: + path: themes/next + - uses: actions/checkout@v4 + with: + repository: SukkaLab/hexo-many-posts + path: source/_posts/hexo-many-posts + - run: npx hexo config theme next + - uses: DamianReeves/write-file-action@master + with: + path: themes/next/scripts/error.js + contents: | + hexo.log.error = function(...params) { + console.error("ERROR", ...params); + process.exit(1); + } + - name: Test + run: npx hexo g diff --git a/themes/next/.gitignore b/themes/next/.gitignore new file mode 100644 index 0000000..1fcc5cb --- /dev/null +++ b/themes/next/.gitignore @@ -0,0 +1,10 @@ +.DS_Store +.idea/ +.vscode/ +*.log +*.iml +yarn.lock +package-lock.json +node_modules/ +.nyc_output/ +coverage/ diff --git a/themes/next/.stylelintrc b/themes/next/.stylelintrc new file mode 100644 index 0000000..e0c08bb --- /dev/null +++ b/themes/next/.stylelintrc @@ -0,0 +1,20 @@ +{ + "plugins": [ + "stylelint-stylus" + ], + "extends": [ + "stylelint-stylus/standard" + ], + "rules": { + "stylus/semicolon": "always", + "stylus/pythonic": "never", + "stylus/declaration-colon": "always", + "stylus/number-leading-zero": "never", + "stylus/selector-list-comma": "always", + "stylus/selector-list-comma-newline-after": "never-multi-line", + "stylus/media-feature-colon": "always", + "stylus/single-line-comment": null, + "stylus/single-line-comment-no-empty": null, + "stylus/block-closing-brace-newline-after": "never-single-line" + } +} diff --git a/themes/next/LICENSE.md b/themes/next/LICENSE.md new file mode 100644 index 0000000..f2f7f65 --- /dev/null +++ b/themes/next/LICENSE.md @@ -0,0 +1,59 @@ +#
«NexT» – Elegant and powerful theme for Hexo.
+ +

Copyright © 2017 «NexT».

+ +

Detail attribution information for «NexT»
+ is contained in the 'docs/AUTHORS.md' file.

+ + This program is free software; you can redistribute it and/or modify +it under the terms of the [GNU Affero General Public License version 3][AGPL3] +as published by the Free Software Foundation with the addition of the +following permission added to [Section 15][AGPL3-15] as permitted in [Section 7(a)][AGPL3-7]: +FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY «NEXT», +«NEXT» DISCLAIMS THE WARRANTY OF NON INFRINGEMENT OF THIRD PARTY RIGHTS. + + This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. +See the GNU Affero General Public License for more details. +You should have received a copy of the GNU Affero General Public License +along with this program; if not, see: https://www.gnu.org/licenses/agpl.txt + + In accordance with [Section 7(b)][AGPL3-7] of the GNU Affero General Public License: + +* a) It is not necessary to specify copyright in each source file of + this program because GitHub fully save commits of all modified files + with their authors and provides to see for this changes publicly. + +* b) For any part of the covered work in which the copyright not specified, + will mean this part owned by «NexT» in accord with terms in this file. + +* c) A covered work must retain «NexT» official website link + (https://theme-next.js.org) in footer section of every website created, + modified or manipulated by using «NexT». + «NexT» theme configuration must be: + ```yml + footer: + theme: + enable: true + ``` + Collaborators, best contributors and all authors specified in the + '[docs/AUTHORS.md][AUTHORS]' file of «NexT» repository under the + 'https://github.com/next-theme' organization can ignore theme info link + requirements. + +Anyone can be released from the requirements of the license by purchasing +a commercial license. Buying such a license is mandatory as soon as you +develop commercial activities involving the «NexT» software without +disclosing the source code of your own applications. +These activities include: + 1. Access to private repository with various premium features. + 2. Priority support for resolve all possible issues with «NexT». + 3. Priority support for implement all possible features to «NexT». + +

This license also available in text format.

+ +[AUTHORS]: docs/AUTHORS.md +[AGPL3]: docs/AGPL3.md +[AGPL3-7]: docs/AGPL3.md/#7-additional-terms +[AGPL3-15]: docs/AGPL3.md/#15-disclaimer-of-warranty diff --git a/themes/next/README.md b/themes/next/README.md new file mode 100644 index 0000000..9da93ce --- /dev/null +++ b/themes/next/README.md @@ -0,0 +1,192 @@ +
+ Language: + 🇺🇸 + 🇨🇳 + 🇷🇺 +
+ + + + + NexT preview + + +NexT logo + +# NexT + +> «NexT» is a high quality elegant [Hexo](https://hexo.io) theme. It is crafted from scratch with love. + +[![NPM version](https://img.shields.io/npm/v/hexo-theme-next?color=red&logo=npm&style=flat-square)](https://www.npmjs.com/package/hexo-theme-next) +[![NPM Downloads](https://img.shields.io/npm/dm/hexo-theme-next?logo=npm&style=flat-square)](https://www.npmjs.com/package/hexo-theme-next) +[![Required Hexo version](https://img.shields.io/badge/hexo-%3E=5.3.0-blue?style=flat-square&logo=hexo)](https://hexo.io) +[![License](https://img.shields.io/badge/license-%20AGPL-orange?style=flat-square&logo=gnu)](https://github.com/next-theme/hexo-theme-next/blob/master/LICENSE.md) +[![Build Status](https://img.shields.io/github/actions/workflow/status/next-theme/hexo-theme-next/linter.yml?branch=master&label=test&logo=github&style=flat-square)](https://github.com/next-theme/hexo-theme-next/actions?query=workflow%3ALinter) +[![Build Status](https://img.shields.io/github/actions/workflow/status/next-theme/hexo-theme-next/tester.yml?branch=master&logo=github&style=flat-square)](https://github.com/next-theme/hexo-theme-next/actions?query=workflow%3ATester) +[![Coverage Status](https://img.shields.io/coveralls/github/next-theme/hexo-theme-next?logo=coveralls&style=flat-square)](https://coveralls.io/github/next-theme/hexo-theme-next) + +## Live Preview + +

+ 💟 Muse | 🔯 Mist | ♓️ Pisces | ♊️ Gemini +
+
+ More «NexT» examples here. +

+ +## Installation + +If you're using Hexo 5.0 or later, the simplest way to install is through npm: + +```sh +$ cd hexo-site +$ npm install hexo-theme-next +``` + +Or you can clone the entire repository: + +```sh +$ cd hexo-site +$ git clone https://github.com/next-theme/hexo-theme-next themes/next +``` + +See [detailed installation instructions][docs-installation-url] if you want any other variant. + +After the installation, open Hexo config file and set `theme` variable to `next`. + +```yml +theme: next +``` + +## Configuration + +It is not recommended to directly modify any files in the NexT theme. Because this may cause errors (e.g. merge conflicts), and the modified files may be discarded when upgrading the theme. + +At present, NexT encourages users to use the [Alternate Theme Config][docs-configuration-url] to configure NexT. And it's easy to customize the layout or style of NexT using [Custom Files][docs-custom-files-url]. + +## Plugins + +Plugins extend and expand the functionality of NexT. There are two types of plugins: core plugins and third-party plugins. The core plugins are required by the basic functions of NexT. Third-party plugins provide a large number of optional features. + +Configuring these plugins is very easy. For example, if you want to enable `pjax` on your site, just set `pjax` to `true` in NexT config file: + +```yml +# Easily enable fast Ajax navigation on your website. +# For more information: https://github.com/next-theme/pjax +pjax: true +``` + +### Configure CDN + +Third-party plugins are loaded from [CDNJS](https://cdnjs.com) CDN by default. We also provide other optional CDNs, including the famous [UNPKG](https://unpkg.com) and [jsDelivr](https://www.jsdelivr.com). + +For example, if you want to use `unpkg` instead of `cdnjs` as the default CDN provider, you need to edit the following settings in NexT config file: + +```yml +vendors: + # ... + # Some contents... + # ... + plugins: unpkg +``` + +## Update + +A new version of NexT will be released every month. Please read the [release notes][docs-release-url] before updating the theme. You can update NexT by the following command. + +Install the latest version through npm: + +```sh +$ cd hexo-site +$ npm install hexo-theme-next@latest +``` + +Or update to the latest master branch: + +```sh +$ cd themes/next +$ git pull +``` + +**If you want to update from v5.x / v7.x to the latest version, read [this][docs-upgrade-url].** + +## Feedback + +* Visit the [Awesome NexT][awesome-next-url] list to share plugins and tutorials with other users. +* Join our [GitHub discussions][discussions-url] / [Gitter][gitter-url] chats. +* [Add or improve translation][i18n-url] in few seconds. +* Report a bug in [GitHub Issues][issues-bug-url]. +* Request a new feature on [GitHub][issues-feat-url]. +* Vote for [popular feature requests][feat-req-vote-url]. + +## Contributing + +We welcome you to join the development of NexT. Please see [contributing document][contributing-document-url]. 🤗 + +Also, we welcome Issue or PR to our [official-plugins][official-plugins-url]. + +## Contributors + +[![Contributors][contributors-image]][contributors-url] + +## Thanks + +«NexT» send special thanks to these great services that sponsor our core infrastructure: + + + +> GitHub allows us to host the Git repository and run the test suite. + + + + + + Netlify Logo + + + +> Netlify allows us to distribute the documentation. + + + + + + Netlify Logo + + + +> Crowdin allows us to translate conveniently the documentation. + + + + + + CDNJS Logo + + + +> Thanks CDNJS for providing public CDN service. + +## License + +[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fnext-theme%2Fhexo-theme-next.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fnext-theme%2Fhexo-theme-next?ref=badge_large) + +[docs-installation-url]: https://theme-next.js.org/docs/getting-started/installation.html +[docs-configuration-url]: https://theme-next.js.org/docs/getting-started/configuration.html +[docs-custom-files-url]: https://theme-next.js.org/docs/advanced-settings/custom-files.html +[docs-release-url]: https://github.com/next-theme/hexo-theme-next/releases +[docs-upgrade-url]: https://theme-next.js.org/docs/getting-started/upgrade.html + +[awesome-next-url]: https://github.com/next-theme/awesome-next +[discussions-url]: https://github.com/next-theme/hexo-theme-next/discussions +[gitter-url]: https://app.gitter.im/#/room/#next:gitter.im +[i18n-url]: https://crowdin.com/project/hexo-theme-next + +[issues-bug-url]: https://github.com/next-theme/hexo-theme-next/issues/new?assignees=&labels=Bug&template=bug-report.md +[issues-feat-url]: https://github.com/next-theme/hexo-theme-next/issues/new?assignees=&labels=Feature+Request&template=feature-request.md +[feat-req-vote-url]: https://github.com/next-theme/hexo-theme-next/issues?q=is%3Aopen+is%3Aissue+label%3A%22Feature+Request%22 + +[contributing-document-url]: https://github.com/next-theme/hexo-theme-next/blob/master/.github/CONTRIBUTING.md +[official-plugins-url]: https://github.com/next-theme +[contributors-image]: https://raw.githubusercontent.com/next-theme/contributors/master/contributors.svg +[contributors-url]: https://github.com/next-theme/hexo-theme-next/blob/master/docs/AUTHORS.md diff --git a/themes/next/_config.yml b/themes/next/_config.yml new file mode 100644 index 0000000..3e8c96c --- /dev/null +++ b/themes/next/_config.yml @@ -0,0 +1,928 @@ +# =============================================================== +# It's recommended to use Alternate Theme Config to configure NexT +# Modifying this file may result in merge conflict +# See: https://theme-next.js.org/docs/getting-started/configuration +# =============================================================== + +# --------------------------------------------------------------- +# Theme Core Configuration Settings +# See: https://theme-next.js.org/docs/theme-settings/ +# --------------------------------------------------------------- + +# Allow to cache content generation. +cache: + enable: true + +# Remove unnecessary files after hexo generate. +minify: false + +# Define custom file paths. +# Create your custom files in site directory `source/_data` and uncomment needed files below. +custom_file_path: + #head: source/_data/head.njk + #header: source/_data/header.njk + #sidebar: source/_data/sidebar.njk + #postMeta: source/_data/post-meta.njk + #postBodyStart: source/_data/post-body-start.njk + #postBodyEnd: source/_data/post-body-end.njk + #footer: source/_data/footer.njk + #bodyEnd: source/_data/body-end.njk + #variable: source/_data/variables.styl + #mixin: source/_data/mixins.styl + #style: source/_data/styles.styl + + +# --------------------------------------------------------------- +# Scheme Settings +# --------------------------------------------------------------- + +# Schemes +scheme: Muse +#scheme: Mist +#scheme: Pisces +#scheme: Gemini + +# Dark Mode +darkmode: false + + +# --------------------------------------------------------------- +# Site Information Settings +# --------------------------------------------------------------- + +favicon: + small: /images/favicon-16x16-next.png + medium: /images/favicon-32x32-next.png + apple_touch_icon: /images/apple-touch-icon-next.png + safari_pinned_tab: /images/logo.svg + #android_manifest: /manifest.json + +# Custom Logo (Warning: Do not support scheme Mist) +custom_logo: #/uploads/custom-logo.png + +# Creative Commons 4.0 International License. +# See: https://creativecommons.org/about/cclicenses/ +creative_commons: + # Available values: by | by-nc | by-nc-nd | by-nc-sa | by-nd | by-sa | cc-zero + license: by-nc-sa + # Available values: big | small + size: small + sidebar: false + post: false + # You can set a language value if you prefer a translated version of CC license, e.g. deed.zh + # CC licenses are available in 39 languages, you can find the specific and correct abbreviation you need on https://creativecommons.org + language: + +# Open graph settings +# See: https://hexo.io/docs/helpers#open-graph +open_graph: + enable: true + options: + #twitter_card: + #twitter_id: + #twitter_site: + #twitter_image: + #google_plus: + #fb_admins: + #fb_app_id: + + +# --------------------------------------------------------------- +# Menu Settings +# --------------------------------------------------------------- + +# Usage: `Key: /link/ || icon` +# Key is the name of menu item. If the translation for this item is available, the translated text will be loaded, otherwise the Key name will be used. Key is case-sensitive. +# Value before `||` delimiter is the target link, value after `||` delimiter is the name of Font Awesome icon. +# External url should start with http:// or https:// +menu: + #home: / || fa fa-home + #about: /about/ || fa fa-user + #tags: /tags/ || fa fa-tags + #categories: /categories/ || fa fa-th + #archives: /archives/ || fa fa-archive + #schedule: /schedule/ || fa fa-calendar + #sitemap: /sitemap.xml || fa fa-sitemap + #commonweal: /404/ || fa fa-heartbeat + +# Enable / Disable menu icons / item badges. +menu_settings: + icons: true + badges: false + + +# --------------------------------------------------------------- +# Sidebar Settings +# See: https://theme-next.js.org/docs/theme-settings/sidebar +# --------------------------------------------------------------- + +sidebar: + # Sidebar Position. + position: left + #position: right + + # Manual define the sidebar width. If commented, will be default for: + # Muse | Mist: 320 + # Pisces | Gemini: 240 + #width: 300 + + # Sidebar Display (only for Muse | Mist), available values: + # - post expand on posts automatically. Default. + # - always expand for all pages automatically. + # - hide expand only when click on the sidebar toggle icon. + # - remove totally remove sidebar including sidebar toggle. + display: post + + # Sidebar padding in pixels. + padding: 18 + # Sidebar offset from top menubar in pixels (only for Pisces | Gemini). + offset: 12 + +# Sidebar Avatar +avatar: + # Replace the default image and set the url here. + url: #/images/avatar.gif + # If true, the avatar will be displayed in circle. + rounded: false + # If true, the avatar will be rotated with the cursor. + rotated: false + +# Posts / Categories / Tags in sidebar. +site_state: true + +# Social Links +# Usage: `Key: permalink || icon` +# Key is the link label showing to end users. +# Value before `||` delimiter is the target permalink, value after `||` delimiter is the name of Font Awesome icon. +social: + #GitHub: https://github.com/yourname || fab fa-github + #E-Mail: mailto:yourname@gmail.com || fa fa-envelope + #Weibo: https://weibo.com/yourname || fab fa-weibo + #Twitter: https://twitter.com/yourname || fab fa-twitter + #FB Page: https://www.facebook.com/yourname || fab fa-facebook + #StackOverflow: https://stackoverflow.com/yourname || fab fa-stack-overflow + #YouTube: https://youtube.com/yourname || fab fa-youtube + #Instagram: https://instagram.com/yourname || fab fa-instagram + #Skype: skype:yourname?call|chat || fab fa-skype + +social_icons: + enable: true + icons_only: false + transition: false + +# Blog rolls +links_settings: + icon: fa fa-globe + # Available values: block | inline + layout: block + +links: + #Title: https://example.com + +# Table of Contents in the Sidebar +# Front-matter variable (nonsupport wrap expand_all). +toc: + enable: true + # Automatically add list number to toc. + number: true + # If true, all words will placed on next lines if header width longer then sidebar width. + wrap: false + # If true, all level of TOC in a post will be displayed, rather than the activated part of it. + expand_all: false + # Maximum heading depth of generated toc. + max_depth: 6 + + +# --------------------------------------------------------------- +# Footer Settings +# See: https://theme-next.js.org/docs/theme-settings/footer +# --------------------------------------------------------------- + +# Show multilingual switcher in footer. +language_switcher: false + +footer: + # Specify the year when the site was setup. If not defined, current year will be used. + #since: 2021 + + # Icon between year and copyright info. + icon: + # Icon name in Font Awesome. See: https://fontawesome.com/icons + name: fa fa-heart + # If you want to animate the icon, set it to true. + animated: false + # Change the color of icon, using Hex Code. + color: "#ff0000" + + # If not defined, `author` from Hexo `_config.yml` will be used. + # Set to `false` to disable the copyright statement. + copyright: + + # Powered by Hexo & NexT + powered: true + + # Beian ICP and gongan information for Chinese users. See: https://beian.miit.gov.cn, https://beian.mps.gov.cn + beian: + enable: false + icp: + # The digit in the num of gongan beian. + gongan_id: + # The full num of gongan beian. + gongan_num: + # The icon for gongan beian. Login and See: https://beian.mps.gov.cn/web/business/businessHome/website + gongan_icon_url: + + +# --------------------------------------------------------------- +# Post Settings +# See: https://theme-next.js.org/docs/theme-settings/posts +# --------------------------------------------------------------- + +# Use `description` in front-matter to specify post excerpt. +excerpt_description: true + +# Read more button +# If true, the read more button will be displayed in excerpt section. +read_more_btn: true + +# Post meta display settings +post_meta: + item_text: true + created_at: true + updated_at: + enable: true + another_day: true + categories: true + +# Post wordcount display settings +# Dependencies: https://github.com/next-theme/hexo-word-counter +symbols_count_time: + separated_meta: true + item_text_total: false + +# Use icon instead of the symbol # to indicate the tag at the bottom of the post +tag_icon: false + +# Donate (Sponsor) settings +# Front-matter variable (nonsupport animation). +reward_settings: + # If true, a donate button will be displayed in every article by default. + enable: false + animation: false + +reward: + #wechatpay: /images/wechatpay.png + #alipay: /images/alipay.png + #paypal: /images/paypal.png + #bitcoin: /images/bitcoin.png + +# Subscribe through Telegram Channel, Twitter, etc. +# Usage: `Key: permalink || icon` (Font Awesome) +follow_me: + #Twitter: https://twitter.com/username || fab fa-twitter + #Telegram: https://t.me/channel_name || fab fa-telegram + #WeChat: /images/wechat_channel.png || fab fa-weixin + #RSS: /atom.xml || fa fa-rss + +# Related popular posts +# Dependencies: https://github.com/sergeyzwezdin/hexo-related-posts +related_posts: + enable: false + icon: fa fa-signs-post + +# Post edit +# Easily browse and edit blog source code online. +post_edit: + enable: false + url: https://github.com/user-name/repo-name/tree/branch-name/subdirectory-name/ # Link for view source + #url: https://github.com/user-name/repo-name/edit/branch-name/subdirectory-name/ # Link for fork & edit + +# Show previous post and next post in post footer if exists +# Available values: left | right | false +post_navigation: left + + +# --------------------------------------------------------------- +# Custom Page Settings +# See: https://theme-next.js.org/docs/theme-settings/custom-pages +# --------------------------------------------------------------- + +# TagCloud settings for tags page. +tagcloud: + min: 12 # Minimum font size in px + max: 30 # Maximum font size in px + amount: 200 # Total amount of tags + orderby: name # Order of tags + order: 1 # Sort order + +# Google Calendar +# Share your recent schedule to others via calendar page. +calendar: + calendar_id: # Your Google account E-Mail + api_key: + orderBy: startTime + showLocation: false + offsetMax: 72 # Time Range + offsetMin: 4 # Time Range + showDeleted: false + singleEvents: true + maxResults: 250 + + +# --------------------------------------------------------------- +# Misc Theme Settings +# See: https://theme-next.js.org/docs/theme-settings/miscellaneous +# --------------------------------------------------------------- + +# Preload styles and preconnect CDN for fonts and plugins. +# For more information: https://www.w3.org/TR/resource-hints/#preconnect +preconnect: false + +# Set the text alignment in posts / pages. +text_align: + # Available values: start | end | left | right | center | justify | justify-all | match-parent + desktop: justify + mobile: justify + +# Reduce padding / margin indents on devices with narrow width. +mobile_layout_economy: false + +# Browser header panel color. +theme_color: + light: "#222" + dark: "#222" + +# Override browsers' default behavior. +body_scrollbar: + # Place the scrollbar over the content. + overlay: false + # Present the scrollbar even if the content is not overflowing. + stable: false + +codeblock: + # Code Highlight theme + # All available themes: https://theme-next.js.org/highlight/ + theme: + light: default + dark: stackoverflow-dark + prism: + light: prism + dark: prism-dark + # Add copy button on codeblock + copy_button: + enable: false + # Available values: default | flat | mac + style: + # Fold code block + fold: + enable: false + height: 500 + +back2top: + enable: true + # Back to top in sidebar. + sidebar: false + # Scroll percent label in b2t button. + scrollpercent: false + +# Reading progress bar +reading_progress: + enable: false + # Available values: left | right + start_at: left + # Available values: top | bottom + position: top + reversed: false + color: "#37c6c0" + height: 3px + +# Bookmark Support +bookmark: + enable: false + # Customize the color of the bookmark. + color: "#222" + # If auto, save the reading progress when closing the page or clicking the bookmark-icon. + # If manual, only save it by clicking the bookmark-icon. + save: auto + +# `Follow me on GitHub` banner in the top-right corner. +github_banner: + enable: false + permalink: https://github.com/yourname + + +# --------------------------------------------------------------- +# Font Settings +# --------------------------------------------------------------- +# Find fonts on Google Fonts (https://fonts.google.com) +# All fonts set here will have the following styles: +# light | light italic | normal | normal italic | bold | bold italic +# Be aware that setting too much fonts will cause site running slowly +# --------------------------------------------------------------- +# Web Safe fonts are recommended for `global` (and `title`): +# Arial | Tahoma | Helvetica | Times New Roman | Courier New | Verdana | Georgia | Palatino | Garamond | Comic Sans MS | Trebuchet MS +# --------------------------------------------------------------- + +font: + enable: false + + # Uri of fonts host, e.g. https://fonts.googleapis.com (Default). + host: + + # Font options: + # `external: true` will load this font family from `host` above. + # `family: Times New Roman`. Without any quotes. + # `size: x.x`. Use `em` as unit. Default: 1 (16px) + + # Global font settings used for all elements inside . + global: + external: true + family: Lato + size: + + # Font settings for site title (.site-title). + title: + external: true + family: + size: + + # Font settings for headlines (

to

). + headings: + external: true + family: + size: + + # Font settings for posts (.post-body). + posts: + external: true + family: + + # Font settings for and code blocks. + codes: + external: true + family: + + +# --------------------------------------------------------------- +# SEO Settings +# See: https://theme-next.js.org/docs/theme-settings/seo +# --------------------------------------------------------------- + +# If true, site-subtitle will be added to the title of index page. +# Remember to set up your site-subtitle in Hexo `_config.yml` (e.g. subtitle: Subtitle) +index_with_subtitle: false + +# Automatically add external URL with Base64 encrypt & decrypt. +exturl: false +# If true, an icon will be attached to each external URL +exturl_icon: true + +# Google Webmaster tools verification. +# See: https://developers.google.com/search +google_site_verification: + +# Bing Webmaster tools verification. +# See: https://www.bing.com/webmasters +bing_site_verification: + +# Yandex Webmaster tools verification. +# See: https://webmaster.yandex.ru +yandex_site_verification: + +# Baidu Webmaster tools verification. +# See: https://ziyuan.baidu.com/site +baidu_site_verification: + + +# --------------------------------------------------------------- +# Tags Settings +# See: https://theme-next.js.org/docs/tag-plugins/ +# --------------------------------------------------------------- + +# Note tag (bootstrap callout) +note: + # Note tag style values: + # - simple bootstrap callout old alert style. Default. + # - modern bootstrap callout new (v2-v3) alert style. + # - flat flat callout style with background, like on Mozilla or StackOverflow. + # - disabled disable all CSS styles import of note tag. + style: simple + icons: false + # Offset lighter of background in % for modern and flat styles (modern: -12 | 12; flat: -18 | 6). + # Offset also applied to label tag variables. This option can work with disabled note tag. + light_bg_offset: 0 + +# Tabs tag +tabs: + # Make the nav bar of tabs with long content stick to the top. + sticky: false + transition: + tabs: false + labels: true + +# PDF tag +# NexT will try to load pdf files natively, if failed, pdf.js will be used. +# So, you have to install the dependency of pdf.js if you want to use pdf tag and make it available to all browsers. +# Dependencies: https://github.com/next-theme/theme-next-pdf +pdf: + enable: false + # Default height + height: 500px + +# Mermaid tag +mermaid: + enable: false + # Available themes: default | dark | forest | neutral + theme: + light: default + dark: dark + +# WaveDrom tag +wavedrom: + enable: false + +# --------------------------------------------------------------- +# Third Party Plugins & Services Settings +# See: https://theme-next.js.org/docs/third-party-services/ +# More plugins: https://github.com/next-theme/awesome-next +# --------------------------------------------------------------- + +# --------------------------------------------------------------- +# Math Formulas Render Support +# See: https://theme-next.js.org/docs/third-party-services/math-equations +# Warning: Please install / uninstall the relevant renderer according to the documentation. +# Server-side plugin: https://github.com/next-theme/hexo-filter-mathjax +# --------------------------------------------------------------- + +math: + # Default (false) will load mathjax / katex script on demand. + # That is it only render those page which has `mathjax: true` in front-matter. + # If you set it to true, it will load mathjax / katex script EVERY PAGE. + every_page: false + + mathjax: + enable: false + # Available values: none | ams | all + tags: none + + katex: + enable: false + # See: https://github.com/KaTeX/KaTeX/tree/master/contrib/copy-tex + copy_tex: false + + +# --------------------------------------------------------------- +# External Libraries +# See: https://theme-next.js.org/docs/third-party-services/external-libraries +# --------------------------------------------------------------- + +# Easily enable fast Ajax navigation on your website. +# For more information: https://github.com/next-theme/pjax +pjax: false + +# FancyBox is a tool that offers a nice and elegant way to add zooming functionality for images. +# For more information: https://fancyapps.com/fancybox/ +fancybox: false + +# Medium Zoom is a JavaScript library for zooming images like Medium. +# Warning: Do not enable both `fancybox` and `mediumzoom`. +# For more information: https://medium-zoom.francoischalifour.com +mediumzoom: false + +# Vanilla JavaScript plugin for lazyloading images. +# For more information: https://apoorv.pro/lozad.js/demo/ +lazyload: false + +# Automatically insert whitespace between CJK and half-width characters. +# For more information: https://github.com/vinta/pangu.js +# Server-side plugin: https://github.com/next-theme/hexo-pangu +pangu: false + +# Prefetch links based on what is in the user's viewport. +# For more information: https://getquick.link +# Front-matter variable (nonsupport home archive). +quicklink: + enable: false + + # Home page and archive page can be controlled through home and archive options below. + # This configuration item is independent of `enable`. + home: false + archive: false + + # Default (true) will initialize quicklink after the load event fires. + delay: true + # Custom a time in milliseconds by which the browser must execute prefetching. + timeout: 3000 + # Default (true) will attempt to use the fetch() API if supported (rather than link[rel=prefetch]). + priority: true + + +# --------------------------------------------------------------- +# Animation Settings +# --------------------------------------------------------------- + +# Use Animate.css to animate everything. +# For more information: https://animate.style +motion: + enable: true + async: false + transition: + # All available transition variants: https://theme-next.js.org/animate/ + menu_item: fadeInDown + post_block: fadeIn + post_header: fadeInDown + post_body: fadeInDown + coll_header: fadeInLeft + # Only for Pisces | Gemini. + sidebar: fadeInUp + +# Progress bar in the top during page loading. +# For more information: https://github.com/CodeByZach/pace +pace: + enable: false + # All available colors: + # black | blue | green | orange | pink | purple | red | silver | white | yellow + color: blue + # All available themes: + # big-counter | bounce | barber-shop | center-atom | center-circle | center-radar | center-simple + # corner-indicator | fill-left | flat-top | flash | loading-bar | mac-osx | material | minimal + theme: minimal + +# Generate a ribbon in your website with HTML5 canvas. +# For more information: https://github.com/hustcc/ribbon.js +canvas_ribbon: + enable: false + size: 300 # The width of the ribbon + alpha: 0.6 # The transparency of the ribbon + zIndex: -1 # The display level of the ribbon + + +# --------------------------------------------------------------- +# Comments Settings +# See: https://theme-next.js.org/docs/third-party-services/comments +# --------------------------------------------------------------- + +# Multiple Comment System Support +comments: + # Available values: tabs | buttons + style: tabs + # Choose a comment system to be displayed by default. + # Available values: disqus | disqusjs | changyan | livere | gitalk | utterances + active: + # Setting `true` means remembering the comment system selected by the visitor. + storage: true + # Lazyload all comment systems. + lazyload: false + # Modify texts or order for any naves, here are some examples. + nav: + #disqus: + # text: Load Disqus + # order: -1 + #gitalk: + # order: -2 + +# Disqus +# For more information: https://disqus.com +disqus: + enable: false + shortname: + count: true + +# DisqusJS +# For more information: https://disqusjs.skk.moe +disqusjs: + enable: false + # API Endpoint of Disqus API (https://disqus.com/api/docs/). + # Leave api empty if you are able to connect to Disqus API. Otherwise you need a reverse proxy for it. + # For example: + # api: https://disqus.skk.moe/disqus/ + api: + apikey: # Register new application from https://disqus.com/api/applications/ + shortname: # See: https://disqus.com/admin/settings/general/ + +# Changyan +# For more information: https://changyan.kuaizhan.com +changyan: + enable: false + appid: + appkey: + # Show comments count + count: true + +# LiveRe comments system +# You can get your uid from https://livere.com/insight/myCode (General web site) +livere_uid: # + +# Gitalk +# For more information: https://gitalk.github.io +gitalk: + enable: false + github_id: # GitHub repo owner + repo: # Repository name to store issues + client_id: # GitHub Application Client ID + client_secret: # GitHub Application Client Secret + admin_user: # GitHub repo owner and collaborators, only these guys can initialize gitHub issues + distraction_free_mode: true # Facebook-like distraction free mode + # When the official proxy is not available, you can change it to your own proxy address + proxy: https://cors-anywhere.azm.workers.dev/https://github.com/login/oauth/access_token # This is official proxy address + # Gitalk's display language depends on user's browser or system environment + # If you want everyone visiting your site to see a uniform language, you can set a force language value + # Available values: en | es-ES | fr | ru | zh-CN | zh-TW + language: + +# Utterances +# For more information: https://utteranc.es +utterances: + enable: false + repo: user-name/repo-name # Github repository owner and name + # Available values: pathname | url | title | og:title + issue_term: pathname + # Available values: github-light | github-dark | preferred-color-scheme | github-dark-orange | icy-dark | dark-blue | photon-dark | boxy-light + theme: github-light + +# Isso +# For more information: https://isso-comments.de +isso: # + + +# --------------------------------------------------------------- +# Post Widgets & Content Sharing Services +# See: https://theme-next.js.org/docs/third-party-services/post-widgets +# --------------------------------------------------------------- + +# AddToAny Share. See: https://www.addtoany.com +addtoany: + enable: false + buttons: + - facebook + - twitter + + +# --------------------------------------------------------------- +# Statistics and Analytics +# See: https://theme-next.js.org/docs/third-party-services/statistics-and-analytics +# --------------------------------------------------------------- + +# Google Analytics +# See: https://analytics.google.com +google_analytics: + tracking_id: # + # By default, NexT will load an external gtag.js script on your site. + # If you only need the pageview feature, set the following option to true to get a better performance. + only_pageview: false + # only needed if you are using `only_pageview` mode, https://developers.google.com/analytics/devguides/collection/protocol/ga4 + measure_protocol_api_secret: + +# Baidu Analytics +# See: https://tongji.baidu.com +baidu_analytics: # + +# Growingio Analytics +# See: https://www.growingio.com +growingio_analytics: # + +# Cloudflare Web Analytics +# See: https://www.cloudflare.com/web-analytics/ +cloudflare_analytics: + +# Microsoft Clarity Analytics +# See: https://clarity.microsoft.com/ +clarity_analytics: # + +# Matomo Analytics +# See: https://matomo.org/ +matomo: + enable: false + server_url: # https://www.example.com/ + site_id: # + +# Umami Analytics +# See: https://umami.is/ +umami: + enable: false + script_url: # https://umami.example.com/script.js + website_id: # + host_url: # + +# Plausible Analytics +# See: https://plausible.io/ +plausible: + enable: false + script_url: # https://plausible.io/js/script.js + site_domain: # www.example.com + +# Show number of visitors of each article. +# You can visit https://www.leancloud.cn to get AppID and AppKey. +leancloud_visitors: + enable: false + app_id: # + app_key: # + # Required for apps from CN region + server_url: # + # Dependencies: https://github.com/theme-next/hexo-leancloud-counter-security + # If you don't care about security in leancloud counter and just want to use it directly + # (without hexo-leancloud-counter-security plugin), set `security` to `false`. + security: true + +# Another tool to show number of visitors to each article. +# Visit https://console.firebase.google.com/u/0/ to get apiKey and projectId. +# Visit https://firebase.google.com/docs/firestore/ to get more information about firestore. +firestore: + enable: false + collection: articles # Required, a string collection name to access firestore database + apiKey: # Required + projectId: # Required + +# Show Views / Visitors of the website / page with busuanzi. +# For more information: http://ibruce.info/2015/04/04/busuanzi/ +busuanzi_count: + enable: false + total_visitors: true + total_visitors_icon: fa fa-user + total_views: true + total_views_icon: fa fa-eye + post_views: true + post_views_icon: far fa-eye + + +# --------------------------------------------------------------- +# Search Services +# See: https://theme-next.js.org/docs/third-party-services/search-services +# --------------------------------------------------------------- + +# Algolia Search +# For more information: https://www.algolia.com +algolia_search: + enable: false + hits: + per_page: 10 + +# Local Search +# Dependencies: https://github.com/next-theme/hexo-generator-searchdb +local_search: + enable: false + # If auto, trigger search by changing input. + # If manual, trigger search by pressing enter key or search button. + trigger: auto + # Show top n results per article, show all results by setting to -1 + top_n_per_article: 1 + # Unescape html strings to the readable one. + unescape: false + # Preload the search data when the page loads. + preload: false + + +# --------------------------------------------------------------- +# Chat Services +# See: https://theme-next.js.org/docs/third-party-services/chat-services +# --------------------------------------------------------------- + +# A button to open designated chat widget in sidebar. +# Firstly, you need to enable and configure the chat service. +chat: + enable: false + icon: fa fa-comment # Icon name in Font Awesome, set to `false` to disable icon. + +# Chatra is a functional, easy to use piece of chat software for websites. +# For more information: https://chatra.com +# Dashboard: https://app.chatra.io/settings/general +chatra: + enable: false + async: true + id: # Visit Dashboard to get your ChatraID + #embed: # Unfinished experimental feature for developers. See: https://chatra.com/help/api/#injectto + +# Tidio is a powerful, all-in-one customer service tool. +# For more information: https://www.tidio.com +# Dashboard: https://www.tidio.com/panel/dashboard +tidio: + enable: false + key: # Public Key, get it from dashboard. See: https://www.tidio.com/panel/settings/developer + + +# --------------------------------------------------------------- +# CDN Settings +# See: https://theme-next.js.org/docs/advanced-settings/vendors +# --------------------------------------------------------------- + +vendors: + # The CDN provider of NexT internal scripts. + # Available values: local | jsdelivr | unpkg | cdnjs | custom + # Warning: If you are using the latest master branch of NexT, please set `internal: local` + internal: local + # The default CDN provider of third-party plugins. + # Available values: local | jsdelivr | unpkg | cdnjs | custom + # Dependencies for `plugins: local`: https://github.com/next-theme/plugins + plugins: cdnjs + # Custom CDN URL + # For example: + # custom_cdn_url: https://cdn.jsdelivr.net/npm/${npm_name}@${version}/${minified} + # custom_cdn_url: https://cdnjs.cloudflare.com/ajax/libs/${cdnjs_name}/${version}/${cdnjs_file} + custom_cdn_url: + +# Assets +# Accelerate delivery of static files using a CDN +# The js option is only valid when vendors.internal is local. +css: css +js: js +images: images diff --git a/themes/next/_vendors.yml b/themes/next/_vendors.yml new file mode 100644 index 0000000..3b0fe9e --- /dev/null +++ b/themes/next/_vendors.yml @@ -0,0 +1,179 @@ +# This file is automatically generated +# See https://github.com/next-theme/plugins + +anime: + name: animejs + version: 3.2.1 + file: lib/anime.min.js + integrity: sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY= +fontawesome: + name: '@fortawesome/fontawesome-free' + version: 6.5.1 + file: css/all.min.css + alias: font-awesome + integrity: sha256-wiz7ZSCn/btzhjKDQBms9Hx4sSeUYsDrTLg7roPstac= +prism: + name: prismjs + version: 1.29.0 + file: components/prism-core.min.js + alias: prism + integrity: sha256-4mJNT2bMXxcc1GCJaxBmMPdmah5ji0Ldnd79DKd1hoM= +prism_autoloader: + name: prismjs + version: 1.29.0 + file: plugins/autoloader/prism-autoloader.min.js + alias: prism + integrity: sha256-AjM0J5XIbiB590BrznLEgZGLnOQWrt62s3BEq65Q/I0= +prism_line_numbers: + name: prismjs + version: 1.29.0 + file: plugins/line-numbers/prism-line-numbers.min.js + alias: prism + integrity: sha256-9cmf7tcLdXpKsPi/2AWE93PbZpTp4M4tqzFk+lWomjU= +mathjax: + name: mathjax + version: 3.2.2 + file: es5/tex-mml-chtml.js + integrity: sha256-MASABpB4tYktI2Oitl4t+78w/lyA+D7b/s9GEP0JOGI= +katex: + name: katex + version: 0.16.9 + file: dist/katex.min.css + alias: KaTeX + integrity: sha256-UF1fgpAiu3tPJN/uCqEUHNe7pnr+QR0SQDNfgglgtcM= +copy_tex_js: + name: katex + version: 0.16.9 + file: dist/contrib/copy-tex.min.js + alias: KaTeX + integrity: sha256-Us54+rSGDSTvIhKKUs4kygE2ipA0RXpWWh0/zLqw3bs= +pjax: + name: '@next-theme/pjax' + version: 0.6.0 + file: pjax.min.js + alias: next-theme-pjax + integrity: sha256-vxLn1tSKWD4dqbMRyv940UYw4sXgMtYcK6reefzZrao= +fancybox_js: + name: '@fancyapps/ui' + version: 5.0.33 + file: dist/fancybox/fancybox.umd.js + alias: fancyapps-ui + integrity: sha256-+2+qOqR8CKoHh/AsVR9k2qaDBKWjYNC2nozhYmv5j9k= +fancybox_css: + name: '@fancyapps/ui' + version: 5.0.33 + file: dist/fancybox/fancybox.css + alias: fancyapps-ui + integrity: sha256-gkQVf8UKZgQ0HyuxL/VnacadJ+D2Kox2TCEBuNQg5+w= +mediumzoom: + name: medium-zoom + version: 1.1.0 + file: dist/medium-zoom.min.js + integrity: sha256-ZgMyDAIYDYGxbcpJcfUnYwNevG/xi9OHKaR/8GK+jWc= +lazyload: + name: lozad + version: 1.16.0 + file: dist/lozad.min.js + alias: lozad.js + integrity: sha256-mOFREFhqmHeQbXpK2lp4nA3qooVgACfh88fpJftLBbc= +pangu: + name: pangu + version: 4.0.7 + file: dist/browser/pangu.min.js + integrity: sha256-j+yj56cdEY2CwkVtGyz18fNybFGpMGJ8JxG3GSyO2+I= +quicklink: + name: quicklink + version: 2.3.0 + file: dist/quicklink.umd.js + integrity: sha256-yvJQOINiH9fWemHn0vCA5lsHWJaHs6/ZmO+1Ft04SvM= +disqusjs_js: + name: disqusjs + version: 3.0.2 + file: dist/browser/disqusjs.es2015.umd.min.js + integrity: sha256-okP99ZQKVpIy7+NogAMpGlIQzJa9XKXhIJcFgdju5bU= +disqusjs_css: + name: disqusjs + version: 3.0.2 + file: dist/browser/styles/disqusjs.css + integrity: sha256-71XarXwNr1Td27HmZI9zjY+rMzRdush6/glo6VFXp7o= +gitalk_js: + name: gitalk + version: 1.8.0 + file: dist/gitalk.min.js + integrity: sha256-MVK9MGD/XJaGyIghSVrONSnoXoGh3IFxLw0zfvzpxR4= +gitalk_css: + name: gitalk + version: 1.8.0 + file: dist/gitalk.css + integrity: sha256-AJnUHL7dBv6PGaeyPQJcgQPDjt/Hn/PvYZde1iqfp8U= +firebase_app: + name: firebase + version: 10.7.2 + file: firebase-app-compat.js + integrity: sha256-xdQCzG9qpUPD/bs/ZEI5cFbxep9Zp6F1VJm3d9ynNcw= +firebase_firestore: + name: firebase + version: 10.7.2 + file: firebase-firestore-compat.js + integrity: sha256-T7LqKXz+9Heox++4MR5RWllW/F1mamRl5xZjMdejtoE= +algolia_search: + name: algoliasearch + version: 4.22.1 + file: dist/algoliasearch-lite.umd.js + integrity: sha256-pxkGFjfnFWYGOtV9uhCWK/spKiGS0Z7gVDKYm39LyfM= +instant_search: + name: instantsearch.js + version: 4.64.2 + file: dist/instantsearch.production.min.js + integrity: sha256-/DLulTBQ8KQ7xGOs8mrQ6FgKsknJpjCGAjFhjfjc8yo= +local_search: + name: hexo-generator-searchdb + version: 1.4.1 + file: dist/search.js + integrity: sha256-1kfA5uHPf65M5cphT2dvymhkuyHPQp5A53EGZOnOLmc= +pdfobject: + name: pdfobject + version: 2.2.12 + file: pdfobject.min.js + integrity: sha256-g2xji1rlE3KsGVClvuxTbcR0Kn2+wtQADSff2Tbb4zA= +mermaid: + name: mermaid + version: 10.7.0 + file: dist/mermaid.min.js + integrity: sha256-TtLOdUA8mstPoO6sGvHIGx2ceXrrX4KgIItO06XOn8A= +animate_css: + name: animate.css + version: 3.1.1 + file: animate.min.css + integrity: sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE= +pace_js: + name: pace-js + version: 1.2.4 + file: pace.min.js + alias: pace + integrity: sha256-gqd7YTjg/BtfqWSwsJOvndl0Bxc8gFImLEkXQT8+qj0= +pace_css: + name: pace-js + version: 1.2.4 + dir: themes + alias: pace +canvas_ribbon: + name: ribbon.js + version: 1.0.2 + file: dist/ribbon.min.js + integrity: sha256-UkSSapoJqxvq+8bSCIrAhXO+aOMBRmkK6vxjTstemLs= +creative_commons: + name: '@creativecommons/vocabulary' + version: 2020.11.3 + dir: assets/license_badges + alias: creativecommons-vocabulary +wavedrom: + name: wavedrom + version: 3.4.0 + file: wavedrom.min.js + integrity: sha256-psuqlelzklLSAoqBmPNNdyJw8msJdKgKpUFJZQlJJjo= +wavedrom_skin: + name: wavedrom + version: 3.4.0 + file: skins/default.js + integrity: sha256-fduc/Zszk5ezWws2uInY/ALWVmIrmV6VTgXbsYSReFI= diff --git a/themes/next/crowdin.yml b/themes/next/crowdin.yml new file mode 100644 index 0000000..be97306 --- /dev/null +++ b/themes/next/crowdin.yml @@ -0,0 +1,9 @@ +files: + - source: /languages/en.yml + translation: /languages/%two_letters_code%.%file_extension% + languages_mapping: + two_letters_code: + zh-CN: zh-CN + zh-TW: zh-TW + zh-HK: zh-HK + pt-BR: pt-BR diff --git a/themes/next/docs/AGPL3.md b/themes/next/docs/AGPL3.md new file mode 100644 index 0000000..2dcf18c --- /dev/null +++ b/themes/next/docs/AGPL3.md @@ -0,0 +1,649 @@ +#
GNU Affero General Public License
+ +

Version 3, 19 November 2007 Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>

+ +

Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed.

+ +##
Preamble
+ +The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + +The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + +Developers that use our General Public Licenses protect your rights +with two steps: **(1)** assert copyright on the software, and **(2)** offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + +A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + +The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + +An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + +The precise terms and conditions for copying, distribution and +modification follow. + +##
TERMS AND CONDITIONS
+ +### 0. Definitions + +“This License” refers to version 3 of the GNU Affero General Public License. + +“Copyright” also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + +“The Program” refers to any copyrightable work licensed under this +License. Each licensee is addressed as “you”. “Licensees” and +“recipients” may be individuals or organizations. + +To “modify” a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a “modified version” of the +earlier work or a work “based on” the earlier work. + +A “covered work” means either the unmodified Program or a work based +on the Program. + +To “propagate” a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + +To “convey” a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + +An interactive user interface displays “Appropriate Legal Notices” +to the extent that it includes a convenient and prominently visible +feature that **(1)** displays an appropriate copyright notice, and **(2)** +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + +### 1. Source Code + +The “source code” for a work means the preferred form of the work +for making modifications to it. “Object code” means any non-source +form of a work. + +A “Standard Interface” means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + +The “System Libraries” of an executable work include anything, other +than the work as a whole, that **(a)** is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and **(b)** serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +“Major Component”, in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + +The “Corresponding Source” for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + +The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + +The Corresponding Source for a work in source code form is that +same work. + +### 2. Basic Permissions + +All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + +You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + +### 3. Protecting Users' Legal Rights From Anti-Circumvention Law + +No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + +When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + +### 4. Conveying Verbatim Copies + +You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + +### 5. Conveying Modified Source Versions + +You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + +* **a)** The work must carry prominent notices stating that you modified +it, and giving a relevant date. +* **b)** The work must carry prominent notices stating that it is +released under this License and any conditions added under section 7. +This requirement modifies the requirement in section 4 to +“keep intact all notices”. +* **c)** You must license the entire work, as a whole, under this +License to anyone who comes into possession of a copy. This +License will therefore apply, along with any applicable section 7 +additional terms, to the whole of the work, and all its parts, +regardless of how they are packaged. This License gives no +permission to license the work in any other way, but it does not +invalidate such permission if you have separately received it. +* **d)** If the work has interactive user interfaces, each must display +Appropriate Legal Notices; however, if the Program has interactive +interfaces that do not display Appropriate Legal Notices, your +work need not make them do so. + +A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +“aggregate” if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + +### 6. Conveying Non-Source Forms + +You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + +* **a)** Convey the object code in, or embodied in, a physical product +(including a physical distribution medium), accompanied by the +Corresponding Source fixed on a durable physical medium +customarily used for software interchange. +* **b)** Convey the object code in, or embodied in, a physical product +(including a physical distribution medium), accompanied by a +written offer, valid for at least three years and valid for as +long as you offer spare parts or customer support for that product +model, to give anyone who possesses the object code either **(1)** a +copy of the Corresponding Source for all the software in the +product that is covered by this License, on a durable physical +medium customarily used for software interchange, for a price no +more than your reasonable cost of physically performing this +conveying of source, or **(2)** access to copy the +Corresponding Source from a network server at no charge. +* **c)** Convey individual copies of the object code with a copy of the +written offer to provide the Corresponding Source. This +alternative is allowed only occasionally and noncommercially, and +only if you received the object code with such an offer, in accord +with subsection 6b. +* **d)** Convey the object code by offering access from a designated +place (gratis or for a charge), and offer equivalent access to the +Corresponding Source in the same way through the same place at no +further charge. You need not require recipients to copy the +Corresponding Source along with the object code. If the place to +copy the object code is a network server, the Corresponding Source +may be on a different server (operated by you or a third party) +that supports equivalent copying facilities, provided you maintain +clear directions next to the object code saying where to find the +Corresponding Source. Regardless of what server hosts the +Corresponding Source, you remain obligated to ensure that it is +available for as long as needed to satisfy these requirements. +* **e)** Convey the object code using peer-to-peer transmission, provided +you inform other peers where the object code and Corresponding +Source of the work are being offered to the general public at no +charge under subsection 6d. + +A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + +A “User Product” is either **(1)** a “consumer product”, which means any +tangible personal property which is normally used for personal, family, +or household purposes, or **(2)** anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, “normally used” refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + +“Installation Information” for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + +If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + +The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + +Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + +### 7. Additional Terms + +“Additional permissions” are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + +Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + +* **a)** Disclaiming warranty or limiting liability differently from the +terms of sections 15 and 16 of this License; or +* **b)** Requiring preservation of specified reasonable legal notices or +author attributions in that material or in the Appropriate Legal +Notices displayed by works containing it; or +* **c)** Prohibiting misrepresentation of the origin of that material, or +requiring that modified versions of such material be marked in +reasonable ways as different from the original version; or +* **d)** Limiting the use for publicity purposes of names of licensors or +authors of the material; or +* **e)** Declining to grant rights under trademark law for use of some +trade names, trademarks, or service marks; or +* **f)** Requiring indemnification of licensors and authors of that +material by anyone who conveys the material (or modified versions of +it) with contractual assumptions of liability to the recipient, for +any liability that these contractual assumptions directly impose on +those licensors and authors. + +All other non-permissive additional terms are considered “further +restrictions” within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + +### 8. Termination + +You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + +However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated **(a)** +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and **(b)** permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + +### 9. Acceptance Not Required for Having Copies + +You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + +### 10. Automatic Licensing of Downstream Recipients + +Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + +An “entity transaction” is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + +### 11. Patents + +A “contributor” is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's “contributor version”. + +A contributor's “essential patent claims” are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, “control” includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + +In the following three paragraphs, a “patent license” is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To “grant” such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + +If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either **(1)** cause the Corresponding Source to be so +available, or **(2)** arrange to deprive yourself of the benefit of the +patent license for this particular work, or **(3)** arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. “Knowingly relying” means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + +A patent license is “discriminatory” if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license **(a)** in connection with copies of the covered work +conveyed by you (or copies made from those copies), or **(b)** primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + +### 12. No Surrender of Others' Freedom + +If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + +### 13. Remote Network Interaction; Use with the GNU General Public License + +Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + +Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + +### 14. Revised Versions of this License + +The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License “or any later version” applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + +If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + +Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + +### 15. Disclaimer of Warranty + +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +### 16. Limitation of Liability + +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + +### 17. Interpretation of Sections 15 and 16 + +If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + +##
END OF TERMS AND CONDITIONS
+ +###
How to Apply These Terms to Your New Programs
+ +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the “copyright” line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + +If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a “Source” link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + +You should also get your employer (if you work as a programmer) or school, +if any, to sign a “copyright disclaimer” for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +<>. \ No newline at end of file diff --git a/themes/next/docs/AUTHORS.md b/themes/next/docs/AUTHORS.md new file mode 100644 index 0000000..714b954 --- /dev/null +++ b/themes/next/docs/AUTHORS.md @@ -0,0 +1,87 @@ +#
«NexT» Authors
+ +NexT theme was initially developed by: + +- **IIssNaN**: [NexT](https://github.com/iissnan/hexo-theme-next) (2014 - 2017) + +With collaborators from initially repository: + +- **Ivan.Nginx**: [DIFF highlight](https://github.com/iissnan/hexo-theme-next/pull/1079), + [HyperComments](https://github.com/iissnan/hexo-theme-next/pull/1155), + [`{% note %}` tag](https://github.com/iissnan/hexo-theme-next/pull/1160), + [`seo` option](https://github.com/iissnan/hexo-theme-next/pull/1311), + [`{% button %}` tag](https://github.com/iissnan/hexo-theme-next/pull/1328), + [VK API](https://github.com/iissnan/hexo-theme-next/pull/1381), + [WordCount plugin support](https://github.com/iissnan/hexo-theme-next/pull/1381), + [Yandex verification option](https://github.com/iissnan/hexo-theme-next/pull/1381), + [`{% exturl %}` tag](https://github.com/iissnan/hexo-theme-next/pull/1438), + [`b2t` option](https://github.com/iissnan/hexo-theme-next/pull/1438), + [`scrollpercent` option](https://github.com/iissnan/hexo-theme-next/pull/1438), + [`save_scroll` option](https://github.com/iissnan/hexo-theme-next/pull/1574), + [Star rating](https://github.com/iissnan/hexo-theme-next/pull/1649), + [`mobile_layout_economy` option](https://github.com/iissnan/hexo-theme-next/pull/1697), + [`{% tabs %}` tag](https://github.com/iissnan/hexo-theme-next/pull/1697), + [`{% label %}` tag](https://github.com/iissnan/hexo-theme-next/pull/1697), + [**`Gemini`** scheme](https://github.com/iissnan/hexo-theme-next/pull/1697), + [Menu & Sidebar icons in 1 line](https://github.com/iissnan/hexo-theme-next/pull/1830), + [Sidebar scrollable](https://github.com/iissnan/hexo-theme-next/pull/1898), + [Responsive favicons](https://github.com/iissnan/hexo-theme-next/pull/1898) + and many other [PR's with fixes and enhancements](https://github.com/iissnan/hexo-theme-next/pulls?utf8=%E2%9C%93&q=is%3Apr%20author%3Aivan-nginx) +- **Acris**: [Many PR's with fixes and updates](https://github.com/iissnan/hexo-theme-next/pulls?utf8=%E2%9C%93&q=is%3Apr%20author%3AAcris) + +And best contributors from initially repository: + +- **Rainy**: [Gentie comments](https://github.com/iissnan/hexo-theme-next/pull/1301), + [Han](https://github.com/iissnan/hexo-theme-next/pull/1598) + and many [PR's with fixes and optimizations](https://github.com/iissnan/hexo-theme-next/pulls?utf8=%E2%9C%93&q=is%3Apr%20author%3Ageekrainy) +- **Jeff**: [Local search](https://github.com/iissnan/hexo-theme-next/pull/694) + and many [PR's with fixes and improvements](https://github.com/iissnan/hexo-theme-next/pulls?utf8=%E2%9C%93&q=is%3Apr%20author%3Aflashlab) +- **Haocen**: [Footer enhancements](https://github.com/iissnan/hexo-theme-next/pull/1886) + and some other [PR's with improvements](https://github.com/iissnan/hexo-theme-next/pulls?utf8=%E2%9C%93&q=is%3Apr%20author%3AHaocen) +- **uchuhimo**: [Greatest enhancements for local search](https://github.com/iissnan/hexo-theme-next/pulls?utf8=%E2%9C%93&q=is%3Apr%20author%3Auchuhimo) +- **Kei**: [Change static file setting to support subdirectory](https://github.com/iissnan/hexo-theme-next/pull/4) +- **Jolyon**: [Swiftype](https://github.com/iissnan/hexo-theme-next/pull/84) +- **xirong**: [404 page](https://github.com/iissnan/hexo-theme-next/pull/126) +- **PinkyJie**: [Fix Swiftype](https://github.com/iissnan/hexo-theme-next/pull/132) +- **Tim Kuijsten**: [Split javascript into separate files](https://github.com/iissnan/hexo-theme-next/pull/152) +- **iamwent**: [Friendly links](https://github.com/iissnan/hexo-theme-next/pull/250) +- **arao lin**: [Option to lazyload images](https://github.com/iissnan/hexo-theme-next/pull/269) +- **Konstantin Pavlov**: [Microdata, opengraph and other semantic features](https://github.com/iissnan/hexo-theme-next/pull/276) +- **Gary**: [FastClick](https://github.com/iissnan/hexo-theme-next/pull/324) +- **Octavian**: [Baidu site vertification](https://github.com/iissnan/hexo-theme-next/pull/367) +- **Henry Chang**: [Facebook SDK](https://github.com/iissnan/hexo-theme-next/pull/410) +- **XiaMo**: [LeanCloud visitors](https://github.com/iissnan/hexo-theme-next/pull/439) +- **iblogc**: [Fix UA in Duoshuo](https://github.com/iissnan/hexo-theme-next/pull/489) +- **Vincent**: [Automatic headline ID's](https://github.com/iissnan/hexo-theme-next/pull/588) +- **cissoid**: [Tencent analytics](https://github.com/iissnan/hexo-theme-next/pull/603) +- **CosmoX**: [AddThis](https://github.com/iissnan/hexo-theme-next/pull/660) +- **Jason Guo**: [Reward for post](https://github.com/iissnan/hexo-theme-next/pull/687) +- **Jerry Bendy**: [CNZZ counter](https://github.com/iissnan/hexo-theme-next/pull/712) +- **Hui Wang**: [Wechat subscriber](https://github.com/iissnan/hexo-theme-next/pull/788) +- **PoonChiTim**: [Busuanzi counter](https://github.com/iissnan/hexo-theme-next/pull/809) +- **hydai**: [Facebook comments](https://github.com/iissnan/hexo-theme-next/pull/925) +- **OAwan**: [`canonical` option](https://github.com/iissnan/hexo-theme-next/pull/931) +- **Jim Zenn**: [Google Calendar](https://github.com/iissnan/hexo-theme-next/pull/1167) +- **Abner Chou**: [Disqus improvements](https://github.com/iissnan/hexo-theme-next/pull/1173) +- **Igor Fesenko**: [Application Insights](https://github.com/iissnan/hexo-theme-next/pull/1257) +- **jinfang**: [Youyan comments](https://github.com/iissnan/hexo-theme-next/pull/1324) +- **AlynxZhou**: [`canvas_nest` option](https://github.com/iissnan/hexo-theme-next/pull/1327) +- **aleon**: [Tencent MTA](https://github.com/iissnan/hexo-theme-next/pull/1408) +- **asmoker**: [LiveRe comments](https://github.com/iissnan/hexo-theme-next/pull/1415) +- **Jacksgong**: [Copyright on posts](https://github.com/iissnan/hexo-theme-next/pull/1497) +- **zhaiqianfeng**: [Changyan comments](https://github.com/iissnan/hexo-theme-next/pull/1514) +- **zproo**: [`canvas_ribbon` option](https://github.com/iissnan/hexo-theme-next/pull/1565) +- **jjandxa**: [`three_waves`](https://github.com/iissnan/hexo-theme-next/pull/1534), + [`canvas_lines` and `canvas_sphere`](https://github.com/iissnan/hexo-theme-next/pull/1595) options +- **shenzekun**: [Load bar at the top](https://github.com/iissnan/hexo-theme-next/pull/1689) +- **elkan1788**: [Upgrade jiathis share](https://github.com/iissnan/hexo-theme-next/pull/1796) +- **xCss**: [Valine comment system support](https://github.com/iissnan/hexo-theme-next/pull/1811) +- **Julian Xhokaxhiu**: [`override` option](https://github.com/iissnan/hexo-theme-next/pull/1861) +- **LEAFERx**: [NeedMoreShare2](https://github.com/iissnan/hexo-theme-next/pull/1913) +- **aimingoo & LEAFERx**: [Gitment supported with Mint](https://github.com/iissnan/hexo-theme-next/pull/1919) +- **LeviDing**: [Fix the bug of Gitment](https://github.com/iissnan/hexo-theme-next/pull/1944) +- **maple3142**: [Firestore visitor counter](https://github.com/iissnan/hexo-theme-next/pull/1978) + +It lives on as an open source project with many contributors, a self updating list is [here](https://github.com/next-theme/hexo-theme-next/graphs/contributors). + +P.S. If you did some useful pulls/commits in original repository and you are not in the list, let us know and you will be added here. diff --git a/themes/next/docs/LICENSE.txt b/themes/next/docs/LICENSE.txt new file mode 100644 index 0000000..c9c9061 --- /dev/null +++ b/themes/next/docs/LICENSE.txt @@ -0,0 +1,52 @@ + «NexT» – Elegant and powerful theme for Hexo. + + Copyright © 2017 «NexT» (github.com/next-theme/hexo-theme-next). + + Detail attribution information for «NexT» + is contained in the 'docs/AUTHORS.md' file. + + This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License version 3 +as published by the Free Software Foundation with the addition of the +following permission added to Section 15 as permitted in Section 7(a): +FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY «NEXT», +«NEXT» DISCLAIMS THE WARRANTY OF NON INFRINGEMENT OF THIRD PARTY RIGHTS. + + This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. +See the GNU Affero General Public License for more details. +You should have received a copy of the GNU Affero General Public License +along with this program; if not, see: https://www.gnu.org/licenses/agpl.txt + + In accordance with Section 7(b) of the GNU Affero General Public License: + + a) It is not necessary to specify copyright in each source file of + this program because GitHub fully save commits of all modified files + with their authors and provides to see for this changes publicly. + + b) For any part of the covered work in which the copyright not specified, + will mean this part owned by «NexT» in accord with terms in this file. + +* c) A covered work must retain «NexT» official website link + (https://theme-next.js.org) in footer section of every website created, + modified or manipulated by using «NexT». + «NexT» theme configuration must be: + ``` + footer: + theme: + enable: true + ``` + Collaborators, best contributors and all authors specified in the + 'docs/AUTHORS.md' file of «NexT» repository under the + 'https://github.com/next-theme' organization can ignore theme info link + requirements. + + Anyone can be released from the requirements of the license by purchasing +a commercial license. Buying such a license is mandatory as soon as you +develop commercial activities involving the «NexT» software without +disclosing the source code of your own applications. +These activities include: + 1. Access to private repository with various premium features. + 2. Priority support for resolve all possible issues with «NexT». + 3. Priority support for implement all possible features to «NexT». diff --git a/themes/next/docs/ru/README.md b/themes/next/docs/ru/README.md new file mode 100644 index 0000000..fd3b9e4 --- /dev/null +++ b/themes/next/docs/ru/README.md @@ -0,0 +1,188 @@ +
+ Язык: + 🇺🇸 + 🇨🇳 + 🇷🇺 +
+ + + + + NexT preview + + +NexT logo + +# NexT + +> «NexT» — элегантная высококачественная тема под [Hexo](https://hexo.io). Сделана с нуля, с любовью. + +[![NPM version](https://img.shields.io/npm/v/hexo-theme-next?color=red&logo=npm&style=flat-square)](https://www.npmjs.com/package/hexo-theme-next) +[![NPM Downloads](https://img.shields.io/npm/dm/hexo-theme-next?logo=npm&style=flat-square)](https://www.npmjs.com/package/hexo-theme-next) +[![Required Hexo version](https://img.shields.io/badge/hexo-%3E=5.3.0-blue?style=flat-square&logo=hexo)](https://hexo.io) +[![License](https://img.shields.io/badge/license-%20AGPL-orange?style=flat-square&logo=gnu)](https://github.com/next-theme/hexo-theme-next/blob/master/LICENSE.md) +[![Build Status](https://img.shields.io/github/actions/workflow/status/next-theme/hexo-theme-next/linter.yml?branch=master&label=test&logo=github&style=flat-square)](https://github.com/next-theme/hexo-theme-next/actions?query=workflow%3ALinter) +[![Build Status](https://img.shields.io/github/actions/workflow/status/next-theme/hexo-theme-next/tester.yml?branch=master&logo=github&style=flat-square)](https://github.com/next-theme/hexo-theme-next/actions?query=workflow%3ATester) +[![Coverage Status](https://img.shields.io/coveralls/github/next-theme/hexo-theme-next?logo=coveralls&style=flat-square)](https://coveralls.io/github/next-theme/hexo-theme-next) + +## Демо + +

+ 💟 Muse | 🔯 Mist | ♓️ Pisces | ♊️ Gemini +
+
+ Больше примеров «NexT» здесь. +

+ +## Установка + +If you're using Hexo 5.0 or later, the simplest way to install is through npm: + +```sh +$ cd hexo-site +$ npm install hexo-theme-next +``` + +Or you can clone the entire repository: + +```sh +$ cd hexo-site +$ git clone https://github.com/next-theme/hexo-theme-next themes/next +``` + +See [detailed installation instructions][docs-installation-url] if you want any other variant. + +After the installation, open Hexo config file and set `theme` variable to `next`. + +```yml +theme: next +``` + +## Configuration + +It is not recommended to directly modify any files in the NexT theme. Because this may cause errors (e.g. merge conflicts), and the modified files may be discarded when upgrading the theme. + +At present, NexT encourages users to use the [Alternate Theme Config][docs-configuration-url] to configure NexT. And it's easy to customize the layout or style of NexT using [Custom Files][docs-custom-files-url]. + +## Плагины + +Plugins extend and expand the functionality of NexT. There are two types of plugins: core plugins and third-party plugins. The core plugins are required by the basic functions of NexT. Third-party plugins provide a large number of optional features. + +Configuring these plugins is very easy. Например, Вы хотите использовать `pjax` для своего сайта. Открываем конфиг NexT'а и находим: + +```yml +# Easily enable fast Ajax navigation on your website. +# For more information: https://github.com/next-theme/pjax +pjax: true +``` + +### Configure CDN + +Third-party plugins are loaded from [CDNJS](https://cdnjs.com) CDN by default. We also provide other optional CDNs, including the famous [UNPKG](https://unpkg.com) and [jsDelivr](https://www.jsdelivr.com). + +For example, if you want to use `unpkg` instead of `cdnjs` as the default CDN provider, you need to edit the following settings in NexT config file: + +```yml +vendors: + # ... + # Some contents... + # ... + plugins: unpkg +``` + +## Обновление + +NexT выпускает новые версии каждый месяц. Please read the [release notes][docs-release-url] before updating the theme. You can update NexT by the following command. + +Install the latest version through npm: + +```sh +$ cd hexo-site +$ npm install hexo-theme-next@latest +``` + +Or update to the latest master branch: + +```sh +$ cd themes/next +$ git pull +``` + +**Если нужно обновиться с версии v5.x / v7.x на последней версиями, читаем [здесь][docs-upgrade-url].** + +## Обратная связь + +* Посетите [Awesome NexT][awesome-next-url] список. +* Вступить в наши [GitHub discussions][discussions-url] / [Gitter][gitter-url] чаты. +* [Добавить или улучшить перевод][i18n-url] за несколько секунд. +* Сообщить об ошибке в разделе [GitHub Issues][issues-bug-url]. +* Запросить новую возможность на [GitHub][issues-feat-url]. +* Голосовать за [популярные запросы возможностей][feat-req-vote-url]. + +## Contributing + +We welcome you to join the development of NexT. Please see [contributing document][contributing-document-url]. 🤗 + +Also, we welcome Issue or PR to our [official-plugins][official-plugins-url]. + +## Содействие + +[![Contributors][contributors-image]][contributors-url] + +## Благодарности + +«NexT» send special thanks to these great services that sponsor our core infrastructure: + + + +> GitHub allows us to host the Git repository and run the test suite. + + + + + + Netlify Logo + + + +> Netlify allows us to distribute the documentation. + + + + + + Netlify Logo + + + +> Crowdin allows us to translate conveniently the documentation. + + + + + + CDNJS Logo + + + +> Thanks CDNJS for providing public CDN service. + +[docs-installation-url]: https://theme-next.js.org/docs/getting-started/installation.html +[docs-configuration-url]: https://theme-next.js.org/docs/getting-started/configuration.html +[docs-custom-files-url]: https://theme-next.js.org/docs/advanced-settings/custom-files.html +[docs-release-url]: https://github.com/next-theme/hexo-theme-next/releases +[docs-upgrade-url]: https://theme-next.js.org/docs/getting-started/upgrade.html + +[awesome-next-url]: https://github.com/next-theme/awesome-next +[discussions-url]: https://github.com/next-theme/hexo-theme-next/discussions +[gitter-url]: https://app.gitter.im/#/room/#next:gitter.im +[i18n-url]: https://crowdin.com/project/hexo-theme-next + +[issues-bug-url]: https://github.com/next-theme/hexo-theme-next/issues/new?assignees=&labels=Bug&template=bug-report.md +[issues-feat-url]: https://github.com/next-theme/hexo-theme-next/issues/new?assignees=&labels=Feature+Request&template=feature-request.md +[feat-req-vote-url]: https://github.com/next-theme/hexo-theme-next/issues?q=is%3Aopen+is%3Aissue+label%3A%22Feature+Request%22 + +[contributing-document-url]: https://github.com/next-theme/hexo-theme-next/blob/master/.github/CONTRIBUTING.md +[official-plugins-url]: https://github.com/next-theme +[contributors-image]: https://raw.githubusercontent.com/next-theme/contributors/master/contributors.svg +[contributors-url]: https://github.com/next-theme/hexo-theme-next/blob/master/docs/AUTHORS.md diff --git a/themes/next/docs/zh-CN/CODE_OF_CONDUCT.md b/themes/next/docs/zh-CN/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..2428cd2 --- /dev/null +++ b/themes/next/docs/zh-CN/CODE_OF_CONDUCT.md @@ -0,0 +1,95 @@ +
+ 语言: + :us: + :cn: + :ru: +
+ +NexT logo + +# NexT + +[NexT](https://theme-next.js.org) 是一个优雅而强大的 [Hexo](https://hexo.io/)主题。在这里,您可以构建一个托管在 [GitHub Pages](https://pages.github.com/) 上的静态博客,分享您的生活,并与新朋友进行交流。 + +参与者公约用来约束在 [NexT](https://github.com/next-theme/hexo-theme-next) 社区中代码更新、问题交流、请求合并等行为。我们期望所有用户相互尊重,礼貌待人。任何违反这些规则的人都将不会被审核,并会在发现后立即被阻止和驱逐。 + +## 目录 + +- [我们的保证](#我们的保证) +- [我们的责任](#我们的责任) +- [我们的标准](#我们的标准) +- [使用范围](#使用范围) +- [强制执行](#强制执行) +- [联系项目维护者](#联系项目维护者) +- [来源](#来源) + +## 我们的保证 + +作为此项目的贡献者和维护者,我们承诺尊重所有做出贡献的用户,这些贡献包括了报告问题、发布功能请求、更新文档、提交合并请求以及其他活动。 + +为了促进一个开放透明且友好的环境,我们作为贡献者和维护者保证:无论年龄、种族、民族、性别认同和表达(方式)、体型、身体健全与否、经验水平、国籍、个人表现、宗教或性别取向,参与者在我们项目和社区中都免于骚扰。 + +## 我们的责任 + +项目维护者有责任为「可接受的行为」标准做出诠释,有权利及责任去删除、编辑、拒绝与本行为标准有所违背的评论(comments)、提交(commits)、代码、wiki 编辑、问题(issues)和其他贡献,以及项目维护者可暂时或永久性的禁止任何他们认为有不适当、威胁、冒犯、有害行为的贡献者。 + +## 我们的标准 + +作为 GitHub 上的一个项目,本项目受到 [GitHub 社区准则](https://help.github.com/articles/github-community-guidelines/)的约束。 此外,作为 npm 托管的项目,[npm 公司的行为准则](https://www.npmjs.com/policies/conduct)也涵盖了本项目。 + +有助于创造正面环境的行为包括但不限于: + +* 使用友好和包容性语言 +* 尊重不同的观点和经历 +* 耐心地接受建设性批评 +* 关注对社区最有利的事情 +* 友善对待其他社区成员 + +身为参与者不能接受的行为包括但不限于: + +* 使用与性有关的言语或是图像,以及不受欢迎的性骚扰 +* 捣乱/煽动/造谣的行为或进行侮辱/贬损的评论,人身攻击及政治攻击 +* 公开或私下的骚扰 +* 未经许可地发布他人的个人资料,例如住址或是电子地址 +* 其他可以被合理地认定为不恰当或者违反职业操守的行为 + +## 使用范围 + +当一个人代表该项目或是其社区时,本行为标准适用于其项目社区和公共社区。 + +根据某人在本社区范围以外发生的违规情况,项目维护者可以认为其不受欢迎,并采取适当措施来保证所有成员的安全性和舒适性。 + +## 强制执行 + +如果您看到违反行为准则的行为,请按以下步骤操作: + +1. 让这个人知道他所做的并不合适,并要求他停止或编辑他们的提交信息。该人应立即停止行为并纠正问题。 +2. 如果该人没有纠正其行为,或者您不方便与其沟通,请[联系项目维护者](#联系项目维护者)。上报时,请尽可能多的提供详细信息,链接,截图,上下文或可用于更好地理解和解决情况的其他信息。 +3. 收到上报信息后,项目维护者会查看问题,并采取进一步的措施。 + +一旦项目维护者参与其中,他们将遵循以下一系列步骤,并尽力保护项目成员的利益。任何维护团队认为有必要且适合的所有投诉都将进行审查及调查,并做出相对应的回应。项目小组有对事件回报者有保密的义务。具体执行的方针近一步细节可能会单独公布。 + +以下是项目维护者根据需要采取的进一步执法步骤: + +1. 再次要求停止违规行为。 +2. 如果违规者还是没有回应,将会受到正式的警告,并收到项目维护者的移除或修改消息。同时,相关的问题或合并请求将会被锁定。 +3. 如果警告后违规行为继续出现,违规者将会被禁言 24 小时。 +4. 如果禁言后违规行为继续出现,违规者将会被处罚长期(6-12个月)禁言。 + +除此之外,项目维护者可以根据需要删除任何违规的消息,图片,贡献等。如果违规行为被认为是对社区成员的严重或直接威胁,包括任何置社区成员于风险的威胁、身体或言语攻击,项目维护者有充分权利自行决定跳过上述任何步骤。 + +没有切实地遵守或是执行本行为标准的项目维护人员,可能会因项目领导人或是其他成员的决定,暂时或是永久地取消其参与资格。 + +## 联系项目维护者 + +您可以通过以下方式与维护人员联系: + +* 讨论: + * [GitHub Discussions](https://github.com/next-theme/hexo-theme-next/discussions) + +* 即时通信: + * [Gitter](https://app.gitter.im/#/room/#next:gitter.im) + +## 来源 + +本行为标准改编自[Contributor Covenant](https://www.contributor-covenant.org/) 和 [WeAllJS Code of Conduct](https://wealljs.org/code-of-conduct)。 diff --git a/themes/next/docs/zh-CN/CONTRIBUTING.md b/themes/next/docs/zh-CN/CONTRIBUTING.md new file mode 100644 index 0000000..50c1694 --- /dev/null +++ b/themes/next/docs/zh-CN/CONTRIBUTING.md @@ -0,0 +1,181 @@ +
+ 语言: + :us: + :cn: + :ru: +
+ +NexT logo + +# NexT + +首先,非常感谢大家抽出宝贵时间来让我们的 NexT 主题越变越好。在这里,我们介绍一下 [NexT 主题及其子模块](https://github.com/next-theme) 的开源贡献指南。不过,我们希望大家不要局限于此,更欢迎大家随时进行补充。 + +## 目录 + +[如何为 NexT 做贡献](#如何为-next-做贡献) + + * [你需要了解的](#你需要了解的) + * [阅读文档](#阅读文档) + * [快速调试指南](#快速调试指南) + * [反馈 Bug](#反馈-bug) + * [提交漏洞](#提交漏洞) + * [提交功能需求](#提交功能需求) + * [提交合并请求](#提交合并请求) + * [发布版本](#发布版本) + +[规范](#规范) + + * [行为规范](#行为规范) + * [编码规范](#编码规范) + * [标签规范](#标签规范) + * [提交信息规范](#提交信息规范) + +## 如何为 NexT 做贡献 + +### 你需要了解的 + +#### 阅读文档 + +如果你在使用过程中遇到了问题,你可以查阅 [FAQs](https://theme-next.js.org/docs/faqs) 或者 [NexT 帮助文档](https://theme-next.js.org/docs/troubleshooting)。 + +另外,你也可以通过 [这里](https://github.com/next-theme/hexo-theme-next/search?q=&type=Issues&utf8=%E2%9C%93) 进行大致检索,有些问题已经得到解答,你可以自行解决。对于没有解决的 Issue,你也可以继续提问。 + +#### 快速调试指南 + +在 GitHub 上提交 Issue 前,请先查看我们的 [快速调试指南](https://theme-next.js.org/docs/troubleshooting.html#Quick-Debug-Instructions) 来 debug。 + +如果你在使用过程中发现了 Bug,请再次确认 Bug 在 [最新发布版本](https://github.com/next-theme/hexo-theme-next/releases/latest) 中是否重现。如果 Bug 重现,欢迎你到我们的 [主题仓库](https://github.com/next-theme/hexo-theme-next) 中 [反馈 Bug](#reporting-bugs) 或者 [提交功能需求](#提交功能需求),也更期待您 [提交合并请求](#提交合并请求)。 + +### 反馈 Bug + +反馈 Bug 前,请再次确认您已经查看了 [你需要了解的](#你需要了解的) 内容,避免提交重复的 Issue。创建 Issue 时,请认真遵守如下指南,这样我们才能更好地理解问题,重现问题和解决问题。 + +* 在标题中清晰准确地描述你的问题。 +* 按照 [模板](../../.github/ISSUE_TEMPLATE.md) 尽可能的详细填写相关信息。 +* 一步步详细你是如何重现 Bug 的,做了什么,使用了哪些功能等等。如果你需要展示代码段,请使用 [Markdown 代码块](https://help.github.com/articles/creating-and-highlighting-code-blocks/) 或 [Github 预览链接](https://help.github.com/articles/creating-a-permanent-link-to-a-code-snippet/) 或 [Gist 链接](https://gist.github.com/)。 +* 提供 Bug 的样例,如图像文件、在线演示网址等等。 +* 详细描述通过上述重现过程出现的问题。 +* 详细描述你期待的结果。 + +#### 提交漏洞 + +如果你发现安全问题,请以负责任的方式行事,即不要在公共 Issue 中提交而是直接向我们反馈,这样我们就可以在漏洞被利用之前对其进行修复。请将相关信息发送到 security@theme-next.com(可接受 PGP 加密邮件)。 + +我们很乐意对任何提交漏洞的人予以特别感谢以便我们修复它。如果你想保持匿名性或使用笔名替代,请告诉我们。我们将充分尊重你的意愿。 + +### 提交功能需求 + +提交功能需求前,请再次确认您已经查看了 [你需要了解的](#你需要了解的) 内容,避免提交重复的 Issue。确定相关仓库后,创建 Issue 并按照 [模板](../../.github/ISSUE_TEMPLATE.md) 尽可能的详细填写相关信息。 + +请认真遵守如下指南,这样我们才能更好地理解和开发功能需求:pencil:: + +* 在标题中清晰准确地描述你的功能需求。 +* 详细描述目前所具有的功能和你所期待的功能,并解释为什么需要该功能。 +* 提供功能需求的样例,如图像文件、在线演示网址等等。 + +### 提交合并请求 + +提交合并请求前,请再次确认您已经查看了 [你需要了解的](#你需要了解的) 内容,避免提交重复的合并请求。确定相关仓库后,创建合并请求。更多详细操作过程可以查看 [帮助文档](https://help.github.com/articles/creating-a-pull-request/)。 + +请认真遵守如下指南,这样我们才能更好地理解你的合并请求: + +* 创建合并请求时,请遵守 [编码规范](#编码规范) 和 [提交信息规范](#提交信息规范)。 +* 在标题中清晰准确地描述你的合并请求,不要加入 Issue 编号。 +* 按照 [模板](../../.github/PULL_REQUEST_TEMPLATE.md) 尽可能的详细填写相关信息。 +* 合并请求需要在所有主题样式中测试通过,并提供所表现功能的样例,如图像文件、在线演示网址等等。 + +### 发布版本 + +版本发布是将项目发布给用户的一种很好的方式。 + +1. 进入 GitHub 项目主页,点击 **Releases** 和 **Draft a new release**。 +2. 输入你需要发布的版本号。版本控制是基于 [Git tags](https://git-scm.com/book/en/Git-Basics-Tagging) 工作的,建议按照 [About Major and Minor NexT versions](https://github.com/theme-next/hexo-theme-next/issues/187) 确定版本号。 +3. 确定你需要发布的分支。除非发布测试版本,通常情况下选择 `master` 分支。 +4. 输入发布版本的标题和说明。 + - 标题为版本号。 + - 内容根据 [Release Drafter](https://github.com/release-drafter/release-drafter) 的模版填写。 + - 使用被动语态,省略主语。 + - 所有的变化都需要记录在版本说明中。对于没有使用 PR 的更改,需要添加相应的 commit 编号。如果使用了 PR 进行合并修改,则直接添加相应的 PR 编号即可。 +5. 如果您希望随版本一起发布二进制文件(如编译的程序),请在上传二进制文件对话框中手动拖放或选择文件。 +6. 如果版本不稳定,请选择 **This is a pre-release**,以通知用户它尚未完全准备好。如果您准备公布您的版本,请点击 **Publish release**。否则,请单击 **Save draft** 以稍后处理。 + +## 规范 + +### 行为规范 + +为了保证本项目的顺利运作,所有参与人都需要遵守 [行为规范](CODE_OF_CONDUCT.md)。 + +### 编码规范 + +我们使用 ESLint 和 Stylint 来识别和报告 JavaScript 和 Stylus 中的模式,目的是使代码更加一致并避免错误。编码时应遵循这些规范。 + +### 标签规范 + +为了方便维护人员和用户能够快速找到他们想要查看的问题,我们使用「标签」功能对 Pull requests 和 Issues 进行分类。 + +如果您不确定某个标签的含义,或者不知道将哪些标签应用于 PR 或 issue,千万别错过这个。 + +Issue 的标签: + +- 类型 + - `Bug`: 检测到需要进行确认的 Bug + - `Feature Request`: 提出了新功能请求的 Issue + - `Question`: 提出疑问的 Issue + - `Meta`: 表明使用条款变更的 Issue + - `Support`: 被标记为支持请求的 Issue + - `Polls`: 发起投票的 Issue +- 结果 + - `Duplicate`: 重复提及的 Issue + - `Hexo`: 与 Hexo 相关的 Issue + - `Hexo Plugin`: 与 Hexo 插件相关的 Issue + - `Browser`: 与浏览器相关的 Issue + - `Invalid`: 无法复现的 Issue + - `Expected Behavior`: 与预期行为相符的 Issue + - `Need More Info`: 需要更多信息的 Issue + - `Solved`: 已经解决的 Issue + - `To Do`: 待解决的 Issue + - `Stale`: 由于长期无人回应被封存的 Issue + +Pull Request 的标签: + +- `Breaking Change`: 产生重大变动的 Pull Request +- `Bug Fix`: 修复相关 Bug 的 Pull Request +- `New Feature`: 添加了新功能的 Pull Request +- `Feature`: 为现有功能提供选项或加成的 Pull Request +- `i18n`: 更新了翻译的 Pull Request +- `Dependencies`: 更新了依赖包的 Pull Request +- `Actions`: 更新了 GitHub Actions 的 Pull Request +- `Skip Release`: 无需在 Release Note 中展现的 Pull Request + +两者兼有: + +- `Roadmap`: 与 NexT 主题发展相关的 Issue 或者 Pull Request +- `Help Wanted`: 需要帮助的 Issue 或者 Pull Request +- `Improvement`: 需要改进的 Issue 或者改进了 NexT 主题的 Pull Request +- `Layout`: 与模版引擎相关的 Issue 或者 Pull Request +- `CSS`: 与 NexT 主题 CSS 文件相关的 Issue 或者 Pull Request +- `Icons & Fonts`: 与 NexT 主题图标和字体相关的 Issue 或者 Pull Request +- `PJAX`: 与 PJAX 相关的 Issue 或者 Pull Request +- `3rd Party Plugin`: 与第三方插件和服务相关的 Issue 或者 Pull Request +- `Docs`: 与文档说明相关的 Issue 或者 Pull Request +- `Configurations`: 与 NexT 主题设置相关的 Issue 或者 Pull Request + +### 提交信息规范 + +我们对项目的 git 提交信息格式进行统一格式约定,每条提交信息由 `type`+`subject` 组成,这将提升项目日志的可读性。 + +- `type` 用于表述此次提交信息的意义,首写字母大写,包括但不局限于如下类型: + * `Build`:基础构建系统或依赖库的变化 + * `Ci`:CI 构建系统及其脚本变化 + * `Docs`:文档内容变化 + * `Feat`:新功能 + * `Fix`:Bug 修复 + * `Perf`:性能优化 + * `Refactor`:重构(即不是新增功能,也不是修改 Bug 的代码变动) + * `Style`:格式(不影响代码运行的变动) + * `Revert`:代码回滚 + * `Release`:版本发布 +- `subject` 用于简要描述修改变更的内容,如 `Update code highlighting in README.md`。 + * 句尾不要使用符号。 + * 使用现在时、祈使句语气。 diff --git a/themes/next/docs/zh-CN/README.md b/themes/next/docs/zh-CN/README.md new file mode 100644 index 0000000..41cd0f0 --- /dev/null +++ b/themes/next/docs/zh-CN/README.md @@ -0,0 +1,188 @@ +
+ 语言: + 🇺🇸 + 🇨🇳 + 🇷🇺 +
+ + + + + NexT preview + + +NexT logo + +# NexT + +> «NexT» 是一款风格优雅的高质量 [Hexo](https://hexo.io) 主题,自点点滴滴中用爱雕琢而成。 + +[![NPM version](https://img.shields.io/npm/v/hexo-theme-next?color=red&logo=npm&style=flat-square)](https://www.npmjs.com/package/hexo-theme-next) +[![NPM Downloads](https://img.shields.io/npm/dm/hexo-theme-next?logo=npm&style=flat-square)](https://www.npmjs.com/package/hexo-theme-next) +[![Required Hexo version](https://img.shields.io/badge/hexo-%3E=5.3.0-blue?style=flat-square&logo=hexo)](https://hexo.io) +[![License](https://img.shields.io/badge/license-%20AGPL-orange?style=flat-square&logo=gnu)](https://github.com/next-theme/hexo-theme-next/blob/master/LICENSE.md) +[![Build Status](https://img.shields.io/github/actions/workflow/status/next-theme/hexo-theme-next/linter.yml?branch=master&label=test&logo=github&style=flat-square)](https://github.com/next-theme/hexo-theme-next/actions?query=workflow%3ALinter) +[![Build Status](https://img.shields.io/github/actions/workflow/status/next-theme/hexo-theme-next/tester.yml?branch=master&logo=github&style=flat-square)](https://github.com/next-theme/hexo-theme-next/actions?query=workflow%3ATester) +[![Coverage Status](https://img.shields.io/coveralls/github/next-theme/hexo-theme-next?logo=coveralls&style=flat-square)](https://coveralls.io/github/next-theme/hexo-theme-next) + +## 即时预览 + +

+ 💟 Muse | 🔯 Mist | ♓️ Pisces | ♊️ Gemini +
+
+ 更多 «NexT» 的例子参见这里。 +

+ +## 安装 + +如果你在使用 Hexo 5.0 或更新版本,最简单的安装方式是通过 npm: + +```sh +$ cd hexo-site +$ npm install hexo-theme-next +``` + +你也可以直接克隆整个仓库: + +```sh +$ cd hexo-site +$ git clone https://github.com/next-theme/hexo-theme-next themes/next +``` + +此外,如果你想要使用其他方式,请参见[详细安装步骤][docs-installation-url]。 + +安装完成后,在 Hexo 配置文件中将 `theme` 设置为 `next`。 + +```yml +theme: next +``` + +## 配置 + +我们不推荐直接修改 NexT 主题的文件。因为这可能导致错误(例如 git merge 冲突),并且在升级主题时修改的文件可能丢失。 + +目前 NexT 鼓励用户使用 [Alternate Theme Config][docs-configuration-url] 进行配置。并且可以轻松地通过 [Custom Files][docs-custom-files-url] 自定义主题的布局和样式。 + +## 插件 + +插件丰富和拓展了 NexT 的功能。这些插件分为两种:核心插件和第三方插件。核心插件被 NexT 的基础功能所依赖。第三方插件提供了大量的可选功能。 + +配置这些插件非常简单。例如,你想要在你的站点中使用 `pjax` 插件,请进入 NexT 配置文件,启用 `pjax` 配置项: + +```yml +# Easily enable fast Ajax navigation on your website. +# For more information: https://github.com/next-theme/pjax +pjax: true +``` + +### 设置 CDN + +第三方插件默认通过 [CDNJS](https://cdnjs.com) CDN 服务加载。我们也提供了其它的 CDN 服务供选择,包括著名的 [UNPKG](https://unpkg.com) 和 [jsDelivr](https://www.jsdelivr.com)。 + +例如,你想要使用 `unpkg` 代替 `cdnjs` 作为默认的 CDN 提供商,你需要在 NexT 配置文件中进行如下设置: + +```yml +vendors: + # ... + # Some contents... + # ... + plugins: unpkg +``` + +## 更新 + +NexT 每个月都会发布新版本。请在更新前阅读[更新说明][docs-release-url]。你可以通过如下命令更新 NexT。 + +通过 npm 安装最新版本: + +```sh +$ cd hexo-site +$ npm install hexo-theme-next@latest +``` + +或者通过 git 更新到最新的 master 分支: + +```sh +$ cd themes/next +$ git pull +``` + +**如果你想要从 v5.x / v7.x 更新到最新版本,阅读[这篇文档][docs-upgrade-url]。** + +## 反馈 + +* 浏览 [Awesome NexT][awesome-next-url] 列表,与其它用户分享插件和教程。 +* 加入我们的 [GitHub discussions][discussions-url] / [Gitter][gitter-url] 聊天。 +* 请花几秒钟来[添加或修正翻译][i18n-url]。 +* 在 [GitHub Issues][issues-bug-url] 报告Bug。 +* 在 [GitHub][issues-feat-url] 请求新的功能。 +* 为 [受欢迎的 Feature request][feat-req-vote-url] 投票。 + +## 贡献你的代码 + +我们欢迎你加入 NexT 的开发,贡献出你的一份力量。请看[开源贡献指南][contributing-document-url]。 🤗 + +你也可以随时向我们的[官方插件][official-plugins-url]提交 Issue 或 Pull Request。 + +## 贡献者 + +[![Contributors][contributors-image]][contributors-url] + +## 鸣谢 + +«NexT» 特别感谢这些支持我们核心基础设施的优质服务: + + + +> GitHub 容许我们托管 Git 仓库及运行测试。 + + + + + + Netlify Logo + + + +> Netlify 容许我们发布文档。 + + + + + + Netlify Logo + + + +> Crowdin 容许我们方便地翻译文档。 + + + + + + CDNJS Logo + + + +> 感谢 CDNJS 提供的 CDN 服务。 + +[docs-installation-url]: https://theme-next.js.org/docs/getting-started/installation.html +[docs-configuration-url]: https://theme-next.js.org/docs/getting-started/configuration.html +[docs-custom-files-url]: https://theme-next.js.org/docs/advanced-settings/custom-files.html +[docs-release-url]: https://github.com/next-theme/hexo-theme-next/releases +[docs-upgrade-url]: https://theme-next.js.org/docs/getting-started/upgrade.html + +[awesome-next-url]: https://github.com/next-theme/awesome-next +[discussions-url]: https://github.com/next-theme/hexo-theme-next/discussions +[gitter-url]: https://app.gitter.im/#/room/#next:gitter.im +[i18n-url]: https://crowdin.com/project/hexo-theme-next + +[issues-bug-url]: https://github.com/next-theme/hexo-theme-next/issues/new?assignees=&labels=Bug&template=bug-report.md +[issues-feat-url]: https://github.com/next-theme/hexo-theme-next/issues/new?assignees=&labels=Feature+Request&template=feature-request.md +[feat-req-vote-url]: https://github.com/next-theme/hexo-theme-next/issues?q=is%3Aopen+is%3Aissue+label%3A%22Feature+Request%22 + +[contributing-document-url]: https://github.com/next-theme/hexo-theme-next/blob/master/docs/zh-CN/CONTRIBUTING.md +[official-plugins-url]: https://github.com/next-theme +[contributors-image]: https://raw.githubusercontent.com/next-theme/contributors/master/contributors.svg +[contributors-url]: https://github.com/next-theme/hexo-theme-next/blob/master/docs/AUTHORS.md diff --git a/themes/next/languages/README.md b/themes/next/languages/README.md new file mode 100644 index 0000000..8d18342 --- /dev/null +++ b/themes/next/languages/README.md @@ -0,0 +1,39 @@ +# Internationalization (i18n) + +[![Crowdin](https://badges.crowdin.net/hexo-theme-next/localized.svg)](https://crowdin.com/project/hexo-theme-next) + +You can use internationalization to present your site in different languages. The default language is set by modifying the `language` setting in Hexo `_config.yml`. You can also set multiple languages and modify the order of default languages. + +```yml +language: en +``` + +```yml +language: + - zh-CN + - en +``` + +## Override Default Translations + +If you would like to customize the default translation, you do not need to modify the translation files in the `languages` directory. You can override all translations using [Data Files](https://hexo.io/docs/data-files). + +1. Creat a `languages.yml` in `source/_data`. +2. Insert following codes: (be careful about the two-space indent) + + ```yml + # language + zh-CN: + # items + post: + copyright: + # the translation you perfer + author: 本文博主 + en: + menu: + schedule: Calendar + ``` + +## Improve Translations + +The files in the `language` directory are automatically generated, you do not need to modify them directly. Please submit translations via [Crowdin](https://crowdin.com/project/hexo-theme-next) if you would like to add or improve translation for NexT theme. diff --git a/themes/next/languages/ar.yml b/themes/next/languages/ar.yml new file mode 100644 index 0000000..51b8b58 --- /dev/null +++ b/themes/next/languages/ar.yml @@ -0,0 +1,103 @@ +--- +name: عربي +title: + archive: الأرشيف + category: تصنيف + tag: وسم + schedule: التقويم +menu: + home: Home + archives: الأرشيفات + categories: التصنيفات + tags: الوسوم + about: معلومات + search: بحث + schedule: التقويم + sitemap: خريطة الموقع + commonweal: Commonweal 404 +sidebar: + overview: عام + toc: المحتويات + links: Links +post: + posted: نُشر في + edited: عُدل في + created: أُنشأ + modified: عُدل + edit: تحرير هذا المقال + in: في + read_more: تابع القراءة + untitled: بدون عنوان + sticky: مثبت + views: مشاهدات + related_posts: مقالات مشابهة + copyright: + author: مؤلف المقال + link: رابط المقال + post_author: Written by + post_link: This article originally appeared on + license_title: حقوق الملكية + license_content: "حميع المقالات في هذه المدوّنة منشورة تحت رخصة %s إلا عند التنويه بخلافه." + license_content_reprint: "This article is a reprinted article and has been reprinted with permission. Please indicate the source!" +footer: + powered: "تطبيق الموقع %s" + total_views: إجمالي المشاهدات + total_visitors: إجمالي الزوار +widget: + github: Follow me on GitHub + chat: Chat +counter: + tag_cloud: + zero: لا وسوم + one: وسمٌ واحدٌ + other: "%d وسماً بالمُجمل" + categories: + zero: لا تصنيفات + one: تصنيفٌ واحد + other: "%d تصنيفات بالمُجمل" + archive_posts: + zero: لا مقالات. + one: مقالٌ واحد. + other: "%d مقالاً بالمُجمل." +state: + posts: المقالات + tags: الوسوم + categories: التصنيفات +search: + placeholder: بحث... + empty: "We didn't find any results for the search: %s" + hits_time: "%s results found in %s ms" + hits: "%s results found" +cheers: + um: هِم.. + ok: حسناً + nice: جميل + good: جيد + great: عظيم + excellent: ممتاز +keep_on: واصل الكتابة. +symbol: + comma: "، " + period: ". " + colon: ": " +reward: + donate: تبرّع + wechatpay: WeChat Pay + alipay: Alipay + paypal: PayPal + bitcoin: Bitcoin + comment: Buy me a coffee +follow_me: + welcome: مرحباً بك حيثُ أنشر أيضاً +accessibility: + nav_toggle: تشغيل شريط التصفح + prev_page: الصفحة السابقة + next_page: الصفحة التالية + back_to_top: Back to top + select_lang: Select language +symbols_count_time: + count: عدد الحروف في المقال + count_total: مُجمل عدد الحروف + time: زمن القراءة + time_total: مُجمل زمن القراءة + time_minutes: دقائق. diff --git a/themes/next/languages/bn.yml b/themes/next/languages/bn.yml new file mode 100644 index 0000000..34a5cd5 --- /dev/null +++ b/themes/next/languages/bn.yml @@ -0,0 +1,103 @@ +--- +name: বাংলা +title: + archive: আর্কাইভ + category: ক্যাটাগরি + tag: ট্যাগ + schedule: কর্ম পরিকল্পনা +menu: + home: হোম পেজ + archives: আর্কাইভ এর তালিকা + categories: ক্যাটাগরি এর তালিকা + tags: ট্যাগ এর তালিকা + about: সম্পর্কে + search: সার্চ + schedule: কর্ম পরিকল্পনা + sitemap: Sitemap + commonweal: Commonweal 404 +sidebar: + overview: সারাংশ + toc: সূচীপত্র + links: লিঙ্কসমুহ +post: + posted: প্রকাশিত হয়েছে + edited: সম্পাদিত হয়েছে + created: তৈরি করা হয়েছে + modified: পরিমার্জন করা হয়েছে + edit: পোস্টটি সম্পাদনা করুন + in: শ্রেনী + read_more: আরো পড়ুন + untitled: শিরোনামহীন + sticky: স্থির + views: ভিউ + related_posts: সম্পর্কিত পোস্ট + copyright: + author: লিখিকা + link: পোস্ট লিঙ্ক + post_author: রচনা করেছেন + post_link: এই আর্টিকেলটি প্রথমে প্রকাশিত হয়েছে + license_title: কপিরাইট নোটিস + license_content: "এই ব্লগের সমস্ত আর্টিকেল %s এর অধীনে লাইসেন্সপ্রাপ্ত যদি না ব্যতিক্রম উল্লেখ করা হয়।" + license_content_reprint: "এই আর্টিকেলটি একটি পুনর্মুদ্রিত আর্টিকেল এবং অনুমতি নিয়ে পুনরায় মুদ্রণ করা হয়েছে। দয়া করে উৎস নির্দেশ করুন!" +footer: + powered: "%s এর সাহায্যে চলছে" + total_views: মোট দর্শক + total_visitors: মোট দর্শক +widget: + github: আমাকে GitHub এ অনুসরন কর + chat: চ্যাট +counter: + tag_cloud: + zero: কোনও ট্যাগ নেই + one: একটি ট্যাগ আছে + other: "মোট %d টি ট্যাগ" + categories: + zero: কোন ক্যাটাগরি নেই + one: একটি ক্যাটাগরি আছে + other: "মোট %d টি ক্যাটাগরি" + archive_posts: + zero: কোনও পোস্ট নেই. + one: ১টি পোস্ট। + other: "মোট %d টি পোস্ট।" +state: + posts: পোস্ট এর তালিকা + tags: ট্যাগ এর তালিকা + categories: ক্যাটাগরি এর তালিকা +search: + placeholder: সার্চ করা হচ্ছে... + empty: "আমরা উক্ত অনুসন্ধানের জন্য কোন ফলাফল খুঁজে পাইনি: %s" + hits_time: "%s টি ফলাফল %s মিলিসেকেন্ড এ পাওয়া গেছে" + hits: "%s টি ফলাফল পাওয়া গেছে" +cheers: + um: ইয়ে... মানে.. + ok: ঠিক আছে + nice: বেশ + good: ভালো + great: অসাধারন + excellent: চমৎকার +keep_on: পোস্ট চালিয়ে যাও। +symbol: + comma: ", " + period: "। " + colon: "ঃ " +reward: + donate: দান করুন + wechatpay: উইচ্যাট পে + alipay: আলি পে + paypal: PayPal + bitcoin: বিটকয়েন + comment: আমাকে একটা কফি কিনে দাও +follow_me: + welcome: আমার অন্যান্য প্রকাশনা চ্যানেলে আপনাকে স্বাগতম +accessibility: + nav_toggle: নেভিগেশন বারের দৃশ্যমানতা টগল করুন + prev_page: পূর্ববর্তী পৃষ্ঠা + next_page: পূর্ববর্তী পৃষ্ঠা + back_to_top: উপরে ফিরে যান + select_lang: ভাষা নির্বাচন করুন +symbols_count_time: + count: আর্টিকালে অক্ষর এর পরিমাণ + count_total: আর্টিকালে অক্ষর এর মোট পরিমাণ + time: পড়াতে লাগবে + time_total: মোট পড়াতে লাগবে + time_minutes: মিনিট। diff --git a/themes/next/languages/de.yml b/themes/next/languages/de.yml new file mode 100644 index 0000000..c5a3ef7 --- /dev/null +++ b/themes/next/languages/de.yml @@ -0,0 +1,103 @@ +--- +name: Deutsch +title: + archive: Archiv + category: Kategorie + tag: Schlagwort + schedule: Zeitplan +menu: + home: Startseite + archives: Archiv + categories: Kategorien + tags: Schlagwörter + about: Über + search: Suche + schedule: Zeitplan + sitemap: Sitemap + commonweal: Commonweal 404 +sidebar: + overview: Übersicht + toc: Inhaltsverzeichnis + links: Links +post: + posted: Veröffentlicht am + edited: Bearbeitet am + created: Erstellt + modified: Geändert am + edit: Diesen Beitrag bearbeiten + in: in + read_more: Weiterlesen + untitled: Unbenannt + sticky: Angepinnt + views: Aufrufe + related_posts: Ähnliche Beiträge + copyright: + author: Beitragsautor + link: Beitragslink + post_author: Written by + post_link: This article originally appeared on + license_title: Urheberrechtshinweis + license_content: "Alle Artikel in diesem Blog sind unter %s lizenziert, außer es wird anders angegeben." + license_content_reprint: "This article is a reprinted article and has been reprinted with permission. Please indicate the source!" +footer: + powered: "Erstellt mit %s" + total_views: Alle Aufrufe + total_visitors: Alle Besucher +widget: + github: Follow me on GitHub + chat: Chat +counter: + tag_cloud: + zero: Keine Schlagworte + one: Insgesamt ein Schlagwort + other: "Insgesamt %d Schlagwörter" + categories: + zero: Keine Kategorien + one: Insgesamt eine Kategorie + other: "Insgesamt %d Kategorien" + archive_posts: + zero: Keine Artikel vorhanden. + one: Ein Artikel. + other: "Insgesamt %d Artikel." +state: + posts: Artikel + tags: schlagwörter + categories: Kategorien +search: + placeholder: Suche... + empty: "We didn't find any results for the search: %s" + hits_time: "%s results found in %s ms" + hits: "%s results found" +cheers: + um: Öhm.. + ok: OK + nice: Schön + good: Gut + great: Wunderbar + excellent: Exzellent +keep_on: Bleib dran. +symbol: + comma: ". " + period: ", " + colon: ": " +reward: + donate: Spenden + wechatpay: WeChat Bezahlung + alipay: Alipay + paypal: PayPal + bitcoin: Bitcoin + comment: Buy me a coffee +follow_me: + welcome: Willkommen zu meinen anderen Veröffentlichen Kanälen +accessibility: + nav_toggle: Navigationsleiste an/ausschalten + prev_page: Vorherige Seite + next_page: Nächste Seite + back_to_top: Back to top + select_lang: Select language +symbols_count_time: + count: Symbole im Artikel gezählt + count_total: Insgesamt gezählte Symbole + time: Lesezeit + time_total: Insgesamte Lesezeit + time_minutes: minuten. diff --git a/themes/next/languages/default.yml b/themes/next/languages/default.yml new file mode 120000 index 0000000..7fcfc3b --- /dev/null +++ b/themes/next/languages/default.yml @@ -0,0 +1 @@ +en.yml \ No newline at end of file diff --git a/themes/next/languages/en.yml b/themes/next/languages/en.yml new file mode 100644 index 0000000..92b65e9 --- /dev/null +++ b/themes/next/languages/en.yml @@ -0,0 +1,120 @@ +name: English + +title: + archive: Archive + category: Category + tag: Tag + schedule: Schedule + +menu: + home: Home + archives: Archives + categories: Categories + tags: Tags + about: About + search: Search + schedule: Schedule + sitemap: Sitemap + commonweal: Commonweal 404 + +sidebar: + overview: Overview + toc: Table of Contents + links: Links + +post: + posted: Posted on + edited: Edited on + created: Created + modified: Modified + edit: Edit this post + in: In + read_more: Read more + untitled: Untitled + sticky: Sticky + views: Views + related_posts: Related Posts + copyright: + author: Post author + link: Post link + post_author: Written by + post_link: This article originally appeared on + license_title: Copyright Notice + license_content: "All articles in this blog are licensed under %s unless stating additionally." + license_content_reprint: "This article is a reprinted article and has been reprinted with permission. Please indicate the source!" + +footer: + powered: "Powered by %s" + total_views: Total Views + total_visitors: Total Visitors + +widget: + github: Follow me on GitHub + chat: Chat + +counter: + tag_cloud: + zero: No tags + one: 1 tag in total + other: "%d tags in total" + + categories: + zero: No categories + one: 1 category in total + other: "%d categories in total" + + archive_posts: + zero: No posts. + one: 1 post. + other: "%d posts in total." + +state: + posts: posts + tags: tags + categories: categories + +search: + placeholder: Searching... + empty: "We didn't find any results for the search: %s" + hits_time: "%s results found in %s ms" + hits: "%s results found" + +cheers: + um: Um.. + ok: OK + nice: Nice + good: Good + great: Great + excellent: Excellent + +keep_on: Keep on posting. + +symbol: + comma: ", " + period: ". " + colon: ": " + +reward: + donate: Donate + wechatpay: WeChat Pay + alipay: Alipay + paypal: PayPal + bitcoin: Bitcoin + comment: Buy me a coffee + +follow_me: + welcome: Welcome to my other publishing channels + +accessibility: + nav_toggle: Toggle navigation bar + prev_page: Previous page + next_page: Next page + back_to_top: Back to top + select_lang: Select language + +symbols_count_time: + count: Word count in article + count_total: Word count total + time: Reading time + time_total: Reading time total + time_minutes: mins. diff --git a/themes/next/languages/eo.yml b/themes/next/languages/eo.yml new file mode 100644 index 0000000..2abae7a --- /dev/null +++ b/themes/next/languages/eo.yml @@ -0,0 +1,103 @@ +--- +name: Esperanto +title: + archive: Arkivo + category: Kategorio + tag: Etikedo + schedule: Horaro +menu: + home: Ĉefpaĝo + archives: Arkivoj + categories: Kategorioj + tags: Etikedoj + about: Pri + search: Serĉi + schedule: Horaro + sitemap: Retejmapo + commonweal: Commonweal 404 +sidebar: + overview: Superrigardo + toc: Enhavtabelo + links: Links +post: + posted: Afiŝita je + edited: Redaktita je + created: Kreita por + modified: Modifita por + edit: Redaktu ĉi tiun afiŝon + in: En + read_more: Legi pli + untitled: Neniu titolo + sticky: Alpingli al la supro + views: Rigardoj + related_posts: Rilataj afiŝoj + copyright: + author: Aŭtoro de ĉi tiu afiŝo + link: Ligilo de ĉi tui afiŝo + post_author: Written by + post_link: This article originally appeared on + license_title: Copyright + license_content: "Ĉiuj artikoloj en ĉi tiu blogo estas licencita sub %s krom se kroma permesilo estas specifita." + license_content_reprint: "This article is a reprinted article and has been reprinted with permission. Please indicate the source!" +footer: + powered: "Funkciigita de %s" + total_views: Tutaj rigardoj + total_visitors: Tutaj visitoj +widget: + github: Follow me on GitHub + chat: Chat +counter: + tag_cloud: + zero: Neniuj etikedoj + one: Entute 1 etikedo + other: "Entute %d etikedoj" + categories: + zero: Neniuj kategorioj + one: Entute 1 kategorio + other: "Entute %d kategorioj" + archive_posts: + zero: Neniuj afiŝoj. + one: Entute 1 afiŝo. + other: "Entute %d afiŝoj." +state: + posts: afiŝoj + tags: etikedoj + categories: kategorioj +search: + placeholder: Serĉante... + empty: "We didn't find any results for the search: %s" + hits_time: "%s results found in %s ms" + hits: "%s results found" +cheers: + um: Um.. + ok: malaĉe + nice: bonete + good: bone + great: bonege + excellent: perfekte +keep_on: Daŭre afiŝu! +symbol: + comma: ", " + period: ". " + colon: ": " +reward: + donate: Doni + wechatpay: WeChat Pay + alipay: Alipay + paypal: PayPal + bitcoin: Bitcoin + comment: Buy me a coffee +follow_me: + welcome: Bonvenon al miaj aliaj eldonkanaloj +accessibility: + nav_toggle: Baskuligi navigacian stangon + prev_page: Antaŭa paĝo + next_page: Sekva paĝo + back_to_top: Back to top + select_lang: Select language +symbols_count_time: + count: Nombro da signoj en la artikolo + count_total: Nombro da signoj en la tuta reto + time: Tempo de rigardo + time_total: Tempo tuta de rigardo + time_minutes: minutoj. diff --git a/themes/next/languages/es.yml b/themes/next/languages/es.yml new file mode 100644 index 0000000..17e546a --- /dev/null +++ b/themes/next/languages/es.yml @@ -0,0 +1,103 @@ +--- +name: Español +title: + archive: Archivo + category: Categoría + tag: Etiqueta + schedule: Calendario +menu: + home: Inicio + archives: Archivo + categories: Categorías + tags: Etiquetas + about: Sobre mi + search: Buscar + schedule: Calendario + sitemap: Mapa del sitio + commonweal: Commonweal 404 +sidebar: + overview: Inicio + toc: Tabla de contenidos + links: Links +post: + posted: Publicado el + edited: Editado el + created: Creado por + modified: Modificado por + edit: Editar esta entrada + in: En + read_more: Leer más + untitled: Sin título + sticky: Destacados + views: Visitas + related_posts: Entradas relacionadas + copyright: + author: Autor de la entrada + link: Enlace a la entrada + post_author: Escrito por + post_link: Este artículo apareció originalmente en + license_title: Copyright + license_content: "Todos los artículos de este blog están licenciados bajo %s a no ser que se especifique una licencia adicional." + license_content_reprint: "This article is a reprinted article and has been reprinted with permission. Please indicate the source!" +footer: + powered: "Creado mediante %s" + total_views: Visitas totales + total_visitors: Visitantes totales +widget: + github: Follow me on GitHub + chat: Chat +counter: + tag_cloud: + zero: Sin etiquetas + one: 1 etiqueta en total + other: "%d etiquetas en total" + categories: + zero: Sin categorías + one: 1 categoría en total + other: "%d categorías en total" + archive_posts: + zero: Sin entradas. + one: 1 entrada. + other: "%d entradas en total." +state: + posts: entradas + tags: etiquetas + categories: categorías +search: + placeholder: Buscando... + empty: "No hemos encontrado ningún resultado para la búsqueda: %s" + hits_time: "%s resultados encontrados en %s ms" + hits: "%s resultados encontrados" +cheers: + um: Um.. + ok: Bueno + nice: Guai + good: Bien + great: Genial + excellent: Excelente +keep_on: Sigue posteando. +symbol: + comma: ", " + period: ". " + colon: ": " +reward: + donate: Donar + wechatpay: WeChat Pay + alipay: Alipay + paypal: PayPal + bitcoin: Bitcoin + comment: Buy me a coffee +follow_me: + welcome: Bienvenido a mis otros canales +accessibility: + nav_toggle: Cambiar a barra de navegación + prev_page: Página anterior + next_page: Página siguiente + back_to_top: Volver al principio + select_lang: Seleccione el idioma +symbols_count_time: + count: Cantidad de caracteres en el articulo + count_total: Cantidad total de caracteres + time: Tiempo de lectura + time_total: Tiempo total de lectura + time_minutes: minutos. diff --git a/themes/next/languages/fa.yml b/themes/next/languages/fa.yml new file mode 100644 index 0000000..6e47787 --- /dev/null +++ b/themes/next/languages/fa.yml @@ -0,0 +1,103 @@ +--- +name: فارسی +title: + archive: بایگانی + category: دسته بندی + tag: برچسب + schedule: زمان بندی +menu: + home: صفحه اصلی + archives: بایگانی + categories: دسته بندی ها + tags: برچسب ها + about: درباره + search: جستجو + schedule: زمان بندی + sitemap: نقشه سایت + commonweal: Commonweal 404 +sidebar: + overview: نمای کلی + toc: فهرست مطالب + links: Links +post: + posted: نوشته شده در + edited: ویرایش شده در + created: ایجاد شده + modified: تغییر یافته + edit: ویرایش این پست + in: در + read_more: ادامه مطلب + untitled: بدون عنوان + sticky: چسبنده + views: بازدیدها + related_posts: پست های مرتبط + copyright: + author: نویسنده پست + link: لینک پست + post_author: Written by + post_link: This article originally appeared on + license_title: مقررات کپی رایت + license_content: "همه مقالات در این وبلاگ تحت %s مجاز می باشند مگر اینکه به طور اضافی بیان شوند." + license_content_reprint: "This article is a reprinted article and has been reprinted with permission. Please indicate the source!" +footer: + powered: "قدرت گرفته از %s" + total_views: مجموع بازدیدها + total_visitors: تعداد بازدید کنندگان +widget: + github: Follow me on GitHub + chat: Chat +counter: + tag_cloud: + zero: بدون برچسب + one: 1 برچسب در مجموع + other: "%d برچسب در مجموع" + categories: + zero: بدون دسته بندی + one: 1 دسته بندی در مجموع + other: "%d دسته بندی در مجموع" + archive_posts: + zero: بدون پست. + one: 1 پست. + other: "%d برچسب در مجموع." +state: + posts: پست ها + tags: برجسب ها + categories: دسته بندی ها +search: + placeholder: جستجو... + empty: "We didn't find any results for the search: %s" + hits_time: "%s results found in %s ms" + hits: "%s results found" +cheers: + um: ام... + ok: باشه + nice: زیبا + good: خوب + great: عالی + excellent: بسیار عالی +keep_on: به پست دادن ادامه دهید. +symbol: + comma: ", " + period: ". " + colon: ": " +reward: + donate: کمک مالی + wechatpay: پرداخت WeChat + alipay: AliPay + paypal: PayPal + bitcoin: بیت کوین + comment: Buy me a coffee +follow_me: + welcome: Welcome to my other publishing channels +accessibility: + nav_toggle: تغییر ناوبری + prev_page: صفحه قبلی + next_page: صفحه بعدی + back_to_top: Back to top + select_lang: Select language +symbols_count_time: + count: تعداد نمادها در مقاله + count_total: تعداد کل نمادها + time: زمان خواندن + time_total: کل زمان خواندن + time_minutes: دقیقه. diff --git a/themes/next/languages/fr.yml b/themes/next/languages/fr.yml new file mode 100644 index 0000000..5dc5fd8 --- /dev/null +++ b/themes/next/languages/fr.yml @@ -0,0 +1,103 @@ +--- +name: Français +title: + archive: Archive + category: Catégorie + tag: Mots clés + schedule: Plannifier +menu: + home: Accueil + archives: Archives + categories: Catégories + tags: Mots clés + about: À propos + search: Recherche + schedule: Plannifier + sitemap: Plan de site + commonweal: Commonweal 404 +sidebar: + overview: Aperçu + toc: Table Des Matières + links: Liens +post: + posted: Posté le + edited: Édité le + created: Article créé le + modified: Mis à jour le + edit: Éditer cet article + in: dans + read_more: Lire la suite + untitled: Sans titre + sticky: Épingler + views: Vues + related_posts: Articles similaires + copyright: + author: Auteur de l'article + link: Lien de l'article + post_author: Rédigé par + post_link: Cet article a été initialement publié sur + license_title: Droit d'auteur + license_content: "Tous les articles de ce blog sont sous licence %s, sauf mention contraire." + license_content_reprint: "Cet article provient d'un article publié et repris avec autorisation. Veuillez indiquer la source!" +footer: + powered: "Propulsé par %s" + total_views: Vues totales + total_visitors: Total visiteurs +widget: + github: Suivez-moi sur GitHub + chat: Discussion +counter: + tag_cloud: + zero: Aucun tag + one: 1 tag au total + other: "%d tags au total" + categories: + zero: Aucune categorie + one: 1 catégorie au total + other: "%d catégories au total" + archive_posts: + zero: Aucun article. + one: 1 article. + other: "%d articles au total." +state: + posts: articles + tags: mots clé + categories: catégories +search: + placeholder: Recherche... + empty: "Nous n'avons trouvé aucun résultat pour la recherche : %s" + hits_time: "%s resultats trouvés en %s ms" + hits: "%s résultats trouvés" +cheers: + um: Eh bien.. + ok: Ok + nice: Jolie + good: Bien + great: Super + excellent: Excellent +keep_on: Continue comme ça. +symbol: + comma: ", " + period: ". " + colon: ": " +reward: + donate: Donner + wechatpay: Paiement WeChat + alipay: Alipay + paypal: PayPal + bitcoin: Bitcoin + comment: Offrez-moi un café +follow_me: + welcome: Bienvenue dans mes autres salons de publication +accessibility: + nav_toggle: Basculer la barre de navigation + prev_page: Page précédente + next_page: Page suivante + back_to_top: Revenir en haut + select_lang: Choisir une langue +symbols_count_time: + count: Caractères dans l'article + count_total: Caractères total + time: Temps de lecture + time_total: Temps total de lecture + time_minutes: minutes. diff --git a/themes/next/languages/id.yml b/themes/next/languages/id.yml new file mode 100644 index 0000000..a9d9525 --- /dev/null +++ b/themes/next/languages/id.yml @@ -0,0 +1,103 @@ +--- +name: Bahasa Indonesia +title: + archive: Arsip + category: Kategori + tag: Tag + schedule: Schedule +menu: + home: Beranda + archives: Arsip + categories: Kategori + tags: Tags + about: Tentang + search: Pencarian + schedule: Schedule + sitemap: Sitemap + commonweal: Commonweal 404 +sidebar: + overview: Ikhtisar + toc: Daftar Isi + links: Links +post: + posted: Diposting di + edited: Edited on + created: Post created + modified: Updated at + edit: Edit this post + in: Di + read_more: Baca lebih + untitled: Tidak ada title + sticky: Sticky + views: Views + related_posts: Related Posts + copyright: + author: Post author + link: Post link + post_author: Written by + post_link: This article originally appeared on + license_title: Copyright Notice + license_content: "All articles in this blog are licensed under %s unless stating additionally." + license_content_reprint: "This article is a reprinted article and has been reprinted with permission. Please indicate the source!" +footer: + powered: "Powered by %s" + total_views: Total Views + total_visitors: Total Visitors +widget: + github: Follow me on GitHub + chat: Chat +counter: + tag_cloud: + zero: Tidak ada tags + one: 1 total tag + other: "%d total tags" + categories: + zero: Tidak ada kategori + one: 1 total categori + other: "%d total kategori" + archive_posts: + zero: Tidak ada posting. + one: 1 posting. + other: "%d total posting." +state: + posts: posting + tags: tags + categories: kategori +search: + placeholder: Searching... + empty: "We didn't find any results for the search: %s" + hits_time: "%s results found in %s ms" + hits: "%s results found" +cheers: + um: Um.. + ok: OK + nice: Bagus + good: Bagus + great: Besar + excellent: Baik +keep_on: Terus Posting. +symbol: + comma: ", " + period: ". " + colon: ": " +reward: + donate: Donate + wechatpay: WeChat Pay + alipay: Alipay + paypal: PayPal + bitcoin: Bitcoin + comment: Buy me a coffee +follow_me: + welcome: Welcome to my other publishing channels +accessibility: + nav_toggle: Toggle navigation bar + prev_page: Halaman sebelumnya + next_page: Halaman selanjutnya + back_to_top: Back to top + select_lang: Select language +symbols_count_time: + count: Symbols count in article + count_total: Symbols count total + time: Reading time + time_total: Reading time total + time_minutes: mins. diff --git a/themes/next/languages/it.yml b/themes/next/languages/it.yml new file mode 100644 index 0000000..6ac5bc1 --- /dev/null +++ b/themes/next/languages/it.yml @@ -0,0 +1,103 @@ +--- +name: Italiano +title: + archive: Archivio + category: Categoria + tag: Tag + schedule: Programma +menu: + home: Home + archives: Archivi + categories: Categorie + tags: Tags + about: Informazioni su + search: Cerca + schedule: Programma + sitemap: Sitemap + commonweal: Commonweal 404 +sidebar: + overview: Panoramica + toc: Indice + links: Links +post: + posted: Scritto il + edited: Edited on + created: Post creato + modified: Post modificato + edit: Edit this post + in: In + read_more: Leggi di più + untitled: Senza titolo + sticky: Sticky + views: Views + related_posts: Related Posts + copyright: + author: Autore + link: Link + post_author: Written by + post_link: This article originally appeared on + license_title: Copyright + license_content: "Tutti gli articoli in questo sito sono sotto licenza %s salvo disposizione contraria." + license_content_reprint: "This article is a reprinted article and has been reprinted with permission. Please indicate the source!" +footer: + powered: "Powered by %s" + total_views: Total Views + total_visitors: Total Visitors +widget: + github: Follow me on GitHub + chat: Chat +counter: + tag_cloud: + zero: Nessun tag + one: 1 tag in totale + other: "%d tags in totale." + categories: + zero: Nessuna categoria + one: 1 categoria in totale + other: "%d categorie in totale." + archive_posts: + zero: Nessun post. + one: 1 post. + other: "%d posts in totale." +state: + posts: posts + tags: tags + categories: categorie +search: + placeholder: Cerca... + empty: "We didn't find any results for the search: %s" + hits_time: "%s results found in %s ms" + hits: "%s results found" +cheers: + um: Mh.. + ok: OK + nice: Bello + good: Buono + great: Ottimo + excellent: Eccellente +keep_on: Continua così. +symbol: + comma: ", " + period: ". " + colon: ": " +reward: + donate: Dona + wechatpay: WeChat Pay + alipay: Alipay + paypal: PayPal + bitcoin: Bitcoin + comment: Buy me a coffee +follow_me: + welcome: Welcome to my other publishing channels +accessibility: + nav_toggle: Toggle navigation bar + prev_page: Pagina precedente + next_page: Pagina successiva + back_to_top: Back to top + select_lang: Select language +symbols_count_time: + count: Symbols count in article + count_total: Symbols count total + time: Reading time + time_total: Reading time total + time_minutes: mins. diff --git a/themes/next/languages/ja.yml b/themes/next/languages/ja.yml new file mode 100644 index 0000000..947b87e --- /dev/null +++ b/themes/next/languages/ja.yml @@ -0,0 +1,103 @@ +--- +name: 日本語 +title: + archive: アーカイブ + category: カテゴリ + tag: タグ + schedule: スケジュール +menu: + home: ホーム + archives: アーカイブ + categories: カテゴリ + tags: タグ + about: プロフィール + search: 検索 + schedule: スケジュール + sitemap: サイトマップ + commonweal: 公益 404 +sidebar: + overview: 概要 + toc: 見出し + links: Links +post: + posted: 投稿日 + edited: 編集日 + created: 作成日 + modified: 修正日 + edit: この記事を編集する + in: カテゴリ + read_more: 続きを読む + untitled: 無題 + sticky: 固定 + views: 閲覧数 + related_posts: 関連記事 + copyright: + author: 著者 + link: 記事へのリンク + post_author: 作者 + post_link: 元の記事 + license_title: 著作権表示 + license_content: "このブログ内のすべての記事は、特別な記載がない限り %s の下のライセンスで保護されています。" + license_content_reprint: "This article is a reprinted article and has been reprinted with permission. Please indicate the source!" +footer: + powered: "Powered by %s" + total_views: 閲覧合計数 + total_visitors: 合計閲覧者数 +widget: + github: Follow me on GitHub + chat: Chat +counter: + tag_cloud: + zero: タグなし + one: 全 1 タグ + other: "全 %d タグ" + categories: + zero: カテゴリなし + one: 全 1 カテゴリ + other: "全 %d カテゴリ" + archive_posts: + zero: ポストなし + one: 全 1 ポスト + other: "全 %d ポスト" +state: + posts: ポスト + tags: タグ + categories: カテゴリ +search: + placeholder: 検索… + empty: "検索結果が見つかりませんでした: %s" + hits_time: "%s の結果が %s ms で見つかりました" + hits: "%s 件の結果が見つかりました" +cheers: + um: うーん + ok: はい + nice: まあまあ + good: いいね + great: すごい + excellent: 最高 +keep_on: もっと書こう! +symbol: + comma: "、" + period: "。" + colon: ":" +reward: + donate: 寄付 + wechatpay: WeChat 支払う + alipay: Alipay + paypal: PayPal + bitcoin: ビットコイン + comment: Buy me a coffee +follow_me: + welcome: 他の公開チャンネルへようこそ +accessibility: + nav_toggle: ナビゲーションバーの切り替え + prev_page: 前のページ + next_page: 次のページ + back_to_top: Back to top + select_lang: Select language +symbols_count_time: + count: 単語数 + count_total: 単語の総数 + time: 読書の時間 + time_total: 読書の合計時間 + time_minutes: 分 diff --git a/themes/next/languages/ko.yml b/themes/next/languages/ko.yml new file mode 100644 index 0000000..99dbd49 --- /dev/null +++ b/themes/next/languages/ko.yml @@ -0,0 +1,103 @@ +--- +name: 한국어 +title: + archive: 아카이브 + category: 카테고리 + tag: 태그 + schedule: Schedule +menu: + home: 홈 + archives: 아카이브 + categories: 카테고리 + tags: 태그 + about: 정보 + search: 검색 + schedule: Schedule + sitemap: Sitemap + commonweal: Commonweal 404 +sidebar: + overview: 흝어보기 + toc: 목차 + links: Links +post: + posted: 작성일 + edited: Edited on + created: Post created + modified: Updated at + edit: Edit this post + in: In + read_more: 더 읽어보기 + untitled: 제목 없음 + sticky: 고정 + views: Views + related_posts: Related Posts + copyright: + author: 포스트 작성자 + link: Post link + post_author: Written by + post_link: This article originally appeared on + license_title: Copyright Notice + license_content: "All articles in this blog are licensed under %s unless stating additionally." + license_content_reprint: "This article is a reprinted article and has been reprinted with permission. Please indicate the source!" +footer: + powered: "Powered by %s" + total_views: Total Views + total_visitors: Total Visitors +widget: + github: Follow me on GitHub + chat: Chat +counter: + tag_cloud: + zero: 태그 없음 + one: 1개의 태그 + other: "총 %d개의 태그" + categories: + zero: 카테고리 없음 + one: 1개의 카테고리 + other: "총 %d개의 카테고리" + archive_posts: + zero: 포스트 없음 + one: 1개의 포스트 + other: "총 %d개의 포스트를 작성하셨습니다." +state: + posts: 포스트 + tags: 태그 + categories: 카테고리 +search: + placeholder: Searching... + empty: "We didn't find any results for the search: %s" + hits_time: "%s results found in %s ms" + hits: "%s results found" +cheers: + um: 음.. + ok: 동의해요 + nice: 잘했어요 + good: 좋아요 + great: 훌륭해요 + excellent: 완벽해요 +keep_on: 포스트를 계속 작성하세요. +symbol: + comma: ", " + period: ". " + colon: ": " +reward: + donate: 도네이션 + wechatpay: WeChat Pay + alipay: Alipay + paypal: PayPal + bitcoin: 비트코인 + comment: Buy me a coffee +follow_me: + welcome: Welcome to my other publishing channels +accessibility: + nav_toggle: Toggle navigation bar + prev_page: 이전 페이지 + next_page: 다음 페이지 + back_to_top: Back to top + select_lang: Select language +symbols_count_time: + count: Symbols count in article + count_total: Symbols count total + time: Reading time + time_total: Reading time total + time_minutes: mins. diff --git a/themes/next/languages/nl.yml b/themes/next/languages/nl.yml new file mode 100644 index 0000000..3fcb8b3 --- /dev/null +++ b/themes/next/languages/nl.yml @@ -0,0 +1,103 @@ +--- +name: Niederländisch +title: + archive: Archief + category: Categorie + tag: Label + schedule: Rooster +menu: + home: Home + archives: Archieven + categories: Categorieën + tags: Labels + about: Over + search: Zoeken + schedule: Rooster + sitemap: Sitemap + commonweal: Gezond verstand 404 +sidebar: + overview: Overzicht + toc: Inhoudsopgave + links: Links +post: + posted: Geplaatst op + edited: Edited on + created: Post aangemaakt + modified: Post aangepast + edit: Edit this post + in: In + read_more: Lees meer + untitled: Naamloos + sticky: Sticky + views: Views + related_posts: Related Posts + copyright: + author: Post auteur + link: Post link + post_author: Written by + post_link: This article originally appeared on + license_title: Copyright melding + license_content: "Alle artikelen op deze blog zijn gelicenseerd onder %s, mits niet anders aangegeven." + license_content_reprint: "This article is a reprinted article and has been reprinted with permission. Please indicate the source!" +footer: + powered: "Mede mogelijk gemaakt door %s" + total_views: Total Views + total_visitors: Total Visitors +widget: + github: Follow me on GitHub + chat: Chat +counter: + tag_cloud: + zero: Geen labels + one: 1 label in totaal + other: "%d labels in totaal" + categories: + zero: Geen categorieën + one: 1 categorie in totaal + other: "%d categorieën in totaal" + archive_posts: + zero: Geen posts. + one: 1 post. + other: "%d posts in totaal." +state: + posts: posts + tags: labels + categories: categorieën +search: + placeholder: Zoeken... + empty: "We didn't find any results for the search: %s" + hits_time: "%s results found in %s ms" + hits: "%s results found" +cheers: + um: Um.. + ok: Oké + nice: Leuk + good: Goed + great: Geweldig + excellent: Uitstekend +keep_on: Blijf posten. +symbol: + comma: ", " + period: ". " + colon: ": " +reward: + donate: Doneer + wechatpay: WeChat Pay + alipay: Alipay + paypal: PayPal + bitcoin: Bitcoin + comment: Buy me a coffee +follow_me: + welcome: Welcome to my other publishing channels +accessibility: + nav_toggle: Toggle navigation bar + prev_page: Vorige pagina + next_page: Volgende pagina + back_to_top: Back to top + select_lang: Select language +symbols_count_time: + count: Symbols count in article + count_total: Symbols count total + time: Reading time + time_total: Reading time total + time_minutes: mins. diff --git a/themes/next/languages/pt-BR.yml b/themes/next/languages/pt-BR.yml new file mode 100644 index 0000000..cdd5b8d --- /dev/null +++ b/themes/next/languages/pt-BR.yml @@ -0,0 +1,103 @@ +--- +name: Português +title: + archive: Arquivo + category: Categoria + tag: Etiqueta + schedule: Programação +menu: + home: Home + archives: Arquivos + categories: Categorias + tags: Etiquetas + about: Sobre + search: Pesquisar + schedule: Programação + sitemap: Mapa do site + commonweal: Commonweal 404 +sidebar: + overview: Visão geral + toc: Índice + links: Links +post: + posted: Postado em + edited: Editado em + created: Criado em + modified: Modificado em + edit: Editar publicação + in: Em + read_more: Leia mais + untitled: Sem título + sticky: Fixo + views: Visualizações + related_posts: Publicações Relacionadas + copyright: + author: Autor da publicação + link: Link da publicação + post_author: Escrito por + post_link: Este artigo foi originalmente publicado em + license_title: Nota de Direitos Autorais + license_content: "Todos os artigos deste blog são licenciados sob %s, a menos que seja indicado o contrário." + license_content_reprint: "This article is a reprinted article and has been reprinted with permission. Please indicate the source!" +footer: + powered: "Feito com %s" + total_views: Visualizações Totais + total_visitors: Total de visitantes +widget: + github: Follow me on GitHub + chat: Chat +counter: + tag_cloud: + zero: Sem etiquetas + one: 1 etiqueta no total de + other: "%d etiquetas no total de" + categories: + zero: Sem categoria + one: 1 categoria no total de + other: "%d categoria no total de" + archive_posts: + zero: Sem publicações. + one: 1 publicação. + other: "%d publicações no total." +state: + posts: publicações + tags: etiquetas + categories: categorias +search: + placeholder: Pesquisando... + empty: "Não encontramos nenhum resultado para a pesquisa: %s" + hits_time: "%s resultados encontrados em %s ms" + hits: "%s resultados encontrados" +cheers: + um: Uhmmmm... + ok: OK + nice: Bom + good: Muito Bom + great: Ótimo + excellent: Excelente +keep_on: Continue publicando. +symbol: + comma: ", " + period: ". " + colon: ": " +reward: + donate: Doar + wechatpay: WeChat Pay + alipay: Alipay + paypal: PayPal + bitcoin: Bitcoin + comment: Buy me a coffee +follow_me: + welcome: Bem-vindo aos meus outros canais de publicação +accessibility: + nav_toggle: Alternar barra de navegação + prev_page: Página anterior + next_page: Próxima página + back_to_top: Back to top + select_lang: Select language +symbols_count_time: + count: Contagem total de caracteres no artigo + count_total: Contagem total de caracteres + time: Tempo de leitura + time_total: Tempo total de leitura + time_minutes: mins. diff --git a/themes/next/languages/pt.yml b/themes/next/languages/pt.yml new file mode 100644 index 0000000..5ea20ed --- /dev/null +++ b/themes/next/languages/pt.yml @@ -0,0 +1,103 @@ +--- +name: Português +title: + archive: Arquivo + category: Categoria + tag: Tag + schedule: Schedule +menu: + home: Home + archives: Arquivos + categories: Categorias + tags: Tags + about: Sobre + search: Pesquisa + schedule: Schedule + sitemap: Sitemap + commonweal: Commonweal 404 +sidebar: + overview: Visão Geral + toc: Tabela de Conteúdo + links: Links +post: + posted: Postado em + edited: Edited on + created: Post created + modified: Updated at + edit: Edit this post + in: Em + read_more: Ler mais + untitled: Sem título + sticky: Sticky + views: Views + related_posts: Related Posts + copyright: + author: Post author + link: Post link + post_author: Written by + post_link: This article originally appeared on + license_title: Copyright Notice + license_content: "All articles in this blog are licensed under %s unless stating additionally." + license_content_reprint: "This article is a reprinted article and has been reprinted with permission. Please indicate the source!" +footer: + powered: "Desenvolvido com amor com %s" + total_views: Total Views + total_visitors: Total Visitors +widget: + github: Follow me on GitHub + chat: Chat +counter: + tag_cloud: + zero: Sem tags + one: 1 tag no total + other: "%d tags no total" + categories: + zero: Sem categorias + one: 1 categoria no total + other: "%d categorias no total" + archive_posts: + zero: Sem publicações. + one: 1 post. + other: "%d publicações no total." +state: + posts: publicações + tags: tags + categories: categorias +search: + placeholder: Searching... + empty: "We didn't find any results for the search: %s" + hits_time: "%s results found in %s ms" + hits: "%s results found" +cheers: + um: Um.. + ok: OK + nice: Legal + good: Bom + great: Grandioso + excellent: Excelente +keep_on: Mantenha-se publicando! +symbol: + comma: ", " + period: ". " + colon: ": " +reward: + donate: Donate + wechatpay: WeChat Pay + alipay: Alipay + paypal: PayPal + bitcoin: Bitcoin + comment: Buy me a coffee +follow_me: + welcome: Welcome to my other publishing channels +accessibility: + nav_toggle: Toggle navigation bar + prev_page: Página anterior + next_page: Página seguinte + back_to_top: Back to top + select_lang: Select language +symbols_count_time: + count: Symbols count in article + count_total: Symbols count total + time: Reading time + time_total: Reading time total + time_minutes: mins. diff --git a/themes/next/languages/ru.yml b/themes/next/languages/ru.yml new file mode 100644 index 0000000..ad9c542 --- /dev/null +++ b/themes/next/languages/ru.yml @@ -0,0 +1,103 @@ +--- +name: Английский +title: + archive: Архив + category: Категория + tag: Тэг + schedule: Календарь +menu: + home: Главная + archives: Архив + categories: Категории + tags: Тэги + about: О сайте + search: Поиск + schedule: Планировщик + sitemap: Карта сайта + commonweal: Страница 404 +sidebar: + overview: Обзор + toc: Содержание + links: Links +post: + posted: Размещено + edited: Изменено + created: Создано + modified: Изменено + edit: Редактировать запись + in: В категории + read_more: Далее... + untitled: Безимянный + sticky: Ссылка + views: Просмотров + related_posts: Похожие записи + copyright: + author: Автор записи + link: Ссылка на запись + post_author: Авторы + post_link: Оригинал этой статьи был написан + license_title: Информация об авторских правах + license_content: "Все записи на этом сайте защищены лицензией %s, если не указано дополнительно." + license_content_reprint: "This article is a reprinted article and has been reprinted with permission. Please indicate the source!" +footer: + powered: "Генератор — %s" + total_views: Всего просмотров + total_visitors: Всего посетителей +widget: + github: Follow me on GitHub + chat: Chat +counter: + tag_cloud: + zero: Нет тэгов. + one: 1 тэг. + other: "%d тэгов всего." + categories: + zero: Нет категорий. + one: 1 категория. + other: "%d категорий всего." + archive_posts: + zero: Нет записей. + one: 1 запись. + other: "%d записей всего." +state: + posts: Архив + tags: Тэги + categories: Категории +search: + placeholder: Поиск... + empty: "По запросу ничего не найдено: %s" + hits_time: "%s результатов найдено за %s мс" + hits: "%s результатов найдено" +cheers: + um: Эм.. + ok: ОК + nice: Неплохо + good: Хорошо + great: Замечательно + excellent: Великолепно +keep_on: Продолжаю писать. +symbol: + comma: ", " + period: ". " + colon: ": " +reward: + donate: Донат + wechatpay: WeChat Pay + alipay: Alipay + paypal: PayPal + bitcoin: Биткоин + comment: Buy me a coffee +follow_me: + welcome: Добро пожаловать на другие мои издательские каналы +accessibility: + nav_toggle: Показать/скрыть меню + prev_page: Предыдущая страница + next_page: Следующая страница + back_to_top: В начало + select_lang: Выберите язык +symbols_count_time: + count: Кол-во символов в статье + count_total: Общее кол-во символов + time: Время чтения + time_total: Общее время чтения + time_minutes: мин. diff --git a/themes/next/languages/si.yml b/themes/next/languages/si.yml new file mode 100644 index 0000000..f2a0ca8 --- /dev/null +++ b/themes/next/languages/si.yml @@ -0,0 +1,103 @@ +--- +name: සිංහල +title: + archive: සංරක්ෂිතය + category: ප්‍රවර්ගය + tag: ටැගය + schedule: කාලසටහන +menu: + home: මුල + archives: සංරක්ෂිත + categories: ප්‍රවර්ග + tags: ටැග + about: පිළිබඳව + search: සොයන්න + schedule: කාලසටහන + sitemap: අඩවි සිතියම + commonweal: සමස්ත ප්‍රජාව 404 +sidebar: + overview: සමස්ත දැක්ම + toc: පටුන + links: Links +post: + posted: පළ කළේ + edited: සංස්කරණය කළේ + created: හැදුවා + modified: සංස්කරණය කළා + edit: ලිපිය සංස්කරණය + in: තුළ + read_more: තව කියවන්න + untitled: නිර්නාමික + sticky: ඇලෙන + views: දර්ශන වාර + related_posts: ආශ්‍රිත ලිපි + copyright: + author: කර්තෘ + link: සබැඳිය + post_author: ලියන ලද්දේ + post_link: මේ ලිපිය මුළින්ම පළ වූයේ + license_title: හිමිකම් ප්‍රකාශය + license_content: "මෙහි සියලු ලිපි, අමතර සඳහනක් නොමැති තැන් වලදී, %s බලපත්‍රය යටතේ පවතී." + license_content_reprint: "This article is a reprinted article and has been reprinted with permission. Please indicate the source!" +footer: + powered: "%s විසින් බල ගැන්වේ" + total_views: සියලු දර්ශන වාර + total_visitors: සියලු අමුත්තන් +widget: + github: Follow me on GitHub + chat: Chat +counter: + tag_cloud: + zero: ටැග නැත + one: 1 ටැගයක් ඇත + other: "ටැග %dක් ඇත" + categories: + zero: ප්‍රවර්ග නැත + one: 1 ප්‍රවර්ගයක් ඇත + other: "ප්‍රවර්ග %dක් ඇත" + archive_posts: + zero: ලිපි නැත. + one: 1 ලිපියක්. + other: "ලිපි %dක් ඇත." +state: + posts: ලිපි + tags: ටැග + categories: ප්‍රවර්ග +search: + placeholder: සොයමින්... + empty: "%s ගැන සෙවීමෙන් ප්‍රතිඵල හමු නොවුණි" + hits_time: "ප්‍රතිඵල %s සඳහා %s ms ගතවිය" + hits: "ප්‍රතිඵල %s හමු විය" +cheers: + um: ඇත්ත වශයෙන්ම.. + ok: හරි + nice: කදිමයි + good: හොඳයි + great: නියමයි + excellent: විශිෂ්ටයි +keep_on: දිගටම පළ කරන්න. +symbol: + comma: ", " + period: ". " + colon: ": " +reward: + donate: පරිත්‍යාග කරන්න + wechatpay: වීචැට් පේ + alipay: අලිපේ + paypal: පේපෑල් + bitcoin: බිට්කොයින් + comment: Buy me a coffee +follow_me: + welcome: මගේ වෙනත් පළකිරීම් මාධ්‍ය වෙත සාදරයෙන් පිළිගනිමි +accessibility: + nav_toggle: යාත්‍රණය මාරු කිරීම + prev_page: පෙර පිටුව + next_page: පසු පිටුව + back_to_top: Back to top + select_lang: Select language +symbols_count_time: + count: ලිපියේ සංකේත ගණන + count_total: මුළු සංකේත ගණන + time: කියවුම් කාලය + time_total: මුළු කියවුම් කාලය + time_minutes: විනාඩි. diff --git a/themes/next/languages/th.yml b/themes/next/languages/th.yml new file mode 100644 index 0000000..db226d9 --- /dev/null +++ b/themes/next/languages/th.yml @@ -0,0 +1,103 @@ +--- +name: ประเทศไทย +title: + archive: คลังเก็บเอกสารสำคัญ + category: หมวดหมู่ + tag: แท็ก + schedule: กำหนดการ +menu: + home: บ้าน + archives: หอจดหมายเหตุ + categories: หมวดหมู่ + tags: แท็ก + about: เกี่ยวกับ + search: ค้นหา + schedule: กำหนดการ + sitemap: แผนผังเว็บไซต์ + commonweal: เครือจักรภพ404 +sidebar: + overview: ภาพรวม + toc: สารบัญ + links: Links +post: + posted: โพสต์เมื่อ + edited: แก้ไขเมื่อ + created: สร้าง + modified: ดัดแปลง + edit: แก้ไขโพสต์นี้ + in: ใน + read_more: อ่านเพิ่มเติม + untitled: ไม่มีชื่อ + sticky: เหนียว + views: มุมมอง + related_posts: กระทู้ที่เกี่ยวข้อง + copyright: + author: ผู้เขียนโพสต์ + link: โพสต์ลิงค์ + post_author: เขียนโดย + post_link: บทความนี้เดิมปรากฏบน + license_title: ประกาศเกี่ยวกับลิขสิทธิ์ + license_content: "บทความทั้งหมดในบล็อกนี้ได้รับอนุญาตภายใต้ %s เว้นแต่จะระบุไว้เพิ่มเติม" + license_content_reprint: "This article is a reprinted article and has been reprinted with permission. Please indicate the source!" +footer: + powered: "ขับเคลื่อนโดย %s" + total_views: ยอดดูทั้งหมด + total_visitors: ผู้เข้าชมทั้งหมด +widget: + github: Follow me on GitHub + chat: Chat +counter: + tag_cloud: + zero: ไม่มีแท็ก + one: ทั้งหมด 1 แท็ก + other: "รวม %d แท็ก" + categories: + zero: ไม่มีหมวดหมู่ + one: ทั้งหมด 1 หมวดหมู่ + other: "ทั้งหมด %d หมวดหมู่" + archive_posts: + zero: ไม่มีโพสต์ + one: 1 โพสต์ + other: "ทั้งหมด %d โพสต์" +state: + posts: posts + tags: tags + categories: categories +search: + placeholder: กำลังค้นหา... + empty: "เราไม่พบผลลัพธ์ใด ๆ สำหรับการค้นหา: %s" + hits_time: "พบผลลัพธ์ %s ใน %s ms" + hits: "พบผลลัพธ์ %s" +cheers: + um: Um.. + ok: OK + nice: Nice + good: Good + great: Great + excellent: Excellent +keep_on: โพสต์ต่อไป. +symbol: + comma: ", " + period: ". " + colon: ": " +reward: + donate: Donate + wechatpay: WeChat Pay + alipay: Alipay + paypal: PayPal + bitcoin: Bitcoin + comment: Buy me a coffee +follow_me: + welcome: ยินดีต้อนรับสู่ช่องทางการเผยแพร่อื่นๆ ของฉัน +accessibility: + nav_toggle: สลับแถบนำทาง + prev_page: หน้าก่อน + next_page: หน้าต่อไป + back_to_top: กลับไปด้านบน + select_lang: เลือกภาษา +symbols_count_time: + count: สัญลักษณ์นับในบทความ + count_total: สัญลักษณ์นับรวม + time: เวลาอ่านหนังสือ + time_total: เวลาในการอ่านทั้งหมด + time_minutes: นาที diff --git a/themes/next/languages/tk.yml b/themes/next/languages/tk.yml new file mode 100644 index 0000000..a107d3c --- /dev/null +++ b/themes/next/languages/tk.yml @@ -0,0 +1,103 @@ +--- +name: Türkmençe +title: + archive: Arhiw + category: Bölüm + tag: Teg + schedule: Kalendar +menu: + home: Baş sahypa + archives: Arhiw + categories: Bölümler + tags: Tegler + about: Saýt hakynda + search: Gözleg + schedule: Kalendar + sitemap: Saýtyň kartasy + commonweal: 404 sahypa +sidebar: + overview: Syn + toc: Mazmuny + links: Links +post: + posted: Goýuldy + edited: Üýtgedildi + created: Döredildi + modified: Üýtgedildi + edit: Redaktirle + in: bölümde + read_more: Dowamyny oka + untitled: Atlandyrylmadyk + sticky: Salgylanma + views: Görüldi + related_posts: Meňzeş makalalar + copyright: + author: Makalanyň awtory + link: Makala salgylanma + post_author: Written by + post_link: This article originally appeared on + license_title: Awtorlyk hukugy hakynda maglumat + license_content: "Eger-de goşmaça maglumat berilmedik bolsa, bu saýtdaky ähli maglumatlar %s lisenziýa bilen goragly." + license_content_reprint: "This article is a reprinted article and has been reprinted with permission. Please indicate the source!" +footer: + powered: "Генератор — %s" + total_views: Görülme sany + total_visitors: Girilen sany +widget: + github: Follow me on GitHub + chat: Chat +counter: + tag_cloud: + zero: Teg ýok. + one: 1 teg. + other: "%d teg bar." + categories: + zero: Bölüm ýok. + one: 1 bölüm. + other: "%d bölüm bar." + archive_posts: + zero: Makala tapylmady. + one: 1 makala. + other: "%d makala bar." +state: + posts: Makalalar + tags: Tegler + categories: Bölümler +search: + placeholder: Gözleg... + empty: "We didn't find any results for the search: %s" + hits_time: "%s results found in %s ms" + hits: "%s results found" +cheers: + um: Hmm.. + ok: OK + nice: Erbet däl + good: Gowy + great: Bet + excellent: Örän gowy +keep_on: Ýazmagy dowam et. +symbol: + comma: ", " + period: ". " + colon: ": " +reward: + donate: Donat + wechatpay: WeChat Pay + alipay: Alipay + paypal: PayPal + bitcoin: Bitcoin + comment: Buy me a coffee +follow_me: + welcome: Meniň başga paýlaşma platformalarym +accessibility: + nav_toggle: Görkez/Gizle + prev_page: Öňki sahypa + next_page: Indiki sahypa + back_to_top: Back to top + select_lang: Select language +symbols_count_time: + count: Makalada symbollaryň mukdary + count_total: Symbollaryň umumy sany + time: Okalma wagty + time_total: Jemi okalma wagty + time_minutes: min. diff --git a/themes/next/languages/tr.yml b/themes/next/languages/tr.yml new file mode 100644 index 0000000..4d27e30 --- /dev/null +++ b/themes/next/languages/tr.yml @@ -0,0 +1,103 @@ +--- +name: Türk +title: + archive: Arşiv + category: Kategori + tag: Etiket + schedule: Program +menu: + home: Ana Sayfa + archives: Arşivler + categories: Kategoriler + tags: Etiketler + about: Hakkımda + search: Ara + schedule: Program + sitemap: Site Haritası + commonweal: Hata 404 +sidebar: + overview: Genel Bakış + toc: İçindekiler + links: Links +post: + posted: Yayınlandı + edited: Düzenlendi + created: Oluşturuldu + modified: Değiştirildi + edit: Bu gönderiyi düzenle + in: İçinde + read_more: Daha fazla oku + untitled: Başlıksız + sticky: Sabit + views: Görünümler + related_posts: İlgili Gönderiler + copyright: + author: Gönderiyi yazan + link: Gönderi bağlantısı + post_author: Written by + post_link: This article originally appeared on + license_title: Telif Hakkı Bildirimi + license_content: "Bu blogdaki tüm makaleler aksi belirtilmediği sürece %s altında lisanslıdır." + license_content_reprint: "This article is a reprinted article and has been reprinted with permission. Please indicate the source!" +footer: + powered: "%s tarafından desteklenmektedir" + total_views: Toplam görüntülenme + total_visitors: Toplam Ziyaretçi +widget: + github: Follow me on GitHub + chat: Chat +counter: + tag_cloud: + zero: Etiket yok + one: Toplam 1 etiket + other: "Toplamda %d etiket" + categories: + zero: Kategori yok + one: Toplamda 1 kategori + other: "Toplamda %d kategori" + archive_posts: + zero: Gönderi yok. + one: 1 gönderi. + other: "Toplamda %d gönderi." +state: + posts: gönderiler + tags: etiketler + categories: kategoriler +search: + placeholder: Aranıyor... + empty: "We didn't find any results for the search: %s" + hits_time: "%s results found in %s ms" + hits: "%s results found" +cheers: + um: Um.. + ok: Tamam + nice: Güzel + good: İyi + great: Müthiş + excellent: Mükemmel +keep_on: Gönderiye devam. +symbol: + comma: ", " + period: ". " + colon: ": " +reward: + donate: Bağış + wechatpay: WeChat Pay + alipay: Alipay + paypal: PayPal + bitcoin: Bitcoin + comment: Buy me a coffee +follow_me: + welcome: Diğer yayıncılık kanallarıma hoşgeldiniz +accessibility: + nav_toggle: Gezinti çubuğunu değiştir + prev_page: Önceki sayfa + next_page: Sonraki sayfa + back_to_top: Back to top + select_lang: Select language +symbols_count_time: + count: Makalede sayılan semboller + count_total: Sayılan toplam semboller + time: Okuma Süresi + time_total: Toplamda Okuma Süresi + time_minutes: dk. diff --git a/themes/next/languages/uk.yml b/themes/next/languages/uk.yml new file mode 100644 index 0000000..b0eef51 --- /dev/null +++ b/themes/next/languages/uk.yml @@ -0,0 +1,103 @@ +--- +name: Український +title: + archive: Архів + category: Категорія + tag: Тег + schedule: Календар +menu: + home: Головна + archives: Архів + categories: Категорії + tags: Теги + about: Про сайт + search: Пошук + schedule: Календар + sitemap: Карта сайту + commonweal: Сторінка 404 +sidebar: + overview: Огляд + toc: Зміст + links: Links +post: + posted: Опубліковано + edited: Змінено + created: Створено + modified: Змінено + edit: Редагувати запис + in: в категорії + read_more: Читати повністю + untitled: Без імені + sticky: Посилання + views: Переглядів + related_posts: Схожі записи + copyright: + author: Автор запису + link: Посилання на запис + post_author: Written by + post_link: This article originally appeared on + license_title: Інформація про авторські права + license_content: "Всі записи на цьому сайті захищені ліцензією %s, якщо не вказано додатково." + license_content_reprint: "This article is a reprinted article and has been reprinted with permission. Please indicate the source!" +footer: + powered: "Генератор — %s" + total_views: Всього переглядів + total_visitors: Всього відвідувачів +widget: + github: Follow me on GitHub + chat: Chat +counter: + tag_cloud: + zero: Немає тегів. + one: 1 тег. + other: "%d тегів всього." + categories: + zero: Немає категорій. + one: 1 категорія. + other: "%d категорій всього." + archive_posts: + zero: Немає записів. + one: 1 запис. + other: "%d записів всього." +state: + posts: Архів + tags: Теги + categories: Категорії +search: + placeholder: Пошук... + empty: "We didn't find any results for the search: %s" + hits_time: "%s results found in %s ms" + hits: "%s results found" +cheers: + um: Ем.. + ok: ОК + nice: Не погано + good: Добре + great: Чудово + excellent: Прекрасно +keep_on: Продовжую писати. +symbol: + comma: ", " + period: ". " + colon: ": " +reward: + donate: Донат + wechatpay: WeChat Pay + alipay: Alipay + paypal: PayPal + bitcoin: Bitcoin + comment: Buy me a coffee +follow_me: + welcome: Мої інші видавничі канали +accessibility: + nav_toggle: Показати/приховати меню + prev_page: Попередня сторінка + next_page: Наступна сторінка + back_to_top: Back to top + select_lang: Select language +symbols_count_time: + count: К-сть символів в статті + count_total: Загальна к-сть символів + time: Час читання + time_total: Загальний час читання + time_minutes: хв. diff --git a/themes/next/languages/vi.yml b/themes/next/languages/vi.yml new file mode 100644 index 0000000..6f0def1 --- /dev/null +++ b/themes/next/languages/vi.yml @@ -0,0 +1,103 @@ +--- +name: Tiếng Việt +title: + archive: Lưu Trữ + category: Phân Loại + tag: Thẻ + schedule: Danh Mục +menu: + home: Trang Chủ + archives: Lưu Trữ + categories: Đầu Mục + tags: Thẻ + about: Giới Thiệu + search: Tìm Kiếm + schedule: Danh Mục + sitemap: Bản đồ trang + commonweal: Commonwealth Act No. 404 +sidebar: + overview: Tổng Quan + toc: Mục Lục + links: Links +post: + posted: Tạo lúc + edited: Chỉnh sửa vào + created: Được tạo + modified: Được thay đổi + edit: Chính sửa bài viết này + in: Trong + read_more: Đọc tiếp + untitled: Không có tiêu đề + sticky: Đính + views: Lượt xem + related_posts: Các bài viết liên quan + copyright: + author: Người viết + link: Liên kết bài viết + post_author: Written by + post_link: This article originally appeared on + license_title: Chú ý bản quyền + license_content: "Tất cả bài viết trong blog này được đăng ký bởi %s trừ khi có thông báo bổ sung." + license_content_reprint: "This article is a reprinted article and has been reprinted with permission. Please indicate the source!" +footer: + powered: "Cung cấp bởi %s" + total_views: Tổng số người xem + total_visitors: Tổng số truy cập +widget: + github: Follow me on GitHub + chat: Chat +counter: + tag_cloud: + zero: Không có thẻ nào + one: có 1 thẻ tất cả + other: "có %d thẻ tất cả" + categories: + zero: Không có trong mục nào + one: có 1 mục tất cả + other: "có %d mục tất cả" + archive_posts: + zero: Không có bài viết. + one: 1 bài viết. + other: "tổng số %d bài viết." +state: + posts: bài viết + tags: thẻ + categories: mục +search: + placeholder: Đang tìm... + empty: "We didn't find any results for the search: %s" + hits_time: "%s results found in %s ms" + hits: "%s results found" +cheers: + um: Um.. + ok: Đồng Ý + nice: Hay + good: Tốt + great: Tuyệt vời + excellent: Tuyệt cú mèo +keep_on: Giữ tiến độ nha. +symbol: + comma: ", " + period: ". " + colon: ": " +reward: + donate: Tài trợ + wechatpay: WeChat Pay + alipay: Alipay + paypal: Paypal + bitcoin: Bitcoin + comment: Buy me a coffee +follow_me: + welcome: Xin chào mừng đến với các kênh khác của tôi +accessibility: + nav_toggle: Thanh điều hướng chuyển đổi + prev_page: Trang trước + next_page: Trang sau + back_to_top: Back to top + select_lang: Select language +symbols_count_time: + count: Số biểu tượng trong bài viết + count_total: Tổng số biểu tượng + time: Thời lượng đọc + time_total: Tổng thời lượng đọc + time_minutes: phút. diff --git a/themes/next/languages/zh-CN.yml b/themes/next/languages/zh-CN.yml new file mode 100644 index 0000000..0f555d0 --- /dev/null +++ b/themes/next/languages/zh-CN.yml @@ -0,0 +1,103 @@ +--- +name: 简体中文 +title: + archive: 归档 + category: 分类 + tag: 标签 + schedule: 日程表 +menu: + home: 首页 + archives: 归档 + categories: 分类 + tags: 标签 + about: 关于 + search: 搜索 + schedule: 日程表 + sitemap: 站点地图 + commonweal: 公益 404 +sidebar: + overview: 站点概览 + toc: 文章目录 + links: 链接 +post: + posted: 发表于 + edited: 更新于 + created: 创建时间 + modified: 修改时间 + edit: 编辑 + in: 分类于 + read_more: 阅读全文 + untitled: 未命名 + sticky: 置顶 + views: 阅读次数 + related_posts: 相关文章 + copyright: + author: 本文作者 + link: 本文链接 + post_author: 原作者 + post_link: 原文链接 + license_title: 版权声明 + license_content: "本博客所有文章除特别声明外,均采用 %s 许可协议。转载请注明出处!" + license_content_reprint: "本文章为转载文章,已获转载许可。转载请注明出处!" +footer: + powered: "由 %s 强力驱动" + total_views: 总访问量 + total_visitors: 总访客量 +widget: + github: 在 GitHub 上关注我 + chat: 聊天 +counter: + tag_cloud: + zero: 暂无标签 + one: 目前共计 1 个标签 + other: "目前共计 %d 个标签" + categories: + zero: 暂无分类 + one: 目前共计 1 个分类 + other: "目前共计 %d 个分类" + archive_posts: + zero: 暂无日志。 + one: 目前共计 1 篇日志。 + other: "目前共计 %d 篇日志。" +state: + posts: 日志 + tags: 标签 + categories: 分类 +search: + placeholder: 搜索... + empty: "没有找到任何搜索结果:%s" + hits_time: "找到 %s 个搜索结果(用时 %s 毫秒)" + hits: "找到 %s 个搜索结果" +cheers: + um: 嗯.. + ok: 还行 + nice: 不错 + good: 很好 + great: 非常好 + excellent: 太棒了 +keep_on: 继续努力。 +symbol: + comma: "," + period: "。" + colon: ":" +reward: + donate: 赞赏 + wechatpay: 微信 + alipay: 支付宝 + paypal: PayPal + bitcoin: 比特币 + comment: 请我一杯咖啡吧! +follow_me: + welcome: 欢迎关注我的其它发布渠道 +accessibility: + nav_toggle: 切换导航栏 + prev_page: 上一页 + next_page: 下一页 + back_to_top: 返回顶部 + select_lang: 选择语言 +symbols_count_time: + count: 本文字数 + count_total: 站点总字数 + time: 阅读时长 + time_total: 站点阅读时长 + time_minutes: 分钟 diff --git a/themes/next/languages/zh-HK.yml b/themes/next/languages/zh-HK.yml new file mode 100644 index 0000000..eb45141 --- /dev/null +++ b/themes/next/languages/zh-HK.yml @@ -0,0 +1,103 @@ +--- +name: 繁體中文(香港) +title: + archive: 歸檔 + category: 分類 + tag: 標籤 + schedule: 日程表 +menu: + home: 首頁 + archives: 歸檔 + categories: 分類 + tags: 標籤 + about: 關於 + search: 檢索 + schedule: 日程表 + sitemap: 站點地圖 + commonweal: 公益 404 +sidebar: + overview: 本站概覽 + toc: 文章目錄 + links: Links +post: + posted: 發表於 + edited: 更新於 + created: 創建時間 + modified: 修改時間 + edit: 編輯 + in: 分類於 + read_more: 閱讀全文 + untitled: 未命名 + sticky: 置頂 + views: 閱讀次數 + related_posts: 相關文章 + copyright: + author: 博主 + link: 文章連結 + post_author: 已寫入 + post_link: 文章最初發表於 + license_title: 版權聲明 + license_content: "本網誌所有文章除特別聲明外,均採用 %s 許可協議。轉載請註明出處!" + license_content_reprint: "This article is a reprinted article and has been reprinted with permission. Please indicate the source!" +footer: + powered: "由 %s 強力驅動" + total_views: 總瀏覽次數 + total_visitors: 訪客總數 +widget: + github: Follow me on GitHub + chat: Chat +counter: + tag_cloud: + zero: 暫無標籤 + one: 目前共有 1 個標籤 + other: "目前共有 %d 個標籤" + categories: + zero: 暫無分類 + one: 目前共有 1 個分類 + other: "目前共有 %d 個分類" + archive_posts: + zero: 暫無文章。 + one: 目前共有 1 篇文章。 + other: "目前共有 %d 篇文章。" +state: + posts: 文章 + tags: 標籤 + categories: 分類 +search: + placeholder: 搜索... + empty: "我們無法找到任何有關 %s 的搜索結果" + hits_time: "%s 結果在 %s 毫秒找到" + hits: "找到 %s 個結果" +cheers: + um: 嗯.. + ok: 還行 + nice: 好 + good: 很好 + great: 非常好 + excellent: 太棒了 +keep_on: 繼續努力。 +symbol: + comma: "," + period: "。" + colon: ":" +reward: + donate: 讚賞 + wechatpay: 微信支付 + alipay: 支付寶 + paypal: 貝寶 + bitcoin: 比特幣 + comment: Buy me a coffee +follow_me: + welcome: 歡迎關注我的其它發布渠道 +accessibility: + nav_toggle: 切換導航欄 + prev_page: 上一頁 + next_page: 下一頁 + back_to_top: 回到頂部 + select_lang: 選擇語言 +symbols_count_time: + count: 本文字數 + count_total: 站點總字數 + time: 閱讀時長 + time_total: 站點閱讀時長 + time_minutes: 分鍾 diff --git a/themes/next/languages/zh-tw.yml b/themes/next/languages/zh-tw.yml new file mode 100644 index 0000000..a2fe83e --- /dev/null +++ b/themes/next/languages/zh-tw.yml @@ -0,0 +1,103 @@ +--- +name: 繁體中文 +title: + archive: 歸檔 + category: 分類 + tag: 標籤 + schedule: 時間表 +menu: + home: 首頁 + archives: 歸檔 + categories: 分類 + tags: 標籤 + about: 關於 + search: 搜尋 + schedule: 時間表 + sitemap: 網站地圖 + commonweal: 公益 404 +sidebar: + overview: 本站概要 + toc: 文章目錄 + links: Links +post: + posted: 發表於 + edited: 更新於 + created: 創建時間 + modified: 修改時間 + edit: 編輯 + in: 分類於 + read_more: 閱讀全文 + untitled: 未命名 + sticky: 置頂 + views: 閱讀次數 + related_posts: 相關文章 + copyright: + author: 作者 + link: 文章連結 + post_author: 已寫入 + post_link: 文章最初發表於 + license_title: 版權聲明 + license_content: "本網誌所有文章除特別聲明外,均採用 %s 許可協議。轉載請註明出處!" + license_content_reprint: "This article is a reprinted article and has been reprinted with permission. Please indicate the source!" +footer: + powered: "由 %s 強力驅動" + total_views: 總瀏覽次數 + total_visitors: 訪客總數 +widget: + github: Follow me on GitHub + chat: Chat +counter: + tag_cloud: + zero: 沒有標籤 + one: 目前共有 1 個標籤 + other: "目前共有 %d 個標籤" + categories: + zero: 沒有分類 + one: 目前共有 1 個分類 + other: "目前共有 %d 個分類" + archive_posts: + zero: 沒有文章。 + one: 目前共有 1 篇文章。 + other: "目前共有 %d 篇文章。" +state: + posts: 文章 + tags: 標籤 + categories: 分類 +search: + placeholder: 搜尋... + empty: "我們無法找到任何有關 %s 的搜索結果" + hits_time: "%s 找到 %s 個結果" + hits: "找到 %s 個結果" +cheers: + um: 嗯.. + ok: 還行 + nice: 好 + good: 很好 + great: 非常好 + excellent: 太棒了 +keep_on: 繼續努力。 +symbol: + comma: "," + period: "。" + colon: ":" +reward: + donate: 捐贈 + wechatpay: 微信支付 + alipay: 支付寶 + paypal: 貝寶 + bitcoin: 比特幣 + comment: Buy me a coffee +follow_me: + welcome: 歡迎關注我的其它發布渠道 +accessibility: + nav_toggle: 切換導航欄 + prev_page: 上一頁 + next_page: 下一頁 + back_to_top: 回到頂端 + select_lang: 選擇語言 +symbols_count_time: + count: 文章字數 + count_total: 總字數 + time: 所需閱讀時間 + time_total: 所需總閱讀時間 + time_minutes: 分鐘 diff --git a/themes/next/layout/_layout.njk b/themes/next/layout/_layout.njk new file mode 100644 index 0000000..8a9bd73 --- /dev/null +++ b/themes/next/layout/_layout.njk @@ -0,0 +1,52 @@ + + + + {{ partial('_partials/head/head.njk', {}, {cache: theme.cache.enable}) }} + {%- include '_partials/head/head-unique.njk' -%} + {% block title %}{% endblock %} + {{ partial('_third-party/analytics/index.njk', {}, {cache: theme.cache.enable}) }} + {{- next_inject('head') }} + + + + +
+ +
+
+
+ {%- include '_partials/header/index.njk' -%} +
+ {%- if theme.sidebar.display !== 'remove' %} + {% block sidebar %}{% endblock %} + {%- endif %} +
+ +
+ {%- include '_partials/header/sub-menu.njk' -%} + {% block content %}{% endblock %} + {%- include '_partials/comments.njk' -%} +
+
+ +
+ +
+ + {{ partial('_partials/widgets.njk', {}, {cache: theme.cache.enable}) }} + + {{ partial('_scripts/index.njk', {}, {cache: theme.cache.enable}) }} + {{ partial('_third-party/index.njk', {}, {cache: theme.cache.enable}) }} + {{ partial('_third-party/statistics/index.njk', {}, {cache: theme.cache.enable}) }} + + {%- include '_third-party/math/index.njk' -%} + {%- include '_third-party/quicklink.njk' -%} + + {{- next_inject('bodyEnd') }} + + diff --git a/themes/next/layout/_macro/post-collapse.njk b/themes/next/layout/_macro/post-collapse.njk new file mode 100644 index 0000000..1489454 --- /dev/null +++ b/themes/next/layout/_macro/post-collapse.njk @@ -0,0 +1,35 @@ +{% macro render(posts) %} +{%- set current_year = '1970' %} +{%- for post in posts.toArray() %} + + {%- set year = date(post.date, 'YYYY') %} + + {%- if year !== current_year %} + {%- set current_year = year %} +
+ {{ current_year }} +
+ {%- endif %} + + + +{%- endfor %} +{% endmacro %} diff --git a/themes/next/layout/_macro/post.njk b/themes/next/layout/_macro/post.njk new file mode 100644 index 0000000..7cb3a6e --- /dev/null +++ b/themes/next/layout/_macro/post.njk @@ -0,0 +1,148 @@ +{##################} +{### POST BLOCK ###} +{##################} +
+ {# Gallery support #} + {{ post_gallery(post.photos) }} + +
+ + + + + + + + + {%- if post.header !== false %} +
+ <{% if is_index %}h2{% else %}h1{% endif %} class="post-title{% if post.direction and post.direction.toLowerCase() === 'rtl' %} rtl{% endif %}" itemprop="name headline"> + {% if is_index %} + {%- if post.sticky > 0 %} + + + + {%- endif %} + {{- next_url(post.path, post.title or __('post.untitled'), {class: 'post-title-link', itemprop: 'url'}) }} + {%- else %} + {{- post.title }} + {{- post_edit(post.source) }} + {%- endif %} + + + +
+ {%- endif %} + + {#################} + {### POST BODY ###} + {#################} +
+ {%- if is_index %} + {%- if post.description and theme.excerpt_description %} +

{{ post.description }}

+ + {%- if theme.read_more_btn %} +
+ + {{ __('post.read_more') }} » + +
+ {%- endif %} + + {% elif post.excerpt %} + {{ post.excerpt }} + + {%- if theme.read_more_btn %} +
+ + {{ __('post.read_more') }} » + +
+ {%- endif %} + + {% else %} + {{ post.content }} + {%- endif %} + {% else %} + {{- next_inject('postBodyStart') }} + {{- post.content }} + {%- endif %} +
+ + {#####################} + {### END POST BODY ###} + {#####################} + +
+ {%- if is_index %} +
+ {% else %} + {{- next_inject('postBodyEnd') }} + + {%- if post.reward_settings.enable %} + {{ partial('_partials/post/post-reward.njk') }} + {%- endif %} + + {%- if theme.creative_commons.license and theme.creative_commons.post and post.copyright !== false %} + {{ partial('_partials/post/post-copyright.njk') }} + {%- endif %} + + {%- if theme.follow_me %} + {{ partial('_partials/post/post-followme.njk', {}, {cache: theme.cache.enable}) }} + {%- endif %} + + {%- if post.tags and post.tags.length %} + {%- set tag_indicate = '' if theme.tag_icon else '#' %} + + {%- endif %} + + {{ partial('_partials/post/post-share.njk', {}, {cache: theme.cache.enable}) }} + + {%- if theme.post_navigation and (post.prev or post.next) %} + {%- set prev = post.prev if theme.post_navigation === 'right' else post.next %} + {%- set next = post.next if theme.post_navigation === 'right' else post.prev %} +
+
+ {%- if prev %} + + {%- endif %} +
+
+ {%- if next %} + + {%- endif %} +
+
+ {%- endif %} + + {%- endif %} +
+
+
+{######################} +{### END POST BLOCK ###} +{######################} diff --git a/themes/next/layout/_macro/sidebar.njk b/themes/next/layout/_macro/sidebar.njk new file mode 100644 index 0000000..cb92c04 --- /dev/null +++ b/themes/next/layout/_macro/sidebar.njk @@ -0,0 +1,77 @@ +{% macro render(display_toc) %} + +{% endmacro %} diff --git a/themes/next/layout/_partials/comments.njk b/themes/next/layout/_partials/comments.njk new file mode 100644 index 0000000..cd38ca3 --- /dev/null +++ b/themes/next/layout/_partials/comments.njk @@ -0,0 +1,35 @@ +{%- if page.comments %} + {%- if theme.injects.comment.length == 1 %} + {%- set inject_item = theme.injects.comment[0] %} + {{ partial(inject_item.layout, inject_item.locals, inject_item.options) }} + {%- elif theme.injects.comment.length > 1 %} + {%- if theme.comments.style == 'buttons' %} +
+ {%- for inject_item in theme.injects.comment %} + {{ inject_item.locals.button }} + {%- endfor %} +
+ {%- for inject_item in theme.injects.comment %} +
+ {{ partial(inject_item.layout, inject_item.locals, inject_item.options) }} +
+ {%- endfor %} + {{- next_js('comments-buttons.js', { pjax: true }) }} + {%- elif theme.comments.style == 'tabs' %} +
+ +
+ {%- for inject_item in theme.injects.comment %} +
+ {{ partial(inject_item.layout, inject_item.locals, inject_item.options) }} +
+ {%- endfor %} +
+
+ {%- endif %} + {%- endif %} +{%- endif %} diff --git a/themes/next/layout/_partials/footer.njk b/themes/next/layout/_partials/footer.njk new file mode 100644 index 0000000..cffc669 --- /dev/null +++ b/themes/next/layout/_partials/footer.njk @@ -0,0 +1,86 @@ +{%- if theme.footer.beian.enable %} +
+ {{- next_url('https://beian.miit.gov.cn', theme.footer.beian.icp + ' ') }} + {%- if theme.footer.beian.gongan_icon_url %} + + {%- endif %} + {%- if theme.footer.beian.gongan_id and theme.footer.beian.gongan_num %} + {{- next_url('https://beian.mps.gov.cn/#/query/webSearch?code=' + theme.footer.beian.gongan_id, theme.footer.beian.gongan_num + ' ') }} + {%- endif %} +
+{%- endif %} + +{%- if theme.footer.copyright !== false %} + +{%- endif %} + +{%- if config.symbols_count_time.total_symbols or config.symbols_count_time.total_time %} +
+ {%- if config.symbols_count_time.total_symbols %} + + {%- endif %} + + {%- if config.symbols_count_time.total_time %} + + {%- endif %} +
+{%- endif %} + +{%- if theme.busuanzi_count.enable %} +
+ {%- if theme.busuanzi_count.total_visitors %} + + {%- endif %} + + {%- if theme.busuanzi_count.total_views %} + + {%- endif %} +
+{%- endif %} + +{%- if theme.footer.powered %} +
+ {%- set next_site = 'https://theme-next.js.org' if theme.scheme === 'Gemini' else 'https://theme-next.js.org/' + theme.scheme | lower + '/' %} + {{- __('footer.powered', next_url('https://hexo.io', 'Hexo') + ' & ' + next_url(next_site, 'NexT.' + theme.scheme)) }} +
+{%- endif %} + +{{- next_inject('footer') }} diff --git a/themes/next/layout/_partials/head/head-unique.njk b/themes/next/layout/_partials/head/head-unique.njk new file mode 100644 index 0000000..8994944 --- /dev/null +++ b/themes/next/layout/_partials/head/head-unique.njk @@ -0,0 +1,22 @@ +{%- if theme.open_graph.enable %} + {%- if theme.open_graph.options %} + {{ open_graph(theme.open_graph.options) }} + {%- else %} + {{ open_graph() }} + {%- endif %} +{%- endif %} + +{# https://github.com/theme-next/hexo-theme-next/issues/866 #} +{%- set canonical = url | replace(r/index\.html$/, '') %} +{%- if not config.permalink.endsWith('.html') %} + {%- set canonical = canonical | replace(r/\.html$/, '') %} +{%- endif %} + + +{# Exports some front-matter variables to Front-End #} +{# https://hexo.io/docs/variables.html #} +{{ next_data('page', next_config_unique()) }} + +{{ next_data('calendar', + theme.calendar if page.type === 'schedule' else '') +}} diff --git a/themes/next/layout/_partials/head/head.njk b/themes/next/layout/_partials/head/head.njk new file mode 100644 index 0000000..fabf711 --- /dev/null +++ b/themes/next/layout/_partials/head/head.njk @@ -0,0 +1,67 @@ + + +{%- if theme.darkmode %} + + +{%- else %} + +{%- endif %} +{%- if config.meta_generator %} + {{- meta_generator() }} +{%- endif %} + +{%- if config.preconnect %} + +{%- endif %} +{{ next_pre() }} + +{%- if theme.favicon.apple_touch_icon %} + +{%- endif %} +{%- if theme.favicon.medium %} + +{%- endif %} +{%- if theme.favicon.small %} + +{%- endif %} +{%- if theme.favicon.safari_pinned_tab %} + +{%- endif %} +{%- if theme.favicon.android_manifest %} + +{%- endif %} + +{%- if theme.google_site_verification %} + +{%- endif %} +{%- if theme.bing_site_verification %} + +{%- endif %} +{%- if theme.yandex_site_verification %} + +{%- endif %} +{%- if theme.baidu_site_verification %} + +{%- endif %} + + + +{{ next_font() }} + +{{ next_vendors('fontawesome') }} + +{%- if theme.motion.enable %} + {{ next_vendors('animate_css') }} +{%- endif %} + +{%- if theme.fancybox %} + {{ next_vendors('fancybox_css') }} +{%- endif %} + +{%- if theme.pace.enable %} + {{ next_vendors('pace_css') }} + {{ next_vendors('pace_js') }} +{%- endif %} + +{{ next_data('main', next_config()) }} +{{- next_js('config.js') }} diff --git a/themes/next/layout/_partials/header/brand.njk b/themes/next/layout/_partials/header/brand.njk new file mode 100644 index 0000000..5cad063 --- /dev/null +++ b/themes/next/layout/_partials/header/brand.njk @@ -0,0 +1,44 @@ +
+ + +
+ {%- if theme.custom_logo and theme.scheme === 'Muse' %} + {{ title }} + {%- endif %} + {%- if theme.language_switcher and languages.length > 1 %} + + + <{% if is_home() or is_archive() %}h1{% else %}p{% endif %} class="site-title">{{ title }} + + + {%- else %} + + + <{% if is_home() or is_archive() %}h1{% else %}p{% endif %} class="site-title">{{ title }} + + + {%- endif %} + {%- if subtitle %} +

{{ subtitle }}

+ {%- endif %} + {%- if theme.custom_logo and (theme.scheme === 'Gemini' or theme.scheme === 'Pisces') %} + {{ title }} + {%- endif %} +
+ + +
diff --git a/themes/next/layout/_partials/header/index.njk b/themes/next/layout/_partials/header/index.njk new file mode 100644 index 0000000..37c4c10 --- /dev/null +++ b/themes/next/layout/_partials/header/index.njk @@ -0,0 +1,7 @@ +{{ partial('_partials/header/brand.njk') }} + +{{ partial('_partials/header/menu.njk', {}, {cache: theme.cache.enable}) }} + +{{ partial('_partials/search/index.njk', {}, {cache: theme.cache.enable}) }} + +{{- next_inject('header') }} diff --git a/themes/next/layout/_partials/header/menu-item.njk b/themes/next/layout/_partials/header/menu-item.njk new file mode 100644 index 0000000..9caf51c --- /dev/null +++ b/themes/next/layout/_partials/header/menu-item.njk @@ -0,0 +1,33 @@ +{% macro render(node) %} + + {%- set itemURL = node.path %} + + +{% endmacro %} diff --git a/themes/next/layout/_partials/header/menu.njk b/themes/next/layout/_partials/header/menu.njk new file mode 100644 index 0000000..55b5aef --- /dev/null +++ b/themes/next/layout/_partials/header/menu.njk @@ -0,0 +1,19 @@ +{% import 'menu-item.njk' as menu_item with context %} + +{%- if theme.menu or theme.algolia_search.enable or theme.local_search.enable %} + +{%- endif %} diff --git a/themes/next/layout/_partials/header/sub-menu.njk b/themes/next/layout/_partials/header/sub-menu.njk new file mode 100644 index 0000000..e4c3bc3 --- /dev/null +++ b/themes/next/layout/_partials/header/sub-menu.njk @@ -0,0 +1,12 @@ +{% import '_partials/header/menu-item.njk' as menu_item with context %} + +{%- if theme.menu and is_page() %} + {%- set menus = next_menu(page.path) %} + {%- for menu in menus %} + + {%- endfor %} +{%- endif %} diff --git a/themes/next/layout/_partials/languages.njk b/themes/next/layout/_partials/languages.njk new file mode 100644 index 0000000..a23f07f --- /dev/null +++ b/themes/next/layout/_partials/languages.njk @@ -0,0 +1,16 @@ +{%- if theme.language_switcher and languages.length > 1 %} +
+ + +
+{%- endif %} diff --git a/themes/next/layout/_partials/page/breadcrumb.njk b/themes/next/layout/_partials/page/breadcrumb.njk new file mode 100644 index 0000000..a64bf33 --- /dev/null +++ b/themes/next/layout/_partials/page/breadcrumb.njk @@ -0,0 +1,30 @@ +{%- set paths = page.path.split('/') %} +{%- set count = paths.length %} +{%- if count > 2 %} + {%- set link = '/' %} + +{%- endif %} diff --git a/themes/next/layout/_partials/page/categories.njk b/themes/next/layout/_partials/page/categories.njk new file mode 100644 index 0000000..60f2cd3 --- /dev/null +++ b/themes/next/layout/_partials/page/categories.njk @@ -0,0 +1,8 @@ +
+
+ {{ _p('counter.categories', site.categories.length) }} +
+
+ {{ list_categories() }} +
+
diff --git a/themes/next/layout/_partials/page/page-header.njk b/themes/next/layout/_partials/page/page-header.njk new file mode 100644 index 0000000..497157b --- /dev/null +++ b/themes/next/layout/_partials/page/page-header.njk @@ -0,0 +1,15 @@ +
+ +

+ {{- page.title }} + {{- post_edit(page.source) }} +

+ + + +
diff --git a/themes/next/layout/_partials/page/schedule.njk b/themes/next/layout/_partials/page/schedule.njk new file mode 100644 index 0000000..9deaec1 --- /dev/null +++ b/themes/next/layout/_partials/page/schedule.njk @@ -0,0 +1,3 @@ +
+
+{{- next_js('schedule.js', { pjax: true }) }} diff --git a/themes/next/layout/_partials/page/tags.njk b/themes/next/layout/_partials/page/tags.njk new file mode 100644 index 0000000..c6e55cc --- /dev/null +++ b/themes/next/layout/_partials/page/tags.njk @@ -0,0 +1,16 @@ +
+
+ {{ _p('counter.tag_cloud', site.tags.length) }} +
+
+ {{ tagcloud({ + min_font: theme.tagcloud.min, + max_font: theme.tagcloud.max, + amount : theme.tagcloud.amount, + orderby : theme.tagcloud.orderby, + order : theme.tagcloud.order, + class : 'tag-cloud' + }) + }} +
+
diff --git a/themes/next/layout/_partials/pagination.njk b/themes/next/layout/_partials/pagination.njk new file mode 100644 index 0000000..2f4097d --- /dev/null +++ b/themes/next/layout/_partials/pagination.njk @@ -0,0 +1,5 @@ +{%- if page.prev or page.next %} + +{%- endif %} diff --git a/themes/next/layout/_partials/post/post-copyright.njk b/themes/next/layout/_partials/post/post-copyright.njk new file mode 100644 index 0000000..84da3eb --- /dev/null +++ b/themes/next/layout/_partials/post/post-copyright.njk @@ -0,0 +1,34 @@ +{%- set ccIcon = '' %} +{%- set ccText = theme.creative_commons.license | upper %} + +
+
    +
  • + {%- if page.author %} + {{ __('post.copyright.post_author') + __('symbol.colon') }} + {{- page.author }} + {%- elif author %} + {{ __('post.copyright.author') + __('symbol.colon') }} + {{- author }} + {%- endif %} +
  • +
  • + {%- if page.post_link %} + {{ __('post.copyright.post_link') + __('symbol.colon') }} + {{ next_url(page.post_link, page.post_link, {title: page.title}) }} + {%- else %} + {{ __('post.copyright.link') + __('symbol.colon') }} + {{ next_url(page.permalink, page.permalink, {title: page.title}, true) }} + {%- endif %} +
  • +
  • + {%- if page.copyright_reprint %} + {{ __('post.copyright.license_title') + __('symbol.colon') }} + {{- __('post.copyright.license_content_reprint', next_url(ccURL, ccIcon + ccText)) }} + {%- else %} + {{ __('post.copyright.license_title') + __('symbol.colon') }} + {{- __('post.copyright.license_content', next_url(ccURL, ccIcon + ccText)) }} + {%- endif %} +
  • +
+
diff --git a/themes/next/layout/_partials/post/post-followme.njk b/themes/next/layout/_partials/post/post-followme.njk new file mode 100644 index 0000000..b34e962 --- /dev/null +++ b/themes/next/layout/_partials/post/post-followme.njk @@ -0,0 +1,32 @@ +
+ {{ __('follow_me.welcome') }} + + +
diff --git a/themes/next/layout/_partials/post/post-meta.njk b/themes/next/layout/_partials/post/post-meta.njk new file mode 100644 index 0000000..c3d3ea4 --- /dev/null +++ b/themes/next/layout/_partials/post/post-meta.njk @@ -0,0 +1,107 @@ + diff --git a/themes/next/layout/_partials/post/post-related.njk b/themes/next/layout/_partials/post/post-related.njk new file mode 100644 index 0000000..ccf1286 --- /dev/null +++ b/themes/next/layout/_partials/post/post-related.njk @@ -0,0 +1,18 @@ + + diff --git a/themes/next/layout/_partials/post/post-reward.njk b/themes/next/layout/_partials/post/post-reward.njk new file mode 100644 index 0000000..f42c7c8 --- /dev/null +++ b/themes/next/layout/_partials/post/post-reward.njk @@ -0,0 +1,18 @@ +
+
{{ __('reward.comment') }}
+ +
+ + {%- for name, image in theme.reward %} + {%- set builtin = ['wechatpay', 'alipay', 'paypal', 'bitcoin'] %} + {%- set translation = __('reward.' + name) if builtin.includes(name) else name %} +
+ {{ author }} {{ translation }} + {{ translation }} +
+ {%- endfor %} + +
+
diff --git a/themes/next/layout/_partials/post/post-share.njk b/themes/next/layout/_partials/post/post-share.njk new file mode 100644 index 0000000..75b66d1 --- /dev/null +++ b/themes/next/layout/_partials/post/post-share.njk @@ -0,0 +1,8 @@ +{%- if theme.addtoany.enable %} + +{%- endif %} diff --git a/themes/next/layout/_partials/search/algolia-search.njk b/themes/next/layout/_partials/search/algolia-search.njk new file mode 100644 index 0000000..59f5b4e --- /dev/null +++ b/themes/next/layout/_partials/search/algolia-search.njk @@ -0,0 +1,14 @@ +
+ + + +
+ + + +
+
+

+
+
+
diff --git a/themes/next/layout/_partials/search/index.njk b/themes/next/layout/_partials/search/index.njk new file mode 100644 index 0000000..0a22e24 --- /dev/null +++ b/themes/next/layout/_partials/search/index.njk @@ -0,0 +1,11 @@ +{%- if theme.algolia_search.enable or theme.local_search.enable %} +
+ +
+{%- endif %} diff --git a/themes/next/layout/_partials/search/localsearch.njk b/themes/next/layout/_partials/search/localsearch.njk new file mode 100644 index 0000000..6fa6f65 --- /dev/null +++ b/themes/next/layout/_partials/search/localsearch.njk @@ -0,0 +1,18 @@ +
+ + + +
+ +
+ + + +
+
+
+ +
+
diff --git a/themes/next/layout/_partials/sidebar/site-overview.njk b/themes/next/layout/_partials/sidebar/site-overview.njk new file mode 100644 index 0000000..23e15c2 --- /dev/null +++ b/themes/next/layout/_partials/sidebar/site-overview.njk @@ -0,0 +1,81 @@ + + +{%- if theme.site_state %} +
+ +
+{%- endif %} + +{%- if theme.chat.enable and (theme.chatra.enable or theme.tidio.enable) %} + +{%- endif %} + +{%- if theme.social %} + +{%- endif %} + +{%- if theme.creative_commons.license and theme.creative_commons.sidebar %} +
+ {%- set ccImage = 'Creative Commons' %} + {{ next_url(ccURL, ccImage, {class: 'cc-opacity'}) }} +
+{%- endif %} diff --git a/themes/next/layout/_partials/widgets.njk b/themes/next/layout/_partials/widgets.njk new file mode 100644 index 0000000..4e5b2d3 --- /dev/null +++ b/themes/next/layout/_partials/widgets.njk @@ -0,0 +1,38 @@ +{# Widgets with fixed position #} + +{%- if theme.sidebar.display !== 'remove' and (theme.scheme === 'Muse' or theme.scheme === 'Mist') %} + + +{%- endif %} + +{%- if theme.back2top.enable and not theme.back2top.sidebar %} +
+ + 0% +
+{%- endif %} + +{%- if theme.reading_progress.enable %} +
+{%- endif %} + +{%- if theme.bookmark.enable %} + +{%- endif %} + +{%- if theme.github_banner.enable %} + {%- set github_URL = theme.github_banner.permalink %} + {%- set github_title = __('widget.github') %} + + {%- set github_image = '' %} + + {{ next_url(github_URL, github_image, {class: 'github-corner', title: github_title, "aria-label": github_title}) }} +{%- endif %} + + diff --git a/themes/next/layout/_scripts/index.njk b/themes/next/layout/_scripts/index.njk new file mode 100644 index 0000000..6a3788b --- /dev/null +++ b/themes/next/layout/_scripts/index.njk @@ -0,0 +1,20 @@ +{%- include 'vendors.njk' -%} + +{{- next_js('comments.js') }} + +{{- next_js('utils.js') }} +{%- if theme.motion.enable %} + {{- next_js('motion.js') }} +{%- endif %} + +{%- if theme.scheme === 'Muse' or theme.scheme === 'Mist' %} + {{- next_js('schemes/muse.js') }} +{%- endif %} + +{{- next_js('next-boot.js') }} +{%- if theme.bookmark.enable %} + {{- next_js('bookmark.js') }} +{%- endif %} +{%- if theme.pjax %} + {{- next_js('pjax.js') }} +{%- endif %} diff --git a/themes/next/layout/_scripts/vendors.njk b/themes/next/layout/_scripts/vendors.njk new file mode 100644 index 0000000..0790100 --- /dev/null +++ b/themes/next/layout/_scripts/vendors.njk @@ -0,0 +1,7 @@ +{%- if theme.canvas_ribbon.enable %} + +{%- endif %} + +{%- for name in js_vendors() %} + {{ next_vendors(name) }} +{%- endfor %} diff --git a/themes/next/layout/_third-party/addtoany.njk b/themes/next/layout/_third-party/addtoany.njk new file mode 100644 index 0000000..cbfa521 --- /dev/null +++ b/themes/next/layout/_third-party/addtoany.njk @@ -0,0 +1,3 @@ +{%- if theme.addtoany.enable %} + {{ next_js('third-party/addtoany.js') }} +{%- endif %} diff --git a/themes/next/layout/_third-party/analytics/baidu-analytics.njk b/themes/next/layout/_third-party/analytics/baidu-analytics.njk new file mode 100644 index 0000000..2e1e429 --- /dev/null +++ b/themes/next/layout/_third-party/analytics/baidu-analytics.njk @@ -0,0 +1,4 @@ +{%- if theme.baidu_analytics %} + {{ next_js('third-party/analytics/baidu-analytics.js') }} + +{%- endif %} diff --git a/themes/next/layout/_third-party/analytics/cloudflare.njk b/themes/next/layout/_third-party/analytics/cloudflare.njk new file mode 100644 index 0000000..d44f2e1 --- /dev/null +++ b/themes/next/layout/_third-party/analytics/cloudflare.njk @@ -0,0 +1,3 @@ +{%- if theme.cloudflare_analytics %} + +{%- endif %} diff --git a/themes/next/layout/_third-party/analytics/google-analytics.njk b/themes/next/layout/_third-party/analytics/google-analytics.njk new file mode 100644 index 0000000..b0ffd9c --- /dev/null +++ b/themes/next/layout/_third-party/analytics/google-analytics.njk @@ -0,0 +1,7 @@ +{%- if theme.google_analytics.tracking_id %} + {%- if not theme.google_analytics.only_pageview %} + + {%- endif %} + {{ next_data('google_analytics', theme.google_analytics) }} + {{ next_js('third-party/analytics/google-analytics.js') }} +{%- endif %} diff --git a/themes/next/layout/_third-party/analytics/growingio.njk b/themes/next/layout/_third-party/analytics/growingio.njk new file mode 100644 index 0000000..0c0c496 --- /dev/null +++ b/themes/next/layout/_third-party/analytics/growingio.njk @@ -0,0 +1,5 @@ +{%- if theme.growingio_analytics %} + + {{ next_data('growingio_analytics', theme.growingio_analytics) }} + {{ next_js('third-party/analytics/growingio.js') }} +{%- endif %} diff --git a/themes/next/layout/_third-party/analytics/index.njk b/themes/next/layout/_third-party/analytics/index.njk new file mode 100644 index 0000000..eee0302 --- /dev/null +++ b/themes/next/layout/_third-party/analytics/index.njk @@ -0,0 +1,8 @@ +{%- include 'google-analytics.njk' -%} +{%- include 'baidu-analytics.njk' -%} +{%- include 'growingio.njk' -%} +{%- include 'cloudflare.njk' -%} +{%- include 'microsoft-clarity.njk' -%} +{%- include 'matomo.njk' -%} +{%- include 'umami.njk' -%} +{%- include 'plausible.njk' -%} diff --git a/themes/next/layout/_third-party/analytics/matomo.njk b/themes/next/layout/_third-party/analytics/matomo.njk new file mode 100644 index 0000000..ed64d11 --- /dev/null +++ b/themes/next/layout/_third-party/analytics/matomo.njk @@ -0,0 +1,4 @@ +{%- if theme.matomo.enable %} + {{ next_data('matomo', theme.matomo) }} + {{ next_js('third-party/analytics/matomo.js') }} +{%- endif %} diff --git a/themes/next/layout/_third-party/analytics/microsoft-clarity.njk b/themes/next/layout/_third-party/analytics/microsoft-clarity.njk new file mode 100644 index 0000000..ebae7a1 --- /dev/null +++ b/themes/next/layout/_third-party/analytics/microsoft-clarity.njk @@ -0,0 +1,9 @@ +{%- if theme.clarity_analytics %} + +{%- endif %} diff --git a/themes/next/layout/_third-party/analytics/plausible.njk b/themes/next/layout/_third-party/analytics/plausible.njk new file mode 100644 index 0000000..31ee10c --- /dev/null +++ b/themes/next/layout/_third-party/analytics/plausible.njk @@ -0,0 +1,3 @@ +{%- if theme.plausible.enable %} + +{%- endif %} diff --git a/themes/next/layout/_third-party/analytics/umami.njk b/themes/next/layout/_third-party/analytics/umami.njk new file mode 100644 index 0000000..df540a6 --- /dev/null +++ b/themes/next/layout/_third-party/analytics/umami.njk @@ -0,0 +1,3 @@ +{%- if theme.umami.enable %} + +{%- endif %} diff --git a/themes/next/layout/_third-party/chat/chatra.njk b/themes/next/layout/_third-party/chat/chatra.njk new file mode 100644 index 0000000..c0ebd12 --- /dev/null +++ b/themes/next/layout/_third-party/chat/chatra.njk @@ -0,0 +1,3 @@ +{{ next_data('chatra', theme.chatra) }} +{{ next_js('third-party/chat/chatra.js') }} + diff --git a/themes/next/layout/_third-party/chat/tidio.njk b/themes/next/layout/_third-party/chat/tidio.njk new file mode 100644 index 0000000..8b222cf --- /dev/null +++ b/themes/next/layout/_third-party/chat/tidio.njk @@ -0,0 +1,2 @@ + +{{ next_js('third-party/chat/tidio.js') }} diff --git a/themes/next/layout/_third-party/comments/changyan.njk b/themes/next/layout/_third-party/comments/changyan.njk new file mode 100644 index 0000000..677c45a --- /dev/null +++ b/themes/next/layout/_third-party/comments/changyan.njk @@ -0,0 +1,2 @@ +{{ next_data('changyan', theme.changyan) }} +{{ next_js('third-party/comments/changyan.js') }} diff --git a/themes/next/layout/_third-party/comments/disqus.njk b/themes/next/layout/_third-party/comments/disqus.njk new file mode 100644 index 0000000..3876f00 --- /dev/null +++ b/themes/next/layout/_third-party/comments/disqus.njk @@ -0,0 +1,6 @@ +{{ next_data('disqus', theme.disqus, { + i18n: { + disqus: __('disqus') + } +}) }} +{{ next_js('third-party/comments/disqus.js') }} diff --git a/themes/next/layout/_third-party/comments/disqusjs.njk b/themes/next/layout/_third-party/comments/disqusjs.njk new file mode 100644 index 0000000..d15e2b3 --- /dev/null +++ b/themes/next/layout/_third-party/comments/disqusjs.njk @@ -0,0 +1,6 @@ +{{ next_vendors('disqusjs_css') }} + +{{ next_data('disqusjs', theme.disqusjs, { + js: theme.vendors.disqusjs_js +}) }} +{{ next_js('third-party/comments/disqusjs.js') }} diff --git a/themes/next/layout/_third-party/comments/gitalk.njk b/themes/next/layout/_third-party/comments/gitalk.njk new file mode 100644 index 0000000..d1cee1d --- /dev/null +++ b/themes/next/layout/_third-party/comments/gitalk.njk @@ -0,0 +1,7 @@ +{{ next_vendors('gitalk_css') }} + +{{ next_data('gitalk', theme.gitalk, { + js: theme.vendors.gitalk_js, + path_md5: gitalk_md5(page.path) +}) }} +{{ next_js('third-party/comments/gitalk.js') }} diff --git a/themes/next/layout/_third-party/comments/isso.njk b/themes/next/layout/_third-party/comments/isso.njk new file mode 100644 index 0000000..86e86b5 --- /dev/null +++ b/themes/next/layout/_third-party/comments/isso.njk @@ -0,0 +1,2 @@ +{{ next_data('isso', theme.isso) }} +{{ next_js('third-party/comments/isso.js') }} diff --git a/themes/next/layout/_third-party/comments/livere.njk b/themes/next/layout/_third-party/comments/livere.njk new file mode 100644 index 0000000..331535b --- /dev/null +++ b/themes/next/layout/_third-party/comments/livere.njk @@ -0,0 +1 @@ +{{ next_js('third-party/comments/livere.js') }} diff --git a/themes/next/layout/_third-party/comments/utterances.njk b/themes/next/layout/_third-party/comments/utterances.njk new file mode 100644 index 0000000..b3656ff --- /dev/null +++ b/themes/next/layout/_third-party/comments/utterances.njk @@ -0,0 +1,2 @@ +{{ next_data('utterances', theme.utterances) }} +{{ next_js('third-party/comments/utterances.js') }} diff --git a/themes/next/layout/_third-party/fancybox.njk b/themes/next/layout/_third-party/fancybox.njk new file mode 100644 index 0000000..a42c374 --- /dev/null +++ b/themes/next/layout/_third-party/fancybox.njk @@ -0,0 +1,3 @@ +{%- if theme.fancybox %} + {{ next_js('third-party/fancybox.js') }} +{%- endif %} diff --git a/themes/next/layout/_third-party/index.njk b/themes/next/layout/_third-party/index.njk new file mode 100644 index 0000000..f027ff0 --- /dev/null +++ b/themes/next/layout/_third-party/index.njk @@ -0,0 +1,19 @@ +{%- if theme.algolia_search.enable %} + {%- include 'search/algolia-search.njk' -%} +{%- elif theme.local_search.enable %} + {%- include 'search/localsearch.njk' -%} +{%- endif %} + +{%- if theme.chatra.enable %} + {%- include 'chat/chatra.njk' -%} +{%- elif theme.tidio.enable %} + {%- include 'chat/tidio.njk' -%} +{%- endif %} + +{%- include 'tags/pdf.njk' -%} +{%- include 'tags/mermaid.njk' -%} +{%- include 'tags/wavedrom.njk' -%} + +{%- include 'fancybox.njk' -%} +{%- include 'pace.njk' -%} +{%- include 'addtoany.njk' -%} diff --git a/themes/next/layout/_third-party/math/index.njk b/themes/next/layout/_third-party/math/index.njk new file mode 100644 index 0000000..a47095b --- /dev/null +++ b/themes/next/layout/_third-party/math/index.njk @@ -0,0 +1,26 @@ +{%- if theme.math.mathjax.enable or theme.math.katex.enable %} + {%- set enable_math = false %} + + {%- set is_index_has_math = false %} + + {# At home, check if there has `mathjax: true` post #} + {%- if is_home() and not theme.math.every_page %} + {%- for post in page.posts.toArray() %} + {%- if post.mathjax and not is_index_has_math %} + {%- set is_index_has_math = true %} + {%- endif %} + {%- endfor %} + {%- endif %} + + {%- if theme.math.every_page or is_index_has_math or page.mathjax %} + {%- set enable_math = true %} + {%- endif %} + + {{ next_data('enableMath', enable_math) }} + + {%- if theme.math.mathjax.enable %} + {%- include '_third-party/math/mathjax.njk' -%} + {% elif theme.math.katex.enable %} + {%- include '_third-party/math/katex.njk' -%} + {%- endif %} +{%- endif %} diff --git a/themes/next/layout/_third-party/math/katex.njk b/themes/next/layout/_third-party/math/katex.njk new file mode 100644 index 0000000..62a64c2 --- /dev/null +++ b/themes/next/layout/_third-party/math/katex.njk @@ -0,0 +1,7 @@ +{{ next_vendors('katex') }} +{%- if theme.math.katex.copy_tex %} + {{ next_data('katex', { + copy_tex_js: theme.vendors.copy_tex_js + }) }} + {{ next_js('third-party/math/katex.js') }} +{%- endif %} diff --git a/themes/next/layout/_third-party/math/mathjax.njk b/themes/next/layout/_third-party/math/mathjax.njk new file mode 100644 index 0000000..a20bb8b --- /dev/null +++ b/themes/next/layout/_third-party/math/mathjax.njk @@ -0,0 +1,4 @@ +{{ next_data('mathjax', theme.math.mathjax, { + js: theme.vendors.mathjax +}) }} +{{ next_js('third-party/math/mathjax.js') }} diff --git a/themes/next/layout/_third-party/pace.njk b/themes/next/layout/_third-party/pace.njk new file mode 100644 index 0000000..ffbadcd --- /dev/null +++ b/themes/next/layout/_third-party/pace.njk @@ -0,0 +1,3 @@ +{%- if theme.pace.enable %} + {{ next_js('third-party/pace.js') }} +{%- endif %} diff --git a/themes/next/layout/_third-party/quicklink.njk b/themes/next/layout/_third-party/quicklink.njk new file mode 100644 index 0000000..e027a98 --- /dev/null +++ b/themes/next/layout/_third-party/quicklink.njk @@ -0,0 +1,7 @@ +{%- if theme.quicklink.enable %} + {{ next_vendors('quicklink') }} + {{ next_data('quicklink', page.quicklink, { + url: url | replace(r/index\.html$/, '') + }) }} + {{ next_js('third-party/quicklink.js') }} +{%- endif %} diff --git a/themes/next/layout/_third-party/search/algolia-search.njk b/themes/next/layout/_third-party/search/algolia-search.njk new file mode 100644 index 0000000..9e69c92 --- /dev/null +++ b/themes/next/layout/_third-party/search/algolia-search.njk @@ -0,0 +1,4 @@ +{{ next_vendors('algolia_search') }} +{{ next_vendors('instant_search') }} + +{{- next_js('third-party/search/algolia-search.js') }} diff --git a/themes/next/layout/_third-party/search/localsearch.njk b/themes/next/layout/_third-party/search/localsearch.njk new file mode 100644 index 0000000..8a8d527 --- /dev/null +++ b/themes/next/layout/_third-party/search/localsearch.njk @@ -0,0 +1,2 @@ +{{ next_vendors('local_search') }} +{{ next_js('third-party/search/local-search.js') }} diff --git a/themes/next/layout/_third-party/statistics/busuanzi-counter.njk b/themes/next/layout/_third-party/statistics/busuanzi-counter.njk new file mode 100644 index 0000000..f3ff6db --- /dev/null +++ b/themes/next/layout/_third-party/statistics/busuanzi-counter.njk @@ -0,0 +1,3 @@ +{%- if theme.busuanzi_count.enable %} + +{%- endif %} diff --git a/themes/next/layout/_third-party/statistics/firestore.njk b/themes/next/layout/_third-party/statistics/firestore.njk new file mode 100644 index 0000000..2bc37a1 --- /dev/null +++ b/themes/next/layout/_third-party/statistics/firestore.njk @@ -0,0 +1,6 @@ +{%- if theme.firestore.enable %} + {{ next_vendors('firebase_app') }} + {{ next_vendors('firebase_firestore') }} + {{ next_data('firestore', theme.firestore) }} + {{ next_js('third-party/statistics/firestore.js') }} +{%- endif %} diff --git a/themes/next/layout/_third-party/statistics/index.njk b/themes/next/layout/_third-party/statistics/index.njk new file mode 100644 index 0000000..6921d8e --- /dev/null +++ b/themes/next/layout/_third-party/statistics/index.njk @@ -0,0 +1,3 @@ +{%- include 'busuanzi-counter.njk' -%} +{%- include 'firestore.njk' -%} +{%- include 'lean-analytics.njk' -%} diff --git a/themes/next/layout/_third-party/statistics/lean-analytics.njk b/themes/next/layout/_third-party/statistics/lean-analytics.njk new file mode 100644 index 0000000..d3171c4 --- /dev/null +++ b/themes/next/layout/_third-party/statistics/lean-analytics.njk @@ -0,0 +1,4 @@ +{%- if theme.leancloud_visitors.enable %} + {{ next_data('leancloud_visitors', theme.leancloud_visitors) }} + {{ next_js('third-party/statistics/lean-analytics.js') }} +{%- endif %} diff --git a/themes/next/layout/_third-party/tags/mermaid.njk b/themes/next/layout/_third-party/tags/mermaid.njk new file mode 100644 index 0000000..1487cb7 --- /dev/null +++ b/themes/next/layout/_third-party/tags/mermaid.njk @@ -0,0 +1,6 @@ +{%- if theme.mermaid.enable %} + {{ next_data('mermaid', theme.mermaid, { + js: theme.vendors.mermaid + }) }} + {{ next_js('third-party/tags/mermaid.js') }} +{%- endif %} diff --git a/themes/next/layout/_third-party/tags/pdf.njk b/themes/next/layout/_third-party/tags/pdf.njk new file mode 100644 index 0000000..d86927c --- /dev/null +++ b/themes/next/layout/_third-party/tags/pdf.njk @@ -0,0 +1,7 @@ +{%- if theme.pdf.enable %} + {{ next_data('pdf', { + object_url: theme.vendors.pdfobject, + url: url_for('lib/pdf/web/viewer.html') + }) }} + {{ next_js('third-party/tags/pdf.js') }} +{%- endif %} diff --git a/themes/next/layout/_third-party/tags/wavedrom.njk b/themes/next/layout/_third-party/tags/wavedrom.njk new file mode 100644 index 0000000..1ff9f46 --- /dev/null +++ b/themes/next/layout/_third-party/tags/wavedrom.njk @@ -0,0 +1,9 @@ +{%- if theme.wavedrom.enable %} + {{ next_data('wavedrom', theme.wavedrom, { + js: theme.vendors.wavedrom + }) }} + {{ next_data('wavedrom_skin', theme.wavedrom, { + js: theme.vendors.wavedrom_skin + }) }} + {{ next_js('third-party/tags/wavedrom.js') }} +{%- endif %} diff --git a/themes/next/layout/archive.njk b/themes/next/layout/archive.njk new file mode 100644 index 0000000..699d583 --- /dev/null +++ b/themes/next/layout/archive.njk @@ -0,0 +1,48 @@ +{% extends '_layout.njk' %} +{% import '_macro/post-collapse.njk' as post_template with context %} +{% import '_macro/sidebar.njk' as sidebar_template with context %} + +{% block title %}{{ __('title.archive') }} | {{ title }}{% endblock %} + +{% block class %}archive posts-collapse{% endblock %} + +{% block content %} + + {#####################} + {### ARCHIVE BLOCK ###} + {#####################} +
+
+
+ {%- set posts_length = site.posts.length %} + {%- if posts_length > 210 %} + {%- set cheers = 'excellent' %} + {% elif posts_length > 130 %} + {%- set cheers = 'great' %} + {% elif posts_length > 80 %} + {%- set cheers = 'good' %} + {% elif posts_length > 50 %} + {%- set cheers = 'nice' %} + {% elif posts_length > 30 %} + {%- set cheers = 'ok' %} + {% else %} + {%- set cheers = 'um' %} + {%- endif %} + {{ __('cheers.' + cheers) }}! {{ _p('counter.archive_posts', site.posts.length) }} {{ __('keep_on') }} +
+ + {{ post_template.render(page.posts) }} + +
+
+ {#########################} + {### END ARCHIVE BLOCK ###} + {#########################} + + {%- include '_partials/pagination.njk' -%} + +{% endblock %} + +{% block sidebar %} + {{ sidebar_template.render(false) }} +{% endblock %} diff --git a/themes/next/layout/category.njk b/themes/next/layout/category.njk new file mode 100644 index 0000000..6468ae3 --- /dev/null +++ b/themes/next/layout/category.njk @@ -0,0 +1,36 @@ +{% extends '_layout.njk' %} +{% import '_macro/post-collapse.njk' as post_template with context %} +{% import '_macro/sidebar.njk' as sidebar_template with context %} + +{% block title %}{{ __('title.category') }}: {{ page.category }} | {{ title }}{% endblock %} + +{% block class %}category posts-collapse{% endblock %} + +{% block content %} + + {######################} + {### CATEGORY BLOCK ###} + {######################} +
+
+
+

+ {{- page.category }} + {{ __('title.category') }} +

+
+ + {{ post_template.render(page.posts) }} +
+
+ {##########################} + {### END CATEGORY BLOCK ###} + {##########################} + + {%- include '_partials/pagination.njk' -%} + +{% endblock %} + +{% block sidebar %} + {{ sidebar_template.render(false) }} +{% endblock %} diff --git a/themes/next/layout/index.njk b/themes/next/layout/index.njk new file mode 100644 index 0000000..0ce84ec --- /dev/null +++ b/themes/next/layout/index.njk @@ -0,0 +1,20 @@ +{% extends '_layout.njk' %} +{% import '_macro/sidebar.njk' as sidebar_template with context %} + +{% block title %}{{ title }}{% if theme.index_with_subtitle and subtitle %} - {{ subtitle }}{% endif %}{% endblock %} + +{% block class %}index posts-expand{% endblock %} + +{% block content %} + + {%- for post in page.posts.toArray() %} + {{ partial('_macro/post.njk', {post: post, is_index: true}) }} + {%- endfor %} + + {%- include '_partials/pagination.njk' -%} + +{% endblock %} + +{% block sidebar %} + {{ sidebar_template.render(false) }} +{% endblock %} diff --git a/themes/next/layout/page.njk b/themes/next/layout/page.njk new file mode 100644 index 0000000..9bf5cf1 --- /dev/null +++ b/themes/next/layout/page.njk @@ -0,0 +1,54 @@ +{% extends '_layout.njk' %} +{% import '_macro/sidebar.njk' as sidebar_template with context %} + +{% block title %} + {%- set page_title_suffix = ' | ' + title %} + + {%- if page.type === 'categories' and not page.title %} + {{- __('title.category') + page_title_suffix }} + {%- elif page.type === 'tags' and not page.title %} + {{- __('title.tag') + page_title_suffix }} + {%- elif page.type === 'schedule' and not page.title %} + {{- __('title.schedule') + page_title_suffix }} + {%- else %} + {{- page.title + page_title_suffix }} + {%- endif %} +{% endblock %} + +{% block class %}page posts-expand{% endblock %} + +{% block content %} + + {##################} + {### PAGE BLOCK ###} + {##################} +
+ {%- include '_partials/page/page-header.njk' -%} + {#################} + {### PAGE BODY ###} + {#################} +
+ {%- if page.type === 'tags' %} + {%- include '_partials/page/tags.njk' -%} + {% elif page.type === 'categories' %} + {%- include '_partials/page/categories.njk' -%} + {% elif page.type === 'schedule' %} + {%- include '_partials/page/schedule.njk' -%} + {% else %} + {{ page.content }} + {%- endif %} +
+ {#####################} + {### END PAGE BODY ###} + {#####################} +
+ {%- include '_partials/page/breadcrumb.njk' -%} + {######################} + {### END PAGE BLOCK ###} + {######################} + +{% endblock %} + +{% block sidebar %} + {{ sidebar_template.render(page.toc.enable) }} +{% endblock %} diff --git a/themes/next/layout/post.njk b/themes/next/layout/post.njk new file mode 100644 index 0000000..24bd548 --- /dev/null +++ b/themes/next/layout/post.njk @@ -0,0 +1,16 @@ +{% extends '_layout.njk' %} +{% import '_macro/sidebar.njk' as sidebar_template with context %} + +{% block title %}{{ page.title }} | {{ title }}{% endblock %} + +{% block class %}post posts-expand{% endblock %} + +{% block content %} + + {{ partial('_macro/post.njk', {post: page}) }} + +{% endblock %} + +{% block sidebar %} + {{ sidebar_template.render(page.toc.enable) }} +{% endblock %} diff --git a/themes/next/layout/tag.njk b/themes/next/layout/tag.njk new file mode 100644 index 0000000..96c8c2a --- /dev/null +++ b/themes/next/layout/tag.njk @@ -0,0 +1,36 @@ +{% extends '_layout.njk' %} +{% import '_macro/post-collapse.njk' as post_template with context %} +{% import '_macro/sidebar.njk' as sidebar_template with context %} + +{% block title %}{{ __('title.tag') }}: {{ page.tag }} | {{ title }}{% endblock %} + +{% block class %}tag posts-collapse{% endblock %} + +{% block content %} + + {#################} + {### TAG BLOCK ###} + {#################} +
+
+
+

+ {{- page.tag }} + {{ __('title.tag') }} +

+
+ + {{ post_template.render(page.posts) }} +
+
+ {#####################} + {### END TAG BLOCK ###} + {#####################} + + {%- include '_partials/pagination.njk' -%} + +{% endblock %} + +{% block sidebar %} + {{ sidebar_template.render(false) }} +{% endblock %} diff --git a/themes/next/package.json b/themes/next/package.json new file mode 100644 index 0000000..36ca9da --- /dev/null +++ b/themes/next/package.json @@ -0,0 +1,46 @@ +{ + "name": "hexo-theme-next", + "version": "8.19.2", + "description": "Elegant and powerful theme for Hexo.", + "main": "package.json", + "files": [ + "docs", + "languages", + "layout", + "scripts", + "source", + "_config.yml", + "_vendors.yml" + ], + "scripts": { + "eslint": "eslint scripts/ source/js test/", + "prepare": "node .githooks/install.js", + "stylint": "stylelint source/css/ --ip source/css/_common/scaffolding/highlight/index.styl", + "test": "mocha test/index.js", + "test-cov": "c8 npm test" + }, + "repository": "next-theme/hexo-theme-next", + "keywords": [ + "hexo", + "theme", + "next" + ], + "author": "NexT (https://theme-next.js.org)", + "license": "AGPL-3.0-only", + "bugs": { + "url": "https://github.com/next-theme/hexo-theme-next/issues" + }, + "homepage": "https://theme-next.js.org", + "devDependencies": { + "@next-theme/eslint-config": "0.0.3", + "c8": "9.1.0", + "chai": "4.4.1", + "eslint": "8.55.0", + "hexo": "7.1.1", + "hexo-renderer-marked": "6.2.0", + "js-yaml": "4.1.0", + "mocha": "10.3.0", + "stylelint": "16.2.1", + "stylelint-stylus": "1.0.0" + } +} diff --git a/themes/next/renovate.json b/themes/next/renovate.json new file mode 100644 index 0000000..f45d8f1 --- /dev/null +++ b/themes/next/renovate.json @@ -0,0 +1,5 @@ +{ + "extends": [ + "config:base" + ] +} diff --git a/themes/next/scripts/events/index.js b/themes/next/scripts/events/index.js new file mode 100644 index 0000000..acf76a1 --- /dev/null +++ b/themes/next/scripts/events/index.js @@ -0,0 +1,32 @@ +/* global hexo */ + +'use strict'; + +hexo.extend.filter.register('before_generate', () => { + // Merge config + require('./lib/config')(hexo); + // Set vendors + require('./lib/vendors')(hexo); + // Add filter type `theme_inject` + require('./lib/injects')(hexo); + // Highlight + require('./lib/highlight')(hexo); + // Menu and sub menu + require('./lib/navigation')(hexo); +}, 0); + +hexo.on('ready', () => { + if (!/^(g|s)/.test(hexo.env.cmd) || process.argv.includes('--next-disable-banner')) return; + const { version } = require('../../package.json'); + hexo.log.info(`================================== + ███╗ ██╗███████╗██╗ ██╗████████╗ + ████╗ ██║██╔════╝╚██╗██╔╝╚══██╔══╝ + ██╔██╗ ██║█████╗ ╚███╔╝ ██║ + ██║╚██╗██║██╔══╝ ██╔██╗ ██║ + ██║ ╚████║███████╗██╔╝ ██╗ ██║ + ╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ ╚═╝ +======================================== +NexT version ${version} +Documentation: https://theme-next.js.org +========================================`); +}); diff --git a/themes/next/scripts/events/lib/config.js b/themes/next/scripts/events/lib/config.js new file mode 100644 index 0000000..ad35061 --- /dev/null +++ b/themes/next/scripts/events/lib/config.js @@ -0,0 +1,44 @@ +'use strict'; + +const { deepMerge } = require('hexo-util'); + +module.exports = hexo => { + const data = hexo.locals.get('data'); + + if (data.next) { + hexo.log.warn('`next.yml` is deprecated. Please upgrade to Hexo 5 or later and use `_config.next.yml` instead.'); + hexo.log.warn('Documentation: https://theme-next.js.org/docs/getting-started/configuration.html'); + } + + const { cache, language_switcher } = hexo.theme.config; + const warning = function(...args) { + hexo.log.warn(`Since ${args[0]} is turned on, the ${args[1]} is disabled to avoid potential hazards.`); + }; + + if (cache && cache.enable && language_switcher) { + warning('language_switcher', 'caching'); + cache.enable = false; + } + if (cache && cache.enable && hexo.config.relative_link) { + warning('caching', '`relative_link` option in Hexo `_config.yml`'); + hexo.config.relative_link = false; + } + + // Custom languages support. Introduced in NexT v6.3.0. + if (data.languages) { + const { language } = hexo.config; + const { i18n } = hexo.theme; + + const mergeLang = lang => { + if (data.languages[lang]) i18n.set(lang, deepMerge(i18n.get([lang]), data.languages[lang])); + }; + + if (Array.isArray(language)) { + for (const lang of language) { + mergeLang(lang); + } + } else { + mergeLang(language); + } + } +}; diff --git a/themes/next/scripts/events/lib/highlight.js b/themes/next/scripts/events/lib/highlight.js new file mode 100644 index 0000000..b3b8d00 --- /dev/null +++ b/themes/next/scripts/events/lib/highlight.js @@ -0,0 +1,28 @@ +'use strict'; + +const fs = require('fs'); +const { resolve, highlightTheme } = require('./utils'); + +function prismTheme(name) { + let file = resolve('prismjs', `themes/${name}.css`); + if (!fs.existsSync(file)) file = resolve('prism-themes', `themes/${name}.css`); + return file; +} + +module.exports = hexo => { + const { config } = hexo; + const theme = hexo.theme.config; + config.highlight.hljs = false; + config.prismjs = config.prismjs || {}; + theme.highlight = { + enable: config.syntax_highlighter === 'highlight.js' || config.highlight.enable, + light : highlightTheme(theme.codeblock.theme.light), + dark : highlightTheme(theme.codeblock.theme.dark) + }; + theme.prism = { + enable: config.syntax_highlighter === 'prismjs' || config.prismjs.enable, + light : prismTheme(theme.codeblock.prism.light), + dark : prismTheme(theme.codeblock.prism.dark), + number: resolve('prismjs', 'plugins/line-numbers/prism-line-numbers.css') + }; +}; diff --git a/themes/next/scripts/events/lib/injects.js b/themes/next/scripts/events/lib/injects.js new file mode 100644 index 0000000..6a7c323 --- /dev/null +++ b/themes/next/scripts/events/lib/injects.js @@ -0,0 +1,85 @@ +'use strict'; + +const fs = require('fs'); +const path = require('path'); +const { points } = require('./utils'); +const defaultExtname = '.njk'; + +// Defining stylus types +class StylusInject { + constructor(base_dir) { + this.base_dir = base_dir; + this.files = []; + } + push(file) { + // Get absolute path base on hexo dir + this.files.push(path.resolve(this.base_dir, file)); + } +} + +// Defining view types +class ViewInject { + constructor(base_dir) { + this.base_dir = base_dir; + this.raws = []; + } + raw(name, raw, ...args) { + // Set default extname + if (path.extname(name) === '') { + name += defaultExtname; + } + this.raws.push({ name, raw, args }); + } + file(name, file, ...args) { + // Set default extname from file's extname + if (path.extname(name) === '') { + name += path.extname(file); + } + // Get absolute path base on hexo dir + this.raw(name, fs.readFileSync(path.resolve(this.base_dir, file), 'utf8'), ...args); + } +} + +// Init injects +function initInject(base_dir) { + const injects = {}; + points.styles.forEach(item => { + injects[item] = new StylusInject(base_dir); + }); + points.views.forEach(item => { + injects[item] = new ViewInject(base_dir); + }); + return injects; +} + +module.exports = hexo => { + // Exec theme_inject filter + const injects = initInject(hexo.base_dir); + hexo.execFilterSync('theme_inject', injects); + hexo.theme.config.injects = {}; + + // Inject stylus + points.styles.forEach(type => { + hexo.theme.config.injects[type] = injects[type].files; + }); + + // Inject views + points.views.forEach(type => { + const configs = Object.create(null); + hexo.theme.config.injects[type] = []; + // Add or override view. + injects[type].raws.forEach((injectObj, index) => { + const name = `inject/${type}/${injectObj.name}`; + hexo.theme.setView(name, injectObj.raw); + configs[name] = { + layout : name, + locals : injectObj.args[0], + options: injectObj.args[1], + order : injectObj.args[2] || index + }; + }); + // Views sort. + hexo.theme.config.injects[type] = Object.values(configs) + .sort((x, y) => x.order - y.order); + }); +}; diff --git a/themes/next/scripts/events/lib/navigation.js b/themes/next/scripts/events/lib/navigation.js new file mode 100644 index 0000000..33f6d1d --- /dev/null +++ b/themes/next/scripts/events/lib/navigation.js @@ -0,0 +1,57 @@ +'use strict'; + +const { join } = require('path').posix; + +class TreeNode { + constructor(parent, path, name, icon) { + if (parent && !path.startsWith('http')) { + path = join(parent.path, path); + } + this.parent = parent; + this.children = []; + this.path = path; + this.name = name; + this.icon = icon; + } + + append(child) { + this.children.push(child); + } +} + +module.exports = hexo => { + const menu_map = new Map(); + const main_menu = []; + hexo.theme.config.menu_map = menu_map; + hexo.theme.config.main_menu = main_menu; + + function parse(menu, parent) { + if (!menu) return; + Object.entries(menu).forEach(([name, value]) => { + if (name.toLowerCase() === 'default') return; + let node; + if (typeof value === 'string') { + const [path, icon] = value.split('||').map(v => v.trim()); + node = new TreeNode(parent, path, name, icon); + } else if (typeof value === 'object') { + if (typeof value.default !== 'string') { + hexo.log.warn('Missing default entry for menu item:', name); + return; + } + const [path, icon] = value.default.split('||').map(v => v.trim()); + node = new TreeNode(parent, path, name, icon); + parse(value, node); + } + if (node) { + menu_map.set(node.path, node); + if (parent) { + parent.append(node); + } else { + main_menu.push(node); + } + } + }); + } + + parse(hexo.theme.config.menu); +}; diff --git a/themes/next/scripts/events/lib/utils.js b/themes/next/scripts/events/lib/utils.js new file mode 100644 index 0000000..6affb43 --- /dev/null +++ b/themes/next/scripts/events/lib/utils.js @@ -0,0 +1,90 @@ +'use strict'; + +const fs = require('fs'); +const path = require('path'); +let css; +try { + css = require('@adobe/css-tools'); +} catch (error) { + css = require('css'); +} + +function resolve(name, file = '') { + let dir; + try { + dir = path.dirname(require.resolve(`${name}/package.json`)); + } catch (error) { + return ''; + } + return `${dir}/${file}`; +} + +function highlightTheme(name) { + const file = resolve('highlight.js', `styles/${name}.css`); + const content = fs.readFileSync(file, 'utf8'); + + let background = ''; + let foreground = ''; + css.parse(content).stylesheet.rules + .filter(rule => rule.type === 'rule' && rule.selectors.some(selector => selector.endsWith('.hljs'))) + .flatMap(rule => rule.declarations) + .forEach(declaration => { + if (declaration.property === 'background' || declaration.property === 'background-color') background = declaration.value; + else if (declaration.property === 'color') foreground = declaration.value; + }); + return { + file, + background, + foreground + }; +} + +function getVendors({ name, alias, version, file, minified, local, custom }) { + // Make it possible to set `cdnjs_name` and `cdnjs_file` in `custom_cdn_url` + const npm_name = name; + const cdnjs_name = alias || name; + const npm_file = file; + const cdnjs_file = minified.replace(/^(dist|lib|source\/js|)\/(browser\/|)/, ''); + const value = { + npm_name, + cdnjs_name, + version, + npm_file, + minified, + cdnjs_file + }; + return { + local, + jsdelivr: `https://cdn.jsdelivr.net/npm/${npm_name}@${version}/${minified}`, + unpkg : `https://unpkg.com/${npm_name}@${version}/${npm_file}`, + cdnjs : `https://cdnjs.cloudflare.com/ajax/libs/${cdnjs_name}/${version}/${cdnjs_file}`, + custom : (custom || '').replace(/\$\{(.+?)\}/g, (match, $1) => value[$1]) + }; +} + +const points = { + views: [ + 'head', + 'header', + 'sidebar', + 'postMeta', + 'postBodyStart', + 'postBodyEnd', + 'footer', + 'bodyEnd', + 'comment' + ], + styles: [ + 'variable', + 'mixin', + 'style' + ] +}; + +// Required by theme-next-docs and @next-theme/plugins +module.exports = { + resolve, + highlightTheme, + getVendors, + points +}; diff --git a/themes/next/scripts/events/lib/vendors.js b/themes/next/scripts/events/lib/vendors.js new file mode 100644 index 0000000..e64badd --- /dev/null +++ b/themes/next/scripts/events/lib/vendors.js @@ -0,0 +1,55 @@ +'use strict'; + +const fs = require('fs'); +const path = require('path'); +const yaml = require('js-yaml'); +const { url_for } = require('hexo-util'); +const { getVendors } = require('./utils'); + +let internal; +try { + internal = require('@next-theme/plugins'); +} catch (error) { +} +const vendorsFile = fs.readFileSync(path.join(__dirname, '../../../_vendors.yml')); +const dependencies = yaml.load(vendorsFile); + +module.exports = hexo => { + const { vendors, creative_commons, pace } = hexo.theme.config; + if (typeof internal === 'function') { + internal(hexo, dependencies); + } + let { plugins = 'cdnjs' } = vendors; + if (plugins === 'local' && typeof internal === 'undefined') { + hexo.log.warn('Dependencies for `plugins: local` not found. The default CDN provider CDNJS is used instead.'); + hexo.log.warn('Run `npm install @next-theme/plugins` in Hexo site root directory to install the plugin.'); + plugins = 'cdnjs'; + } + for (const [key, value] of Object.entries(dependencies)) { + // This script will be executed repeatedly when Hexo listens file changes + // But the variable vendors[key] only needs to be modified once + if (vendors[key] && typeof vendors[key] === 'string') { + vendors[key] = { + url: url_for.call(hexo, vendors[key]) + }; + continue; + } + if (key === 'creative_commons') { + value.file = `${value.dir}/${creative_commons.size}/${creative_commons.license.replace(/-/g, '_')}.svg`; + } + if (key === 'pace_css') { + value.file = `${value.dir}/${pace.color}/pace-theme-${pace.theme}.css`; + } + const { name, file } = value; + const links = getVendors({ + ...value, + minified: file, + local : url_for.call(hexo, `lib/${name}/${file}`), + custom : vendors.custom_cdn_url + }); + vendors[key] = { + url : links[plugins] || links.cdnjs, + integrity: value.integrity + }; + } +}; diff --git a/themes/next/scripts/filters/comment/changyan.js b/themes/next/scripts/filters/comment/changyan.js new file mode 100644 index 0000000..e3bd25a --- /dev/null +++ b/themes/next/scripts/filters/comment/changyan.js @@ -0,0 +1,35 @@ +/* global hexo */ + +'use strict'; + +const path = require('path'); +const { iconText } = require('./common'); + +// Add comment +hexo.extend.filter.register('theme_inject', injects => { + const config = hexo.theme.config.changyan; + if (!config.enable || !config.appid || !config.appkey) return; + + injects.comment.raw('changyan', '
', {}, {}); + + injects.bodyEnd.file('changyan', path.join(hexo.theme_dir, 'layout/_third-party/comments/changyan.njk')); + +}); + +// Add post_meta +hexo.extend.filter.register('theme_inject', injects => { + const config = hexo.theme.config.changyan; + if (!config.enable || !config.count || !config.appid || !config.appkey) return; + + injects.postMeta.raw('changyan', ` + {% if post.comments %} + + {% endif %} + `, {}, {}); + +}); diff --git a/themes/next/scripts/filters/comment/common.js b/themes/next/scripts/filters/comment/common.js new file mode 100644 index 0000000..7b8dd4a --- /dev/null +++ b/themes/next/scripts/filters/comment/common.js @@ -0,0 +1,23 @@ +'use strict'; + +function capitalize(input) { + return input.toString().charAt(0).toUpperCase() + input.toString().substring(1); +} + +module.exports = { + iconText(icon, key, defaultValue) { + if (!defaultValue) { + defaultValue = capitalize(key); + } + return ` + + {%- set post_meta_comment = __('post.comments.${key}') %} + {%- if post_meta_comment == 'post.comments.${key}' %} + {%- set post_meta_comment = '${defaultValue}' %} + {%- endif %} + + `; + } +}; diff --git a/themes/next/scripts/filters/comment/default-config.js b/themes/next/scripts/filters/comment/default-config.js new file mode 100644 index 0000000..316a174 --- /dev/null +++ b/themes/next/scripts/filters/comment/default-config.js @@ -0,0 +1,34 @@ +/* global hexo */ + +'use strict'; + +const path = require('path'); + +hexo.extend.filter.register('theme_inject', injects => { + injects.comment.raws.forEach(element => { + // Set default button content + const injectName = path.basename(element.name, path.extname(element.name)); + element.args[0] = Object.assign({ + configKey: injectName, + class : injectName, + button : injectName + }, element.args[0]); + // Get locals and config + const locals = element.args[0]; + const config = hexo.theme.config.comments; + // Set activeClass + if (config.active === locals.configKey) { + config.activeClass = locals.class; + } + // Set custom button content + if (config.nav) { + const nav = config.nav[locals.configKey] || {}; + if (nav.order) { + element.args[2] = nav.order; + } + if (nav.text) { + locals.button = nav.text; + } + } + }); +}, 99999); diff --git a/themes/next/scripts/filters/comment/disqus.js b/themes/next/scripts/filters/comment/disqus.js new file mode 100644 index 0000000..9c2efa0 --- /dev/null +++ b/themes/next/scripts/filters/comment/disqus.js @@ -0,0 +1,39 @@ +/* global hexo */ + +'use strict'; + +const path = require('path'); +const { iconText } = require('./common'); + +// Add comment +hexo.extend.filter.register('theme_inject', injects => { + const config = hexo.theme.config.disqus; + if (!config.enable || !config.shortname) return; + + injects.comment.raw('disqus', ` +
+ +
+ `, {}, { cache: true }); + + injects.bodyEnd.file('disqus', path.join(hexo.theme_dir, 'layout/_third-party/comments/disqus.njk')); + +}); + +// Add post_meta +hexo.extend.filter.register('theme_inject', injects => { + const config = hexo.theme.config.disqus; + if (!config.enable || !config.shortname || !config.count) return; + + injects.postMeta.raw('disqus', ` + {% if post.comments %} + + {% endif %} + `, {}, {}); + +}); diff --git a/themes/next/scripts/filters/comment/disqusjs.js b/themes/next/scripts/filters/comment/disqusjs.js new file mode 100644 index 0000000..79f15c0 --- /dev/null +++ b/themes/next/scripts/filters/comment/disqusjs.js @@ -0,0 +1,20 @@ +/* global hexo */ + +'use strict'; + +const path = require('path'); + +// Add comment +hexo.extend.filter.register('theme_inject', injects => { + const config = hexo.theme.config.disqusjs; + if (!config.enable || !config.shortname || !config.apikey) return; + + injects.comment.raw('disqusjs', ` +
+ +
+ `, {}, { cache: true }); + + injects.bodyEnd.file('disqusjs', path.join(hexo.theme_dir, 'layout/_third-party/comments/disqusjs.njk')); + +}); diff --git a/themes/next/scripts/filters/comment/gitalk.js b/themes/next/scripts/filters/comment/gitalk.js new file mode 100644 index 0000000..5acd5d0 --- /dev/null +++ b/themes/next/scripts/filters/comment/gitalk.js @@ -0,0 +1,16 @@ +/* global hexo */ + +'use strict'; + +const path = require('path'); + +// Add comment +hexo.extend.filter.register('theme_inject', injects => { + const theme = hexo.theme.config; + if (!theme.gitalk.enable) return; + + injects.comment.raw('gitalk', '
', {}, { cache: true }); + + injects.bodyEnd.file('gitalk', path.join(hexo.theme_dir, 'layout/_third-party/comments/gitalk.njk')); + +}); diff --git a/themes/next/scripts/filters/comment/isso.js b/themes/next/scripts/filters/comment/isso.js new file mode 100644 index 0000000..10876fb --- /dev/null +++ b/themes/next/scripts/filters/comment/isso.js @@ -0,0 +1,16 @@ +/* global hexo */ + +'use strict'; + +const path = require('path'); + +// Add comment +hexo.extend.filter.register('theme_inject', injects => { + const theme = hexo.theme.config; + if (!theme.isso) return; + + injects.comment.raw('isso', '
', {}, { cache: true }); + + injects.bodyEnd.file('isso', path.join(hexo.theme_dir, 'layout/_third-party/comments/isso.njk')); + +}); diff --git a/themes/next/scripts/filters/comment/livere.js b/themes/next/scripts/filters/comment/livere.js new file mode 100644 index 0000000..865754f --- /dev/null +++ b/themes/next/scripts/filters/comment/livere.js @@ -0,0 +1,16 @@ +/* global hexo */ + +'use strict'; + +const path = require('path'); + +// Add comment +hexo.extend.filter.register('theme_inject', injects => { + const theme = hexo.theme.config; + if (!theme.livere_uid) return; + + injects.comment.raw('livere', '
', {}, { cache: true }); + + injects.bodyEnd.file('livere', path.join(hexo.theme_dir, 'layout/_third-party/comments/livere.njk')); + +}); diff --git a/themes/next/scripts/filters/comment/utterances.js b/themes/next/scripts/filters/comment/utterances.js new file mode 100644 index 0000000..398a60a --- /dev/null +++ b/themes/next/scripts/filters/comment/utterances.js @@ -0,0 +1,21 @@ +/* global hexo */ + +'use strict'; + +const path = require('path'); + +// Add comment +hexo.extend.filter.register('theme_inject', injects => { + const config = hexo.theme.config.utterances; + if (!config.enable) return; + + if (!config.repo) { + hexo.log.warn('utterances.repo can\'t be null.'); + return; + } + + injects.comment.raw('utterances', '
', {}, { cache: true }); + + injects.bodyEnd.file('utterances', path.join(hexo.theme_dir, 'layout/_third-party/comments/utterances.njk')); + +}); diff --git a/themes/next/scripts/filters/default-injects.js b/themes/next/scripts/filters/default-injects.js new file mode 100644 index 0000000..14fc0ad --- /dev/null +++ b/themes/next/scripts/filters/default-injects.js @@ -0,0 +1,24 @@ +/* global hexo */ + +'use strict'; + +const { points } = require('../events/lib/utils'); + +hexo.extend.filter.register('theme_inject', injects => { + const filePath = hexo.theme.config.custom_file_path; + + if (!filePath) return; + + points.views.forEach(key => { + if (filePath[key]) { + injects[key].file('custom', filePath[key]); + } + }); + + points.styles.forEach(key => { + if (filePath[key]) { + injects[key].push(filePath[key]); + } + }); + +}, 99); diff --git a/themes/next/scripts/filters/locals.js b/themes/next/scripts/filters/locals.js new file mode 100644 index 0000000..4b3d184 --- /dev/null +++ b/themes/next/scripts/filters/locals.js @@ -0,0 +1,37 @@ +/* global hexo */ + +'use strict'; + +const keys = ['toc', 'reward_settings', 'quicklink']; + +hexo.extend.filter.register('template_locals', locals => { + const { config } = hexo; + const { __, theme, page } = locals; + const { i18n } = hexo.theme; + // Hexo & NexT version + locals.next_version = require('../../package.json').version; + // Language & Config + locals.title = __('title') !== 'title' ? __('title') : config.title; + locals.subtitle = __('subtitle') !== 'subtitle' ? __('subtitle') : config.subtitle; + locals.author = __('author') !== 'author' ? __('author') : config.author; + locals.description = __('description') !== 'description' ? __('description') : config.description; + locals.languages = [...i18n.languages]; + locals.languages.splice(locals.languages.indexOf('default'), 1); + // See https://github.com/hexojs/hexo/pull/4614 + page.lang = page.lang || page.language; + // Creative Commons + locals.ccURL = 'https://creativecommons.org/' + (theme.creative_commons.license === 'cc-zero' ? 'publicdomain/zero/1.0/' : 'licenses/' + theme.creative_commons.license + '/4.0/') + (theme.creative_commons.language || ''); + // PJAX + locals.pjax = theme.pjax ? ' data-pjax' : ''; + // Front-matter + keys.forEach(key => { + page[key] = { ...theme[key], ...page[key] }; + }); + // Set home or archive quicklink + if (page.__index) { + page.quicklink.enable = theme.quicklink.home; + } + if (page.archive) { + page.quicklink.enable = theme.quicklink.archive; + } +}); diff --git a/themes/next/scripts/filters/minify.js b/themes/next/scripts/filters/minify.js new file mode 100644 index 0000000..0f33711 --- /dev/null +++ b/themes/next/scripts/filters/minify.js @@ -0,0 +1,152 @@ +/* global hexo */ + +'use strict'; + +const internalScripts = []; + +hexo.theme.addProcessor('js/*', file => { + internalScripts.push(file.params[0]); +}); + +hexo.extend.filter.register('after_generate', () => { + const theme = hexo.theme.config; + if (!theme.minify) return; + + if (theme.vendors.internal !== 'local') { + // Remove all internal scripts + internalScripts.forEach(path => { + hexo.route.remove(path); + }); + return; + } + + if (!hexo.locals.get('pages').some(page => page.type === 'schedule')) { + hexo.route.remove('js/schedule.js'); + } + + if (!theme.bookmark.enable) { + hexo.route.remove('js/bookmark.js'); + } + + if (!theme.motion.enable) { + hexo.route.remove('js/motion.js'); + } + + if (!theme.pjax) { + hexo.route.remove('js/pjax.js'); + } + + if (theme.comments.style !== 'buttons') { + hexo.route.remove('js/comments-buttons.js'); + } + + if (theme.scheme === 'Pisces' || theme.scheme === 'Gemini') { + hexo.route.remove('js/schemes/muse.js'); + } + + // Third Party Scripts + // Analytics + if (!theme.baidu_analytics) { + hexo.route.remove('js/third-party/analytics/baidu-analytics.js'); + } + + if (!theme.google_analytics.tracking_id) { + hexo.route.remove('js/third-party/analytics/google-analytics.js'); + } + + if (!theme.growingio_analytics) { + hexo.route.remove('js/third-party/analytics/growingio.js'); + } + + // Chat + if (!theme.chatra.enable) { + hexo.route.remove('js/third-party/chat/chatra.js'); + } + + if (!theme.tidio.enable) { + hexo.route.remove('js/third-party/chat/tidio.js'); + } + + // Comments + if (!theme.changyan.enable || !theme.changyan.appid || !theme.changyan.appkey) { + hexo.route.remove('js/third-party/comments/changyan.js'); + } + + if (!theme.disqus.enable || !theme.disqus.shortname) { + hexo.route.remove('js/third-party/comments/disqus.js'); + } + + if (!theme.disqusjs.enable || !theme.disqusjs.shortname || !theme.disqusjs.apikey) { + hexo.route.remove('js/third-party/comments/disqusjs.js'); + } + + if (!theme.gitalk.enable) { + hexo.route.remove('js/third-party/comments/gitalk.js'); + } + + if (!theme.isso) { + hexo.route.remove('js/third-party/comments/isso.js'); + } + + if (!theme.livere_uid) { + hexo.route.remove('js/third-party/comments/livere.js'); + } + + if (!theme.utterances.enable || !theme.utterances.repo) { + hexo.route.remove('js/third-party/comments/utterances.js'); + } + + // Math + if (!theme.math.katex.enable || !theme.math.katex.copy_tex) { + hexo.route.remove('js/third-party/math/katex.js'); + } + + if (!theme.math.mathjax.enable) { + hexo.route.remove('js/third-party/math/mathjax.js'); + } + + // Search + if (!theme.algolia_search.enable) { + hexo.route.remove('js/third-party/search/algolia-search.js'); + hexo.route.remove('images/logo-algolia-nebula-blue-full.svg'); + } + + if (!theme.local_search.enable) { + hexo.route.remove('js/third-party/search/local-search.js'); + } + + // Statistics + if (!theme.firestore.enable) { + hexo.route.remove('js/third-party/statistics/firestore.js'); + } + + if (!theme.leancloud_visitors.enable) { + hexo.route.remove('js/third-party/statistics/lean-analytics.js'); + } + + // Tags + if (!theme.mermaid.enable) { + hexo.route.remove('js/third-party/tags/mermaid.js'); + } + + if (!theme.pdf.enable) { + hexo.route.remove('js/third-party/tags/pdf.js'); + } + + if (!theme.wavedrom.enable) { + hexo.route.remove('js/third-party/tags/wavedrom.js'); + } + + // Others + if (!theme.fancybox) { + hexo.route.remove('js/third-party/fancybox.js'); + } + + if (!theme.pace.enable) { + hexo.route.remove('js/third-party/pace.js'); + } + + if (!theme.quicklink.enable) { + hexo.route.remove('js/third-party/quicklink.js'); + } +}); diff --git a/themes/next/scripts/filters/post.js b/themes/next/scripts/filters/post.js new file mode 100644 index 0000000..2faa1f9 --- /dev/null +++ b/themes/next/scripts/filters/post.js @@ -0,0 +1,36 @@ +/* global hexo */ + +'use strict'; + +const { parse } = require('url'); +const { unescapeHTML } = require('hexo-util'); + +hexo.extend.filter.register('after_post_render', data => { + const { config } = hexo; + const theme = hexo.theme.config; + if (!theme.exturl && !theme.lazyload) return; + if (theme.lazyload) { + data.content = data.content.replace(/(]*)\ssrc=/ig, '$1 data-src='); + } + if (theme.exturl) { + const siteHost = parse(config.url).hostname || config.url; + // External URL icon + const exturlIcon = theme.exturl_icon ? '' : ''; + data.content = data.content.replace(/]*\shref="([^"]+)"[^>]*>([^<]+)<\/a>/ig, (match, href, html) => { + // Exit if the href attribute doesn't exist. + if (!href) return match; + + // Exit if the url has same host with `config.url`, which means it's an internal link. + const link = parse(href); + if (!link.protocol || link.hostname === siteHost) return match; + + // Return encrypted URL with title. + const title = match.match(/title="([^"]+)"/); + const encoded = Buffer.from(unescapeHTML(href)).toString('base64'); + if (title) return `${html}${exturlIcon}`; + + return `${html}${exturlIcon}`; + }); + } + +}, 0); diff --git a/themes/next/scripts/helpers/engine.js b/themes/next/scripts/helpers/engine.js new file mode 100644 index 0000000..5ca3755 --- /dev/null +++ b/themes/next/scripts/helpers/engine.js @@ -0,0 +1,115 @@ +/* global hexo */ + +'use strict'; + +const crypto = require('crypto'); +const { parse } = require('url'); +const nextFont = require('./font'); +const nextUrl = require('./next-url'); +const { getVendors } = require('../events/lib/utils'); + +hexo.extend.helper.register('next_font', nextFont); +hexo.extend.helper.register('next_url', nextUrl); + +hexo.extend.helper.register('next_inject', function(point) { + return this.theme.injects[point] + .map(item => this.partial(item.layout, item.locals, item.options)) + .join(''); +}); + +hexo.extend.helper.register('next_js', function(file, { + pjax = false, + module = false +} = {}) { + const { next_version } = this; + const { internal, custom_cdn_url } = this.theme.vendors; + const links = getVendors({ + name : 'hexo-theme-next', + version : next_version, + file : 'source/js/' + file, + minified: 'source/js/' + file.replace(/\.js$/, '.min.js'), + local : this.url_for(`${this.theme.js}/${file}`), + custom : custom_cdn_url + }); + const src = links[internal] || links.local; + return ``; +}); + +hexo.extend.helper.register('next_vendors', function(name) { + const { url, integrity } = this.theme.vendors[name]; + const type = url.endsWith('css') ? 'css' : 'js'; + if (type === 'css') { + if (integrity) return ``; + return ``; + } + if (integrity) return ``; + return ``; +}); + +hexo.extend.helper.register('next_data', function(name, ...data) { + const json = data.length === 1 ? data[0] : Object.assign({}, ...data); + return ``; +}); + +hexo.extend.helper.register('next_pre', function() { + if (!this.theme.preconnect) return ''; + const { enable, host } = this.theme.font; + const { internal, plugins, custom_cdn_url } = this.theme.vendors; + const links = { + local : this.theme.js && parse(this.theme.js).hostname ? parse(this.theme.js).protocol + '//' + parse(this.theme.js).hostname : '', + jsdelivr: 'https://cdn.jsdelivr.net', + unpkg : 'https://unpkg.com', + cdnjs : 'https://cdnjs.cloudflare.com', + custom : custom_cdn_url && parse(custom_cdn_url).hostname ? parse(custom_cdn_url).protocol + '//' + parse(custom_cdn_url).hostname : '' + }; + const h = enable ? host || 'https://fonts.googleapis.com' : ''; + const i = links[internal]; + const p = links[plugins]; + return [...new Set([h, i, p].filter(origin => origin))].map( + origin => `` + ).join('\n'); +}); + +hexo.extend.helper.register('post_gallery', function(photos) { + if (!photos || !photos.length) return ''; + const content = photos.map(photo => ` +
+ +
`).join(''); + return `
+ ${content} +
`; +}); + +hexo.extend.helper.register('post_edit', function(src) { + const { post_edit } = this.theme; + if (!post_edit.enable) return ''; + return this.next_url(post_edit.url + src, '', { + class: 'post-edit-link', + title: this.__('post.edit') + }); +}); + +hexo.extend.helper.register('gitalk_md5', function(path) { + const str = this.url_for(path); + return crypto.createHash('md5').update(str).digest('hex'); +}); + +/** + * Get page path given a certain language tag + */ +hexo.extend.helper.register('i18n_path', function(language) { + const { path, lang } = this.page; + const base = path.startsWith(lang) ? path.slice(lang.length + 1) : path; + return this.url_for(`/${language}/${base}`); +}); + +/** + * Get the language name + */ +hexo.extend.helper.register('language_name', function(language) { + const name = hexo.theme.i18n.__(language)('name'); + return name === 'name' ? language : name; +}); diff --git a/themes/next/scripts/helpers/font.js b/themes/next/scripts/helpers/font.js new file mode 100644 index 0000000..5c46090 --- /dev/null +++ b/themes/next/scripts/helpers/font.js @@ -0,0 +1,25 @@ +'use strict'; + +// https://developers.google.com/fonts/docs/getting_started +module.exports = function() { + const config = this.theme.font; + + if (!config || !config.enable) return ''; + + const fontStyles = ':300,300italic,400,400italic,700,700italic'; + const fontHost = config.host || 'https://fonts.googleapis.com'; + + // Get a font list from config + let fontFamilies = []; + ['global', 'title', 'headings', 'posts', 'codes'].forEach(item => { + if (config[item] && config[item].family && config[item].external) { + fontFamilies = fontFamilies.concat(config[item].family.split(',')); + } + }); + + fontFamilies = fontFamilies.map(name => name.trim().replace(/\s/g, '+') + fontStyles); + fontFamilies = [...new Set(fontFamilies)].join('%7C'); + + // Merge extra parameters to the final processed font string + return fontFamilies ? `` : ''; +}; diff --git a/themes/next/scripts/helpers/navigation.js b/themes/next/scripts/helpers/navigation.js new file mode 100644 index 0000000..bdc0aed --- /dev/null +++ b/themes/next/scripts/helpers/navigation.js @@ -0,0 +1,19 @@ +/* global hexo */ + +'use strict'; + +hexo.extend.helper.register('next_menu', function(path) { + path = ('/' + path).replace(/index\.html$/, ''); + const { menu_map } = this.theme; + if (!menu_map.has(path)) return; + let node = menu_map.get(path); + const menus = []; + if (node.children.length) { + menus.unshift(node.children); + } + while (node.parent) { + menus.unshift(node.parent.children); + node = node.parent; + } + return menus; +}); diff --git a/themes/next/scripts/helpers/next-config.js b/themes/next/scripts/helpers/next-config.js new file mode 100644 index 0000000..5c93fb8 --- /dev/null +++ b/themes/next/scripts/helpers/next-config.js @@ -0,0 +1,65 @@ +/* global hexo */ + +'use strict'; + +const { parse } = require('url'); + +/** + * Export theme config + */ +hexo.extend.helper.register('next_config', function() { + const { config, theme, url_for, __ } = this; + const exportConfig = { + hostname : parse(config.url).hostname || config.url, + root : config.root, + images : url_for(theme.images), + scheme : theme.scheme, + darkmode : theme.darkmode, + version : this.next_version, + exturl : theme.exturl, + sidebar : theme.sidebar, + copycode : theme.codeblock.copy_button, + fold : theme.codeblock.fold, + bookmark : theme.bookmark, + mediumzoom: theme.mediumzoom, + lazyload : theme.lazyload, + pangu : theme.pangu, + comments : theme.comments, + stickytabs: theme.tabs.sticky, + motion : theme.motion, + prism : theme.prism.enable && !config.prismjs.preprocess, + i18n : { + placeholder: __('search.placeholder'), + empty : __('search.empty', '${query}'), + hits_time : __('search.hits_time', '${hits}', '${time}'), + hits : __('search.hits', '${hits}') + } + }; + if (config.algolia && theme.algolia_search && theme.algolia_search.enable) { + exportConfig.algolia = { + appID : config.algolia.applicationID || config.algolia.appId, + apiKey : config.algolia.apiKey, + indexName: config.algolia.indexName, + hits : theme.algolia_search.hits + }; + } + if (config.search && theme.local_search && theme.local_search.enable) { + exportConfig.path = url_for(config.search.path); + exportConfig.localsearch = theme.local_search; + } + return exportConfig; +}); + +hexo.extend.helper.register('next_config_unique', function() { + const { page, is_home, is_post } = this; + return { + sidebar : page.sidebar || '', + isHome : is_home(), + isPost : is_post(), + lang : page.lang, + comments : page.comments || '', + permalink: page.permalink || '', + path : page.path || '', + title : page.title || '' + }; +}); diff --git a/themes/next/scripts/helpers/next-paginator.js b/themes/next/scripts/helpers/next-paginator.js new file mode 100644 index 0000000..6d12419 --- /dev/null +++ b/themes/next/scripts/helpers/next-paginator.js @@ -0,0 +1,18 @@ +/* global hexo */ + +'use strict'; + +hexo.extend.helper.register('next_paginator', function() { + const prev = this.__('accessibility.prev_page'); + const next = this.__('accessibility.next_page'); + let paginator = this.paginator({ + prev_text: '', + next_text: '', + mid_size : 1, + escape : false + }); + paginator = paginator + .replace('rel="prev"', `rel="prev" title="${prev}" aria-label="${prev}"`) + .replace('rel="next"', `rel="next" title="${next}" aria-label="${next}"`); + return paginator; +}); diff --git a/themes/next/scripts/helpers/next-url.js b/themes/next/scripts/helpers/next-url.js new file mode 100644 index 0000000..9f88b58 --- /dev/null +++ b/themes/next/scripts/helpers/next-url.js @@ -0,0 +1,54 @@ +'use strict'; + +const { htmlTag } = require('hexo-util'); +const { parse } = require('url'); + +module.exports = function(path, text, options = {}, decode = false) { + const { config, theme } = this; + const data = parse(path); + const siteHost = parse(config.url).hostname || config.url; + + let exturl = ''; + let tag = 'a'; + let attrs = { href: this.url_for(path) }; + + // If `exturl` enabled, set spanned links only on external links. + if (theme.exturl && data.protocol && data.hostname !== siteHost) { + tag = 'span'; + exturl = 'exturl'; + const encoded = Buffer.from(path).toString('base64'); + attrs = { + class : exturl, + 'data-url': encoded + }; + } + + for (const key in options) { + + /** + * If option have `class` attribute, add it to + * 'exturl' class if `exturl` option enabled. + */ + if (exturl !== '' && key === 'class') { + attrs[key] += ' ' + options[key]; + } else { + attrs[key] = options[key]; + } + } + + // If it's external link, rewrite attributes. + if (data.protocol && data.hostname !== siteHost) { + attrs.external = null; + + if (!theme.exturl) { + // Only for simple link need to rewrite/add attributes. + attrs.rel = attrs.rel || 'noopener'; + attrs.target = '_blank'; + } else { + // Remove rel attributes for `exturl` in main menu. + attrs.rel = null; + } + } + + return htmlTag(tag, attrs, decode ? decodeURI(text) : text, false); +}; diff --git a/themes/next/scripts/helpers/next-vendors.js b/themes/next/scripts/helpers/next-vendors.js new file mode 100644 index 0000000..0c06549 --- /dev/null +++ b/themes/next/scripts/helpers/next-vendors.js @@ -0,0 +1,30 @@ +/* global hexo */ + +'use strict'; + +hexo.extend.helper.register('js_vendors', function() { + const { config, theme } = this; + const vendors = ['anime']; + if (theme.prism.enable && !config.prismjs.preprocess) { + vendors.push('prism', 'prism_autoloader'); + if (config.prismjs.line_number) { + vendors.push('prism_line_numbers'); + } + } + if (theme.pjax) { + vendors.push('pjax'); + } + if (theme.fancybox) { + vendors.push('fancybox_js'); + } + if (theme.mediumzoom) { + vendors.push('mediumzoom'); + } + if (theme.lazyload) { + vendors.push('lazyload'); + } + if (theme.pangu) { + vendors.push('pangu'); + } + return vendors; +}); diff --git a/themes/next/scripts/tags/button.js b/themes/next/scripts/tags/button.js new file mode 100644 index 0000000..8379ffd --- /dev/null +++ b/themes/next/scripts/tags/button.js @@ -0,0 +1,23 @@ +/** + * button.js | https://theme-next.js.org/docs/tag-plugins/button + */ + +'use strict'; + +module.exports = ctx => function(args) { + args = args.join(' ').split(','); + const url = args[0]; + const text = (args[1] || '').trim(); + let icon = (args[2] || '').trim(); + const title = (args[3] || '').trim(); + + if (!url) { + ctx.log.warn('URL can NOT be empty.'); + } + if (icon.length > 0) { + if (!icon.startsWith('fa')) icon = 'fa fa-' + icon; + icon = ``; + } + + return ` 0 ? ` title="${title}"` : ''}>${icon}${text}`; +}; diff --git a/themes/next/scripts/tags/caniuse.js b/themes/next/scripts/tags/caniuse.js new file mode 100644 index 0000000..a6b0454 --- /dev/null +++ b/themes/next/scripts/tags/caniuse.js @@ -0,0 +1,16 @@ +/** + * caniuse.js | https://theme-next.js.org/docs/tag-plugins/caniuse + */ + +'use strict'; + +module.exports = ctx => function(args) { + const [feature, periods = 'current'] = args.join('').split('@'); + + if (!feature) { + ctx.log.warn('Caniuse feature can NOT be empty.'); + return ''; + } + + return ``; +}; diff --git a/themes/next/scripts/tags/center-quote.js b/themes/next/scripts/tags/center-quote.js new file mode 100644 index 0000000..169be33 --- /dev/null +++ b/themes/next/scripts/tags/center-quote.js @@ -0,0 +1,11 @@ +/** + * center-quote.js | https://theme-next.js.org/docs/tag-plugins/ + */ + +'use strict'; + +module.exports = ctx => function(args, content) { + return `
+${ctx.render.renderSync({ text: content, engine: 'markdown' })} +
`; +}; diff --git a/themes/next/scripts/tags/group-pictures.js b/themes/next/scripts/tags/group-pictures.js new file mode 100644 index 0000000..b55a654 --- /dev/null +++ b/themes/next/scripts/tags/group-pictures.js @@ -0,0 +1,132 @@ +/** + * group-pictures.js | https://theme-next.js.org/docs/tag-plugins/group-pictures + */ + +'use strict'; + +const LAYOUTS = { + 2: { + 1: [1, 1], + 2: [2] + }, + 3: { + 1: [1, 2], + 2: [2, 1], + 3: [3] + }, + 4: { + 1: [1, 2, 1], + 2: [1, 3], + 3: [2, 2], + 4: [3, 1] + }, + 5: { + 1: [1, 2, 2], + 2: [2, 1, 2], + 3: [2, 3], + 4: [3, 2] + }, + 6: { + 1: [1, 2, 3], + 2: [1, 3, 2], + 3: [2, 1, 3], + 4: [2, 2, 2], + 5: [3, 3] + }, + 7: { + 1: [1, 2, 2, 2], + 2: [1, 3, 3], + 3: [2, 2, 3], + 4: [2, 3, 2], + 5: [3, 2, 2] + }, + 8: { + 1: [1, 2, 2, 3], + 2: [1, 2, 3, 2], + 3: [1, 3, 2, 2], + 4: [2, 2, 2, 2], + 5: [2, 3, 3], + 6: [3, 2, 3], + 7: [3, 3, 2] + }, + 9: { + 1: [1, 2, 3, 3], + 2: [1, 3, 2, 3], + 3: [2, 2, 2, 3], + 4: [2, 2, 3, 2], + 5: [2, 3, 2, 2], + 6: [3, 2, 2, 2], + 7: [3, 3, 3] + }, + 10: { + 1: [1, 3, 3, 3], + 2: [2, 2, 3, 3], + 3: [2, 3, 2, 3], + 4: [2, 3, 3, 2], + 5: [3, 2, 2, 3], + 6: [3, 2, 3, 2], + 7: [3, 3, 2, 2] + } +}; + +function groupBy(group, data) { + const r = []; + for (const count of group) { + r.push(data.slice(0, count)); + data = data.slice(count); + } + return r; +} + +const templates = { + + dispatch: function(pictures, group, layout) { + const rule = LAYOUTS[group] ? LAYOUTS[group][layout] : null; + return rule ? this.getHTML(groupBy(rule, pictures)) : this.defaults(pictures); + }, + + /** + * Defaults Layout + * + * □ □ □ + * □ □ □ + * ... + * + * @param pictures + */ + defaults: function(pictures) { + const ROW_SIZE = 3; + const rows = pictures.length / ROW_SIZE; + const pictureArr = []; + + for (let i = 0; i < rows; i++) { + pictureArr.push(pictures.slice(i * ROW_SIZE, (i + 1) * ROW_SIZE)); + } + + return this.getHTML(pictureArr); + }, + + getHTML: function(rows) { + return rows.map(row => { + return `
${this.getColumnHTML(row)}
`; + }).join(''); + }, + + getColumnHTML: function(pictures) { + return pictures.map(picture => { + return `
${picture}
`; + }).join(''); + } +}; + +module.exports = ctx => function(args, content) { + args = args[0].split('-'); + const group = parseInt(args[0], 10); + const layout = parseInt(args[1], 10); + + content = ctx.render.renderSync({ text: content, engine: 'markdown' }); + + const pictures = content.match(/(]*>((?!<\/a)(.|\n))+<\/a>)|(]+>)/g); + + return `
${templates.dispatch(pictures, group, layout)}
`; +}; diff --git a/themes/next/scripts/tags/index.js b/themes/next/scripts/tags/index.js new file mode 100644 index 0000000..d0c4392 --- /dev/null +++ b/themes/next/scripts/tags/index.js @@ -0,0 +1,59 @@ +/* global hexo */ + +'use strict'; + +const postButton = require('./button')(hexo); + +hexo.extend.tag.register('button', postButton); +hexo.extend.tag.register('btn', postButton); + +const caniUse = require('./caniuse')(hexo); + +hexo.extend.tag.register('caniuse', caniUse); +hexo.extend.tag.register('can', caniUse); + +const centerQuote = require('./center-quote')(hexo); + +hexo.extend.tag.register('centerquote', centerQuote, true); +hexo.extend.tag.register('cq', centerQuote, true); + +const groupPicture = require('./group-pictures')(hexo); + +hexo.extend.tag.register('grouppicture', groupPicture, true); +hexo.extend.tag.register('gp', groupPicture, true); + +const postLabel = require('./label')(hexo); + +hexo.extend.tag.register('label', postLabel); + +const linkGrid = require('./link-grid'); + +hexo.extend.tag.register('linkgrid', linkGrid, true); +hexo.extend.tag.register('lg', linkGrid, true); + +const mermaid = require('./mermaid'); + +hexo.extend.tag.register('mermaid', mermaid, true); + +const wavedrom = require('./wavedrom'); + +hexo.extend.tag.register('wavedrom', wavedrom, true); + +const postNote = require('./note')(hexo); + +hexo.extend.tag.register('note', postNote, true); +hexo.extend.tag.register('subnote', postNote, true); + +const pdf = require('./pdf')(hexo); + +hexo.extend.tag.register('pdf', pdf); + +const postTabs = require('./tabs')(hexo); + +hexo.extend.tag.register('tabs', postTabs, true); +hexo.extend.tag.register('subtabs', postTabs, true); +hexo.extend.tag.register('subsubtabs', postTabs, true); + +const postVideo = require('./video'); + +hexo.extend.tag.register('video', postVideo); diff --git a/themes/next/scripts/tags/label.js b/themes/next/scripts/tags/label.js new file mode 100644 index 0000000..1ebfca5 --- /dev/null +++ b/themes/next/scripts/tags/label.js @@ -0,0 +1,13 @@ +/** + * label.js | https://theme-next.js.org/docs/tag-plugins/label + */ + +'use strict'; + +module.exports = ctx => function(args) { + const [classes = 'default', text = ''] = args.join(' ').split('@'); + + if (!text) ctx.log.warn('Label text must be defined!'); + + return `${text}`; +}; diff --git a/themes/next/scripts/tags/link-grid.js b/themes/next/scripts/tags/link-grid.js new file mode 100644 index 0000000..22913cb --- /dev/null +++ b/themes/next/scripts/tags/link-grid.js @@ -0,0 +1,20 @@ +/** + * link-grid.js | https://theme-next.js.org/docs/tag-plugins/link-grid + */ + +'use strict'; + +module.exports = function([image = '/images/avatar.gif', delimiter = '|', comment = '%'], content) { + const links = content.split('\n').filter(line => line.trim() !== '').map(line => { + const item = line.split(delimiter).map(arg => arg.trim()); + if (item[0][0] === comment) return ''; + const imageSource = item[3] || image; + const hasExtension = /\.[^/]+$/.test(imageSource); + return ``; + }); + return ``; +}; diff --git a/themes/next/scripts/tags/mermaid.js b/themes/next/scripts/tags/mermaid.js new file mode 100644 index 0000000..d927216 --- /dev/null +++ b/themes/next/scripts/tags/mermaid.js @@ -0,0 +1,14 @@ +/** + * mermaid.js | https://theme-next.js.org/docs/tag-plugins/mermaid + */ + +'use strict'; + +const { escapeHTML } = require('hexo-util'); + +module.exports = function(args, content) { + return `
+${args.join(' ')}
+${escapeHTML(content)}
+
`; +}; diff --git a/themes/next/scripts/tags/note.js b/themes/next/scripts/tags/note.js new file mode 100644 index 0000000..6b818bd --- /dev/null +++ b/themes/next/scripts/tags/note.js @@ -0,0 +1,25 @@ +/** + * note.js | https://theme-next.js.org/docs/tag-plugins/note + */ + +'use strict'; + +module.exports = ctx => function(args, content) { + const keywords = ['default', 'primary', 'info', 'success', 'warning', 'danger', 'no-icon']; + const className = []; + for (let i = 0; i < 2; i++) { + if (keywords.includes(args[0])) { + className.push(args.shift()); + } else { + break; + } + } + + content = ctx.render.renderSync({ text: content, engine: 'markdown' }); + if (args.length === 0) { + return `
${content}
`; + } + return `
${ctx.render.renderSync({ text: args.join(' '), engine: 'markdown' })} +${content} +
`; +}; diff --git a/themes/next/scripts/tags/pdf.js b/themes/next/scripts/tags/pdf.js new file mode 100644 index 0000000..6c29f6c --- /dev/null +++ b/themes/next/scripts/tags/pdf.js @@ -0,0 +1,10 @@ +/** + * pdf.js | https://theme-next.js.org/docs/tag-plugins/pdf + */ + +'use strict'; + +module.exports = ctx => function(args) { + const theme = ctx.theme.config; + return `
`; +}; diff --git a/themes/next/scripts/tags/tabs.js b/themes/next/scripts/tags/tabs.js new file mode 100644 index 0000000..d54da50 --- /dev/null +++ b/themes/next/scripts/tags/tabs.js @@ -0,0 +1,47 @@ +/** + * tabs.js | https://theme-next.js.org/docs/tag-plugins/tabs + */ + +'use strict'; + +module.exports = ctx => function(args, content = '') { + const tabBlock = /\n([\w\W\s\S]*?)/g; + + args = args.join(' ').split(','); + const tabName = args[0]; + const tabActive = Number(args[1]) || 0; + + let tabId = 0; + let tabNav = ''; + let tabContent = ''; + + if (!tabName) ctx.log.warn('Tabs block must have unique name!'); + const matches = content.matchAll(tabBlock); + + for (const match of matches) { + let [caption = '', icon = ''] = match[1].split('@'); + let postContent = match[2]; + + postContent = ctx.render.renderSync({ text: postContent, engine: 'markdown' }).trim(); + + const abbr = tabName + ' ' + ++tabId; + const href = abbr.toLowerCase().split(' ').join('-'); + + icon = icon.trim(); + if (icon.length > 0) { + if (!icon.startsWith('fa')) icon = 'fa fa-' + icon; + icon = ``; + } + + caption = icon + caption.trim(); + + const isActive = (tabActive > 0 && tabActive === tabId) || (tabActive === 0 && tabId === 1) ? ' active' : ''; + tabNav += `
  • ${caption || abbr}
  • `; + tabContent += `
    ${postContent}
    `; + } + + tabNav = ``; + tabContent = `
    ${tabContent}
    `; + + return `
    ${tabNav + tabContent}
    `; +}; diff --git a/themes/next/scripts/tags/video.js b/themes/next/scripts/tags/video.js new file mode 100644 index 0000000..2c326e5 --- /dev/null +++ b/themes/next/scripts/tags/video.js @@ -0,0 +1,9 @@ +/** + * video.js | https://theme-next.js.org/docs/tag-plugins/ + */ + +'use strict'; + +module.exports = function(args) { + return ``; +}; diff --git a/themes/next/scripts/tags/wavedrom.js b/themes/next/scripts/tags/wavedrom.js new file mode 100644 index 0000000..458517d --- /dev/null +++ b/themes/next/scripts/tags/wavedrom.js @@ -0,0 +1,11 @@ +/** + * wavedrom.js | https://theme-next.js.org/docs/tag-plugins/wavedrom + */ + +'use strict'; + +module.exports = function(args, content) { + return `
    `; +}; diff --git a/themes/next/source/css/_colors.styl b/themes/next/source/css/_colors.styl new file mode 100644 index 0000000..25d49cd --- /dev/null +++ b/themes/next/source/css/_colors.styl @@ -0,0 +1,75 @@ +:root { + --body-bg-color: $body-bg-color; + --content-bg-color: $content-bg-color; + --card-bg-color: $card-bg-color; + --text-color: $text-color; + --blockquote-color: $blockquote-color; + --link-color: $link-color; + --link-hover-color: $link-hover-color; + --brand-color: $brand-color; + --brand-hover-color: $brand-hover-color; + --table-row-odd-bg-color: $table-row-odd-bg-color; + --table-row-hover-bg-color: $table-row-hover-bg-color; + --menu-item-bg-color: $menu-item-bg-color; + --theme-color: $theme-color; + + --btn-default-bg: $btn-default-bg; + --btn-default-color: $btn-default-color; + --btn-default-border-color: $btn-default-border-color; + --btn-default-hover-bg: $btn-default-hover-bg; + --btn-default-hover-color: $btn-default-hover-color; + --btn-default-hover-border-color: $btn-default-hover-border-color; + + --highlight-background: $highlight-background; + --highlight-foreground: $highlight-foreground; + --highlight-gutter-background: $highlight-gutter-background; + --highlight-gutter-foreground: $highlight-gutter-foreground; + + color-scheme: light; +} + +if (hexo-config('darkmode')) { + @media (prefers-color-scheme: dark) { + :root { + --body-bg-color: $body-bg-color-dark; + --content-bg-color: $content-bg-color-dark; + --card-bg-color: $card-bg-color-dark; + --text-color: $text-color-dark; + --blockquote-color: $blockquote-color-dark; + --link-color: $link-color-dark; + --link-hover-color: $link-hover-color-dark; + --brand-color: $brand-color-dark; + --brand-hover-color: $brand-hover-color-dark; + --table-row-odd-bg-color: $table-row-odd-bg-color-dark; + --table-row-hover-bg-color: $table-row-hover-bg-color-dark; + --menu-item-bg-color: $menu-item-bg-color-dark; + --theme-color: $theme-color-dark; + + --btn-default-bg: $btn-default-bg-dark; + --btn-default-color: $btn-default-color-dark; + --btn-default-border-color: $btn-default-border-color-dark; + --btn-default-hover-bg: $btn-default-hover-bg-dark; + --btn-default-hover-color: $btn-default-hover-color-dark; + --btn-default-hover-border-color: $btn-default-hover-border-color-dark; + + --highlight-background: $highlight-background-dark; + --highlight-foreground: $highlight-foreground-dark; + --highlight-gutter-background: $highlight-gutter-background-dark; + --highlight-gutter-foreground: $highlight-gutter-foreground-dark; + + color-scheme: dark; + } + + img { + opacity: .75; + + &:hover { + opacity: .9; + } + } + + iframe { + color-scheme: light; + } + } +} diff --git a/themes/next/source/css/_common/components/back-to-top.styl b/themes/next/source/css/_common/components/back-to-top.styl new file mode 100644 index 0000000..8fa649e --- /dev/null +++ b/themes/next/source/css/_common/components/back-to-top.styl @@ -0,0 +1,49 @@ +if (hexo-config('back2top.enable')) { + .back-to-top { + font-size: $b2t-font-size; + + span { + margin-right: 8px; + if (not hexo-config('back2top.scrollpercent')) { + display: none; + } + } + + .fa { + text-align: center; + width: $sidebar-toggle-size; + } + + if (hexo-config('back2top.sidebar')) { + margin: 20px - $sidebar-offset -10px -20px; + // FIXME: opacity override by motion + opacity: 0; + transition: opacity $transition-ease; + + &.back-to-top-on { + cursor: pointer; + opacity: $b2t-opacity; + + &:hover { + opacity: $b2t-opacity-hover; + } + } + } else { + align-items: center; + bottom: $b2t-position-bottom; + color: $b2t-color; + display: flex; + height: $sidebar-toggle-size; + transition: bottom $transition-ease; + sidebar-toggle(); + + &:hover { + color: $sidebar-highlight; + } + + &.back-to-top-on { + bottom: $b2t-position-bottom-on; + } + } + } +} diff --git a/themes/next/source/css/_common/components/index.styl b/themes/next/source/css/_common/components/index.styl new file mode 100644 index 0000000..b2ac2e2 --- /dev/null +++ b/themes/next/source/css/_common/components/index.styl @@ -0,0 +1,6 @@ +@import 'back-to-top'; +@import 'reading-progress'; + +@import 'post'; +@import 'pages'; +@import 'third-party'; diff --git a/themes/next/source/css/_common/components/pages/breadcrumb.styl b/themes/next/source/css/_common/components/pages/breadcrumb.styl new file mode 100644 index 0000000..c0b6f7a --- /dev/null +++ b/themes/next/source/css/_common/components/pages/breadcrumb.styl @@ -0,0 +1,21 @@ +ul.breadcrumb { + font-size: $font-size-smallest; + list-style: none; + margin: 1em 0; + padding: 0 2em; + text-align: center; + + li { + display: inline; + } + + li:not(:first-child)::before { + content: '/\00a0'; + font-weight: normal; + padding: .5em; + } + + li:last-child { + font-weight: bold; + } +} diff --git a/themes/next/source/css/_common/components/pages/categories.styl b/themes/next/source/css/_common/components/pages/categories.styl new file mode 100644 index 0000000..130c58f --- /dev/null +++ b/themes/next/source/css/_common/components/pages/categories.styl @@ -0,0 +1,35 @@ +.category-all-page { + .category-all-title { + text-align: center; + } + + .category-all { + margin-top: 20px; + } + + .category-list { + list-style: none; + margin: 0; + padding: 0; + } + + .category-list-item { + margin: 5px 10px; + } + + .category-list-count { + color: $grey; + + &::before { + content: ' ('; + } + + &::after { + content: ') '; + } + } + + .category-list-child { + padding-left: 10px; + } +} diff --git a/themes/next/source/css/_common/components/pages/index.styl b/themes/next/source/css/_common/components/pages/index.styl new file mode 100644 index 0000000..ee55922 --- /dev/null +++ b/themes/next/source/css/_common/components/pages/index.styl @@ -0,0 +1,5 @@ +// Page specific styles +@import 'categories'; +@import 'schedule'; +@import 'breadcrumb'; +@import 'tag-cloud'; diff --git a/themes/next/source/css/_common/components/pages/schedule.styl b/themes/next/source/css/_common/components/pages/schedule.styl new file mode 100644 index 0000000..cce754c --- /dev/null +++ b/themes/next/source/css/_common/components/pages/schedule.styl @@ -0,0 +1,102 @@ +@keyframes dot-flash { + from { + opacity: 1; + transform: scale(1); + } + + to { + opacity: 0; + transform: scale(.8); + } +} + +.event-list { + hr { + background: $black-deep; + margin: 20px 0 45px; + + &::after { + background: $black-deep; + color: white; + content: 'NOW'; + display: inline-block; + font-weight: bold; + padding: 0 5px; + } + } + + .event { + --event-background: $black-deep; + --event-foreground: $grey; + --event-title: white; + background: var(--event-background); + padding: 15px; + + .event-summary { + border-bottom: 0; + color: var(--event-title); + margin: 0; + padding: 0 0 0 35px; + position: relative; + + &::before { + animation: dot-flash 1s alternate infinite ease-in-out; + background: var(--event-title); + left: 0; + margin-top: -6px; + position: absolute; + top: 50%; + round-icon(12px); + } + } + + &:nth-of-type(odd) .event-summary::before { + animation-delay: .5s; + } + + &:not(:last-child) { + margin-bottom: 20px; + } + + .event-relative-time { + color: var(--event-foreground); + display: inline-block; + font-size: 12px; + font-weight: normal; + padding-left: 12px; + } + + .event-details { + color: var(--event-foreground); + display: block; + line-height: 18px; + padding: 6px 0 6px 35px; + + &::before { + color: var(--event-foreground); + display: inline-block; + margin-right: 9px; + width: 14px; + font-family-icons(); + } + + &.event-location::before { + content: '\f041'; + } + + &.event-duration::before { + content: '\f017'; + } + + &.event-description::before { + content: '\f024'; + } + } + } + + .event-past { + --event-background: $whitesmoke; + --event-foreground: $grey-dark; + --event-title: $black-deep; + } +} diff --git a/themes/next/source/css/_common/components/pages/tag-cloud.styl b/themes/next/source/css/_common/components/pages/tag-cloud.styl new file mode 100644 index 0000000..6079545 --- /dev/null +++ b/themes/next/source/css/_common/components/pages/tag-cloud.styl @@ -0,0 +1,28 @@ +.tag-cloud { + text-align: center; + + a { + display: inline-block; + margin: 10px; + } +} + +for $tag-cloud in (0 .. 10) { + $tag-cloud-color = mix($tag-cloud-end, $tag-cloud-start, $tag-cloud * 10); + .tag-cloud-{$tag-cloud} { + border-bottom-color: $tag-cloud-color; + color: $tag-cloud-color; + } +} + +if (hexo-config('darkmode')) { + @media (prefers-color-scheme: dark) { + for $tag-cloud in (0 .. 10) { + $tag-cloud-color = mix($tag-cloud-end-dark, $tag-cloud-start-dark, $tag-cloud * 10); + .tag-cloud-{$tag-cloud} { + border-bottom-color: $tag-cloud-color; + color: $tag-cloud-color; + } + } + } +} diff --git a/themes/next/source/css/_common/components/post/index.styl b/themes/next/source/css/_common/components/post/index.styl new file mode 100644 index 0000000..8f0e550 --- /dev/null +++ b/themes/next/source/css/_common/components/post/index.styl @@ -0,0 +1,53 @@ +.rtl { + &.post-body { + p, a, h1, h2, h3, h4, h5, h6, li, ul, ol { + direction: rtl; + font-family: UKIJ Ekran; + } + } + + &.post-title { + font-family: UKIJ Ekran; + } +} + +.post-button { + margin-top: 40px; + text-align: $scheme-text-align; +} + +.use-motion { + if (hexo-config('motion.transition.post_block')) { + .post-block, .pagination, .comments { + visibility: hidden; + } + } + + if (hexo-config('motion.transition.post_header')) { + .post-header { + visibility: hidden; + } + } + + if (hexo-config('motion.transition.post_body')) { + .post-body { + visibility: hidden; + } + } + + if (hexo-config('motion.transition.coll_header')) { + .collection-header { + visibility: hidden; + } + } +} + +@import 'post-collapse'; +@import 'post-body'; +@import 'post-gallery'; +@import 'post-header'; +@import 'post-nav'; +@import 'post-footer'; +@import 'post-widgets'; +@import 'post-reward'; +@import 'post-followme'; diff --git a/themes/next/source/css/_common/components/post/post-body.styl b/themes/next/source/css/_common/components/post/post-body.styl new file mode 100644 index 0000000..d846229 --- /dev/null +++ b/themes/next/source/css/_common/components/post/post-body.styl @@ -0,0 +1,79 @@ +.post-body { + font-family: $font-family-posts; + word-wrap(); + + +desktop-large() { + font-size: $font-size-large; + } + + +desktop() { + text-align: unquote(hexo-config('text_align.desktop')); + } + + +tablet-mobile() { + text-align: unquote(hexo-config('text_align.mobile')); + } + + h1, h2, h3, h4, h5, h6 { + // Supported plugins: hexo-renderer-markdown-it hexo-renderer-marked + .header-anchor, .headerlink { + border-bottom-style: none; + color: inherit; + float: right; + font-size: $font-size-small; + margin-left: 10px; + opacity: 0; + + &::before { + font-family-icons('\f0c1'); + } + } + + &:hover { + .header-anchor, .headerlink { + opacity: .5; + + &:hover { + opacity: 1; + } + } + } + } + + .exturl .fa { + font-size: $font-size-small; + margin-left: 4px; + } + + // https://github.com/hexojs/hexo-renderer-marked/pull/264 + img + figcaption, .fancybox + figcaption { + color: $grey-dark; + font-size: $font-size-small; + font-weight: bold; + line-height: 1; + margin: -15px auto 15px; + text-align: center; + } + + iframe, img, video, embed { + margin-bottom: 20px; + } + + .video-container { + height: 0; + margin-bottom: 20px; + overflow: hidden; + padding-top: 75%; + position: relative; + width: 100%; + + iframe, object, embed { + height: 100%; + left: 0; + margin: 0; + position: absolute; + top: 0; + width: 100%; + } + } +} diff --git a/themes/next/source/css/_common/components/post/post-collapse.styl b/themes/next/source/css/_common/components/post/post-collapse.styl new file mode 100644 index 0000000..b406c62 --- /dev/null +++ b/themes/next/source/css/_common/components/post/post-collapse.styl @@ -0,0 +1,104 @@ +.posts-collapse .post-content { + margin-bottom: $posts-collapse-margin; + margin-left: $posts-collapse-margin; + position: relative; + + +mobile() { + margin-left: $posts-collapse-margin-mobile; + margin-right: $posts-collapse-margin-mobile; + } + + .collection-title { + font-size: $font-size-large; + position: relative; + + &::before { + background: $grey-dark; + border: 1px solid white; + margin-left: -6px; + margin-top: -4px; + position: absolute; + top: 50%; + round-icon(10px); + } + } + + .collection-year { + font-size: $font-size-largest; + font-weight: bold; + margin: 60px 0; + position: relative; + + &::before { + background: $grey; + margin-left: -4px; + margin-top: -4px; + position: absolute; + top: 50%; + round-icon(8px); + } + } + + .collection-header { + display: block; + margin-left: 20px; + + small { + color: $grey; + margin-left: 5px; + } + } + + .post-header { + border-bottom: 1px dashed $grey-light; + // 2px is equal to half the width of .posts-collapse::before + margin: 30px 2px 0; + padding-left: 15px; + position: relative; + transition: border $transition-ease; + + &::before { + background: $grey; + border: 1px solid white; + left: -6px; + position: absolute; + top: $font-size-smallest; + transition: background $transition-ease; + round-icon(6px); + } + + &:hover { + border-bottom-color: $grey-dim; + + &::before { + background: $black-deep; + } + } + } + + .post-meta-container { + display: inline; + font-size: $font-size-smallest; + margin-right: 10px; + } + + .post-title { + display: inline; + + a { + border-bottom: 0; + color: var(--link-color); + } + } + + &::before { + background: $whitesmoke; + content: ' '; + height: 100%; + margin-left: -2px; + position: absolute; + // To do: 1.25em is inaccurate when .collection-title has line breaks on mobile + top: 1.25em; + width: 4px; + } +} diff --git a/themes/next/source/css/_common/components/post/post-followme.styl b/themes/next/source/css/_common/components/post/post-followme.styl new file mode 100644 index 0000000..0e9332a --- /dev/null +++ b/themes/next/source/css/_common/components/post/post-followme.styl @@ -0,0 +1,56 @@ +if (hexo-config('follow_me')) { + .followme { + color: $grey; + padding: 1em 1.5em; + text-align: center; + post-card(); + + .social-list { + flex-wrap(); + + .social-item { + margin: .5em 2em; + position: relative; + + +tablet-mobile() { + margin: .5em .75em; + } + } + + .social-link { + border: 0; + // Make the hit area continious + display: block; + + .icon { + font-size: 1.75em; + } + + .label { + display: block; + font-size: 14px; + } + + &:hover + .social-item-img { + display: block; + } + } + + span.social-link { + color: var(--link-color); + + &:hover { + color: var(--link-hover-color); + } + } + + .social-item-img { + display: none; + left: 50%; + max-width: $post-reward-img-width; + position: absolute; + transform: translate(-50%, 20px); + } + } + } +} diff --git a/themes/next/source/css/_common/components/post/post-footer.styl b/themes/next/source/css/_common/components/post/post-footer.styl new file mode 100644 index 0000000..b71bc6c --- /dev/null +++ b/themes/next/source/css/_common/components/post/post-footer.styl @@ -0,0 +1,53 @@ +// Flexbox layout makes it possible to reorder the child +// elements of .post-footer through the `order` CSS property +// Fix issue #16 +// To do: use `gap` instead of `margin` +// See https://caniuse.com/flexbox-gap +.post-footer { + flex-column(); +} + +.post-eof { + background: $grey-light; + height: 1px; + margin: $post-eof-margin-top auto $post-eof-margin-bottom; + width: 8%; + + .post-block:last-of-type & { + display: none; + } +} + +if (hexo-config('creative_commons.post')) { + .post-copyright ul { + list-style: none; + overflow: hidden; + padding: .5em 1em; + position: relative; + post-card(); + + &::after { + content: '\f25e'; + font-family: 'Font Awesome 6 Brands'; + font-size: 200px; + opacity: .1; + position: absolute; + right: -50px; + top: -150px; + } + } +} + +.post-tags { + margin-top: 40px; + text-align: $scheme-text-align; + + a { + display: inline-block; + font-size: $font-size-smaller; + + &:not(:last-child) { + margin-right: 10px; + } + } +} diff --git a/themes/next/source/css/_common/components/post/post-gallery.styl b/themes/next/source/css/_common/components/post/post-gallery.styl new file mode 100644 index 0000000..a4240d7 --- /dev/null +++ b/themes/next/source/css/_common/components/post/post-gallery.styl @@ -0,0 +1,33 @@ +.post-gallery { + display: flex; + min-height: 200px; + + .post-gallery-image { + flex: 1; + + &:not(:first-child) { + clip-path: polygon(40px 0, 100% 0, 100% 100%, 0 100%); + margin-left: -20px; + } + + &:not(:last-child) { + margin-right: -20px; + } + + img { + height: 100%; + object-fit: cover; + // Override darkmode image opacity. + opacity: 1; + width: 100%; + } + } +} + +.posts-expand .post-gallery { + margin-bottom: 60px; +} + +.posts-collapse .post-gallery { + margin: 15px 0; +} diff --git a/themes/next/source/css/_common/components/post/post-header.styl b/themes/next/source/css/_common/components/post/post-header.styl new file mode 100644 index 0000000..f9f6e43 --- /dev/null +++ b/themes/next/source/css/_common/components/post/post-header.styl @@ -0,0 +1,120 @@ +.posts-expand .post-header { + font-size: $font-size-large; + margin-bottom: 60px; + text-align: center; +} + +.posts-expand .post-title { + font-size: $font-size-largest; + font-weight: normal; + margin: initial; + word-wrap(); + + if (hexo-config('post_edit.enable')) { + .post-edit-link { + border-bottom: 0; + color: $grey; + float: right; + font-size: $font-size-larger; + margin-left: -1.2em; + transition: color $transition-ease-in; + + +mobile-small() { + margin-left: initial; + } + + &:hover { + color: $sidebar-highlight; + } + } + } +} + +.posts-expand .post-title-link { + border-bottom: 0; + color: var(--link-color); + display: inline-block; + position: relative; + + &::before { + background: var(--link-color); + bottom: 0; + content: ''; + height: 2px; + // Fix issue #75 + left: 0; + position: absolute; + transform: scaleX(0); + transition: transform $transition-ease; + width: 100%; + } + + &:hover::before { + transform: scaleX(1); + } + + .fa { + font-size: $font-size-small; + margin-left: 5px; + } +} + +.post-sticky-flag { + display: inline-block; + // Fix issue #80 #140 + margin-right: 8px; + transform: rotate(30deg); +} + +.posts-expand .post-meta-container { + color: $grey-dark; + font-family: $font-family-posts; + font-size: $font-size-smallest; + margin-top: 3px; + + .post-description { + font-size: $font-size-small; + margin-top: 2px; + } + + time { + border-bottom: 1px dashed $grey-dark; + } +} + +// Flexbox layout makes it possible to reorder the child +// elements of .post-meta through the `order` CSS property +.post-meta { + flex-wrap(); +} + +// .post-meta-item exists in .post-meta and footer +:not(.post-meta-break) + .post-meta-item::before { + content: '|'; + margin: 0 .5em; +} + +.post-meta-item-icon { + margin-right: 3px; +} + +.post-meta-item-text { + if (not hexo-config('post_meta.item_text')) { + display: none; + } + + +tablet-mobile() { + display: none; + } +} + +.post-meta-break { + flex-basis: 100%; + height: 0; +} + +if (hexo-config('busuanzi_count.enable') and hexo-config('busuanzi_count.post_views')) { + #busuanzi_container_page_pv { + display: none; + } +} diff --git a/themes/next/source/css/_common/components/post/post-nav.styl b/themes/next/source/css/_common/components/post/post-nav.styl new file mode 100644 index 0000000..1f14593 --- /dev/null +++ b/themes/next/source/css/_common/components/post/post-nav.styl @@ -0,0 +1,41 @@ +.post-nav { + border-top: 1px solid $gainsboro; + display: flex; + gap: 30px; + justify-content: space-between; + margin-top: 1em; + padding: 10px 5px 0; +} + +.post-nav-item { + flex: 1; + + a { + border-bottom: 0; + display: block; + font-size: $font-size-small; + line-height: 1.6; + + &:active { + top: 2px; + } + } + + .fa { + font-size: $font-size-smallest; + } + + &:first-child { + .fa { + margin-right: 5px; + } + } + + &:last-child { + text-align: right; + + .fa { + margin-left: 5px; + } + } +} diff --git a/themes/next/source/css/_common/components/post/post-reward.styl b/themes/next/source/css/_common/components/post/post-reward.styl new file mode 100644 index 0000000..6f1531f --- /dev/null +++ b/themes/next/source/css/_common/components/post/post-reward.styl @@ -0,0 +1,56 @@ +.reward-container { + margin: $post-card-margin; + padding: 1em 0; + text-align: center; + + button { + button($sidebar-highlight); + border: 2px solid $sidebar-highlight; + border-radius: 2px; + outline: 0; + transition: all $transition-ease; + vertical-align: text-top; + } +} + +.post-reward { + display: none; + padding-top: 20px; + + &.active { + display: block; + } + + div { + display: inline-block; + + span { + display: block; + } + + if (hexo-config('reward_settings.animation')) { + &:hover span { + animation: next-roll .1s infinite linear; + // The animation may affect :hover of img in dark mode + pointer-events: none; + } + } + } + + img { + display: inline-block; + margin: .8em 2em 0; + max-width: 100%; + width: $post-reward-img-width; + } +} + +@keyframes next-roll { + from { + transform: rotateZ(30deg); + } + + to { + transform: rotateZ(-30deg); + } +} diff --git a/themes/next/source/css/_common/components/post/post-widgets.styl b/themes/next/source/css/_common/components/post/post-widgets.styl new file mode 100644 index 0000000..34c7afb --- /dev/null +++ b/themes/next/source/css/_common/components/post/post-widgets.styl @@ -0,0 +1,11 @@ +.social-like { + border-top: 1px solid $gainsboro; + font-size: $font-size-small; + margin-top: 1em; + padding-top: 1em; + flex-wrap(); + + a { + border-bottom: none; + } +} diff --git a/themes/next/source/css/_common/components/reading-progress.styl b/themes/next/source/css/_common/components/reading-progress.styl new file mode 100644 index 0000000..d28c4f9 --- /dev/null +++ b/themes/next/source/css/_common/components/reading-progress.styl @@ -0,0 +1,27 @@ +if (hexo-config('reading_progress.enable')) { + .reading-progress-bar { + --progress: 0; + background: convert(hexo-config('reading_progress.color')); + height: convert(hexo-config('reading_progress.height')); + position: fixed; + z-index: $zindex-5; + + if (hexo-config('reading_progress.reversed')) { + width: calc(100% - var(--progress)); + } else { + width: var(--progress); + } + + if (hexo-config('reading_progress.start_at') == 'right') { + right: 0; + } else { + left: 0; + } + + if (hexo-config('reading_progress.position') == 'bottom') { + bottom: 0; + } else { + top: 0; + } + } +} diff --git a/themes/next/source/css/_common/components/third-party/disqusjs.styl b/themes/next/source/css/_common/components/third-party/disqusjs.styl new file mode 100644 index 0000000..aad736f --- /dev/null +++ b/themes/next/source/css/_common/components/third-party/disqusjs.styl @@ -0,0 +1,39 @@ +if (hexo-config('disqusjs.enable') and hexo-config('darkmode')) { + @media (prefers-color-scheme:dark) { + html #dsqjs a { + color: var(--link-color); + } + + html #dsqjs a:focus,html #dsqjs a:hover { + color: var(--link-hover-color); + } + + html #dsqjs .dsqjs-nav,html #dsqjs footer { + border-color: var(--card-bg-color); + } + + html #dsqjs .dsqjs-load-more,html #dsqjs .dsqjs-load-more:hover,html #dsqjs .dsqjs-nav-tab,html #dsqjs .dsqjs-no-comment,html #dsqjs .dsqjs-post-content { + color: var(--text-color); + } + + html #dsqjs .dsqjs-order-label { + background-color: #3e4b5e; + } + + html #dsqjs .dsqjs-order-radio:checked+.dsqjs-order-label { + background-color: var(--content-bg-color); + } + + html #dsqjs .dsqjs-tab-active>span:after { + background-color: #2e9fff!important; + } + + html #dsqjs .dsqjs-footer,html #dsqjs .dsqjs-meta { + color: var(--text-color); + } + + html #dsqjs .dsqjs-post-body blockquote { + border-color: var(--content-bg-color); + } + } +} diff --git a/themes/next/source/css/_common/components/third-party/gitalk.styl b/themes/next/source/css/_common/components/third-party/gitalk.styl new file mode 100644 index 0000000..252caa7 --- /dev/null +++ b/themes/next/source/css/_common/components/third-party/gitalk.styl @@ -0,0 +1,17 @@ +if (hexo-config('gitalk.enable')) { + .gt-header a, .gt-comments a, .gt-popup a { + border-bottom: 0; + } + + .gt-container .gt-popup .gt-action.is--active::before { + top: .7em; + } + + if (hexo-config('darkmode')) { + @media (prefers-color-scheme: dark) { + .gt-container .gt-header-textarea { + background-color: var(--card-bg-color) !important; + } + } + } +} diff --git a/themes/next/source/css/_common/components/third-party/index.styl b/themes/next/source/css/_common/components/third-party/index.styl new file mode 100644 index 0000000..2202395 --- /dev/null +++ b/themes/next/source/css/_common/components/third-party/index.styl @@ -0,0 +1,16 @@ +@import 'disqusjs'; +@import 'gitalk'; +@import 'utterances'; +@import 'search'; +@import 'math'; + +.use-motion .animated { + // Fix issue #48 #55 + animation-fill-mode: none; + // Fix issue #46 .animated in .sidebar + visibility: inherit; +} + +.use-motion .sidebar .animated { + animation-fill-mode: both; +} diff --git a/themes/next/source/css/_common/components/third-party/math.styl b/themes/next/source/css/_common/components/third-party/math.styl new file mode 100644 index 0000000..7837b3d --- /dev/null +++ b/themes/next/source/css/_common/components/third-party/math.styl @@ -0,0 +1,9 @@ +if (hexo-config('math.mathjax.enable')) { + mjx-container[jax='CHTML'][display='true'], .has-jax { + overflow: auto hidden; + } + + mjx-container[display='true'] + br { + display: none; + } +} diff --git a/themes/next/source/css/_common/components/third-party/search.styl b/themes/next/source/css/_common/components/third-party/search.styl new file mode 100644 index 0000000..d5b6a15 --- /dev/null +++ b/themes/next/source/css/_common/components/third-party/search.styl @@ -0,0 +1,179 @@ +if (hexo-config('local_search.enable') or hexo-config('algolia_search.enable')) { + .search-active { + overflow: hidden; + } + + .search-pop-overlay { + background: rgba(0, 0, 0, 0); + display: flex; + height: 100%; + left: 0; + position: fixed; + top: 0; + transition: visibility .4s, background .4s; + visibility: hidden; + width: 100%; + z-index: $zindex-4; + + .search-active & { + background: rgba(0, 0, 0, .3); + visibility: visible; + } + } + + .search-popup { + background: var(--card-bg-color); + border-radius: 5px; + height: 80%; + margin: auto; + transform: scale(0); + transition: transform .4s; + width: 700px; + + .search-active & { + transform: scale(1); + } + + +mobile() { + border-radius: 0; + height: 100%; + width: 100%; + } + + .search-icon, .popup-btn-close { + color: $grey-dark; + font-size: 18px; + padding: 0 10px; + } + + .popup-btn-close { + cursor: pointer; + + &:hover .fa { + color: $black-deep; + } + } + + .search-header { + background: $gainsboro; + if (hexo-config('darkmode')) { + @media (prefers-color-scheme: dark) { + background: $grey-dim; + } + } + border-top-left-radius: 5px; + border-top-right-radius: 5px; + display: flex; + padding: 5px; + } + + input.search-input { + background: transparent; + border: 0; + outline: 0; + width: 100%; + + &::-webkit-search-cancel-button { + display: none; + } + } + + .search-result-container { + height: calc(100% - 55px); + overflow: auto; + padding: 5px 25px; + + hr { + margin: 5px 0 10px; + + &:first-child { + display: none; + } + } + } + + .search-result-list { + margin: 0 5px; + padding: 0; + } + + a.search-result-title { + font-weight: bold; + } + + p.search-result { + border-bottom: 1px dashed $grey-light; + padding: 5px 0; + } + } +} + +if (hexo-config('algolia_search.enable')) { + .search-input-container { + flex-grow: 1; + + form { + padding: 2px; + } + } + + .search-stats { + align-items: center; + display: flex; + justify-content: space-between; + + img { + height: 1em; + margin: 0; + } + } + + .algolia-pagination { + // Override default style of ul + margin: 40px 0; + opacity: 1; + padding: 0; + + .pagination-item { + display: inline-block; + } + + .current .page-number { + @extend $page-number-current; + cursor: default; + } + + .disabled-item { + visibility: hidden; + } + } +} + +if (hexo-config('local_search.enable')) { + .search-popup { + .search-input-container { + flex-grow: 1; + padding: 2px; + } + + .no-result { + display: flex; + } + + .search-result-list { + width: 100%; + } + + .search-result-icon { + color: $grey-light; + margin: auto; + } + } + + mark.search-keyword { + background: transparent; + border-bottom: 1px dashed $red; + color: $red; + font-weight: bold; + } +} diff --git a/themes/next/source/css/_common/components/third-party/utterances.styl b/themes/next/source/css/_common/components/third-party/utterances.styl new file mode 100644 index 0000000..771e731 --- /dev/null +++ b/themes/next/source/css/_common/components/third-party/utterances.styl @@ -0,0 +1,5 @@ +if (hexo-config('utterances.enable')) { + .utterances { + max-width: unset; + } +} diff --git a/themes/next/source/css/_common/outline/footer/index.styl b/themes/next/source/css/_common/outline/footer/index.styl new file mode 100644 index 0000000..0371a2b --- /dev/null +++ b/themes/next/source/css/_common/outline/footer/index.styl @@ -0,0 +1,102 @@ +// Footer Section +// -------------------------------------------------- +.footer { + color: $grey-dark; + font-size: $font-size-small; + padding: 20px 0; + transition: $transition-ease; + transition-property: left, right; + + &.footer-fixed { + bottom: 0; + left: 0; + position: absolute; + right: 0; + } +} + +// Flexbox layout makes it possible to reorder the child +// elements of .footer-inner through the `order` CSS property +.footer-inner { + box-sizing: border-box; + text-align: $scheme-text-align; + flex-column(); + main-container(); +} + +.use-motion { + .footer { + opacity: 0; + } +} + +@keyframes icon-animate { + 0%, 100% { + transform: scale(1); + } + + 10%, 30% { + transform: scale(.9); + } + + 20%, 40%, 60%, 80% { + transform: scale(1.1); + } + + 50%, 70% { + transform: scale(1.1); + } +} + +.languages { + display: inline-block; + font-size: $font-size-large; + position: relative; + + .lang-select-label span { + margin: 0 .5em; + } + + .lang-select { + height: 100%; + left: 0; + opacity: 0; + position: absolute; + top: 0; + width: 100%; + } +} + +.with-love { + color: convert(hexo-config('footer.icon.color')); + display: inline-block; + margin: 0 5px; + + if (hexo-config('footer.icon.animated')) { + animation: icon-animate 1.33s ease-in-out infinite; + } +} + +if (hexo-config('footer.beian.enable') and hexo-config('footer.beian.gongan_icon_url')) { + .beian img { + display: inline-block; + margin: 0 3px; + vertical-align: middle; + } +} + +if (hexo-config('busuanzi_count.enable')) { + .busuanzi-count { + if (hexo-config('busuanzi_count.total_visitors')) { + #busuanzi_container_site_uv { + display: none; + } + } + + if (hexo-config('busuanzi_count.total_views')) { + #busuanzi_container_site_pv { + display: none; + } + } + } +} diff --git a/themes/next/source/css/_common/outline/header/bookmark.styl b/themes/next/source/css/_common/outline/header/bookmark.styl new file mode 100644 index 0000000..f0f01d3 --- /dev/null +++ b/themes/next/source/css/_common/outline/header/bookmark.styl @@ -0,0 +1,24 @@ +if (hexo-config('bookmark.enable')) { + .book-mark-link { + border-bottom: 0; + position: fixed; + top: -10px; + transition: top .3s; + sidebar-toggle-position(true); + + +tablet-mobile() { + display: none; + } + + &::before { + color: convert(hexo-config('bookmark.color')); + font-size: 32px; + line-height: 1; + font-family-icons('\f02e'); + } + } + + .book-mark-link:hover, .book-mark-link-fixed { + top: -2px; + } +} diff --git a/themes/next/source/css/_common/outline/header/github-banner.styl b/themes/next/source/css/_common/outline/header/github-banner.styl new file mode 100644 index 0000000..214f768 --- /dev/null +++ b/themes/next/source/css/_common/outline/header/github-banner.styl @@ -0,0 +1,59 @@ +if (hexo-config('github_banner.enable')) { + @keyframes octocat-wave { + 0%, 100% { + transform: rotate(0); + } + + 20%, 60% { + transform: rotate(-25deg); + } + + 40%, 80% { + transform: rotate(10deg); + } + } + + .github-corner { + :hover .octo-arm { + animation: octocat-wave 560ms ease-in-out; + } + + svg { + color: white; + fill: var(--theme-color); + position: absolute; + right: 0; + top: 0; + z-index: $zindex-0; + } + + +tablet-mobile() { + if (hexo-config('local_search.enable') or hexo-config('algolia_search.enable')) { + display: none; + } + + svg { + if (($scheme == 'Pisces') or ($scheme == 'Gemini')) { + color: var(--theme-color); + fill: white; + } + } + + .github-corner:hover .octo-arm { + animation: none; + } + + .github-corner .octo-arm { + animation: octocat-wave 560ms ease-in-out; + } + } + + if ($scheme == 'Mist') { + +mobile() { + svg { + top: inherit; + } + } + } + } +} diff --git a/themes/next/source/css/_common/outline/header/index.styl b/themes/next/source/css/_common/outline/header/index.styl new file mode 100644 index 0000000..6ff3084 --- /dev/null +++ b/themes/next/source/css/_common/outline/header/index.styl @@ -0,0 +1,29 @@ +// Header Section +// -------------------------------------------------- +.headband { + background: $headband-bg; + height: $headband-height; + + +tablet-mobile() { + display: none; + } +} + +.site-brand-container { + display: flex; + flex-shrink: 0; + padding: 0 10px; +} + +.use-motion { + .column, .site-brand-container .toggle { + opacity: 0; + } +} + +@import 'site-meta'; +@import 'site-nav'; +@import 'menu'; + +@import 'bookmark'; +@import 'github-banner'; diff --git a/themes/next/source/css/_common/outline/header/menu.styl b/themes/next/source/css/_common/outline/header/menu.styl new file mode 100644 index 0000000..377f1e1 --- /dev/null +++ b/themes/next/source/css/_common/outline/header/menu.styl @@ -0,0 +1,58 @@ +// Menu +// -------------------------------------------------- +.menu { + margin: 0; + padding: 1em 0; + text-align: center; +} + +.menu-item { + display: inline-block; + list-style: none; + margin: 0 10px; + + +mobile() { + display: block; + margin-top: 10px; + + &.menu-item-search { + display: none; + } + } + + a { + border-bottom: 0; + display: block; + font-size: $font-size-smaller; + transition: border-color $transition-ease; + + &:hover, &.menu-item-active { + background: var(--menu-item-bg-color); + } + } + + i[class^='fa'] { + margin-right: 8px; + } + + .badge { + display: inline-block; + font-weight: bold; + line-height: 1; + margin-left: .35em; + margin-top: .35em; + text-align: center; + white-space: nowrap; + + +mobile() { + float: right; + margin-left: 0; + } + } +} + +if (hexo-config('motion.transition.menu_item')) { + .use-motion .menu-item { + visibility: hidden; + } +} diff --git a/themes/next/source/css/_common/outline/header/site-meta.styl b/themes/next/source/css/_common/outline/header/site-meta.styl new file mode 100644 index 0000000..54dabc0 --- /dev/null +++ b/themes/next/source/css/_common/outline/header/site-meta.styl @@ -0,0 +1,49 @@ +.site-meta { + flex-grow: 1; + text-align: center; + + +mobile() { + text-align: center; + } +} + +.custom-logo-image { + margin-top: 20px; + + +tablet-mobile() { + display: none; + } +} + +.brand { + border-bottom: 0; + color: var(--brand-color); + display: inline-block; + padding: $brand-padding; + + &:hover { + color: var(--brand-hover-color); + } +} + +.site-title { + font-family: $font-family-logo; + font-size: $font-size-title; + font-weight: normal; + line-height: 1.5; + margin: 0; +} + +.site-subtitle { + color: $subtitle-color; + font-size: $font-size-subtitle; + margin: $site-subtitle-margin; +} + +.use-motion { + .site-title, .site-subtitle, .custom-logo-image { + opacity: 0; + position: relative; + top: -10px; + } +} diff --git a/themes/next/source/css/_common/outline/header/site-nav.styl b/themes/next/source/css/_common/outline/header/site-nav.styl new file mode 100644 index 0000000..864d1bf --- /dev/null +++ b/themes/next/source/css/_common/outline/header/site-nav.styl @@ -0,0 +1,24 @@ +.site-nav-toggle, .site-nav-right { + display: none; + + +mobile() { + flex-column(); + } + + .toggle { + color: var(--text-color); + padding: 10px; + width: 22px; + + .toggle-line { + background: var(--text-color); + border-radius: 1px; + } + } +} + +.site-nav { + +mobile() { + site-nav-hide-by-default(); + } +} diff --git a/themes/next/source/css/_common/outline/index.styl b/themes/next/source/css/_common/outline/index.styl new file mode 100644 index 0000000..fd6fc19 --- /dev/null +++ b/themes/next/source/css/_common/outline/index.styl @@ -0,0 +1,5 @@ +@import 'header'; +@import 'sidebar'; +@import 'footer'; + +@import 'mobile'; diff --git a/themes/next/source/css/_common/outline/mobile.styl b/themes/next/source/css/_common/outline/mobile.styl new file mode 100644 index 0000000..2643054 --- /dev/null +++ b/themes/next/source/css/_common/outline/mobile.styl @@ -0,0 +1,90 @@ +/* +// < 767px ++mobile() { + +} +*/ + +if (hexo-config('mobile_layout_economy')) { + +mobile-small() { + // For Pisces & Gemini schemes only wider width (remove main blocks in Gemini). + .main-inner { + padding: initial !important; + } + + // For all schemes wider width. + .posts-expand { + .post-header { + margin-bottom: 10px !important; + } + } + + .post-block { + margin-top: initial !important; + // Inside posts blocks content padding (default 40px). + padding: $content-mobile-padding 18px $content-mobile-padding !important; + } + + .post-body { + // For headers narrow width. + h1, h2, h3, h4, h5, h6 { + margin: 20px 0 8px; + } + + // Rewrite paddings & margins inside tags. + .note, .tabs .tab-content .tab-pane { + h1, h2, h3, h4, h5, h6 { + margin: 0 5px; + } + } + + // For paragraphs narrow width. + > p { + margin: 0 0 10px; + } + + // Rewrite paddings & margins inside tags. + .note > p, .tabs .tab-content .tab-pane > p { + padding: 0 5px; + } + + img, video { + margin-bottom: 10px !important; + } + + // Fix issue #641 + img + figcaption, .fancybox + figcaption { + margin: -5px auto 15px !important; + } + + .note { + margin-bottom: 10px !important; + padding: 10px !important; + + if (hexo-config('note.icons')) { + &:not(.no-icon) { + padding-left: 35px !important; + } + } + } + + .tabs .tab-content .tab-pane { + padding: 10px 10px 0 !important; + } + } + + .post-eof { + margin: 40px auto 20px !important; + } + + .pagination { + margin-top: 40px; + } + } +} +/* +// < 413px ++mobile-smallest() { + +} +*/ diff --git a/themes/next/source/css/_common/outline/sidebar/index.styl b/themes/next/source/css/_common/outline/sidebar/index.styl new file mode 100644 index 0000000..5b04716 --- /dev/null +++ b/themes/next/source/css/_common/outline/sidebar/index.styl @@ -0,0 +1,31 @@ +.sidebar-inner { + color: $grey-dark; + padding: $sidebar-padding 10px; + text-align: center; + flex-column(); +} + +.cc-license { + .cc-opacity { + border-bottom: 0; + opacity: .7; + + &:hover { + opacity: .9; + } + } + + img { + display: inline-block; + } +} + +@import 'sidebar-author'; +@import 'sidebar-author-links'; +@import 'sidebar-button'; +@import 'sidebar-blogroll'; +@import 'sidebar-nav'; +@import 'sidebar-toggle'; +@import 'sidebar-toc'; +@import 'site-state'; +@import 'related-posts'; diff --git a/themes/next/source/css/_common/outline/sidebar/related-posts.styl b/themes/next/source/css/_common/outline/sidebar/related-posts.styl new file mode 100644 index 0000000..157b43b --- /dev/null +++ b/themes/next/source/css/_common/outline/sidebar/related-posts.styl @@ -0,0 +1,31 @@ +if (hexo-config('related_posts.enable')) { + .sidebar-post-related { + font-size: $font-size-smaller; + padding: $sidebar-padding 0 0 0; + } + + .popular-posts { + margin: 0; + padding: 1em 0; + text-align: left; + + .popular-posts-item { + display: block; + + .popular-posts-link { + border-bottom: 0; + display: block; + padding: 5px 20px; + transition: background .2s ease-in-out; + + &:hover { + background: var(--menu-item-bg-color); + } + } + + .popular-posts-time { + color: $site-state-item-name-color; + } + } + } +} diff --git a/themes/next/source/css/_common/outline/sidebar/sidebar-author-links.styl b/themes/next/source/css/_common/outline/sidebar/sidebar-author-links.styl new file mode 100644 index 0000000..cd3766c --- /dev/null +++ b/themes/next/source/css/_common/outline/sidebar/sidebar-author-links.styl @@ -0,0 +1,11 @@ +.links-of-author { + a { + font-size: $font-size-smaller; + } + + if (not hexo-config('social_icons.icons_only')) { + i[class^='fa'] { + margin-right: 2px; + } + } +} diff --git a/themes/next/source/css/_common/outline/sidebar/sidebar-author.styl b/themes/next/source/css/_common/outline/sidebar/sidebar-author.styl new file mode 100644 index 0000000..825d87d --- /dev/null +++ b/themes/next/source/css/_common/outline/sidebar/sidebar-author.styl @@ -0,0 +1,29 @@ +.site-author-image { + border: $site-author-image-border-width solid $site-author-image-border-color; + max-width: $site-author-image-width; + padding: 2px; + + if (hexo-config('avatar.rounded')) { + border-radius: 50%; + } + + if (hexo-config('avatar.rotated')) { + transition: transform 1s ease-out; + + &:hover { + transform: rotateZ(360deg); + } + } +} + +.site-author-name { + color: $site-author-name-color; + font-weight: $site-author-name-weight; + margin: $site-author-name-margin; +} + +.site-description { + color: $site-description-color; + font-size: $site-description-font-size; + margin-top: $site-description-margin-top; +} diff --git a/themes/next/source/css/_common/outline/sidebar/sidebar-blogroll.styl b/themes/next/source/css/_common/outline/sidebar/sidebar-blogroll.styl new file mode 100644 index 0000000..a1a3eb8 --- /dev/null +++ b/themes/next/source/css/_common/outline/sidebar/sidebar-blogroll.styl @@ -0,0 +1,14 @@ +.links-of-blogroll { + font-size: $font-size-smaller; +} + +.links-of-blogroll-title { + font-size: $font-size-small; + font-weight: 600; +} + +.links-of-blogroll-list { + list-style: none; + margin: 0; + padding: 0; +} diff --git a/themes/next/source/css/_common/outline/sidebar/sidebar-button.styl b/themes/next/source/css/_common/outline/sidebar/sidebar-button.styl new file mode 100644 index 0000000..850faa9 --- /dev/null +++ b/themes/next/source/css/_common/outline/sidebar/sidebar-button.styl @@ -0,0 +1,15 @@ +.sidebar .sidebar-button { + &:not(:first-child) { + margin-top: 15px; + } + + button { + button($orange); + border: 1px solid $orange; + border-radius: 4px; + + i[class^='fa'] { + margin-right: 5px; + } + } +} diff --git a/themes/next/source/css/_common/outline/sidebar/sidebar-nav.styl b/themes/next/source/css/_common/outline/sidebar/sidebar-nav.styl new file mode 100644 index 0000000..eabfb89 --- /dev/null +++ b/themes/next/source/css/_common/outline/sidebar/sidebar-nav.styl @@ -0,0 +1,129 @@ +// Sidebar Navigation +.sidebar-nav { + font-size: $font-size-small; + height: 0; + margin: 0; + overflow: hidden; + padding-left: 0; + pointer-events: none; + transition: $transition-ease; + transition-property: height, visibility; + visibility: hidden; + + .sidebar-nav-active & { + height: "calc(%sem + 1px)" % $line-height-base; + pointer-events: unset; + visibility: unset; + } + + li { + border-bottom: 1px solid transparent; + color: $sidebar-nav-color; + cursor: pointer; + display: inline-block; + transition: $transition-ease; + transition-property: border-bottom-color, color; + + &.sidebar-nav-overview { + margin-left: 10px; + } + + &:hover { + color: $sidebar-nav-hover-color; + } + } +} + +.sidebar-toc-active .sidebar-nav-toc, .sidebar-overview-active .sidebar-nav-overview { + border-bottom-color: $sidebar-highlight; + color: $sidebar-highlight; + transition-delay: $transition-duration; + + &:hover { + color: $sidebar-highlight; + } +} + +// For TOC/Overview scrolling +.sidebar-panel-container { + align-items: start; + display: grid; + flex: 1; + overflow-x: hidden; + overflow-y: auto; + padding-top: 0; + transition: padding-top $transition-ease; + + .sidebar-nav-active & { + padding-top: 20px; + } +} + +.sidebar-panel { + animation: deactivate-sidebar-panel $transition-duration ease-in-out; + grid-area: 1 / 1; + height: 0; + opacity: 0; + overflow: hidden; + pointer-events: none; + transform: translateY(0); + transition: $transition-ease; + transition-delay: 0s; + transition-property: opacity, transform, visibility; + visibility: hidden; + + // Apply transform to both panels when sidebar nav is active, + // to the TOC panel when switching between Overview and TOC regardless of + // whether the sidebar nav is active + .sidebar-nav-active &, + .sidebar-overview-active &.post-toc-wrap { + transform: translateY(-20px); + } + + // Delay TOC transform transition when switching from TOC to Overview and + // deactivating the sidebar nav at the same time, to prevent the TOC panel + // from moving too fast + // https://github.com/next-theme/hexo-theme-next/pull/323#issuecomment-1420780965 + .sidebar-overview-active:not(.sidebar-nav-active) &.post-toc-wrap { + transition-delay: 0s, $transition-duration, 0s; + } + + .sidebar-overview-active &.site-overview-wrap, + .sidebar-toc-active &.post-toc-wrap { + animation-name: activate-sidebar-panel; + height: auto; + opacity: 1; + pointer-events: unset; + transform: translateY(0); + // The visibility delay is intentionally set to 0s to accommodate + // the visibility change on initial page load. + transition-delay: $transition-duration, $transition-duration, 0s; + visibility: unset; + } + + &.site-overview-wrap { + // Flexbox layout makes it possible to reorder the child + // elements of .site-overview-wrap through the `order` CSS property + flex-column(); + gap: 10px; + justify-content: flex-start; // TODO: Optimize the duplicate with flex-column() + } +} + +@keyframes deactivate-sidebar-panel { + from { + height: var(--inactive-panel-height, 0); + } + to { + height: var(--active-panel-height, 0); + } +} + +@keyframes activate-sidebar-panel { + from { + height: var(--inactive-panel-height, auto); + } + to { + height: var(--active-panel-height, auto); + } +} diff --git a/themes/next/source/css/_common/outline/sidebar/sidebar-toc.styl b/themes/next/source/css/_common/outline/sidebar/sidebar-toc.styl new file mode 100644 index 0000000..253191d --- /dev/null +++ b/themes/next/source/css/_common/outline/sidebar/sidebar-toc.styl @@ -0,0 +1,67 @@ +if (hexo-config('toc.enable')) { + .post-toc { + font-size: $font-size-small; + + ol { + list-style: none; + margin: 0; + padding: 0 2px 0 10px; + text-align: left; + + > :last-child { + margin-bottom: 5px; + } + + > ol { + padding-left: 0; + } + + a { + transition: all $transition-ease; + } + } + + .nav-item { + line-height: 1.8; + overflow: hidden; + text-overflow: ellipsis; + + if (not hexo-config('toc.wrap')) { + white-space: nowrap; + } + } + + .nav { + if (not hexo-config('toc.expand_all')) { + .nav-child { + --height: 0; + height: 0; + opacity: 0; + overflow: hidden; + transition-property: height, opacity, visibility; + transition: $transition-ease; + visibility: hidden; + } + + .active > .nav-child { + height: var(--height, auto); + opacity: 1; + visibility: unset; + } + } + + .active > a { + border-bottom-color: $sidebar-highlight; + color: $sidebar-highlight; + } + + .active-current > a { + color: $sidebar-highlight; + + &:hover { + color: $sidebar-highlight; + } + } + } + } +} diff --git a/themes/next/source/css/_common/outline/sidebar/sidebar-toggle.styl b/themes/next/source/css/_common/outline/sidebar/sidebar-toggle.styl new file mode 100644 index 0000000..0b19b89 --- /dev/null +++ b/themes/next/source/css/_common/outline/sidebar/sidebar-toggle.styl @@ -0,0 +1,21 @@ +.sidebar-toggle { + bottom: $b2t-position-bottom-on + $sidebar-toggle-size + 5px; + height: $sidebar-toggle-inner-size; + padding: $sidebar-toggle-padding; + width: $sidebar-toggle-inner-size; + sidebar-toggle(); +} + +.sidebar-toggle:hover .toggle-line { + background: $sidebar-highlight; +} + +@media (any-hover: hover) { + body:not(.sidebar-active) .sidebar-toggle:hover { + toggle-arrow(hexo-config('sidebar.position')); + } +} + +.sidebar-active .sidebar-toggle { + toggle-close(hexo-config('sidebar.position')); +} diff --git a/themes/next/source/css/_common/outline/sidebar/site-state.styl b/themes/next/source/css/_common/outline/sidebar/site-state.styl new file mode 100644 index 0000000..d1d30f7 --- /dev/null +++ b/themes/next/source/css/_common/outline/sidebar/site-state.styl @@ -0,0 +1,28 @@ +if (hexo-config('site_state')) { + .site-state { + flex-wrap(); + line-height: 1.4; + } + + .site-state-item { + // Fix issue #103 + // The click area of the link becomes smaller + padding: 0 15px; + + a { + border-bottom: 0; + display: block; + } + } + + .site-state-item-count { + display: block; + font-size: $site-state-item-count-font-size; + font-weight: 600; + } + + .site-state-item-name { + color: $site-state-item-name-color; + font-size: $site-state-item-name-font-size; + } +} diff --git a/themes/next/source/css/_common/scaffolding/base.styl b/themes/next/source/css/_common/scaffolding/base.styl new file mode 100644 index 0000000..0042acb --- /dev/null +++ b/themes/next/source/css/_common/scaffolding/base.styl @@ -0,0 +1,99 @@ +::selection { + background: $selection-bg; + color: $selection-color; +} + +html, body { + height: 100%; +} + +body { + background: var(--body-bg-color); + box-sizing: border-box; + color: var(--text-color); + font-family: $font-family-base; + font-size: $font-size-base; + line-height: $line-height-base; + min-height: 100%; + position: relative; + transition: padding $transition-ease; + + if (hexo-config('body_scrollbar.overlay')) { + overflow-x: hidden; + @supports (overflow-x: clip) { + overflow-x: clip; + } + width: 100vw; + } + + if (hexo-config('body_scrollbar.stable')) { + overflow-y: scroll; + } +} + +h1, h2, h3, h4, h5, h6 { + font-family: $font-family-headings; + font-weight: bold; + line-height: 1.5; + margin: 30px 0 15px; +} + +for $headline in (1 .. 6) { + h{$headline} { + font-size: $font-size-headings-base - $font-size-headings-step * $headline; + } +} + +p { + margin: 0 0 20px; +} + +a { + border-bottom: 1px solid $link-decoration-color; + color: var(--link-color); + // For a:not(:any-link) + cursor: pointer; + outline: 0; + text-decoration: none; + word-wrap(); + + &:hover { + border-bottom-color: var(--link-hover-color); + color: var(--link-hover-color); + } +} + +iframe, img, video, embed { + display: block; + margin-left: auto; + margin-right: auto; + max-width: 100%; +} + +hr { + background-image: repeating-linear-gradient(-45deg, $grey-lighter, $grey-lighter 4px, transparent 4px, transparent 8px); + border: 0; + height: 3px; + margin: 40px 0; +} + +blockquote { + border-left: 4px solid $grey-lighter; + color: var(--blockquote-color); + margin: 0; + padding: 0 15px; + + cite::before { + content: '-'; + padding: 0 5px; + } +} + +dt { + font-weight: bold; +} + +dd { + margin: 0; + padding: 0; +} diff --git a/themes/next/source/css/_common/scaffolding/buttons.styl b/themes/next/source/css/_common/scaffolding/buttons.styl new file mode 100644 index 0000000..a54372f --- /dev/null +++ b/themes/next/source/css/_common/scaffolding/buttons.styl @@ -0,0 +1,26 @@ +.btn { + background: var(--btn-default-bg); + border: 2px solid var(--btn-default-border-color); + border-radius: $btn-default-radius; + color: var(--btn-default-color); + display: inline-block; + font-size: $font-size-small; + line-height: 2; + padding: 0 20px; + transition: background-color $transition-ease; + + &:hover { + background: var(--btn-default-hover-bg); + border-color: var(--btn-default-hover-border-color); + color: var(--btn-default-hover-color); + } + + + .btn { + margin: 0 0 8px 8px; + } + + .fa-fw { + text-align: left; + width: (18em / 14); + } +} diff --git a/themes/next/source/css/_common/scaffolding/comments.styl b/themes/next/source/css/_common/scaffolding/comments.styl new file mode 100644 index 0000000..8ace888 --- /dev/null +++ b/themes/next/source/css/_common/scaffolding/comments.styl @@ -0,0 +1,39 @@ +.comments { + margin-top: 60px; + overflow: hidden; +} + +.comment-button-group { + display: flex; + flex-wrap: wrap-reverse; + justify-content: center; + margin: 1em 0; + + .comment-button { + margin: .1em .2em; + + &.active { + background: var(--btn-default-hover-bg); + border-color: var(--btn-default-hover-border-color); + color: var(--btn-default-hover-color); + } + } +} + +.comment-position { + display: none; + + &.active { + display: block; + } +} + +.tabs-comment { + margin-top: 4em; + padding-top: 0; + + .comments { + margin-top: 0; + padding-top: 0; + } +} diff --git a/themes/next/source/css/_common/scaffolding/highlight/copy-code.styl b/themes/next/source/css/_common/scaffolding/highlight/copy-code.styl new file mode 100644 index 0000000..ce42dc1 --- /dev/null +++ b/themes/next/source/css/_common/scaffolding/highlight/copy-code.styl @@ -0,0 +1,59 @@ +.highlight:hover .copy-btn, .code-container:hover .copy-btn { + opacity: 1; +} + +.code-container { + position: relative; +} + +.copy-btn { + color: $black-dim; + cursor: pointer; + line-height: 1.6; + opacity: 0; + padding: 2px 6px; + position: absolute; + transition: opacity $transition-ease; + + if (hexo-config('codeblock.copy_button.style') == 'flat') { + background: white; + border: 0; + font-size: $font-size-smaller; + right: 0; + top: 0; + } else if (hexo-config('codeblock.copy_button.style') == 'mac') { + color: var(--highlight-foreground); + font-size: 14px; + right: 0; + top: 2px; + } else { + background-color: $gainsboro; + background-image: linear-gradient(#fcfcfc, $gainsboro); + border: 1px solid #d5d5d5; + border-radius: 3px; + font-size: $font-size-smaller; + right: 4px; + top: 8px; + } +} + +if (hexo-config('codeblock.copy_button.style') == 'mac') { + figure.highlight { + border-radius: 5px; + box-shadow: 0 10px 30px 0 rgba(0, 0, 0, .4); + padding-top: 30px; + + .table-container { + border-radius: 0 0 5px 5px; + } + + &::before { + background: #fc625d; + box-shadow: 20px 0 #fdbc40, 40px 0 #35cd4b; + left: 12px; + margin-top: -20px; + position: absolute; + round-icon(12px); + } + } +} diff --git a/themes/next/source/css/_common/scaffolding/highlight/fold.styl b/themes/next/source/css/_common/scaffolding/highlight/fold.styl new file mode 100644 index 0000000..5168e76 --- /dev/null +++ b/themes/next/source/css/_common/scaffolding/highlight/fold.styl @@ -0,0 +1,29 @@ +.expand-btn { + bottom: 0; + color: var(--highlight-foreground); + cursor: pointer; + display: none; + left: 0; + right: 0; + position: absolute; + text-align: center; +} + +.fold-cover { + background-image: linear-gradient(to top, var(--highlight-background) 0, rgba(0, 0, 0, 0) 100%); + bottom: 0; + display: none; + height: 50px; + left: 0; + right: 0; + position: absolute; +} + +.highlight-fold { + max-height: unit(hexo-config('codeblock.fold.height'), 'px'); + overflow-y: hidden !important; + + .expand-btn, .fold-cover { + display: block; + } +} diff --git a/themes/next/source/css/_common/scaffolding/highlight/index.styl b/themes/next/source/css/_common/scaffolding/highlight/index.styl new file mode 100644 index 0000000..3115966 --- /dev/null +++ b/themes/next/source/css/_common/scaffolding/highlight/index.styl @@ -0,0 +1,146 @@ +// Use `@require` to fix issue #67 +@require hexo-config('highlight.light.file') if (hexo-config('highlight.enable') && hexo-config('highlight.light.file')); +if (hexo-config('prism.enable')) { + @require hexo-config('prism.light') if (hexo-config('prism.light')); + @require hexo-config('prism.number') if (hexo-config('prism.number')); +} + +if (hexo-config('darkmode')) { + @media (prefers-color-scheme: dark) { + @require hexo-config('highlight.dark.file') if (hexo-config('highlight.enable') && hexo-config('highlight.dark.file')); + @require hexo-config('prism.dark') if (hexo-config('prism.enable') && hexo-config('prism.dark')); + } +} + +@require 'copy-code' if (hexo-config('codeblock.copy_button.enable')); +@require 'fold' if (hexo-config('codeblock.fold.enable')); + +// Placeholder: $code-inline $code-block +$code-inline { + background: var(--highlight-background); + color: var(--highlight-foreground); +} + +$code-block { + @extend $code-inline; + line-height: $line-height-code-block; + margin: 0 auto 20px; +} + +$figcaption { + background: var(--highlight-gutter-background); + color: var(--highlight-foreground); + display: flow-root; + font-size: $table-font-size; + line-height: 1.2; + padding: .5em; + + a { + color: var(--highlight-foreground); + float: right; + + &:hover { + border-bottom-color: var(--highlight-foreground); + } + } +} + +pre, code { + font-family: $code-font-family; +} + +code { + @extend $code-inline; + border-radius: 3px; + font-size: $table-font-size; + padding: 2px 4px; + word-wrap(); +} + +kbd { + @extend $code-inline; + border: 2px solid $grey-light; + border-radius: .2em; + box-shadow: .1em .1em .2em rgba(0, 0, 0, .1); + font-family: inherit; + padding: .1em .3em; + white-space: nowrap; +} + +// `highlight.line_number: false` and `highlight.wrap: false` +// in Hexo config generates code.highlight elements +figure.highlight { + @extend $code-block; + // Reduce DOM reflow with wrapTableWithBox + overflow: auto; + position: relative; + + pre { + border: 0; + margin: 0; + padding: 10px 0; + } + + table { + border: 0; + margin: 0; + width: auto; + } + + td { + border: 0; + padding: 0; + } + + figcaption { + @extend $figcaption; + } + + .gutter { + disable-user-select(); + + pre { + background: var(--highlight-gutter-background); + color: var(--highlight-gutter-foreground); + padding-left: 10px; + padding-right: 10px; + text-align: right; + } + } + + .code pre { + padding-left: 10px; + width: 100%; + } + + // See https://github.com/next-theme/hexo-theme-next/discussions/410 + .marked { + background: rgba(0, 0, 0, .3); + } +} + +// See https://github.com/hexojs/hexo-util/pull/229 +pre .caption, pre figcaption { + @extend $figcaption; + margin-bottom: 10px; +} + +.gist table { + width: auto; + + td { + border: 0; + } +} + +pre { + @extend $code-block; + overflow: auto; + padding: 10px; + + code { + background: none; + padding: 0; + text-shadow: none; + } +} diff --git a/themes/next/source/css/_common/scaffolding/index.styl b/themes/next/source/css/_common/scaffolding/index.styl new file mode 100644 index 0000000..aec7a8d --- /dev/null +++ b/themes/next/source/css/_common/scaffolding/index.styl @@ -0,0 +1,12 @@ +// +// Scaffolding +// ================================================== +@import 'normalize'; +@import 'base'; +@import 'tables'; +@import 'buttons'; +@import 'toggles'; +@import 'highlight'; +@import 'tags'; +@import 'pagination'; +@import 'comments'; diff --git a/themes/next/source/css/_common/scaffolding/normalize.styl b/themes/next/source/css/_common/scaffolding/normalize.styl new file mode 100644 index 0000000..beb43cf --- /dev/null +++ b/themes/next/source/css/_common/scaffolding/normalize.styl @@ -0,0 +1,289 @@ +/* normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ +/* Document +========================================================================== */ +/** + * 1. Correct the line height in all browsers. + * 2. Prevent adjustments of font size after orientation changes in iOS. + */ +html { + line-height: 1.15; /* 1 */ + -webkit-text-size-adjust: 100%; /* 2 */ +} + +/* Sections +========================================================================== */ +/** + * Remove the margin in all browsers. + */ +body { + margin: 0; +} + +/** + * Render the `main` element consistently in IE. + */ +main { + display: block; +} + +/** + * Correct the font size and margin on `h1` elements within `section` and + * `article` contexts in Chrome, Firefox, and Safari. + */ +h1 { + font-size: 2em; + margin: .67em 0; +} + +/* Grouping content +========================================================================== */ +/** + * 1. Add the correct box sizing in Firefox. + * 2. Show the overflow in Edge and IE. + */ +hr { + box-sizing: content-box; /* 1 */ + height: 0; /* 1 */ + overflow: visible; /* 2 */ +} + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ +pre { + font-family: monospace, monospace; /* 1 */ + font-size: 1em; /* 2 */ +} + +/* Text-level semantics +========================================================================== */ +/** + * Remove the gray background on active links in IE 10. + */ +a { + background: transparent; +} + +/** + * 1. Remove the bottom border in Chrome 57- + * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. + */ +abbr[title] { + border-bottom: none; /* 1 */ + text-decoration: underline; /* 2 */ + text-decoration: underline dotted; /* 2 */ +} + +/** + * Add the correct font weight in Chrome, Edge, and Safari. + */ +b, strong { + font-weight: bolder; +} + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ +code, kbd, samp { + font-family: monospace, monospace; /* 1 */ + font-size: 1em; /* 2 */ +} + +/** + * Add the correct font size in all browsers. + */ +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` elements from affecting the line height in + * all browsers. + */ +sub, sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sub { + bottom: -.25em; +} + +sup { + top: -.5em; +} + +/* Embedded content +========================================================================== */ +/** + * Remove the border on images inside links in IE 10. + */ +img { + border-style: none; +} + +/* Forms +========================================================================== */ +/** + * 1. Change the font styles in all browsers. + * 2. Remove the margin in Firefox and Safari. + */ +button, input, optgroup, select, textarea { + font-family: inherit; /* 1 */ + font-size: 100%; /* 1 */ + line-height: 1.15; /* 1 */ + margin: 0; /* 2 */ +} + +/** + * Show the overflow in IE. + * 1. Show the overflow in Edge. + */ +button, input { + /* 1 */ + overflow: visible; +} + +/** + * Remove the inheritance of text transform in Edge, Firefox, and IE. + * 1. Remove the inheritance of text transform in Firefox. + */ +button, select { + /* 1 */ + text-transform: none; +} + +/** + * Correct the inability to style clickable types in iOS and Safari. + */ +button, [type='button'], [type='reset'], [type='submit'] { + -webkit-appearance: button; +} + +/** + * Remove the inner border and padding in Firefox. + */ +button::-moz-focus-inner, [type='button']::-moz-focus-inner, [type='reset']::-moz-focus-inner, [type='submit']::-moz-focus-inner { + border-style: none; + padding: 0; +} + +/** + * Restore the focus styles unset by the previous rule. + */ +button:-moz-focusring, [type='button']:-moz-focusring, [type='reset']:-moz-focusring, [type='submit']:-moz-focusring { + outline: 1px dotted ButtonText; +} + +/** + * Correct the padding in Firefox. + */ +fieldset { + padding: .35em .75em .625em; +} + +/** + * 1. Correct the text wrapping in Edge and IE. + * 2. Correct the color inheritance from `fieldset` elements in IE. + * 3. Remove the padding so developers are not caught out when they zero out + * `fieldset` elements in all browsers. + */ +legend { + box-sizing: border-box; /* 1 */ + color: inherit; /* 2 */ + display: table; /* 1 */ + max-width: 100%; /* 1 */ + padding: 0; /* 3 */ + white-space: normal; /* 1 */ +} + +/** + * Add the correct vertical alignment in Chrome, Firefox, and Opera. + */ +progress { + vertical-align: baseline; +} + +/** + * Remove the default vertical scrollbar in IE 10+. + */ +textarea { + overflow: auto; +} + +/** + * 1. Add the correct box sizing in IE 10. + * 2. Remove the padding in IE 10. + */ +[type='checkbox'], [type='radio'] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * Correct the cursor style of increment and decrement buttons in Chrome. + */ +[type='number']::-webkit-inner-spin-button, [type='number']::-webkit-outer-spin-button { + height: auto; +} + +/** + * 1. Correct the odd appearance in Chrome and Safari. + * 2. Correct the outline style in Safari. + */ +[type='search'] { + outline-offset: -2px; /* 2 */ + -webkit-appearance: textfield; /* 1 */ +} + +/** + * Remove the inner padding in Chrome and Safari on macOS. + */ +[type='search']::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * 1. Correct the inability to style clickable types in iOS and Safari. + * 2. Change font properties to `inherit` in Safari. + */ +::-webkit-file-upload-button { + font: inherit; /* 2 */ + -webkit-appearance: button; /* 1 */ +} + +/* Interactive +========================================================================== */ +/* + * Add the correct display in Edge, IE 10+, and Firefox. + */ +details { + display: block; +} + +/* + * Add the correct display in all browsers. + */ +summary { + display: list-item; +} + +/* Misc +========================================================================== */ +/** + * Add the correct display in IE 10+. + */ +template { + display: none; +} + +/** + * Add the correct display in IE 10. + */ +[hidden] { + display: none; +} diff --git a/themes/next/source/css/_common/scaffolding/pagination.styl b/themes/next/source/css/_common/scaffolding/pagination.styl new file mode 100644 index 0000000..8399354 --- /dev/null +++ b/themes/next/source/css/_common/scaffolding/pagination.styl @@ -0,0 +1,55 @@ +$page-number-basic { + display: inline-block; + margin: -1px 10px 0; + padding: 0 10px; + + +mobile() { + margin: 0 5px; + } +} + +$page-number-current { + background: $pagination-active-bg; + border-color: $pagination-active-border; + color: $pagination-active-color; +} + +.pagination { + border-top: 1px solid $pagination-border; + margin: 120px 0 0; + text-align: $scheme-text-align; + + .prev, .next, .page-number { + @extend $page-number-basic; + border-bottom: 0; + border-top: 1px solid $pagination-link-border; + transition: border-color $transition-ease; + + &:hover { + border-top-color: $pagination-link-hover-border; + } + } + + +mobile() { + border-top: 0; + + .prev, .next, .page-number { + border-bottom: 1px solid $pagination-link-border; + border-top: 0; + + &:hover { + border-bottom-color: $pagination-link-hover-border; + } + } + } + + .space { + @extend $page-number-basic; + margin: 0; + padding: 0; + } + + .page-number.current { + @extend $page-number-current; + } +} diff --git a/themes/next/source/css/_common/scaffolding/tables.styl b/themes/next/source/css/_common/scaffolding/tables.styl new file mode 100644 index 0000000..9f1e866 --- /dev/null +++ b/themes/next/source/css/_common/scaffolding/tables.styl @@ -0,0 +1,39 @@ +.table-container { + overflow: auto; +} + +table { + border-collapse: collapse; + border-spacing: 0; + font-size: $table-font-size; + margin: 0 0 20px; + width: 100%; +} + +tbody tr { + &:nth-of-type(odd) { + background: var(--table-row-odd-bg-color); + } + + &:hover { + background: var(--table-row-hover-bg-color); + } +} + +caption, th, td { + padding: 8px; +} + +th, td { + border: 1px solid $table-border-color; + border-bottom: 3px solid $table-cell-border-bottom-color; +} + +th { + font-weight: 700; + padding-bottom: 10px; +} + +td { + border-bottom-width: 1px; +} diff --git a/themes/next/source/css/_common/scaffolding/tags/blockquote-center.styl b/themes/next/source/css/_common/scaffolding/tags/blockquote-center.styl new file mode 100644 index 0000000..f391a6b --- /dev/null +++ b/themes/next/source/css/_common/scaffolding/tags/blockquote-center.styl @@ -0,0 +1,34 @@ +// Blockquote with all children centered. +.blockquote-center { + border-left: 0; + margin: 40px 0; + padding: 0; + position: relative; + text-align: center; + + &::before, &::after { + left: 0; + line-height: 1; + opacity: .6; + position: absolute; + width: 100%; + } + + &::before { + border-top: 1px solid $grey-light; + text-align: left; + top: -20px; + font-family-icons('\f10d'); + } + + &::after { + border-bottom: 1px solid $grey-light; + bottom: -20px; + text-align: right; + font-family-icons('\f10e'); + } + + p, div { + text-align: center; + } +} diff --git a/themes/next/source/css/_common/scaffolding/tags/group-pictures.styl b/themes/next/source/css/_common/scaffolding/tags/group-pictures.styl new file mode 100644 index 0000000..3d314b1 --- /dev/null +++ b/themes/next/source/css/_common/scaffolding/tags/group-pictures.styl @@ -0,0 +1,20 @@ +.group-picture { + margin-bottom: 20px; + + .group-picture-row { + display: flex; + gap: 3px; + margin-bottom: 3px; + } + + .group-picture-column { + flex: 1; + + img { + height: 100%; + margin: 0; + object-fit: cover; + width: 100%; + } + } +} diff --git a/themes/next/source/css/_common/scaffolding/tags/index.styl b/themes/next/source/css/_common/scaffolding/tags/index.styl new file mode 100644 index 0000000..1fe49fc --- /dev/null +++ b/themes/next/source/css/_common/scaffolding/tags/index.styl @@ -0,0 +1,9 @@ +@import 'blockquote-center'; +@import 'group-pictures'; +@import 'label'; +@import 'link-grid'; +@import 'mermaid'; +@import 'wavedrom'; +@import 'note'; +@import 'pdf'; +@import 'tabs'; diff --git a/themes/next/source/css/_common/scaffolding/tags/label.styl b/themes/next/source/css/_common/scaffolding/tags/label.styl new file mode 100644 index 0000000..032f54a --- /dev/null +++ b/themes/next/source/css/_common/scaffolding/tags/label.styl @@ -0,0 +1,10 @@ +.post-body .label { + color: $text-color; + padding: 0 2px; + + for $type in $note-types { + &.{$type} { + background: $label[$type]; + } + } +} diff --git a/themes/next/source/css/_common/scaffolding/tags/link-grid.styl b/themes/next/source/css/_common/scaffolding/tags/link-grid.styl new file mode 100644 index 0000000..1c736af --- /dev/null +++ b/themes/next/source/css/_common/scaffolding/tags/link-grid.styl @@ -0,0 +1,113 @@ +.post-body .link-grid { + display: grid; + // https://caniuse.com/mdn-css_properties_gap_grid_context + grid-gap: 1.5rem; + gap: 1.5rem; + grid-template-columns: 1fr 1fr; + margin-bottom: 20px; + padding: 1rem; + + +mobile() { + grid-template-columns: 1fr; + } + + .link-grid-container { + border: solid $grey-lighter; + box-shadow: 1rem 1rem .5rem rgba(0, 0, 0, .5); + min-height: 5rem; + // Fix issue #30 + min-width: 0; + padding: .5rem; + position: relative; + transition: background .3s; + + &:hover { + animation: next-shake .5s; + background: var(--card-bg-color); + } + + &:active { + box-shadow: .5rem .5rem .25rem rgba(0, 0, 0, .5); + transform: translate(.2rem, .2rem); + } + + .link-grid-image { + border: 1px solid $grey-lighter; + border-radius: 50%; + box-sizing: border-box; + height: 5rem; + padding: 3px; + position: absolute; + width: 5rem; + } + + p { + margin: 0 1rem 0 6rem; + + &:first-of-type { + font-size: 1.2em; + } + + &:last-of-type { + font-size: .8em; + line-height: 1.3rem; + opacity: .7; + } + } + + a { + border: 0; + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; + } + } +} + +@keyframes next-shake { + 0% { + transform: translate(1pt, 1pt) rotate(0deg); + } + + 10% { + transform: translate(-1pt, -2pt) rotate(-1deg); + } + + 20% { + transform: translate(-3pt, 0pt) rotate(1deg); + } + + 30% { + transform: translate(3pt, 2pt) rotate(0deg); + } + + 40% { + transform: translate(1pt, -1pt) rotate(1deg); + } + + 50% { + transform: translate(-1pt, 2pt) rotate(-1deg); + } + + 60% { + transform: translate(-3pt, 1pt) rotate(0deg); + } + + 70% { + transform: translate(3pt, 1pt) rotate(-1deg); + } + + 80% { + transform: translate(-1pt, -1pt) rotate(1deg); + } + + 90% { + transform: translate(1pt, 2pt) rotate(0deg); + } + + 100% { + transform: translate(1pt, -2pt) rotate(-1deg); + } +} diff --git a/themes/next/source/css/_common/scaffolding/tags/mermaid.styl b/themes/next/source/css/_common/scaffolding/tags/mermaid.styl new file mode 100644 index 0000000..f872c66 --- /dev/null +++ b/themes/next/source/css/_common/scaffolding/tags/mermaid.styl @@ -0,0 +1,6 @@ +if (hexo-config('mermaid.enable')) { + .mermaid { + margin-bottom: 20px; + text-align: center; + } +} diff --git a/themes/next/source/css/_common/scaffolding/tags/note.styl b/themes/next/source/css/_common/scaffolding/tags/note.styl new file mode 100644 index 0000000..fcbdfae --- /dev/null +++ b/themes/next/source/css/_common/scaffolding/tags/note.styl @@ -0,0 +1,110 @@ +if (hexo-config('note.style') != 'disabled') { + .post-body .note { + $note-icons = hexo-config('note.icons'); + $note-style = hexo-config('note.style'); + + border-radius: $note-border-radius; + margin-bottom: 20px; + padding: 1em; + position: relative; + + if ($note-style == 'simple') { + border: 1px solid $gainsboro; + border-left-width: 5px; + } + + if ($note-style == 'modern') { + background: $whitesmoke; + border: 1px solid transparent; + } + + if ($note-style == 'flat') { + background: lighten($gainsboro, 65%); + border: initial; + border-left: 3px solid $gainsboro; + } + + summary { + cursor: pointer; + outline: 0; + + p { + display: inline; + } + } + + h2, h3, h4, h5, h6 { + border-bottom: initial; + margin: 0; + padding-top: 0; + } + + :first-child { + margin-top: 0; + } + + :last-child { + margin-bottom: 0; + } + + if ($note-icons) { + &:not(.no-icon) { + padding-left: 2.5em; + + &::before { + font-size: 1.5em; + left: .3em; + position: absolute; + top: calc(50% - 1em); + } + } + } + + for $type in $note-types { + &.{$type} { + if ($note-style == 'flat') { + background: $note-bg[$type]; + if (hexo-config('darkmode')) { + @media (prefers-color-scheme: dark) { + background: mix($note-bg[$type], $body-bg-color-dark, 10%); + } + } + } + + if ($note-style == 'modern') { + background: $note-modern-bg[$type]; + border-color: $note-modern-border[$type]; + color: $note-modern-text[$type]; + + a:not(.btn) { + border-bottom-color: $note-modern-text[$type]; + color: $note-modern-text[$type]; + + &:hover { + border-bottom-color: $note-modern-hover[$type]; + color: $note-modern-hover[$type]; + } + } + } + + if ($note-style != 'modern') { + border-left-color: $note-border[$type]; + + h2, h3, h4, h5, h6 { + color: $note-text[$type]; + } + } + + if ($note-icons) { + &:not(.no-icon)::before { + font-family-icons($note-icon[$type]); + + if ($note-style != 'modern') { + color: $note-text[$type]; + } + } + } + } + } + } +} diff --git a/themes/next/source/css/_common/scaffolding/tags/pdf.styl b/themes/next/source/css/_common/scaffolding/tags/pdf.styl new file mode 100644 index 0000000..6881622 --- /dev/null +++ b/themes/next/source/css/_common/scaffolding/tags/pdf.styl @@ -0,0 +1,8 @@ +if (hexo-config('pdf.enable')) { + .pdfobject-container { + iframe, embed { + height: convert(hexo-config('pdf.height')); + width: 100%; + } + } +} diff --git a/themes/next/source/css/_common/scaffolding/tags/tabs.styl b/themes/next/source/css/_common/scaffolding/tags/tabs.styl new file mode 100644 index 0000000..f395c24 --- /dev/null +++ b/themes/next/source/css/_common/scaffolding/tags/tabs.styl @@ -0,0 +1,103 @@ +.post-body .tabs { + margin-bottom: 20px; +} + +.post-body .tabs, .tabs-comment { + padding-top: 10px; + + ul.nav-tabs { + background: (($scheme == 'Muse') or ($scheme == 'Mist')) ? var(--body-bg-color) : var(--content-bg-color); + display: flex; + flex-wrap: wrap; + margin: 0; + padding: 0; + position: -webkit-sticky; + position: sticky; + top: 0; + // Fix issue #398 + z-index: $zindex-0; + + +mobile-smallest() { + display: block; + margin-bottom: 5px; + } + + li.tab { + border-bottom: 1px solid $grey-lighter; + border-left: 1px solid transparent; + border-right: 1px solid transparent; + border-radius: $tbr $tbr 0 0; + border-top: 3px solid transparent; + flex-grow: 1; + list-style-type: none; + + +mobile-smallest() { + border-bottom: 1px solid transparent; + border-left: 3px solid transparent; + border-right: 1px solid transparent; + border-top: 1px solid transparent; + } + + +mobile-smallest() { + border-radius: $tbr; + } + + if (hexo-config('tabs.transition.tabs')) { + transition: all $transition-ease-out; + } + + a { + border-bottom: initial; + display: block; + line-height: 1.8; + padding: .25em .75em; + text-align: center; + + i[class^='fa'] { + width: (18em / 14); + } + + if (hexo-config('tabs.transition.labels')) { + transition: all $transition-ease-out; + } + } + + &.active { + border-bottom-color: transparent; + border-left-color: $table-border-color; + border-right-color: $table-border-color; + border-top-color: $orange; + + +mobile-smallest() { + border-bottom-color: $table-border-color; + border-left-color: $orange; + border-right-color: $table-border-color; + border-top-color: $table-border-color; + } + + a { + cursor: default; + } + } + } + } + + .tab-content { + border: 1px solid $table-border-color; + border-radius: 0 0 $tbr $tbr; + border-top-color: transparent; + + +mobile-smallest() { + border-radius: $tbr; + border-top-color: $table-border-color; + } + + .tab-pane { + padding: 20px 20px 0; + + &:not(.active) { + display: none; + } + } + } +} diff --git a/themes/next/source/css/_common/scaffolding/tags/wavedrom.styl b/themes/next/source/css/_common/scaffolding/tags/wavedrom.styl new file mode 100644 index 0000000..42e1914 --- /dev/null +++ b/themes/next/source/css/_common/scaffolding/tags/wavedrom.styl @@ -0,0 +1,6 @@ +if (hexo-config('wavedrom.enable')) { + .wavedrom { + margin-bottom: 20px; + text-align: center; + } +} diff --git a/themes/next/source/css/_common/scaffolding/toggles.styl b/themes/next/source/css/_common/scaffolding/toggles.styl new file mode 100644 index 0000000..163bd9e --- /dev/null +++ b/themes/next/source/css/_common/scaffolding/toggles.styl @@ -0,0 +1,30 @@ +.toggle { + line-height: 0; + + .toggle-line { + background: white; + display: block; + height: 2px; + left: 0; + position: relative; + top: 0; + transition: all .4s; + width: 100%; + + &:first-child { + margin-top: 1px; + } + + &:not(:first-child) { + margin-top: 4px; + } + } +} + +.toggle.toggle-arrow { + toggle-arrow(hexo-config('sidebar.position')); +} + +.toggle.toggle-close { + toggle-close(hexo-config('sidebar.position')); +} diff --git a/themes/next/source/css/_mixins.styl b/themes/next/source/css/_mixins.styl new file mode 100644 index 0000000..2cb0470 --- /dev/null +++ b/themes/next/source/css/_mixins.styl @@ -0,0 +1,274 @@ +mobile-smallest() { + @media (max-width: 413px) { + {block}; + } +} + +mobile-small() { + @media (max-width: 567px) { + {block}; + } +} + +mobile() { + @media (max-width: 767px) { + {block}; + } +} + +tablet-mobile() { + @media (max-width: 991px) { + {block}; + } +} + +tablet-desktop() { + @media (min-width: 768px) { + {block}; + } +} + +tablet() { + @media (min-width: 768px) and (max-width: 991px) { + {block}; + } +} + +desktop() { + @media (min-width: 992px) { + {block}; + } +} + +desktop-large() { + @media (min-width: 1200px) { + {block}; + } +} + +desktop-largest() { + @media (min-width: 1600px) { + {block}; + } +} + +random-color($min, $max) { + return floor(math(0, 'random') * ($max - $min + 1) + $min); +} + +word-wrap() { + overflow-wrap: break-word; +} + +disable-user-select() { + -moz-user-select: none; + -ms-user-select: none; + -webkit-user-select: none; + user-select: none; +} + +sidebar-inline-links-item() { + margin: 5px 0 0; + + a { + box-sizing: border-box; + display: inline-block; + max-width: 100%; + overflow: hidden; + padding: 0 5px; + text-overflow: ellipsis; + white-space: nowrap; + } +} + +flex-wrap() { + display: flex; + flex-wrap: wrap; + justify-content: center; +} + +flex-column() { + display: flex; + flex-direction: column; + justify-content: center; +} + +post-card() { + background: var(--card-bg-color); + border-left: 3px solid $red; + margin: $post-card-margin; +} + +font-family-icons($icon = '') { + if ($icon) { + content: $icon; + } + font-family: 'Font Awesome 6 Free'; + font-weight: 900; +} + +main-container() { + margin: 0 auto; + width: $content-desktop; + + +mobile() { + width: auto; + } + + +desktop-large() { + width: $content-desktop-large; + } + + +desktop-largest() { + width: $content-desktop-largest; + } +} + +sidebar-toggle-alignment($reverse) { + $condition = hexo-config('sidebar.position') == 'right'; + if (($scheme == 'Muse') or ($scheme == 'Mist')) { + $condition = $condition == $reverse; + } + return $condition ? ('left' 'right') : ('right' 'left'); +} + +sidebar-toggle-position($reverse) { + $alignment = sidebar-toggle-alignment($reverse)[0]; + {$alignment}: $b2t-position-right; + +tablet-mobile() { + {$alignment}: $b2t-position-right-mobile; + } +} + +sidebar-toggle() { + background: $b2t-bg-color; + cursor: pointer; + opacity: $b2t-opacity; + position: fixed; + z-index: $zindex-3; + sidebar-toggle-position(false); + + &:hover { + opacity: $b2t-opacity-hover; + } + + +tablet-mobile() { + opacity: $b2t-opacity-hover; + } +} + +round-icon($diameter) { + border-radius: 50%; + content: ' '; + height: $diameter; + width: $diameter; +} + +toggle-arrow($position) { + if ($position == 'right') { + :first-child { + top: 2px; + transform: rotate(-45deg); + width: 50%; + } + + :last-child { + top: -2px; + transform: rotate(45deg); + width: 50%; + } + } else { + :first-child { + left: 50%; + top: 2px; + transform: rotate(45deg); + width: 50%; + } + + :last-child { + left: 50%; + top: -2px; + transform: rotate(-45deg); + width: 50%; + } + } +} + +toggle-close($position) { + :nth-child(2) { + opacity: 0; + } + + if ($position == 'right') { + :first-child { + top: 6px; + transform: rotate(-45deg); + } + + :last-child { + top: -6px; + transform: rotate(45deg); + } + } else { + :first-child { + top: 6px; + transform: rotate(45deg); + } + + :last-child { + top: -6px; + transform: rotate(-45deg); + } + } +} + +site-nav-hide-by-default() { + --scroll-height: 0; + height: 0; + overflow: hidden; + transition: $transition-ease; + transition-property: height, visibility; + visibility: hidden; + + body:not(.site-nav-on) & .animated { + animation: none; + } + + body.site-nav-on & { + height: var(--scroll-height); + visibility: unset; + } +} + +button($color) { + background: transparent; + color: $color; + cursor: pointer; + line-height: 2; + padding: 0 15px; + + &:hover { + background: $color; + color: white; + } +} + +gemini-block() { + background: var(--content-bg-color); + border-radius: $border-radius-inner; + box-shadow: $box-shadow-inner; +} + +gemini-block-not-first() { + border-radius: $border-radius; + box-shadow: $box-shadow; + margin-top: $sidebar-offset; + + +tablet() { + margin-top: $content-tablet-padding; + } + + +mobile() { + margin-top: $content-mobile-padding; + } +} diff --git a/themes/next/source/css/_schemes/Gemini/index.styl b/themes/next/source/css/_schemes/Gemini/index.styl new file mode 100644 index 0000000..7077ed7 --- /dev/null +++ b/themes/next/source/css/_schemes/Gemini/index.styl @@ -0,0 +1,124 @@ +@import '../Pisces/_layout'; +@import '../Pisces/_header'; +@import '../Pisces/_menu'; +@import '../Pisces/_sub-menu'; +@import '../Pisces/_sidebar'; + +// ================================================== +// Rewrite _layout.styl +// ================================================== +// Sidebar padding used as main desktop content padding for sidebar padding and post blocks padding too. + +// In `source/css/_variables/Pisces.styl` there are variable for main offset: +// $sidebar-offset = 12px; +// This value alse can be changed in main NexT config as `sidebar: offset: 12` option. + +// In `source/css/_variables/base.styl` there are variables for other resolutions: +// $content-tablet-padding = 10px; +// $content-mobile-padding = 8px; +// P.S. If u want to change this paddings u may set this variables into `custom_file_path.variable` (in theme _config.yml). + +// So, it will 12px in Desktop, 10px in Tablets and 8px in Mobiles for all possible paddings. + +// ================================================== +// Desktop layout styles. +// ================================================== +// Post blocks. +.main-inner { + .sub-menu, .post-block, .tabs-comment, & > .comments, .comment-position .comments, .pagination { + gemini-block(); + } + + .post-block:not(:first-child) { + &:not(:first-child) { + gemini-block-not-first(); + } + } + + .tabs-comment, & > .comments, .comment-position .comments, .pagination { + gemini-block-not-first(); + } +} + +// Post & Comments blocks. +.post-block, .comments { + padding: $content-desktop-padding; +} + +// Post delimiters. +.post-eof { + display: none; +} + +// Pagination. +.pagination { + border-top: initial; + padding: 10px 0; +} + +// ================================================== +// Headers. +// ================================================== +.post-body { + h1, h2 { + border-bottom: 1px solid $body-bg-color; + } + + h3 { + border-bottom: 1px dotted $body-bg-color; + } +} + +// ================================================== +// > 768px & < 991px +// ================================================== ++tablet() { + // Posts in blocks. + .main-inner { + padding: $content-tablet-padding; + } + + .posts-expand { + // Components inside Posts. + .post-button { + margin-top: ($content-tablet-padding * 2); + } + } + + .post-block { + // Inside posts blocks content padding (default 40px). + padding: ($content-tablet-padding * 2); + } + + .comments { + padding: $content-tablet-padding ($content-tablet-padding * 2); + // padding: initial; + // padding-top: $content-tablet-padding; + } +} + +// ================================================== +// < 767px +// ================================================== ++mobile() { + // Posts in blocks. + .main-inner { + padding: $content-mobile-padding; + } + + .posts-expand { + // Components inside Posts. + .post-button { + margin: $sidebar-offset 0; + } + } + + .post-block { + // Inside posts blocks content padding (default 40px). + padding: $sidebar-offset; + } + + .comments { + padding: 10px $sidebar-offset; + } +} diff --git a/themes/next/source/css/_schemes/Mist/_header.styl b/themes/next/source/css/_schemes/Mist/_header.styl new file mode 100644 index 0000000..6573917 --- /dev/null +++ b/themes/next/source/css/_schemes/Mist/_header.styl @@ -0,0 +1,58 @@ +// Header +// -------------------------------------------------- +.column { + background: var(--content-bg-color); +} + +header.header { + align-items: center; + display: flex; + padding: 20px 0; + + +mobile() { + display: block; + padding: 10px 0; + } +} + +.site-meta { + line-height: normal; + + .brand { + +mobile() { + display: block; + } + } + + .site-title { + font-weight: bolder; + } +} + +.logo-line { + background: var(--brand-color); + display: block; + height: 2px; + margin: 0 auto; + width: 75%; + + +mobile() { + display: none; + } +} + +.use-motion { + .logo-line:first-of-type { + transform: scaleX(0); + transform-origin: left; + } + + .logo-line:last-of-type { + transform: scaleX(0); + transform-origin: right; + } +} + +.site-subtitle { + display: none; +} diff --git a/themes/next/source/css/_schemes/Mist/_layout.styl b/themes/next/source/css/_schemes/Mist/_layout.styl new file mode 100644 index 0000000..40669a7 --- /dev/null +++ b/themes/next/source/css/_schemes/Mist/_layout.styl @@ -0,0 +1,39 @@ +// Tags +// -------------------------------------------------- +hr { + height: 2px; + margin: 20px 0; +} + +// Components +// -------------------------------------------------- +.btn { + padding: 0 10px; +} + +.headband { + display: none; +} + +// Pagination +// -------------------------------------------------- +.pagination { + +mobile() { + margin: 80px 0 0; + text-align: center; + } +} + +// Footer +// -------------------------------------------------- +.footer { + background: var(--content-bg-color); + color: var(--text-color); + padding: 10px 0; +} + +.footer-inner { + +mobile() { + text-align: center; + } +} diff --git a/themes/next/source/css/_schemes/Mist/_menu.styl b/themes/next/source/css/_schemes/Mist/_menu.styl new file mode 100644 index 0000000..6c15a5a --- /dev/null +++ b/themes/next/source/css/_schemes/Mist/_menu.styl @@ -0,0 +1,45 @@ +// Menu +// -------------------------------------------------- +.site-nav { + flex-grow: 1; + + +mobile() { + padding: 0 10px 0; + } +} + +.main-menu { + +mobile() { + padding-top: 10px; + } +} + +.menu { + padding: 0; + + .menu-item { + margin: 0; + + +mobile() { + margin-top: 5px; + } + + a { + border-radius: 2px; + padding: 0 10px; + transition-property: background; + + +mobile() { + text-align: left; + } + } + + .badge { + background: white; + border-radius: 10px; + color: $black-light; + padding: 1px 4px; + text-shadow: 1px 1px 0 rgba(0, 0, 0, .1); + } + } +} diff --git a/themes/next/source/css/_schemes/Mist/_posts-expand.styl b/themes/next/source/css/_schemes/Mist/_posts-expand.styl new file mode 100644 index 0000000..8a4321a --- /dev/null +++ b/themes/next/source/css/_schemes/Mist/_posts-expand.styl @@ -0,0 +1,69 @@ +// Post Expand +// -------------------------------------------------- +.posts-expand { + &.index { + .post-header { + text-align: $scheme-text-align; + + +mobile() { + text-align: center; + } + } + + .post-meta-container { + margin-top: 5px; + } + + .post-meta { + justify-content: flex-start; + + +mobile() { + justify-content: center; + } + } + } + + .post-eof { + display: none; + } + + .post-block:not(:first-of-type) { + margin-top: 120px; + } + + .post-header { + margin-bottom: 20px; + } + + .post-tags { + a { + background: var(--content-bg-color); + border-bottom: 0; + padding: 1px 5px; + + &:hover { + background: var(--menu-item-bg-color); + } + } + } + + .post-nav { + margin-top: 40px; + } +} + +.post-button { + margin-top: 20px; + + .btn { + background: none; + border: 0; + border-bottom: 2px solid var(--btn-default-border-color); + padding: 0; + transition-property: border; + + &:hover { + border-bottom-color: var(--btn-default-hover-border-color); + } + } +} diff --git a/themes/next/source/css/_schemes/Mist/index.styl b/themes/next/source/css/_schemes/Mist/index.styl new file mode 100644 index 0000000..6969d77 --- /dev/null +++ b/themes/next/source/css/_schemes/Mist/index.styl @@ -0,0 +1,10 @@ +// +// Mist scheme +// ================================================== +@import '_layout'; +@import '_header'; +@import '_menu'; +@import '_posts-expand'; +@import '../Muse/_layout'; +@import '../Muse/_sidebar'; +@import '../Muse/_sub-menu'; diff --git a/themes/next/source/css/_schemes/Muse/_header.styl b/themes/next/source/css/_schemes/Muse/_header.styl new file mode 100644 index 0000000..e15410d --- /dev/null +++ b/themes/next/source/css/_schemes/Muse/_header.styl @@ -0,0 +1,18 @@ +.custom-logo-image { + background: white; + margin: 0 auto 10px; + max-width: 150px; + padding: 5px; +} + +.brand { + background: var(--btn-default-bg); +} + +header.header { + padding-top: 100px; + + +mobile() { + padding-top: 50px; + } +} diff --git a/themes/next/source/css/_schemes/Muse/_layout.styl b/themes/next/source/css/_schemes/Muse/_layout.styl new file mode 100644 index 0000000..1de4b7a --- /dev/null +++ b/themes/next/source/css/_schemes/Muse/_layout.styl @@ -0,0 +1,23 @@ +header.header { + main-container(); +} + +.main-inner { + main-container(); + padding-bottom: $content-padding-bottom; + + +mobile() { + padding-left: 20px; + padding-right: 20px; + } +} + +// Page - Container +// -------------------------------------------------- +.post-block:first-of-type { + padding-top: $posts-first-padding; + + +mobile() { + padding-top: $posts-first-padding-mobile; + } +} diff --git a/themes/next/source/css/_schemes/Muse/_menu.styl b/themes/next/source/css/_schemes/Muse/_menu.styl new file mode 100644 index 0000000..d583618 --- /dev/null +++ b/themes/next/source/css/_schemes/Muse/_menu.styl @@ -0,0 +1,56 @@ +.site-nav { + +mobile() { + padding-top: 30px; + } +} + +.main-menu { + +mobile() { + border-bottom: 1px solid $grey-lighter; + border-top: 1px solid $grey-lighter; + } +} + +.menu { + +mobile() { + text-align: left; + } +} + +.menu .menu-item { + +mobile() { + margin: 0 10px; + } + + a { + border-bottom: 1px solid transparent; + + +mobile() { + padding: 5px 10px; + } + + &:hover, &.menu-item-active { + background: transparent; + border-bottom: 1px solid var(--link-hover-color); + + +mobile() { + border-bottom: 1px dotted $grey-lighter; + } + } + } + + i[class^='fa'] { + +tablet-desktop() { + display: block; + line-height: 2; + margin-right: 0; + width: 100%; + } + } + + .badge { + background: $gainsboro; + color: $black-light; + padding: 1px 4px; + } +} diff --git a/themes/next/source/css/_schemes/Muse/_sidebar.styl b/themes/next/source/css/_schemes/Muse/_sidebar.styl new file mode 100644 index 0000000..87b0ef2 --- /dev/null +++ b/themes/next/source/css/_schemes/Muse/_sidebar.styl @@ -0,0 +1,134 @@ +if (hexo-config('sidebar.position') == 'right') { + .sidebar-active { + // Note: $sidebar-desktop + $content-desktop-large should be less than desktop-large threshold + // Otherwise a horizontal scrollbar will appear + +desktop-large() { + padding-right: $sidebar-desktop; + + .footer-fixed { + right: $sidebar-desktop; + } + } + } + + .sidebar { + right: 0 - $sidebar-desktop; + + .sidebar-active & { + right: 0; + } + } +} else { + .sidebar-active { + +desktop-large() { + padding-left: $sidebar-desktop; + + .footer-fixed { + left: $sidebar-desktop; + } + } + } + + .sidebar { + left: 0 - $sidebar-desktop; + + .sidebar-active & { + left: 0; + } + } +} + +.sidebar { + background: $black-deep; + bottom: 0; + if (not hexo-config('back2top.sidebar')) { + box-shadow: inset 0 2px 6px black; + } + max-height: 100vh; + overflow-y: auto; + position: fixed; + top: 0; + transition: all $transition-ease-out; + width: $sidebar-desktop; + z-index: $zindex-2; + + a { + border-bottom-color: $black-light; + color: $grey-dark; + + &:hover { + border-bottom-color: $gainsboro; + color: $gainsboro; + } + } +} + +.links-of-author { + &:not(:first-child) { + margin-top: 15px; + } + + a { + border-bottom-color: $black-light; + display: inline-block; + margin-bottom: 10px; + margin-right: 10px; + vertical-align: middle; + + if (hexo-config('social_icons.transition')) { + transition: all $transition-ease; + } + + &::before { + background: rgb(random-color(0, 255) - 50%, random-color(0, 255) - 50%, random-color(0, 255) - 50%); + display: inline-block; + margin-right: 3px; + transform: translateY(-2px); + round-icon(4px); + } + } +} + +.links-of-blogroll-item { + if (hexo-config('links_settings.layout') == 'inline') { + display: inline-block; + } + padding: 2px 10px; + + a { + box-sizing: border-box; + display: inline-block; + max-width: 280px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } +} + +.popular-posts .popular-posts-item .popular-posts-link:hover { + background: none; +} + +.sidebar-dimmer { + background: black; + height: 100%; + left: 0; + opacity: 0; + position: fixed; + top: 0; + transition: visibility .4s, opacity .4s; + visibility: hidden; + width: 100%; + z-index: $zindex-1; + + .sidebar-active & { + opacity: .7; + visibility: visible; + } +} + ++desktop-large() { + .sidebar-dimmer { + display: none; + } +} diff --git a/themes/next/source/css/_schemes/Muse/_sub-menu.styl b/themes/next/source/css/_schemes/Muse/_sub-menu.styl new file mode 100644 index 0000000..59bf193 --- /dev/null +++ b/themes/next/source/css/_schemes/Muse/_sub-menu.styl @@ -0,0 +1,7 @@ +.sub-menu { + margin: 10px 0; + + .menu-item { + display: inline-block; + } +} diff --git a/themes/next/source/css/_schemes/Muse/index.styl b/themes/next/source/css/_schemes/Muse/index.styl new file mode 100644 index 0000000..959b7ae --- /dev/null +++ b/themes/next/source/css/_schemes/Muse/index.styl @@ -0,0 +1,5 @@ +@import '_layout'; +@import '_header'; +@import '_menu'; +@import '_sub-menu'; +@import '_sidebar'; diff --git a/themes/next/source/css/_schemes/Pisces/_header.styl b/themes/next/source/css/_schemes/Pisces/_header.styl new file mode 100644 index 0000000..6716886 --- /dev/null +++ b/themes/next/source/css/_schemes/Pisces/_header.styl @@ -0,0 +1,35 @@ +.column { + width: $sidebar-desktop; + + +tablet-mobile() { + width: auto; + } +} + +.site-brand-container { + background: var(--theme-color); + + .site-nav-on & { + +tablet-mobile() { + box-shadow: 0 0 16px rgba(0, 0, 0, .5); + } + } +} + +.site-meta { + padding: 20px 0; +} + +.site-nav-toggle, .site-nav-right { + +tablet() { + flex-column(); + } + + .toggle { + color: white; + + .toggle-line { + background: white; + } + } +} diff --git a/themes/next/source/css/_schemes/Pisces/_layout.styl b/themes/next/source/css/_schemes/Pisces/_layout.styl new file mode 100644 index 0000000..2d74dc7 --- /dev/null +++ b/themes/next/source/css/_schemes/Pisces/_layout.styl @@ -0,0 +1,50 @@ +header.header { + gemini-block(); + + +tablet-mobile() { + border-radius: initial; + } +} + +.main { + // Make sure that .header and .main-inner are the same height + // Required for .sidebar `position: sticky;` + align-items: stretch; + display: flex; + justify-content: space-between; + main-container(); + + if (hexo-config('sidebar.position') == 'right') { + flex-direction: row-reverse; + } + + +tablet-mobile() { + display: block; + width: auto; + } +} + +.main-inner { + border-radius: $border-radius-inner; + box-sizing: border-box; + width: $content-wrap; + + +tablet-mobile() { + border-radius: initial; + width: 100%; + } +} + +.footer-inner { + if (hexo-config('sidebar.position') == 'right') { + padding-right: $sidebar-desktop + $sidebar-offset; + } else { + padding-left: $sidebar-desktop + $sidebar-offset; + } + + +tablet-mobile() { + padding-left: 0; + padding-right: 0; + width: auto; + } +} diff --git a/themes/next/source/css/_schemes/Pisces/_menu.styl b/themes/next/source/css/_schemes/Pisces/_menu.styl new file mode 100644 index 0000000..79b1c20 --- /dev/null +++ b/themes/next/source/css/_schemes/Pisces/_menu.styl @@ -0,0 +1,46 @@ +.site-nav { + +tablet() { + site-nav-hide-by-default(); + } +} + +.menu .menu-item { + display: block; + margin: 0; + + a { + padding: 5px 20px; + position: relative; + text-align: left; + transition-property: background-color; + } + + +tablet-mobile() { + &.menu-item-search { + display: none; + } + } + + .badge { + background: $grey-light; + border-radius: 10px; + color: var(--content-bg-color); + float: right; + padding: 2px 5px; + text-shadow: 1px 1px 0 rgba(0, 0, 0, .1); + } +} + +if (not hexo-config('menu_settings.badges')) { + .main-menu .menu-item-active::after { + background: $grey; + border-radius: 50%; + content: ' '; + height: 6px; + margin-top: -3px; + position: absolute; + right: 15px; + top: 50%; + width: 6px; + } +} diff --git a/themes/next/source/css/_schemes/Pisces/_sidebar.styl b/themes/next/source/css/_schemes/Pisces/_sidebar.styl new file mode 100644 index 0000000..2ce83a7 --- /dev/null +++ b/themes/next/source/css/_schemes/Pisces/_sidebar.styl @@ -0,0 +1,88 @@ +.sidebar { + // https://caniuse.com/css-sticky + position: -webkit-sticky; + position: sticky; + top: $sidebar-offset; + + +tablet-mobile() { + display: none; + } +} + +.sidebar-inner { + background: var(--content-bg-color); + border-radius: $border-radius; + box-shadow: $box-shadow; + box-sizing: border-box; + color: var(--text-color); + margin-top: $sidebar-offset; + max-height: 'calc(100vh - %s)' % unit($sidebar-offset * 2, 'px'); + + if (hexo-config('motion.enable') and hexo-config('motion.transition.sidebar')) { + visibility: hidden; + } +} + +.site-state-item { + padding: 0 10px; +} + +.sidebar .sidebar-button { + border-bottom: 1px dotted $grey-light; + border-top: 1px dotted $grey-light; + + button { + border: 0; + color: $orange; + display: block; + width: 100%; + + &:hover { + background: none; + border: 0; + color: darken($orange, 20%); + } + } +} + +.links-of-author { + flex-wrap(); +} + +.links-of-author-item { + sidebar-inline-links-item(); + + if (not hexo-config('social_icons.icons_only')) { + width: 50%; + } + + a { + border-bottom: 0; + border-radius: 4px; + display: block; + + &:hover { + background: var(--body-bg-color); + } + } +} + +.links-of-blogroll-item { + if (hexo-config('links_settings.layout') == 'inline') { + display: inline-block; + max-width: 100%; + sidebar-inline-links-item(); + } +} + +if (hexo-config('back2top.sidebar')) { + // Only when back2top.sidebar is true, apply the following styles + .back-to-top { + background: var(--body-bg-color); + margin: 8px - $sidebar-offset -10px -18px; + + &.back-to-top-on { + margin-top: 16px; + } + } +} diff --git a/themes/next/source/css/_schemes/Pisces/_sub-menu.styl b/themes/next/source/css/_schemes/Pisces/_sub-menu.styl new file mode 100644 index 0000000..166f600 --- /dev/null +++ b/themes/next/source/css/_schemes/Pisces/_sub-menu.styl @@ -0,0 +1,28 @@ +.sub-menu { + margin: 0; + padding: 6px 0; + + .menu-item { + display: inline-block; + + a { + background: transparent; + margin: 5px 10px; + padding: initial; + + &:hover { + background: transparent; + color: $sidebar-highlight; + } + } + } + + .menu-item-active { + border-bottom-color: $sidebar-highlight; + color: $sidebar-highlight; + + &:hover { + border-bottom-color: $sidebar-highlight; + } + } +} diff --git a/themes/next/source/css/_schemes/Pisces/index.styl b/themes/next/source/css/_schemes/Pisces/index.styl new file mode 100644 index 0000000..5574b5f --- /dev/null +++ b/themes/next/source/css/_schemes/Pisces/index.styl @@ -0,0 +1,30 @@ +@import '_layout'; +@import '_header'; +@import '_menu'; +@import '_sub-menu'; +@import '_sidebar'; + +.main-inner { + background: var(--content-bg-color); + box-shadow: $box-shadow-inner; + padding: $content-desktop-padding; + + +tablet-mobile() { + padding: 20px; + } +} + +// Sub-menu(s). +.sub-menu { + border-bottom: 1px solid $table-border-color; +} + +.post-block:first-of-type { + padding-top: 40px; +} + +.pagination { + +mobile() { + margin-bottom: 10px; + } +} diff --git a/themes/next/source/css/_variables/Gemini.styl b/themes/next/source/css/_variables/Gemini.styl new file mode 100644 index 0000000..e8ff7e4 --- /dev/null +++ b/themes/next/source/css/_variables/Gemini.styl @@ -0,0 +1,18 @@ +// Variables of Gemini scheme +// ================================================== + +@import 'Pisces'; + +// Settings for some of the most global styles. +// -------------------------------------------------- +$body-bg-color = #eee; + +// Borders. +// -------------------------------------------------- +$box-shadow-inner = 0 2px 2px 0 rgba(0, 0, 0, .12), 0 3px 1px -2px rgba(0, 0, 0, .06), 0 1px 5px 0 rgba(0, 0, 0, .12); +$box-shadow = 0 2px 2px 0 rgba(0, 0, 0, .12), 0 3px 1px -2px rgba(0, 0, 0, .06), 0 1px 5px 0 rgba(0, 0, 0, .12), 0 -1px .5px 0 rgba(0, 0, 0, .09); + +$border-radius-inner = initial; +$border-radius = initial; +// $border-radius-inner = 0 0 3px 3px; +// $border-radius = 3px; diff --git a/themes/next/source/css/_variables/Mist.styl b/themes/next/source/css/_variables/Mist.styl new file mode 100644 index 0000000..c0d5ca2 --- /dev/null +++ b/themes/next/source/css/_variables/Mist.styl @@ -0,0 +1,27 @@ +// Variables of Mist scheme +// ================================================== + +@import 'Muse'; + +$scheme-text-align = left; + +$content-padding-bottom = 80px; +$posts-first-padding = 80px; +$posts-first-padding-mobile = 60px; + +$link-decoration-color = $grey-light; +$content-bg-color = $whitesmoke; +$menu-item-bg-color = $grey-lighter; + +$brand-color = $black-deep; +$brand-hover-color = $brand-color; +$brand-padding = 2px 1px; + +$posts-collapse-left = 0; + +$btn-default-bg = transparent; +$btn-default-color = var(--link-color); +$btn-default-hover-bg = transparent; +$btn-default-border-color = var(--link-color); +$btn-default-hover-color = var(--link-hover-color); +$btn-default-hover-border-color = var(--link-hover-color); diff --git a/themes/next/source/css/_variables/Muse.styl b/themes/next/source/css/_variables/Muse.styl new file mode 100644 index 0000000..b63b697 --- /dev/null +++ b/themes/next/source/css/_variables/Muse.styl @@ -0,0 +1,9 @@ +// Variables of Muse scheme +// ================================================== + +$sidebar-width = hexo-config('sidebar.width') is a 'unit' ? hexo-config('sidebar.width') : 320; +$sidebar-desktop = unit($sidebar-width, 'px'); + +$content-padding-bottom = 60px; +$posts-first-padding = 70px; +$posts-first-padding-mobile = 35px; diff --git a/themes/next/source/css/_variables/Pisces.styl b/themes/next/source/css/_variables/Pisces.styl new file mode 100644 index 0000000..7ec4253 --- /dev/null +++ b/themes/next/source/css/_variables/Pisces.styl @@ -0,0 +1,69 @@ +// Variables of Pisces scheme +// ================================================== + +// Settings for some of the most global styles. +// -------------------------------------------------- +$body-bg-color = #f5f7f9; + +$sidebar-width = hexo-config('sidebar.width') is a 'unit' ? hexo-config('sidebar.width') : 240; +$sidebar-desktop = unit($sidebar-width, 'px'); +$content-wrap = 'calc(100% - %s)' % unit($sidebar-width + $sidebar-offset, 'px'); + +$content-desktop = 'calc(100% - %s)' % unit($content-desktop-padding / 2, 'px'); +$content-desktop-large = 1160px; +$content-desktop-largest = 73%; + + +// Borders +// -------------------------------------------------- +$box-shadow-inner = initial; +$box-shadow = initial; + +$border-radius-inner = initial; +$border-radius = initial; + + +// Header +// -------------------------------------------------- +$subtitle-color = $grey-lighter; +$brand-padding = 0; +$site-subtitle-margin = 10px 10px 0; + + +// Sidebar +// -------------------------------------------------- +$sidebar-nav-color = var(--text-color); +$sidebar-nav-hover-color = $orange; +$sidebar-highlight = $orange; + +$site-author-image-width = 120px; +$site-author-image-border-width = 1px; +$site-author-image-border-color = $gainsboro; + +$site-author-name-margin = 0; +$site-author-name-color = var(--text-color); +$site-author-name-weight = 600; + +$site-description-font-size = $font-size-smaller; +$site-description-color = $grey-dark; +$site-description-margin-top = 0; + +$site-state-item-count-font-size = $font-size-medium; +$site-state-item-name-font-size = $font-size-smaller; +$site-state-item-name-color = $grey-dark; + + +// Components +// -------------------------------------------------- + +// Button +$btn-default-radius = 2px; +$btn-default-bg = white; +$btn-default-color = $text-color; +$btn-default-border-color = $text-color; +$btn-default-hover-bg = $black-deep; +$btn-default-hover-color = white; + +// Back to top +$b2t-opacity = .6; +$b2t-opacity-hover = .8; diff --git a/themes/next/source/css/_variables/base.styl b/themes/next/source/css/_variables/base.styl new file mode 100644 index 0000000..e7fb8c3 --- /dev/null +++ b/themes/next/source/css/_variables/base.styl @@ -0,0 +1,389 @@ +// +// Variables +// ================================================== + + +// Color system +// -------------------------------------------------- +$whitesmoke = #f5f5f5; +$gainsboro = #eee; +$grey-lighter = #ddd; +$grey-light = #ccc; +$grey = #bbb; +$grey-dark = #999; +$grey-dim = #666; +$black-light = #555; +$black-dim = #333; +$black-deep = #222; +$red = #ff2a2a; +$blue-bright = #87daff; +$blue = #0684bd; +$blue-deep = #262a30; +$orange = #fc6423; + + +// Transition +// -------------------------------------------------- +$transition-duration = .2s; +$transition-ease = $transition-duration ease-in-out; +$transition-ease-in = $transition-duration ease-in; +$transition-ease-out = $transition-duration ease-out; + + +// Scaffolding +// Settings for some of the most global styles. +// -------------------------------------------------- +// Global text color on +$text-color = $black-light; +$text-color-dark = $grey-light; + +// Global link color. +$link-color = $black-light; +$link-color-dark = $grey-light; +$link-hover-color = $black-deep; +$link-hover-color-dark = $gainsboro; +$link-decoration-color = $grey-dark; + +$blockquote-color = $grey-dim; +$blockquote-color-dark = $grey; + +// Global border color. +$border-color = $grey-light; + +// Background color for +$body-bg-color = white; +$body-bg-color-dark = #282828; +$content-bg-color = white; +$content-bg-color-dark = $black-dim; + +// Selection +$selection-bg = $blue-deep; +$selection-color = $gainsboro; + +// Dark mode color +$card-bg-color = $whitesmoke; +$card-bg-color-dark = $black-light; + +$menu-item-bg-color = $whitesmoke; +$menu-item-bg-color-dark = $black-light; + +$theme-color = convert(hexo-config('theme_color.light')); +$theme-color-dark = convert(hexo-config('theme_color.dark')); + +$scheme-text-align = center; + +// Typography +// Font, line-height, and elements colors. +// -------------------------------------------------- +get_font_family(config) { + $custom-family = hexo-config('font.' + config + '.family'); + return $custom-family is a 'string' ? unquote($custom-family) : null; +} + +// Font families. +$font-family-chinese = 'PingFang SC', 'Microsoft YaHei'; + +$font-family-base = $font-family-chinese, sans-serif; +$font-family-base = get_font_family('global'), $font-family-chinese, sans-serif if get_font_family('global'); + +$font-family-logo = $font-family-base; +$font-family-logo = get_font_family('title'), $font-family-base if get_font_family('title'); + +$font-family-headings = $font-family-base; +$font-family-headings = get_font_family('headings'), $font-family-base if get_font_family('headings'); + +$font-family-posts = $font-family-base; +$font-family-posts = get_font_family('posts'), $font-family-base if get_font_family('posts'); + +$font-family-monospace = consolas, Menlo, monospace, $font-family-chinese; +$font-family-monospace = get_font_family('codes'), consolas, Menlo, monospace, $font-family-chinese if get_font_family('codes'); + + +// Font size +$font-size-base = (hexo-config('font.enable') and hexo-config('font.global.size') is a 'unit') ? unit(hexo-config('font.global.size'), em) : 1em; +$font-size-smallest = .75em; +$font-size-smaller = .8125em; +$font-size-small = .875em; +$font-size-medium = 1em; +$font-size-large = 1.125em; +$font-size-larger = 1.25em; +$font-size-largest = 1.5em; + + +// Headings font size +$font-size-headings-step = .125em; +$font-size-headings-base = (hexo-config('font.enable') and hexo-config('font.headings.size') is a 'unit') ? unit(hexo-config('font.headings.size'), em) : 1.625em; + + +// Global line height +$line-height-base = 2; +$line-height-code-block = 1.6; // Can't be less than 1.3; + + +// Z-index master list +// -------------------------------------------------- +// Fix issue https://github.com/next-theme/theme-next-docs/issues/54 +$zindex-0 = 5; +$zindex-1 = 10; +$zindex-2 = 20; +$zindex-3 = 30; +$zindex-4 = 40; +$zindex-5 = 50; + + +// Table +// -------------------------------------------------- +$table-border-color = $grey-lighter; +$table-font-size = $font-size-small; +$table-cell-border-bottom-color = $grey-lighter; +$table-row-odd-bg-color = #f9f9f9; +$table-row-odd-bg-color-dark = #282828; +$table-row-hover-bg-color = $whitesmoke; +$table-row-hover-bg-color-dark = #363636; + + +// Code & Code Blocks +// -------------------------------------------------- +$code-font-family = $font-family-monospace; + +$highlight-background = convert(hexo-config('highlight.light.background')); +$highlight-foreground = convert(hexo-config('highlight.light.foreground')); +$highlight-gutter-background = mix($highlight-background, $highlight-foreground, 90%); +$highlight-gutter-foreground = mix($highlight-background, $highlight-foreground, 10%); + +$highlight-background-dark = convert(hexo-config('highlight.dark.background')); +$highlight-foreground-dark = convert(hexo-config('highlight.dark.foreground')); +$highlight-gutter-background-dark = mix($highlight-background-dark, $highlight-foreground-dark, 90%); +$highlight-gutter-foreground-dark = mix($highlight-background-dark, $highlight-foreground-dark, 10%); + + +// Buttons +// -------------------------------------------------- +$btn-default-radius = 0; +$btn-default-bg = $black-deep; +$btn-default-bg-dark = $black-deep; +$btn-default-color = white; +$btn-default-color-dark = $text-color-dark; +$btn-default-border-color = $black-deep; +$btn-default-border-color-dark = $black-light; +$btn-default-hover-bg = white; +$btn-default-hover-bg-dark = $grey-dim; +$btn-default-hover-color = $black-deep; +$btn-default-hover-color-dark = $text-color-dark; +$btn-default-hover-border-color = $black-deep; +$btn-default-hover-border-color-dark = $grey-dim; + + +// Pagination +// -------------------------------------------------- +$pagination-border = $gainsboro; + +$pagination-link-bg = transparent; +$pagination-link-color = $link-color; +$pagination-link-border = $gainsboro; + +$pagination-link-hover-bg = transparent; +$pagination-link-hover-color = $link-color; +$pagination-link-hover-border = var(--link-hover-color); + +$pagination-active-bg = $grey-light; +$pagination-active-color = var(--content-bg-color); +$pagination-active-border = $grey-light; + + +// Layout sizes +// -------------------------------------------------- +$content-desktop = 700px; +$content-desktop-large = 800px; +$content-desktop-largest = 900px; + +$content-desktop-padding = 40px; +$content-tablet-padding = 10px; +$content-mobile-padding = 8px; + + +// Headband +// -------------------------------------------------- +$headband-height = 3px; +$headband-bg = var(--theme-color); + + +// Site Meta +// -------------------------------------------------- +$brand-color = white; +$brand-hover-color = white; +$brand-color-dark = $grey-lighter; +$brand-hover-color-dark = $grey-lighter; +$brand-padding = 0 40px; + +$site-subtitle-margin = 10px 0; + +$font-size-title = (hexo-config('font.enable') and hexo-config('font.title.size') is a 'unit') ? unit(hexo-config('font.title.size'), em) : 1.375em; +$font-size-subtitle = $font-size-smaller; +$subtitle-color = $grey-dark; +$site-subtitle-color = $grey-dark; + + +// Posts Collpase +// -------------------------------------------------- +$posts-collapse-margin = 35px; +$posts-collapse-margin-mobile = 0; + + +// Tag Cloud +// -------------------------------------------------- +$tag-cloud-start = #aaa; +$tag-cloud-end = #111; +$tag-cloud-start-dark = #555; +$tag-cloud-end-dark = #eee; + + +// Sidebar +// Variables for sidebar section elements. +// -------------------------------------------------- + +$sidebar-padding = hexo-config('sidebar.padding') is a 'unit' ? unit(hexo-config('sidebar.padding'), px) : 18px; +$sidebar-offset = hexo-config('sidebar.offset') is a 'unit' ? unit(hexo-config('sidebar.offset'), px) : 12px; +$sidebar-nav-color = $grey-dim; +$sidebar-nav-hover-color = $whitesmoke; +$sidebar-highlight = $blue-bright; + +$site-author-image-width = 96px; +$site-author-image-border-width = 2px; +$site-author-image-border-color = $black-dim; + +$site-author-name-margin = 5px 0 0; +$site-author-name-color = $whitesmoke; +$site-author-name-weight = normal; + +$site-description-font-size = $font-size-medium; +$site-description-color = $grey-dark; +$site-description-margin-top = 5px; + +$site-state-item-count-font-size = $font-size-larger; +$site-state-item-name-font-size = $font-size-small; +$site-state-item-name-color = inherit; + + +// Components +// -------------------------------------------------- +// Back to top +$b2t-opacity = .8; +$b2t-opacity-hover = 1; +$b2t-position-bottom = -100px; +$b2t-position-bottom-on = 30px; +$b2t-position-right = 30px; +$b2t-position-right-mobile = 20px; +$b2t-font-size = 12px; +$b2t-color = white; +$b2t-bg-color = $black-deep; + +$sidebar-toggle-inner-size = 16px; +$sidebar-toggle-padding = 5px; +$sidebar-toggle-size = $sidebar-toggle-inner-size + $sidebar-toggle-padding * 2; + +// .post-expand .post-eof +// In Muse scheme, margin above and below the post separator +$post-eof-margin-top = 80px; // or 160px for more white space; +$post-eof-margin-bottom = 60px; // or 120px for less white space; + +$post-card-margin = 1em 0 0; +$post-reward-img-width = 180px; + + +// Note colors +// -------------------------------------------------- +// Read note light_bg_offset from NexT config and set in '$lbg%' to use it as string variable. +$lbg = hexo-config('note.light_bg_offset') is a 'unit' ? unit(hexo-config('note.light_bg_offset'), '%') : 0; +$note-types = 'default' 'primary' 'info' 'success' 'warning' 'danger'; + +$note-border-radius = 3px; + +$note-border = { + default : #777, + primary : #6f42c1, + info : #428bca, + success : #5cb85c, + warning : #f0ad4e, + danger : #d9534f +}; + +$note-bg = { + default : lighten(spin($note-border.default, 0), 94% + $lbg), + primary : lighten(spin($note-border.primary, 10), 92% + $lbg), + info : lighten(spin($note-border.info, -10), 91% + $lbg), + success : lighten(spin($note-border.success, 10), 90% + $lbg), + warning : lighten(spin($note-border.warning, 10), 88% + $lbg), + danger : lighten(spin($note-border.danger, -10), 92% + $lbg) +}; + +$note-text = { + default : $note-border.default, + primary : $note-border.primary, + info : $note-border.info, + success : $note-border.success, + warning : $note-border.warning, + danger : $note-border.danger +}; + +$note-icon = { + default : '\f0a9', + primary : '\f055', + info : '\f05a', + success : '\f058', + warning : '\f06a', + danger : '\f056' +}; + +$note-modern-border = { + default : #e1e1e1, + primary : #e1c2ff, + info : #b3e5ef, + success : #d0e6be, + warning : #fae4cd, + danger : #ebcdd2 +}; + +$note-modern-bg = { + default : lighten(spin($note-modern-border.default, 10), 60% + ($lbg * 4)), + primary : lighten(spin($note-modern-border.primary, 10), 40% + ($lbg * 4)), + info : lighten(spin($note-modern-border.info, 10), 50% + ($lbg * 4)), + success : lighten(spin($note-modern-border.success, 10), 40% + ($lbg * 4)), + warning : lighten(spin($note-modern-border.warning, 10), 43% + ($lbg * 4)), + danger : lighten(spin($note-modern-border.danger, 10), 35% + ($lbg * 4)) +}; + +$note-modern-text = { + default : $grey-dim, + primary : #6f42c1, + info : #31708f, + success : #3c763d, + warning : #8a6d3b, + danger : #a94442 +}; + +$note-modern-hover = { + default : darken(spin($note-modern-text.default, -10), 32%), + primary : darken(spin($note-modern-text.primary, -10), 22%), + info : darken(spin($note-modern-text.info, -10), 32%), + success : darken(spin($note-modern-text.success, -10), 27%), + warning : darken(spin($note-modern-text.warning, -10), 18%), + danger : darken(spin($note-modern-text.danger, -10), 22%) +}; + + +// Tabs border radius +// -------------------------------------------------- +$tbr = 0; + + +// Label colors +// -------------------------------------------------- +$label = { + default : lighten(spin($note-border.default, 0), 89% + $lbg), + primary : lighten(spin($note-border.primary, 10), 87% + $lbg), + info : lighten(spin($note-border.info, -10), 86% + $lbg), + success : lighten(spin($note-border.success, 10), 85% + $lbg), + warning : lighten(spin($note-border.warning, 10), 83% + $lbg), + danger : lighten(spin($note-border.danger, -10), 87% + $lbg) +}; diff --git a/themes/next/source/css/main.styl b/themes/next/source/css/main.styl new file mode 100644 index 0000000..d75c4a1 --- /dev/null +++ b/themes/next/source/css/main.styl @@ -0,0 +1,47 @@ +// CSS Style Guide: https://codeguide.co/#css + +// https://stylus-lang.com/docs/keyframes.html +vendors = official; + +$scheme = hexo-config('scheme') ? hexo-config('scheme') : 'Muse'; + + +// Variables Layer +// -------------------------------------------------- +@import '_variables/base'; +@import '_variables/' + $scheme; +for $inject_variable in hexo-config('injects.variable') + @import $inject_variable; + +// Mixins Layer +// -------------------------------------------------- +@import '_mixins'; +for $inject_mixin in hexo-config('injects.mixin') + @import $inject_mixin; + +// Dark mode colors +// -------------------------------------------------- +@import '_colors'; + +// Common Layer +// -------------------------------------------------- + +// Scaffolding +@import '_common/scaffolding'; + +// Layout +@import '_common/outline'; + +// Components +@import '_common/components'; + + +// Schemes Layer +// -------------------------------------------------- +@import '_schemes/' + $scheme; + + +// Custom Layer +// -------------------------------------------------- +for $inject_style in hexo-config('injects.style') + @import $inject_style; diff --git a/themes/next/source/css/noscript.styl b/themes/next/source/css/noscript.styl new file mode 100644 index 0000000..8891cf4 --- /dev/null +++ b/themes/next/source/css/noscript.styl @@ -0,0 +1,47 @@ +@import '_variables/base'; + +body { margin-top: 2rem; } + +.use-motion .menu-item, +.use-motion .sidebar, +.use-motion .sidebar-inner, +.use-motion .post-block, +.use-motion .pagination, +.use-motion .comments, +.use-motion .post-header, +.use-motion .post-body, +.use-motion .collection-header { + visibility: visible; +} + +.use-motion .column, +.use-motion .site-brand-container .toggle, +.use-motion .footer { opacity: initial; } + +.use-motion .site-title, +.use-motion .site-subtitle, +.use-motion .custom-logo-image { + opacity: initial; + top: initial; +} + +.use-motion .logo-line { + transform: scaleX(1); +} + +.search-pop-overlay, .sidebar-nav { display: none; } +.sidebar-panel { display: block; } + +.noscript-warning { + background-color: lighten($red, 20%); + color: white; + font-family: sans-serif; + font-size: 1rem; + font-weight: bold; + left: 0; + position: fixed; + text-align: center; + top: 0; + width: 100%; + z-index: $zindex-5; +} diff --git a/themes/next/source/images/apple-touch-icon-next.png b/themes/next/source/images/apple-touch-icon-next.png new file mode 100644 index 0000000000000000000000000000000000000000..86a0d1d33bc2ae8a0416ebba67d1bbb60aa29c38 GIT binary patch literal 1544 zcmV+j2KV`iP)Px#OHfQyMIs_1FE20E)zv2_C(h2!$jHdT!ovUm|GT@p zWo2de_xJq#{8d#|IyyQ>M@Qx533`J9dBE>4W{r{KFjMLpp4N$2iMRJCGfPM7@le{)BPzVgz zp?ByVdWYVj|4-=tUS5SkR}Te{-Fr#UrxsqJ9+ed6YY9KmoXq6n^B9DRMwF@T2u)qH z!=wh-sAdPH_8fFy0-I1d68Zp);!FTtdweUZc2nr)?5^hh99w*FOU z@NYFT^!v%iPrGly0Q*+sLVtesYh+the|AET4WK8lR^dv1IZ-3FhAuiK5V|-?gf2#j z&_yW`x^K3G&OKl4kP$$ih@p!?B6M+)2(4Rz(6$=G6WT(;6uP)cgkEi(xI(Yi7`D(w zo(Y6r>FyarFV`4e&^@lk@PfWf|DSeM5}?agV`>aDXt-c%3^!*Ij0g0Q8X5*mjbRC$9oB0MOK51O_53LU8p`RzcozW; zx3wC>721@58xhdzx?E$}LW9xpjUu4UhOZO>Z8Us+D+1bR_}&sQXJ}B}yadb|8fraT zV|YUw4WF(>KpPF;mjp}*eTo5XG<+u!&}PFoihwq!uhI`XPYZ1{e1FDs0nqR?Ym5YF zqv0DwK${KUMFjNpqb>9(0vg8Y^d$otmiJc}L#s|8wD~Z~fHtQu8PG6DgwAq-&}PFY z1KMo(WI!7YpAcwxN`zJiV(2pgG_<|npE+y^Z8UsBppAx42(;Po$$&N*J{izP!?y+W zi2YsL=fkK`KXsymhWcmL#_y-S*Y&V_u#us^S9pDvbMSkxv7uidoc36Qa`CQ+5AC^d z=CTJ%0ZkrQ=v?t(E_)>OCL8YaU+nX$$--iAUNb;m^jBG2!5*5enU|exmY3aQcv=O- znjO}ft-yw2|VZs2g-W`Epf@n*5gsJ2LLtC^nFlq8+?%Xc!{Z3_|hFI~!oeU$ep z%4jE9Y9n1{ah68@W{++)8|fc~HIM4)QycHpg}3P<_K$M$L~}7jBXs?6bDwjvo+I;D zsoi}398La6+~*osM@45l#ptQ6MrZFz597*no3v)ffsUEletxWeW~`A+ntYvaeQj?e z*kSqGXZsrrhZ>IsxH$({IR{z11zkG`GR^j$#{%z41lp5(Ne#glJc5nj-BUaKR!X?# zzN6F-<0?&z;|30?9q0Z}oHG*G)Q)s%Db~RbjMU)mp-u&Dmm0zkF~o9eRh}p?ByVnjn4wmEZ*c=^{+H00012dQ@0+Qek%>aB^>E zX>4U6ba`-PAZc)PV*mhnoa6Eg2ys>@D9TUE%t_@^00ScnE@KN5BNI!L6ay0=M1VBI uWCJ6!R3OXP)X2ol#2my2%YaCrN-hBE7ZG&wLN%2D0000`v literal 0 HcmV?d00001 diff --git a/themes/next/source/images/avatar.gif b/themes/next/source/images/avatar.gif new file mode 100644 index 0000000000000000000000000000000000000000..3b5d744b17ae541e331e9296640f0418d4e7c821 GIT binary patch literal 1785 zcmc(eiCfYK1Au>kC}AoSube4(tj%1XGs-IqwL{J4`&#nMW_^ZNl2cuo5V((w@KF|BSr-Dy?Ci?Qibx<>SXfwIUgogbVv$IpPzd>aHjAZHDkmh84Xt*5 zetu+ln8)SL&&~0%H{C|LeZF5GCnaWl}%00$Q845^9#jbGjmg0YYZq% z1HxF_nwpz|7kNflF9N9Q5iJvD0w&0S9`em0*f}BgKh?c=3?YfFSYWEn(AG8D&f9}T zF|^Ozg(s2g21~=--BqP2;U+HbKfJ-6t^Mpd+Vd(rH9aPG>VjZaYzrEFkzM1W4W*?PEbt7_?0ObX=R3 zfm*vF0T2e?IaX0s7omGCFNR2kL@?w2C0yDOh`J7v?|JOT+#U{?U0_{uqpk}`=r+VP zC12fo8O3{HxoZwDCgwbOZNi&VzKT}`9?t!=AVtC=y%<;l+psDMv*su+IEO5Q?TgN0 z=&H7$Gf?L=qqi5`@bimQ^6tFqKOeh&ck{=aiDvo7nlqFv&4wkwGeO}maQB{~k%?ck zE7Cdok^c8R9AM5IP1JJ)~Cz5Sv{>KNvX5%lB* z9%4%%UT_Wehfmg@gc%I&MaBNNZg03yUt|q!t%QXZJ9njhaoqbXT&%>qob*i$7vJ9{ z<5xiO5wWzi1105!#^PQCsto8sM4BepmIPkI5zoZ?*-1r_m8zst+M_T+_C9c`BdGyZ z()dMh4bJ_{K1iXtN>KzH?;xb$$ACsu8o5!>Fp}gw-jJ7^zUL{9PKe8II{SSj5atkhyp)&z8{9L0;5~dN8IV%e^8!Cm#@R*x{T5QR+y!yez%{*GTHhd}S&e?yi8`c_py&b`IA#{jM67?2A- z96X6KMj50BNJHBI?9Zj78OXyk^6Q>ufCnUfBpmb@X3fgX_M_S)8KAM>*1*t+*UyZc z^4w;`mO~qzDlqH`0`+#Ffh1i?m ztGf;Harv-B6uCo0TB=_qclsj^84AC_7^!(v;Oi5;Kl$z+X{K*fpE(N zWyVw!0PLHXpb*M(Bl@dIQsB%LhJP-?;tE={h{Y(QpYjdD9`hDbfEiJN) znh_Ry7j#5m>=)N|?3XDh_r1_zMIHc&wJ0=9`=ky7CuDT$ia(uo`t1DDrGgKeCI{e@ z{!P0)EBNAc7g6Tp|0X`9!<~%Y?miKrA{MDPqrRMh1+NgBt?oT@PRlxMyn2}v=_`HO z`{&U{yA!^h75UlWQ#)`T_pCemHpYGaJuhRu^ZY~){h#)L$)<4Zd(gT$0zX0)xk sj2>F=QOaOm@==$w^6D`S!9xiV>IXt*{ozi=Q1Vaehf=%aC;;&N3lE276aWAK literal 0 HcmV?d00001 diff --git a/themes/next/source/images/favicon-16x16-next.png b/themes/next/source/images/favicon-16x16-next.png new file mode 100644 index 0000000000000000000000000000000000000000..de8c5d3a5f8215c3f7b095c9e284e061bda65f86 GIT binary patch literal 435 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl<6e(pbstUx|vage(c z!@6@aFM%A+0*}aIAe|4wj2{=>aRxHH1AIbUeKHFb!9Yn#DLy_vBO^maMdk0`zd#Zw z0tY~@yu3V6p{Ay$mX_Az$B+O0`?r4m`qisfPnj~MwY3$f@^9nqaG!lvI6;x#X;^) z4C~IxyaaMM3p^r=f%IJvW-JI^#13S11^9%x`eYU=fq|TyoQjGHgbgIWfB*jF%NI8{ zx2;>Zu3x`iO-&6bs0aoM3JPUqWq0n}*}Qo(P|Le_@AmKC57(%ytPE5IHwwrGiqzKD z{{8#c)YSCg!Gk}3{P_R>|Gj(no6k4eJyZq^Jd4Jw%*zpM57yY9pK zMcQgs21j>QigM54W!RCVazM0UCtHDVhG46xh5pA!(TqDDnlwLEm~eRS(JM@6p3293 zNMwDW(!P~x!s$%jghh-wOB)P19fJ88oOHECttPa5*~LF^Vp#0%pwrbyN~~|szWB|o z_J4%n&U>rEu5s2%I6jof{A;(j!|>g|;yo?%ZfFGheBJp^9_Zijs*s41pu}>8f};Gi z%$!t(lFEWqh0KDIWCn(cIgdZ_a1@4VXq@stea7=?5CgL^w_Y;0u(GiCWD#az1(ybs x!zs+ln?n>%-?(z($eANDN7zp{cr5VJV|XPlSn|oqbSlsa22WQ%mvv4FO#p=N1nU3* literal 0 HcmV?d00001 diff --git a/themes/next/source/images/logo-algolia-nebula-blue-full.svg b/themes/next/source/images/logo-algolia-nebula-blue-full.svg new file mode 100644 index 0000000..886c422 --- /dev/null +++ b/themes/next/source/images/logo-algolia-nebula-blue-full.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/themes/next/source/images/logo.svg b/themes/next/source/images/logo.svg new file mode 100644 index 0000000..992c1a5 --- /dev/null +++ b/themes/next/source/images/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/themes/next/source/js/bookmark.js b/themes/next/source/js/bookmark.js new file mode 100644 index 0000000..8e3ae6a --- /dev/null +++ b/themes/next/source/js/bookmark.js @@ -0,0 +1,56 @@ +/* global CONFIG */ + +document.addEventListener('DOMContentLoaded', () => { + 'use strict'; + + const doSaveScroll = () => { + localStorage.setItem('bookmark' + location.pathname, window.scrollY); + }; + + const scrollToMark = () => { + let top = localStorage.getItem('bookmark' + location.pathname); + top = parseInt(top, 10); + // If the page opens with a specific hash, just jump out + if (!isNaN(top) && location.hash === '') { + // Auto scroll to the position + window.anime({ + targets : document.scrollingElement, + duration : 200, + easing : 'linear', + scrollTop: top + }); + } + }; + // Register everything + const init = function(trigger) { + // Create a link element + const link = document.querySelector('.book-mark-link'); + // Scroll event + window.addEventListener('scroll', () => link.classList.toggle('book-mark-link-fixed', window.scrollY === 0), { passive: true }); + // Register beforeunload event when the trigger is auto + if (trigger === 'auto') { + // Register beforeunload event + window.addEventListener('beforeunload', doSaveScroll); + document.addEventListener('pjax:send', doSaveScroll); + } + // Save the position by clicking the icon + link.addEventListener('click', () => { + doSaveScroll(); + window.anime({ + targets : link, + duration: 200, + easing : 'linear', + top : -30, + complete: () => { + setTimeout(() => { + link.style.top = ''; + }, 400); + } + }); + }); + scrollToMark(); + document.addEventListener('pjax:success', scrollToMark); + }; + + init(CONFIG.bookmark.save); +}); diff --git a/themes/next/source/js/comments-buttons.js b/themes/next/source/js/comments-buttons.js new file mode 100644 index 0000000..505c21b --- /dev/null +++ b/themes/next/source/js/comments-buttons.js @@ -0,0 +1,25 @@ +/* global CONFIG */ + +(function() { + const commentButton = document.querySelectorAll('.comment-button'); + commentButton.forEach(element => { + const commentClass = element.classList[2]; + element.addEventListener('click', () => { + commentButton.forEach(active => active.classList.toggle('active', active === element)); + document.querySelectorAll('.comment-position').forEach(active => active.classList.toggle('active', active.classList.contains(commentClass))); + if (CONFIG.comments.storage) { + localStorage.setItem('comments_active', commentClass); + } + }); + }); + let { activeClass } = CONFIG.comments; + if (CONFIG.comments.storage) { + activeClass = localStorage.getItem('comments_active') || activeClass; + } + if (activeClass) { + const activeButton = document.querySelector(`.comment-button.${activeClass}`); + if (activeButton) { + activeButton.click(); + } + } +})(); diff --git a/themes/next/source/js/comments.js b/themes/next/source/js/comments.js new file mode 100644 index 0000000..4045e8c --- /dev/null +++ b/themes/next/source/js/comments.js @@ -0,0 +1,21 @@ +/* global CONFIG */ + +window.addEventListener('tabs:register', () => { + let { activeClass } = CONFIG.comments; + if (CONFIG.comments.storage) { + activeClass = localStorage.getItem('comments_active') || activeClass; + } + if (activeClass) { + const activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`); + if (activeTab) { + activeTab.click(); + } + } +}); +if (CONFIG.comments.storage) { + window.addEventListener('tabs:click', event => { + if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return; + const commentClass = event.target.classList[1]; + localStorage.setItem('comments_active', commentClass); + }); +} diff --git a/themes/next/source/js/config.js b/themes/next/source/js/config.js new file mode 100644 index 0000000..caa0075 --- /dev/null +++ b/themes/next/source/js/config.js @@ -0,0 +1,66 @@ +if (!window.NexT) window.NexT = {}; + +(function() { + const className = 'next-config'; + + const staticConfig = {}; + let variableConfig = {}; + + const parse = text => JSON.parse(text || '{}'); + + const update = name => { + const targetEle = document.querySelector(`.${className}[data-name="${name}"]`); + if (!targetEle) return; + const parsedConfig = parse(targetEle.text); + if (name === 'main') { + Object.assign(staticConfig, parsedConfig); + } else { + variableConfig[name] = parsedConfig; + } + }; + + update('main'); + + window.CONFIG = new Proxy({}, { + get(overrideConfig, name) { + let existing; + if (name in staticConfig) { + existing = staticConfig[name]; + } else { + if (!(name in variableConfig)) update(name); + existing = variableConfig[name]; + } + + // For unset override and mixable existing + if (!(name in overrideConfig) && typeof existing === 'object') { + // Get ready to mix. + overrideConfig[name] = {}; + } + + if (name in overrideConfig) { + const override = overrideConfig[name]; + + // When mixable + if (typeof override === 'object' && typeof existing === 'object') { + // Mix, proxy changes to the override. + return new Proxy({ ...existing, ...override }, { + set(target, prop, value) { + target[prop] = value; + override[prop] = value; + return true; + } + }); + } + + return override; + } + + // Only when not mixable and override hasn't been set. + return existing; + } + }); + + document.addEventListener('pjax:success', () => { + variableConfig = {}; + }); +})(); diff --git a/themes/next/source/js/motion.js b/themes/next/source/js/motion.js new file mode 100644 index 0000000..aad22db --- /dev/null +++ b/themes/next/source/js/motion.js @@ -0,0 +1,140 @@ +/* global NexT, CONFIG */ + +NexT.motion = {}; + +NexT.motion.integrator = { + queue: [], + init : function() { + this.queue = []; + return this; + }, + add: function(fn) { + const sequence = fn(); + if (CONFIG.motion.async) this.queue.push(sequence); + else this.queue = this.queue.concat(sequence); + return this; + }, + bootstrap: function() { + if (!CONFIG.motion.async) this.queue = [this.queue]; + this.queue.forEach(sequence => { + const timeline = window.anime.timeline({ + duration: 200, + easing : 'linear' + }); + sequence.forEach(item => { + if (item.deltaT) timeline.add(item, item.deltaT); + else timeline.add(item); + }); + }); + } +}; + +NexT.motion.middleWares = { + header: function() { + const sequence = []; + + function getMistLineSettings(targets) { + sequence.push({ + targets, + scaleX : [0, 1], + duration: 500, + deltaT : '-=200' + }); + } + + function pushToSequence(targets, sequenceQueue = false) { + sequence.push({ + targets, + opacity: 1, + top : 0, + deltaT : sequenceQueue ? '-=200' : '-=0' + }); + } + + pushToSequence('.column'); + CONFIG.scheme === 'Mist' && getMistLineSettings('.logo-line'); + CONFIG.scheme === 'Muse' && pushToSequence('.custom-logo-image'); + pushToSequence('.site-title'); + pushToSequence('.site-brand-container .toggle', true); + pushToSequence('.site-subtitle'); + (CONFIG.scheme === 'Pisces' || CONFIG.scheme === 'Gemini') && pushToSequence('.custom-logo-image'); + + const menuItemTransition = CONFIG.motion.transition.menu_item; + if (menuItemTransition) { + document.querySelectorAll('.menu-item').forEach(targets => { + sequence.push({ + targets, + complete: () => targets.classList.add('animated', menuItemTransition), + deltaT : '-=200' + }); + }); + } + + return sequence; + }, + + subMenu: function() { + const subMenuItem = document.querySelectorAll('.sub-menu .menu-item'); + if (subMenuItem.length > 0) { + subMenuItem.forEach(element => { + element.classList.add('animated'); + }); + } + return []; + }, + + postList: function() { + const sequence = []; + const { post_block, post_header, post_body, coll_header } = CONFIG.motion.transition; + + function animate(animation, elements) { + if (!animation) return; + elements.forEach(targets => { + sequence.push({ + targets, + complete: () => targets.classList.add('animated', animation), + deltaT : '-=100' + }); + }); + } + + document.querySelectorAll('.post-block').forEach(targets => { + sequence.push({ + targets, + complete: () => targets.classList.add('animated', post_block), + deltaT : '-=100' + }); + animate(coll_header, targets.querySelectorAll('.collection-header')); + animate(post_header, targets.querySelectorAll('.post-header')); + animate(post_body, targets.querySelectorAll('.post-body')); + }); + + animate(post_block, document.querySelectorAll('.pagination, .comments')); + + return sequence; + }, + + sidebar: function() { + const sequence = []; + const sidebar = document.querySelectorAll('.sidebar-inner'); + const sidebarTransition = CONFIG.motion.transition.sidebar; + // Only for Pisces | Gemini. + if (sidebarTransition && (CONFIG.scheme === 'Pisces' || CONFIG.scheme === 'Gemini')) { + sidebar.forEach(targets => { + sequence.push({ + targets, + complete: () => targets.classList.add('animated', sidebarTransition), + deltaT : '-=100' + }); + }); + } + return sequence; + }, + + footer: function() { + return [{ + targets: document.querySelector('.footer'), + opacity: 1 + }]; + } +}; diff --git a/themes/next/source/js/next-boot.js b/themes/next/source/js/next-boot.js new file mode 100644 index 0000000..fceb80b --- /dev/null +++ b/themes/next/source/js/next-boot.js @@ -0,0 +1,79 @@ +/* global NexT, CONFIG */ + +NexT.boot = {}; + +NexT.boot.registerEvents = function() { + + NexT.utils.registerScrollPercent(); + NexT.utils.registerCanIUseTag(); + + // Mobile top menu bar. + document.querySelector('.site-nav-toggle .toggle').addEventListener('click', event => { + event.currentTarget.classList.toggle('toggle-close'); + const siteNav = document.querySelector('.site-nav'); + if (!siteNav) return; + siteNav.style.setProperty('--scroll-height', siteNav.scrollHeight + 'px'); + document.body.classList.toggle('site-nav-on'); + }); + + document.querySelectorAll('.sidebar-nav li').forEach((element, index) => { + element.addEventListener('click', () => { + NexT.utils.activateSidebarPanel(index); + }); + }); + + window.addEventListener('hashchange', () => { + const tHash = location.hash; + if (tHash !== '' && !tHash.match(/%\S{2}/)) { + const target = document.querySelector(`.tabs ul.nav-tabs li a[href="${tHash}"]`); + target && target.click(); + } + }); + + window.addEventListener('tabs:click', e => { + NexT.utils.registerCodeblock(e.target); + }); +}; + +NexT.boot.refresh = function() { + + /** + * Register JS handlers by condition option. + * Need to add config option in Front-End at 'scripts/helpers/next-config.js' file. + */ + CONFIG.prism && window.Prism.highlightAll(); + CONFIG.mediumzoom && window.mediumZoom('.post-body :not(a) > img, .post-body > img', { + background: 'var(--content-bg-color)' + }); + CONFIG.lazyload && window.lozad('.post-body img').observe(); + CONFIG.pangu && window.pangu.spacingPage(); + + CONFIG.exturl && NexT.utils.registerExtURL(); + NexT.utils.wrapTableWithBox(); + NexT.utils.registerCodeblock(); + NexT.utils.registerTabsTag(); + NexT.utils.registerActiveMenuItem(); + NexT.utils.registerLangSelect(); + NexT.utils.registerSidebarTOC(); + NexT.utils.registerPostReward(); + NexT.utils.registerVideoIframe(); +}; + +NexT.boot.motion = function() { + // Define Motion Sequence & Bootstrap Motion. + if (CONFIG.motion.enable) { + NexT.motion.integrator + .add(NexT.motion.middleWares.header) + .add(NexT.motion.middleWares.postList) + .add(NexT.motion.middleWares.sidebar) + .add(NexT.motion.middleWares.footer) + .bootstrap(); + } + NexT.utils.updateSidebarPosition(); +}; + +document.addEventListener('DOMContentLoaded', () => { + NexT.boot.registerEvents(); + NexT.boot.refresh(); + NexT.boot.motion(); +}); diff --git a/themes/next/source/js/pjax.js b/themes/next/source/js/pjax.js new file mode 100644 index 0000000..f81a6a0 --- /dev/null +++ b/themes/next/source/js/pjax.js @@ -0,0 +1,50 @@ +/* global NexT, CONFIG, Pjax */ + +const pjax = new Pjax({ + selectors: [ + 'head title', + 'script[type="application/json"]', + // Precede .main-inner to prevent placeholder TOC changes asap + '.post-toc-wrap', + '.main-inner', + '.languages', + '.pjax' + ], + switches: { + '.post-toc-wrap': function(oldWrap, newWrap) { + if (newWrap.querySelector('.post-toc')) { + Pjax.switches.outerHTML.call(this, oldWrap, newWrap); + } else { + const curTOC = oldWrap.querySelector('.post-toc'); + if (curTOC) { + curTOC.classList.add('placeholder-toc'); + } + this.onSwitch(); + } + } + }, + analytics: false, + cacheBust: false, + scrollTo : !CONFIG.bookmark.enable +}); + +document.addEventListener('pjax:success', () => { + pjax.executeScripts(document.querySelectorAll('script[data-pjax]')); + NexT.boot.refresh(); + // Define Motion Sequence & Bootstrap Motion. + if (CONFIG.motion.enable) { + NexT.motion.integrator + .init() + .add(NexT.motion.middleWares.subMenu) + .add(NexT.motion.middleWares.postList) + // Add sidebar-post-related transition. + .add(NexT.motion.middleWares.sidebar) + .bootstrap(); + } + if (CONFIG.sidebar.display !== 'remove') { + const hasTOC = document.querySelector('.post-toc:not(.placeholder-toc)'); + document.querySelector('.sidebar-inner').classList.toggle('sidebar-nav-active', hasTOC); + NexT.utils.activateSidebarPanel(hasTOC ? 0 : 1); + NexT.utils.updateSidebarPosition(); + } +}); diff --git a/themes/next/source/js/schedule.js b/themes/next/source/js/schedule.js new file mode 100644 index 0000000..8f0c26c --- /dev/null +++ b/themes/next/source/js/schedule.js @@ -0,0 +1,138 @@ +/* global CONFIG */ + +// https://developers.google.com/calendar/api/v3/reference/events/list +(function() { + // Initialization + const calendar = { + orderBy : 'startTime', + showLocation: false, + offsetMax : 72, + offsetMin : 4, + showDeleted : false, + singleEvents: true, + maxResults : 250 + }; + + // Read config form theme config file + Object.assign(calendar, CONFIG.calendar); + + const now = new Date(); + const timeMax = new Date(); + const timeMin = new Date(); + + timeMax.setHours(now.getHours() + calendar.offsetMax); + timeMin.setHours(now.getHours() - calendar.offsetMin); + + // Build URL + const params = { + key : calendar.api_key, + orderBy : calendar.orderBy, + timeMax : timeMax.toISOString(), + timeMin : timeMin.toISOString(), + showDeleted : calendar.showDeleted, + singleEvents: calendar.singleEvents, + maxResults : calendar.maxResults + }; + + const request_url = new URL(`https://www.googleapis.com/calendar/v3/calendars/${calendar.calendar_id}/events`); + Object.entries(params).forEach(param => request_url.searchParams.append(...param)); + + function getRelativeTime(current, previous) { + const msPerMinute = 60 * 1000; + const msPerHour = msPerMinute * 60; + const msPerDay = msPerHour * 24; + const msPerMonth = msPerDay * 30; + const msPerYear = msPerDay * 365; + + let elapsed = current - previous; + const tense = elapsed > 0 ? ' ago' : ' later'; + + elapsed = Math.abs(elapsed); + + if (elapsed < msPerHour) { + return Math.round(elapsed / msPerMinute) + ' minutes' + tense; + } else if (elapsed < msPerDay) { + return Math.round(elapsed / msPerHour) + ' hours' + tense; + } else if (elapsed < msPerMonth) { + return 'about ' + Math.round(elapsed / msPerDay) + ' days' + tense; + } else if (elapsed < msPerYear) { + return 'about ' + Math.round(elapsed / msPerMonth) + ' months' + tense; + } + + return 'about ' + Math.round(elapsed / msPerYear) + ' years' + tense; + } + + function buildEventDOM(tense, event, start, end) { + const durationFormat = { + weekday: 'short', + hour : '2-digit', + minute : '2-digit' + }; + const relativeTime = tense === 'now' ? 'NOW' : getRelativeTime(now, start); + const duration = start.toLocaleTimeString([], durationFormat) + ' - ' + end.toLocaleTimeString([], durationFormat); + + let location = ''; + if (calendar.showLocation && event.location) { + location = `${event.location}`; + } + let description = ''; + if (event.description) { + description = `${event.description}`; + } + + const eventContent = `
    +

    + ${event.summary} + ${relativeTime} +

    + ${location} + ${duration} + ${description} +
    `; + return eventContent; + } + + function fetchData() { + const eventList = document.querySelector('.event-list'); + if (!eventList) return; + + fetch(request_url.href).then(response => { + return response.json(); + }).then(data => { + if (data.items.length === 0) { + eventList.innerHTML = '
    '; + return; + } + // Clean the event list + eventList.innerHTML = ''; + let prevEnd = 0; // used to decide where to insert an
    + const utc = new Date().getTimezoneOffset() * 60000; + + data.items.forEach(event => { + // Parse data + const start = new Date(event.start.dateTime || (new Date(event.start.date).getTime() + utc)); + const end = new Date(event.end.dateTime || (new Date(event.end.date).getTime() + utc)); + + let tense = 'now'; + if (end < now) { + tense = 'past'; + } else if (start > now) { + tense = 'future'; + } + + if (tense === 'future' && prevEnd < now) { + eventList.insertAdjacentHTML('beforeend', '
    '); + } + + eventList.insertAdjacentHTML('beforeend', buildEventDOM(tense, event, start, end)); + prevEnd = end; + }); + }); + } + + fetchData(); + const fetchDataTimer = setInterval(fetchData, 60000); + document.addEventListener('pjax:send', () => { + clearInterval(fetchDataTimer); + }); +})(); diff --git a/themes/next/source/js/schemes/muse.js b/themes/next/source/js/schemes/muse.js new file mode 100644 index 0000000..ba60b51 --- /dev/null +++ b/themes/next/source/js/schemes/muse.js @@ -0,0 +1,60 @@ +/* global CONFIG */ + +document.addEventListener('DOMContentLoaded', () => { + + const isRight = CONFIG.sidebar.position === 'right'; + + const sidebarToggleMotion = { + mouse: {}, + init : function() { + window.addEventListener('mousedown', this.mousedownHandler.bind(this)); + window.addEventListener('mouseup', this.mouseupHandler.bind(this)); + document.querySelector('.sidebar-dimmer').addEventListener('click', this.clickHandler.bind(this)); + document.querySelector('.sidebar-toggle').addEventListener('click', this.clickHandler.bind(this)); + window.addEventListener('sidebar:show', this.showSidebar); + window.addEventListener('sidebar:hide', this.hideSidebar); + }, + mousedownHandler: function(event) { + this.mouse.X = event.pageX; + this.mouse.Y = event.pageY; + }, + mouseupHandler: function(event) { + const deltaX = event.pageX - this.mouse.X; + const deltaY = event.pageY - this.mouse.Y; + const clickingBlankPart = Math.hypot(deltaX, deltaY) < 20 && event.target.matches('.main'); + // Fancybox has z-index property, but medium-zoom does not, so the sidebar will overlay the zoomed image. + if (clickingBlankPart || event.target.matches('img.medium-zoom-image')) { + this.hideSidebar(); + } + }, + clickHandler: function() { + document.body.classList.contains('sidebar-active') ? this.hideSidebar() : this.showSidebar(); + }, + showSidebar: function() { + document.body.classList.add('sidebar-active'); + const animateAction = isRight ? 'fadeInRight' : 'fadeInLeft'; + document.querySelectorAll('.sidebar .animated').forEach((element, index) => { + element.style.animationDelay = (100 * index) + 'ms'; + element.classList.remove(animateAction); + setTimeout(() => { + // Trigger a DOM reflow + element.classList.add(animateAction); + }); + }); + }, + hideSidebar: function() { + document.body.classList.remove('sidebar-active'); + } + }; + if (CONFIG.sidebar.display !== 'remove') sidebarToggleMotion.init(); + + function updateFooterPosition() { + const footer = document.querySelector('.footer'); + const containerHeight = document.querySelector('.main').offsetHeight + footer.offsetHeight; + footer.classList.toggle('footer-fixed', containerHeight <= window.innerHeight); + } + + updateFooterPosition(); + window.addEventListener('resize', updateFooterPosition); + window.addEventListener('scroll', updateFooterPosition, { passive: true }); +}); diff --git a/themes/next/source/js/third-party/addtoany.js b/themes/next/source/js/third-party/addtoany.js new file mode 100644 index 0000000..f9009f8 --- /dev/null +++ b/themes/next/source/js/third-party/addtoany.js @@ -0,0 +1,8 @@ +/* global NexT */ + +document.addEventListener('page:loaded', () => { + NexT.utils.getScript('https://static.addtoany.com/menu/page.js', { condition: window.a2a }) + .then(() => { + window.a2a.init(); + }); +}); diff --git a/themes/next/source/js/third-party/analytics/baidu-analytics.js b/themes/next/source/js/third-party/analytics/baidu-analytics.js new file mode 100644 index 0000000..c10e7d0 --- /dev/null +++ b/themes/next/source/js/third-party/analytics/baidu-analytics.js @@ -0,0 +1,7 @@ +/* global _hmt */ + +if (!window._hmt) window._hmt = []; + +document.addEventListener('pjax:success', () => { + _hmt.push(['_trackPageview', location.pathname]); +}); diff --git a/themes/next/source/js/third-party/analytics/google-analytics.js b/themes/next/source/js/third-party/analytics/google-analytics.js new file mode 100644 index 0000000..8601806 --- /dev/null +++ b/themes/next/source/js/third-party/analytics/google-analytics.js @@ -0,0 +1,53 @@ +/* global CONFIG, dataLayer, gtag */ + +if (!CONFIG.google_analytics.only_pageview) { + if (CONFIG.hostname === location.hostname) { + window.dataLayer = window.dataLayer || []; + window.gtag = function() { + dataLayer.push(arguments); + }; + gtag('js', new Date()); + gtag('config', CONFIG.google_analytics.tracking_id); + + document.addEventListener('pjax:success', () => { + gtag('event', 'page_view', { + page_location: location.href, + page_path : location.pathname, + page_title : document.title + }); + }); + } +} else { + const sendPageView = () => { + if (CONFIG.hostname !== location.hostname) return; + const uid = localStorage.getItem('uid') || (Math.random() + '.' + Math.random()); + localStorage.setItem('uid', uid); + fetch( + 'https://www.google-analytics.com/mp/collect?' + new URLSearchParams({ + api_secret : CONFIG.google_analytics.measure_protocol_api_secret, + measurement_id: CONFIG.google_analytics.tracking_id + }), + { + method : 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + client_id: uid, + events : [ + { + name : 'page_view', + params: { + page_location: location.href, + page_title : document.title + } + } + ] + }), + mode: 'no-cors' + } + ); + }; + document.addEventListener('pjax:complete', sendPageView); + sendPageView(); +} diff --git a/themes/next/source/js/third-party/analytics/growingio.js b/themes/next/source/js/third-party/analytics/growingio.js new file mode 100644 index 0000000..0460833 --- /dev/null +++ b/themes/next/source/js/third-party/analytics/growingio.js @@ -0,0 +1,10 @@ +/* global CONFIG, gio */ + +if (!window.gio) { + window.gio = function() { + (window.gio.q = window.gio.q || []).push(arguments); + }; +} + +gio('init', `${CONFIG.growingio_analytics}`, {}); +gio('send'); diff --git a/themes/next/source/js/third-party/analytics/matomo.js b/themes/next/source/js/third-party/analytics/matomo.js new file mode 100644 index 0000000..290a3e0 --- /dev/null +++ b/themes/next/source/js/third-party/analytics/matomo.js @@ -0,0 +1,19 @@ +/* global CONFIG */ + +if (CONFIG.matomo.enable) { + window._paq = window._paq || []; + const _paq = window._paq; + + /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ + _paq.push(['trackPageView']); + _paq.push(['enableLinkTracking']); + const u = CONFIG.matomo.server_url; + _paq.push(['setTrackerUrl', u + 'matomo.php']); + _paq.push(['setSiteId', CONFIG.matomo.site_id]); + const d = document; + const g = d.createElement('script'); + const s = d.getElementsByTagName('script')[0]; + g.async = true; + g.src = u + 'matomo.js'; + s.parentNode.insertBefore(g, s); +} diff --git a/themes/next/source/js/third-party/chat/chatra.js b/themes/next/source/js/third-party/chat/chatra.js new file mode 100644 index 0000000..e495b8e --- /dev/null +++ b/themes/next/source/js/third-party/chat/chatra.js @@ -0,0 +1,19 @@ +/* global CONFIG, Chatra */ + +(function() { + if (CONFIG.chatra.embed) { + window.ChatraSetup = { + mode : 'frame', + injectTo: CONFIG.chatra.embed + }; + } + + window.ChatraID = CONFIG.chatra.id; + + const chatButton = document.querySelector('.sidebar-button button'); + if (chatButton) { + chatButton.addEventListener('click', () => { + Chatra('openChat', true); + }); + } +})(); diff --git a/themes/next/source/js/third-party/chat/tidio.js b/themes/next/source/js/third-party/chat/tidio.js new file mode 100644 index 0000000..bffb918 --- /dev/null +++ b/themes/next/source/js/third-party/chat/tidio.js @@ -0,0 +1,10 @@ +/* global tidioChatApi */ + +(function() { + const chatButton = document.querySelector('.sidebar-button button'); + if (chatButton) { + chatButton.addEventListener('click', () => { + tidioChatApi.open(); + }); + } +})(); diff --git a/themes/next/source/js/third-party/comments/changyan.js b/themes/next/source/js/third-party/comments/changyan.js new file mode 100644 index 0000000..18a1be4 --- /dev/null +++ b/themes/next/source/js/third-party/comments/changyan.js @@ -0,0 +1,39 @@ +/* global NexT, CONFIG */ + +document.addEventListener('page:loaded', () => { + const { appid, appkey } = CONFIG.changyan; + const mainJs = 'https://cy-cdn.kuaizhan.com/upload/changyan.js'; + const countJs = `https://cy-cdn.kuaizhan.com/upload/plugins/plugins.list.count.js?clientId=${appid}`; + + // Get the number of comments + setTimeout(() => { + return NexT.utils.getScript(countJs, { + attributes: { + async: true, + id : 'cy_cmt_num' + } + }); + }, 0); + + // When scroll to comment section + if (CONFIG.page.comments && !CONFIG.page.isHome) { + NexT.utils.loadComments('#SOHUCS') + .then(() => { + return NexT.utils.getScript(mainJs, { + attributes: { + async: true + } + }); + }) + .then(() => { + window.changyan.api.config({ + appid, + conf: appkey + }); + }) + .catch(error => { + // eslint-disable-next-line no-console + console.error('Failed to load Changyan', error); + }); + } +}); diff --git a/themes/next/source/js/third-party/comments/disqus.js b/themes/next/source/js/third-party/comments/disqus.js new file mode 100644 index 0000000..4d1ca9e --- /dev/null +++ b/themes/next/source/js/third-party/comments/disqus.js @@ -0,0 +1,41 @@ +/* global NexT, CONFIG, DISQUS */ + +document.addEventListener('page:loaded', () => { + + if (CONFIG.disqus.count) { + if (window.DISQUSWIDGETS) { + window.DISQUSWIDGETS.getCount({ reset: true }); + } else { + // Defer loading until the whole page loading is completed + NexT.utils.getScript(`https://${CONFIG.disqus.shortname}.disqus.com/count.js`, { + attributes: { id: 'dsq-count-scr', defer: true } + }); + } + } + + if (CONFIG.page.comments) { + // `disqus_config` should be a global variable + // See https://help.disqus.com/en/articles/1717084-javascript-configuration-variables + window.disqus_config = function() { + this.page.url = CONFIG.page.permalink; + this.page.identifier = CONFIG.page.path; + this.page.title = CONFIG.page.title; + if (CONFIG.disqus.i18n.disqus !== 'disqus') { + this.language = CONFIG.disqus.i18n.disqus; + } + }; + NexT.utils.loadComments('#disqus_thread').then(() => { + if (window.DISQUS) { + DISQUS.reset({ + reload: true, + config: window.disqus_config + }); + } else { + NexT.utils.getScript(`https://${CONFIG.disqus.shortname}.disqus.com/embed.js`, { + attributes: { dataset: { timestamp: '' + +new Date() } } + }); + } + }); + } + +}); diff --git a/themes/next/source/js/third-party/comments/disqusjs.js b/themes/next/source/js/third-party/comments/disqusjs.js new file mode 100644 index 0000000..d8401ee --- /dev/null +++ b/themes/next/source/js/third-party/comments/disqusjs.js @@ -0,0 +1,23 @@ +/* global NexT, CONFIG, DisqusJS */ + +document.addEventListener('page:loaded', () => { + if (!CONFIG.page.comments) return; + + NexT.utils.loadComments('#disqus_thread') + .then(() => NexT.utils.getScript(CONFIG.disqusjs.js, { condition: window.DisqusJS })) + .then(() => { + window.dsqjs = new DisqusJS({ + api : CONFIG.disqusjs.api || 'https://disqus.com/api/', + apikey : CONFIG.disqusjs.apikey, + shortname : CONFIG.disqusjs.shortname, + url : CONFIG.page.permalink, + identifier: CONFIG.page.path, + title : CONFIG.page.title + }); + window.dsqjs.render(document.querySelector('.disqusjs-container')); + }); +}); + +document.addEventListener('pjax:send', () => { + if (window.dsqjs) window.dsqjs.destroy(); +}); diff --git a/themes/next/source/js/third-party/comments/gitalk.js b/themes/next/source/js/third-party/comments/gitalk.js new file mode 100644 index 0000000..08d07f4 --- /dev/null +++ b/themes/next/source/js/third-party/comments/gitalk.js @@ -0,0 +1,24 @@ +/* global NexT, CONFIG, Gitalk */ + +document.addEventListener('page:loaded', () => { + if (!CONFIG.page.comments) return; + + NexT.utils.loadComments('.gitalk-container') + .then(() => NexT.utils.getScript(CONFIG.gitalk.js, { + condition: window.Gitalk + })) + .then(() => { + const gitalk = new Gitalk({ + clientID : CONFIG.gitalk.client_id, + clientSecret : CONFIG.gitalk.client_secret, + repo : CONFIG.gitalk.repo, + owner : CONFIG.gitalk.github_id, + admin : [CONFIG.gitalk.admin_user], + id : CONFIG.gitalk.path_md5, + proxy : CONFIG.gitalk.proxy, + language : CONFIG.gitalk.language || window.navigator.language, + distractionFreeMode: CONFIG.gitalk.distraction_free_mode + }); + gitalk.render(document.querySelector('.gitalk-container')); + }); +}); diff --git a/themes/next/source/js/third-party/comments/isso.js b/themes/next/source/js/third-party/comments/isso.js new file mode 100644 index 0000000..2c70601 --- /dev/null +++ b/themes/next/source/js/third-party/comments/isso.js @@ -0,0 +1,15 @@ +/* global NexT, CONFIG */ + +document.addEventListener('page:loaded', () => { + if (!CONFIG.page.comments) return; + + NexT.utils.loadComments('#isso-thread') + .then(() => NexT.utils.getScript(`${CONFIG.isso}js/embed.min.js`, { + attributes: { + dataset: { + isso: `${CONFIG.isso}` + } + }, + parentNode: document.querySelector('#isso-thread') + })); +}); diff --git a/themes/next/source/js/third-party/comments/livere.js b/themes/next/source/js/third-party/comments/livere.js new file mode 100644 index 0000000..c4bcd2e --- /dev/null +++ b/themes/next/source/js/third-party/comments/livere.js @@ -0,0 +1,19 @@ +/* global NexT, CONFIG, LivereTower */ + +document.addEventListener('page:loaded', () => { + if (!CONFIG.page.comments) return; + + NexT.utils.loadComments('#lv-container').then(() => { + window.livereOptions = { + refer: CONFIG.page.path.replace(/index\.html$/, '') + }; + + if (typeof LivereTower === 'function') return; + + NexT.utils.getScript('https://cdn-city.livere.com/js/embed.dist.js', { + attributes: { + async: true + } + }); + }); +}); diff --git a/themes/next/source/js/third-party/comments/utterances.js b/themes/next/source/js/third-party/comments/utterances.js new file mode 100644 index 0000000..332ee05 --- /dev/null +++ b/themes/next/source/js/third-party/comments/utterances.js @@ -0,0 +1,17 @@ +/* global NexT, CONFIG */ + +document.addEventListener('page:loaded', () => { + if (!CONFIG.page.comments) return; + + NexT.utils.loadComments('.utterances-container') + .then(() => NexT.utils.getScript('https://utteranc.es/client.js', { + attributes: { + async : true, + crossOrigin : 'anonymous', + 'repo' : CONFIG.utterances.repo, + 'issue-term': CONFIG.utterances.issue_term, + 'theme' : CONFIG.utterances.theme + }, + parentNode: document.querySelector('.utterances-container') + })); +}); diff --git a/themes/next/source/js/third-party/fancybox.js b/themes/next/source/js/third-party/fancybox.js new file mode 100644 index 0000000..178db4b --- /dev/null +++ b/themes/next/source/js/third-party/fancybox.js @@ -0,0 +1,35 @@ +/* global Fancybox */ + +document.addEventListener('page:loaded', () => { + + /** + * Wrap images with fancybox. + */ + document.querySelectorAll('.post-body :not(a) > img, .post-body > img').forEach(image => { + const imageLink = image.dataset.src || image.src; + const imageWrapLink = document.createElement('a'); + imageWrapLink.classList.add('fancybox'); + imageWrapLink.href = imageLink; + imageWrapLink.setAttribute('itemscope', ''); + imageWrapLink.setAttribute('itemtype', 'http://schema.org/ImageObject'); + imageWrapLink.setAttribute('itemprop', 'url'); + + let dataFancybox = 'default'; + if (image.closest('.post-gallery') !== null) { + dataFancybox = 'gallery'; + } else if (image.closest('.group-picture') !== null) { + dataFancybox = 'group'; + } + imageWrapLink.dataset.fancybox = dataFancybox; + + const imageTitle = image.title || image.alt; + if (imageTitle) { + imageWrapLink.title = imageTitle; + // Make sure img captions will show correctly in fancybox + imageWrapLink.dataset.caption = imageTitle; + } + image.wrap(imageWrapLink); + }); + + Fancybox.bind('[data-fancybox]'); +}); diff --git a/themes/next/source/js/third-party/math/katex.js b/themes/next/source/js/third-party/math/katex.js new file mode 100644 index 0000000..ad745b1 --- /dev/null +++ b/themes/next/source/js/third-party/math/katex.js @@ -0,0 +1,7 @@ +/* global NexT, CONFIG */ + +document.addEventListener('page:loaded', () => { + if (!CONFIG.enableMath) return; + + NexT.utils.getScript(CONFIG.katex.copy_tex_js).catch(() => {}); +}); diff --git a/themes/next/source/js/third-party/math/mathjax.js b/themes/next/source/js/third-party/math/mathjax.js new file mode 100644 index 0000000..fe4d448 --- /dev/null +++ b/themes/next/source/js/third-party/math/mathjax.js @@ -0,0 +1,36 @@ +/* global NexT, CONFIG, MathJax */ + +document.addEventListener('page:loaded', () => { + if (!CONFIG.enableMath) return; + + if (typeof MathJax === 'undefined') { + window.MathJax = { + tex: { + inlineMath: { '[+]': [['$', '$']] }, + tags : CONFIG.mathjax.tags + }, + options: { + renderActions: { + insertedScript: [200, () => { + document.querySelectorAll('mjx-container').forEach(node => { + const target = node.parentNode; + if (target.nodeName.toLowerCase() === 'li') { + target.parentNode.classList.add('has-jax'); + } + }); + }, '', false] + } + } + }; + NexT.utils.getScript(CONFIG.mathjax.js, { + attributes: { + defer: true + } + }); + } else { + MathJax.startup.document.state(0); + MathJax.typesetClear(); + MathJax.texReset(); + MathJax.typesetPromise(); + } +}); diff --git a/themes/next/source/js/third-party/pace.js b/themes/next/source/js/third-party/pace.js new file mode 100644 index 0000000..c22d59f --- /dev/null +++ b/themes/next/source/js/third-party/pace.js @@ -0,0 +1,7 @@ +/* global Pace */ + +Pace.options.restartOnPushState = false; + +document.addEventListener('pjax:send', () => { + Pace.restart(); +}); diff --git a/themes/next/source/js/third-party/quicklink.js b/themes/next/source/js/third-party/quicklink.js new file mode 100644 index 0000000..2543ad1 --- /dev/null +++ b/themes/next/source/js/third-party/quicklink.js @@ -0,0 +1,37 @@ +/* global CONFIG, quicklink */ + +(function() { + if (typeof CONFIG.quicklink.ignores === 'string') { + const ignoresStr = `[${CONFIG.quicklink.ignores}]`; + CONFIG.quicklink.ignores = JSON.parse(ignoresStr); + } + + let resetFn = null; + + const onRefresh = () => { + if (resetFn) resetFn(); + if (!CONFIG.quicklink.enable) return; + + let ignoresArr = CONFIG.quicklink.ignores || []; + if (!Array.isArray(ignoresArr)) { + ignoresArr = [ignoresArr]; + } + + resetFn = quicklink.listen({ + timeout : CONFIG.quicklink.timeout, + priority: CONFIG.quicklink.priority, + ignores : [ + uri => uri.includes('#'), + uri => uri === CONFIG.quicklink.url, + ...ignoresArr + ] + }); + }; + + if (CONFIG.quicklink.delay) { + window.addEventListener('load', onRefresh); + document.addEventListener('pjax:success', onRefresh); + } else { + document.addEventListener('page:loaded', onRefresh); + } +})(); diff --git a/themes/next/source/js/third-party/search/algolia-search.js b/themes/next/source/js/third-party/search/algolia-search.js new file mode 100644 index 0000000..12a554c --- /dev/null +++ b/themes/next/source/js/third-party/search/algolia-search.js @@ -0,0 +1,130 @@ +/* global instantsearch, algoliasearch, CONFIG, pjax */ + +document.addEventListener('DOMContentLoaded', () => { + const { indexName, appID, apiKey, hits } = CONFIG.algolia; + + const search = instantsearch({ + indexName, + searchClient : algoliasearch(appID, apiKey), + searchFunction: helper => { + if (document.querySelector('.search-input').value) { + helper.search(); + } + } + }); + + if (typeof pjax === 'object') { + search.on('render', () => { + pjax.refresh(document.querySelector('.algolia-hits')); + }); + } + + // Registering Widgets + search.addWidgets([ + instantsearch.widgets.configure({ + hitsPerPage: hits.per_page || 10 + }), + + instantsearch.widgets.searchBox({ + container : '.search-input-container', + placeholder : CONFIG.i18n.placeholder, + // Hide default icons of algolia search + showReset : false, + showSubmit : false, + showLoadingIndicator: false, + cssClasses : { + input: 'search-input' + } + }), + + instantsearch.widgets.stats({ + container: '.algolia-stats', + templates: { + text: data => { + const stats = CONFIG.i18n.hits_time + .replace('${hits}', data.nbHits) + .replace('${time}', data.processingTimeMS); + return `${stats} + Algolia`; + } + }, + cssClasses: { + text: 'search-stats' + } + }), + + instantsearch.widgets.hits({ + container : '.algolia-hits', + escapeHTML: false, + templates : { + item: data => { + const { title, excerpt, excerptStrip, contentStripTruncate } = data._highlightResult; + let result = `${title.value}`; + const content = excerpt || excerptStrip || contentStripTruncate; + if (content && content.value) { + const div = document.createElement('div'); + div.innerHTML = content.value; + result += `

    ${div.textContent.substring(0, 100)}...

    `; + } + return result; + }, + empty: data => { + return `
    + ${CONFIG.i18n.empty.replace('${query}', data.query)} +
    `; + } + }, + cssClasses: { + list: 'search-result-list' + } + }), + + instantsearch.widgets.pagination({ + container: '.algolia-pagination', + scrollTo : false, + showFirst: false, + showLast : false, + templates: { + first : '', + last : '', + previous: '', + next : '' + }, + cssClasses: { + list : ['pagination', 'algolia-pagination'], + item : 'pagination-item', + link : 'page-number', + selectedItem: 'current', + disabledItem: 'disabled-item' + } + }) + ]); + + search.start(); + + // Handle and trigger popup window + document.querySelectorAll('.popup-trigger').forEach(element => { + element.addEventListener('click', () => { + document.body.classList.add('search-active'); + setTimeout(() => document.querySelector('.search-input').focus(), 500); + }); + }); + + // Monitor main search box + const onPopupClose = () => { + document.body.classList.remove('search-active'); + }; + + document.querySelector('.search-pop-overlay').addEventListener('click', event => { + if (event.target === document.querySelector('.search-pop-overlay')) { + onPopupClose(); + } + }); + document.querySelector('.popup-btn-close').addEventListener('click', onPopupClose); + document.addEventListener('pjax:success', onPopupClose); + window.addEventListener('keyup', event => { + if (event.key === 'Escape') { + onPopupClose(); + } + }); +}); diff --git a/themes/next/source/js/third-party/search/local-search.js b/themes/next/source/js/third-party/search/local-search.js new file mode 100644 index 0000000..92a264d --- /dev/null +++ b/themes/next/source/js/third-party/search/local-search.js @@ -0,0 +1,99 @@ +/* global CONFIG, pjax, LocalSearch */ + +document.addEventListener('DOMContentLoaded', () => { + if (!CONFIG.path) { + // Search DB path + console.warn('`hexo-generator-searchdb` plugin is not installed!'); + return; + } + const localSearch = new LocalSearch({ + path : CONFIG.path, + top_n_per_article: CONFIG.localsearch.top_n_per_article, + unescape : CONFIG.localsearch.unescape + }); + + const input = document.querySelector('.search-input'); + + const inputEventFunction = () => { + if (!localSearch.isfetched) return; + const searchText = input.value.trim().toLowerCase(); + const keywords = searchText.split(/[-\s]+/); + const container = document.querySelector('.search-result-container'); + let resultItems = []; + if (searchText.length > 0) { + // Perform local searching + resultItems = localSearch.getResultItems(keywords); + } + if (keywords.length === 1 && keywords[0] === '') { + container.classList.add('no-result'); + container.innerHTML = '
    '; + } else if (resultItems.length === 0) { + container.classList.add('no-result'); + container.innerHTML = '
    '; + } else { + resultItems.sort((left, right) => { + if (left.includedCount !== right.includedCount) { + return right.includedCount - left.includedCount; + } else if (left.hitCount !== right.hitCount) { + return right.hitCount - left.hitCount; + } + return right.id - left.id; + }); + const stats = CONFIG.i18n.hits.replace('${hits}', resultItems.length); + + container.classList.remove('no-result'); + container.innerHTML = `
    ${stats}
    +
    +
      ${resultItems.map(result => result.item).join('')}
    `; + if (typeof pjax === 'object') pjax.refresh(container); + } + }; + + localSearch.highlightSearchWords(document.querySelector('.post-body')); + if (CONFIG.localsearch.preload) { + localSearch.fetchData(); + } + + if (CONFIG.localsearch.trigger === 'auto') { + input.addEventListener('input', inputEventFunction); + } else { + document.querySelector('.search-icon').addEventListener('click', inputEventFunction); + input.addEventListener('keypress', event => { + if (event.key === 'Enter') { + inputEventFunction(); + } + }); + } + window.addEventListener('search:loaded', inputEventFunction); + + // Handle and trigger popup window + document.querySelectorAll('.popup-trigger').forEach(element => { + element.addEventListener('click', () => { + document.body.classList.add('search-active'); + // Wait for search-popup animation to complete + setTimeout(() => input.focus(), 500); + if (!localSearch.isfetched) localSearch.fetchData(); + }); + }); + + // Monitor main search box + const onPopupClose = () => { + document.body.classList.remove('search-active'); + }; + + document.querySelector('.search-pop-overlay').addEventListener('click', event => { + if (event.target === document.querySelector('.search-pop-overlay')) { + onPopupClose(); + } + }); + document.querySelector('.popup-btn-close').addEventListener('click', onPopupClose); + document.addEventListener('pjax:success', () => { + localSearch.highlightSearchWords(document.querySelector('.post-body')); + onPopupClose(); + }); + window.addEventListener('keyup', event => { + if (event.key === 'Escape') { + onPopupClose(); + } + }); +}); diff --git a/themes/next/source/js/third-party/statistics/firestore.js b/themes/next/source/js/third-party/statistics/firestore.js new file mode 100644 index 0000000..3ea7ba6 --- /dev/null +++ b/themes/next/source/js/third-party/statistics/firestore.js @@ -0,0 +1,60 @@ +/* global CONFIG, firebase */ + +firebase.initializeApp({ + apiKey : CONFIG.firestore.apiKey, + projectId: CONFIG.firestore.projectId +}); + +(function() { + const getCount = (doc, increaseCount) => { + // IncreaseCount will be false when not in article page + return doc.get().then(d => { + // Has no data, initialize count + let count = d.exists ? d.data().count : 0; + // If first view this article + if (increaseCount) { + // Increase count + count++; + doc.set({ + count + }); + } + return count; + }); + }; + + const db = firebase.firestore(); + const articles = db.collection(CONFIG.firestore.collection); + + document.addEventListener('page:loaded', () => { + + if (CONFIG.page.isPost) { + // Fix issue #118 + // https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent + const title = document.querySelector('.post-title').textContent.trim(); + const doc = articles.doc(title); + let increaseCount = CONFIG.hostname === location.hostname; + if (localStorage.getItem(title)) { + increaseCount = false; + } else { + // Mark as visited + localStorage.setItem(title, true); + } + getCount(doc, increaseCount).then(count => { + document.querySelector('.firestore-visitors-count').innerText = count; + }); + } else if (CONFIG.page.isHome) { + const promises = [...document.querySelectorAll('.post-title')].map(element => { + const title = element.textContent.trim(); + const doc = articles.doc(title); + return getCount(doc); + }); + Promise.all(promises).then(counts => { + const metas = document.querySelectorAll('.firestore-visitors-count'); + counts.forEach((val, idx) => { + metas[idx].innerText = val; + }); + }); + } + }); +})(); diff --git a/themes/next/source/js/third-party/statistics/lean-analytics.js b/themes/next/source/js/third-party/statistics/lean-analytics.js new file mode 100644 index 0000000..8397112 --- /dev/null +++ b/themes/next/source/js/third-party/statistics/lean-analytics.js @@ -0,0 +1,107 @@ +/* global CONFIG */ +/* eslint-disable no-console */ + +(function() { + const leancloudSelector = url => { + url = encodeURI(url); + return document.getElementById(url).querySelector('.leancloud-visitors-count'); + }; + + const addCount = Counter => { + const visitors = document.querySelector('.leancloud_visitors'); + const url = decodeURI(visitors.id); + const title = visitors.dataset.flagTitle; + + Counter('get', `/classes/Counter?where=${encodeURIComponent(JSON.stringify({ url }))}`) + .then(response => response.json()) + .then(({ results }) => { + if (results.length > 0) { + const counter = results[0]; + leancloudSelector(url).innerText = counter.time + 1; + Counter('put', '/classes/Counter/' + counter.objectId, { + time: { + '__op' : 'Increment', + 'amount': 1 + } + }) + .catch(error => { + console.error('Failed to save visitor count', error); + }); + } else if (CONFIG.leancloud_visitors.security) { + leancloudSelector(url).innerText = 'Counter not initialized! More info at console err msg.'; + console.error('ATTENTION! LeanCloud counter has security bug, see how to solve it here: https://github.com/theme-next/hexo-leancloud-counter-security. \n However, you can still use LeanCloud without security, by setting `security` option to `false`.'); + } else { + Counter('post', '/classes/Counter', { title, url, time: 1 }) + .then(response => response.json()) + .then(() => { + leancloudSelector(url).innerText = 1; + }) + .catch(error => { + console.error('Failed to create', error); + }); + } + }) + .catch(error => { + console.error('LeanCloud Counter Error', error); + }); + }; + + const showTime = Counter => { + const visitors = document.querySelectorAll('.leancloud_visitors'); + const entries = [...visitors].map(element => { + return decodeURI(element.id); + }); + + Counter('get', `/classes/Counter?where=${encodeURIComponent(JSON.stringify({ url: { '$in': entries } }))}`) + .then(response => response.json()) + .then(({ results }) => { + for (const url of entries) { + const target = results.find(item => item.url === url); + leancloudSelector(url).innerText = target ? target.time : 0; + } + }) + .catch(error => { + console.error('LeanCloud Counter Error', error); + }); + }; + + const { app_id, app_key, server_url } = CONFIG.leancloud_visitors; + const fetchData = api_server => { + const Counter = (method, url, data) => { + return fetch(`${api_server}/1.1${url}`, { + method, + headers: { + 'X-LC-Id' : app_id, + 'X-LC-Key' : app_key, + 'Content-Type': 'application/json' + }, + body: JSON.stringify(data) + }); + }; + if (CONFIG.page.isPost) { + if (CONFIG.hostname !== location.hostname) return; + addCount(Counter); + } else if (document.querySelectorAll('.post-title-link').length >= 1) { + showTime(Counter); + } + }; + + let api_server; + if (server_url) { + api_server = server_url; + } else if (app_id.slice(-9) === '-MdYXbMMI') { + api_server = `https://${app_id.slice(0, 8).toLowerCase()}.api.lncldglobal.com`; + } + + document.addEventListener('page:loaded', () => { + if (api_server) { + fetchData(api_server); + } else { + fetch(`https://app-router.leancloud.cn/2/route?appId=${app_id}`) + .then(response => response.json()) + .then(({ api_server }) => { + fetchData(`https://${api_server}`); + }); + } + }); +})(); diff --git a/themes/next/source/js/third-party/tags/mermaid.js b/themes/next/source/js/third-party/tags/mermaid.js new file mode 100644 index 0000000..54f6288 --- /dev/null +++ b/themes/next/source/js/third-party/tags/mermaid.js @@ -0,0 +1,32 @@ +/* global NexT, CONFIG, mermaid */ + +document.addEventListener('page:loaded', () => { + const mermaidElements = document.querySelectorAll('.mermaid'); + if (mermaidElements.length) { + NexT.utils.getScript(CONFIG.mermaid.js, { + condition: window.mermaid + }).then(() => { + mermaidElements.forEach(element => { + const newElement = document.createElement('div'); + newElement.innerHTML = element.innerHTML; + newElement.className = element.className; + const parent = element.parentNode; + // Fix issue #347 + // Support mermaid inside backtick code block + if (parent.matches('pre')) { + parent.parentNode.replaceChild(newElement, parent); + } else { + parent.replaceChild(newElement, element); + } + }); + mermaid.initialize({ + theme : CONFIG.darkmode && window.matchMedia('(prefers-color-scheme: dark)').matches ? CONFIG.mermaid.theme.dark : CONFIG.mermaid.theme.light, + logLevel : 4, + flowchart: { curve: 'linear' }, + gantt : { axisFormat: '%m/%d/%Y' }, + sequence : { actorMargin: 50 } + }); + mermaid.run(); + }); + } +}); diff --git a/themes/next/source/js/third-party/tags/pdf.js b/themes/next/source/js/third-party/tags/pdf.js new file mode 100644 index 0000000..7e82891 --- /dev/null +++ b/themes/next/source/js/third-party/tags/pdf.js @@ -0,0 +1,23 @@ +/* global NexT, CONFIG, PDFObject */ + +document.addEventListener('page:loaded', () => { + if (document.querySelectorAll('.pdf-container').length) { + NexT.utils.getScript(CONFIG.pdf.object_url, { + condition: window.PDFObject + }).then(() => { + document.querySelectorAll('.pdf-container').forEach(element => { + PDFObject.embed(element.dataset.target, element, { + pdfOpenParams: { + navpanes : 0, + toolbar : 0, + statusbar: 0, + pagemode : 'thumbs', + view : 'FitH' + }, + PDFJS_URL: CONFIG.pdf.url, + height : element.dataset.height + }); + }); + }); + } +}); diff --git a/themes/next/source/js/third-party/tags/wavedrom.js b/themes/next/source/js/third-party/tags/wavedrom.js new file mode 100644 index 0000000..ddd9a1d --- /dev/null +++ b/themes/next/source/js/third-party/tags/wavedrom.js @@ -0,0 +1,13 @@ +/* global NexT, CONFIG, WaveDrom */ + +document.addEventListener('page:loaded', () => { + NexT.utils.getScript(CONFIG.wavedrom.js, { + condition: window.WaveDrom + }).then(() => { + NexT.utils.getScript(CONFIG.wavedrom_skin.js, { + condition: window.WaveSkin + }).then(() => { + WaveDrom.ProcessAll(); + }); + }); +}); diff --git a/themes/next/source/js/utils.js b/themes/next/source/js/utils.js new file mode 100644 index 0000000..808d838 --- /dev/null +++ b/themes/next/source/js/utils.js @@ -0,0 +1,489 @@ +/* global NexT, CONFIG */ + +HTMLElement.prototype.wrap = function(wrapper) { + this.parentNode.insertBefore(wrapper, this); + this.parentNode.removeChild(this); + wrapper.appendChild(this); +}; + +(function() { + const onPageLoaded = () => document.dispatchEvent( + new Event('page:loaded', { + bubbles: true + }) + ); + + if (document.readyState === 'loading') { + document.addEventListener('readystatechange', onPageLoaded, { once: true }); + } else { + onPageLoaded(); + } + document.addEventListener('pjax:success', onPageLoaded); +})(); + +NexT.utils = { + + registerExtURL: function() { + document.querySelectorAll('span.exturl').forEach(element => { + const link = document.createElement('a'); + // https://stackoverflow.com/questions/30106476/using-javascripts-atob-to-decode-base64-doesnt-properly-decode-utf-8-strings + link.href = decodeURIComponent(atob(element.dataset.url).split('').map(c => { + return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2); + }).join('')); + link.rel = 'noopener external nofollow noreferrer'; + link.target = '_blank'; + link.className = element.className; + link.title = element.title; + link.innerHTML = element.innerHTML; + element.parentNode.replaceChild(link, element); + }); + }, + + registerCodeblock: function(element) { + const inited = !!element; + let figure = (inited ? element : document).querySelectorAll('figure.highlight'); + let isHljsWithWrap = true; + if (figure.length === 0) { + figure = document.querySelectorAll('pre:not(.mermaid)'); + isHljsWithWrap = false; + } + figure.forEach(element => { + if (!inited) { + let span = element.querySelectorAll('.code .line span'); + if (span.length === 0) { + // Hljs without line_number and wrap + span = element.querySelectorAll('code.highlight span'); + } + span.forEach(s => { + s.classList.forEach(name => { + s.classList.replace(name, `hljs-${name}`); + }); + }); + } + const height = parseInt(window.getComputedStyle(element).height.replace('px', ''), 10); + const needFold = CONFIG.fold.enable && (height > CONFIG.fold.height); + if (!needFold && !CONFIG.copycode.enable) return; + let target; + if (isHljsWithWrap && CONFIG.copycode.style === 'mac') { + target = element; + } else { + let box = element.querySelector('.code-container'); + if (!box) { + // https://github.com/next-theme/hexo-theme-next/issues/98 + // https://github.com/next-theme/hexo-theme-next/pull/508 + const container = element.querySelector('.table-container') || element; + box = document.createElement('div'); + box.className = 'code-container'; + container.wrap(box); + + // add "notranslate" to prevent Google Translate from translating it, which also completely messes up the layout + box.classList.add('notranslate'); + } + target = box; + } + if (needFold && !target.classList.contains('unfold')) { + target.classList.add('highlight-fold'); + target.insertAdjacentHTML('beforeend', '
    '); + target.querySelector('.expand-btn').addEventListener('click', () => { + target.classList.remove('highlight-fold'); + target.classList.add('unfold'); + }); + } + if (inited || !CONFIG.copycode.enable) return; + // One-click copy code support. + target.insertAdjacentHTML('beforeend', '
    '); + const button = target.querySelector('.copy-btn'); + button.addEventListener('click', () => { + const lines = element.querySelector('.code') || element.querySelector('code'); + const code = lines.innerText; + if (navigator.clipboard) { + // https://caniuse.com/mdn-api_clipboard_writetext + navigator.clipboard.writeText(code).then(() => { + button.querySelector('i').className = 'fa fa-check-circle fa-fw'; + }, () => { + button.querySelector('i').className = 'fa fa-times-circle fa-fw'; + }); + } else { + const ta = document.createElement('textarea'); + ta.style.top = window.scrollY + 'px'; // Prevent page scrolling + ta.style.position = 'absolute'; + ta.style.opacity = '0'; + ta.readOnly = true; + ta.value = code; + document.body.append(ta); + ta.select(); + ta.setSelectionRange(0, code.length); + ta.readOnly = false; + const result = document.execCommand('copy'); + button.querySelector('i').className = result ? 'fa fa-check-circle fa-fw' : 'fa fa-times-circle fa-fw'; + ta.blur(); // For iOS + button.blur(); + document.body.removeChild(ta); + } + }); + element.addEventListener('mouseleave', () => { + setTimeout(() => { + button.querySelector('i').className = 'fa fa-copy fa-fw'; + }, 300); + }); + }); + }, + + wrapTableWithBox: function() { + document.querySelectorAll('table').forEach(element => { + const box = document.createElement('div'); + box.className = 'table-container'; + element.wrap(box); + }); + }, + + registerVideoIframe: function() { + document.querySelectorAll('iframe').forEach(element => { + const supported = [ + 'www.youtube.com', + 'player.vimeo.com', + 'player.youku.com', + 'player.bilibili.com', + 'www.tudou.com' + ].some(host => element.src.includes(host)); + if (supported && !element.parentNode.matches('.video-container')) { + const box = document.createElement('div'); + box.className = 'video-container'; + element.wrap(box); + const width = Number(element.width); + const height = Number(element.height); + if (width && height) { + box.style.paddingTop = (height / width * 100) + '%'; + } + } + }); + }, + + updateActiveNav: function() { + if (!Array.isArray(NexT.utils.sections)) return; + let index = NexT.utils.sections.findIndex(element => { + return element && element.getBoundingClientRect().top > 10; + }); + if (index === -1) { + index = NexT.utils.sections.length - 1; + } else if (index > 0) { + index--; + } + this.activateNavByIndex(index); + }, + + registerScrollPercent: function() { + const backToTop = document.querySelector('.back-to-top'); + const readingProgressBar = document.querySelector('.reading-progress-bar'); + // For init back to top in sidebar if page was scrolled after page refresh. + window.addEventListener('scroll', () => { + if (backToTop || readingProgressBar) { + const contentHeight = document.body.scrollHeight - window.innerHeight; + const scrollPercent = contentHeight > 0 ? Math.min(100 * window.scrollY / contentHeight, 100) : 0; + if (backToTop) { + backToTop.classList.toggle('back-to-top-on', Math.round(scrollPercent) >= 5); + backToTop.querySelector('span').innerText = Math.round(scrollPercent) + '%'; + } + if (readingProgressBar) { + readingProgressBar.style.setProperty('--progress', scrollPercent.toFixed(2) + '%'); + } + } + this.updateActiveNav(); + }, { passive: true }); + + backToTop && backToTop.addEventListener('click', () => { + window.anime({ + targets : document.scrollingElement, + duration : 500, + easing : 'linear', + scrollTop: 0 + }); + }); + }, + + /** + * Tabs tag listener (without twitter bootstrap). + */ + registerTabsTag: function() { + // Binding `nav-tabs` & `tab-content` by real time permalink changing. + document.querySelectorAll('.tabs ul.nav-tabs .tab').forEach(element => { + element.addEventListener('click', event => { + event.preventDefault(); + // Prevent selected tab to select again. + if (element.classList.contains('active')) return; + const nav = element.parentNode; + // Get the height of `tab-pane` which is activated before, and set it as the height of `tab-content` with extra margin / paddings. + const tabContent = nav.nextElementSibling; + tabContent.style.overflow = 'hidden'; + tabContent.style.transition = 'height 1s'; + // Comment system selection tab does not contain .active class. + const activeTab = tabContent.querySelector('.active') || tabContent.firstElementChild; + // Hight might be `auto`. + const prevHeight = parseInt(window.getComputedStyle(activeTab).height.replace('px', ''), 10) || 0; + const paddingTop = parseInt(window.getComputedStyle(activeTab).paddingTop.replace('px', ''), 10); + const marginBottom = parseInt(window.getComputedStyle(activeTab.firstElementChild).marginBottom.replace('px', ''), 10); + tabContent.style.height = prevHeight + paddingTop + marginBottom + 'px'; + // Add & Remove active class on `nav-tabs` & `tab-content`. + [...nav.children].forEach(target => { + target.classList.toggle('active', target === element); + }); + // https://stackoverflow.com/questions/20306204/using-queryselector-with-ids-that-are-numbers + const tActive = document.getElementById(element.querySelector('a').getAttribute('href').replace('#', '')); + [...tActive.parentNode.children].forEach(target => { + target.classList.toggle('active', target === tActive); + }); + // Trigger event + tActive.dispatchEvent(new Event('tabs:click', { + bubbles: true + })); + // Get the height of `tab-pane` which is activated now. + const hasScrollBar = document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight); + const currHeight = parseInt(window.getComputedStyle(tabContent.querySelector('.active')).height.replace('px', ''), 10); + // Reset the height of `tab-content` and see the animation. + tabContent.style.height = currHeight + paddingTop + marginBottom + 'px'; + // Change the height of `tab-content` may cause scrollbar show / disappear, which may result in the change of the `tab-pane`'s height + setTimeout(() => { + if ((document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight)) !== hasScrollBar) { + tabContent.style.transition = 'height 0.3s linear'; + // After the animation, we need reset the height of `tab-content` again. + const currHeightAfterScrollBarChange = parseInt(window.getComputedStyle(tabContent.querySelector('.active')).height.replace('px', ''), 10); + tabContent.style.height = currHeightAfterScrollBarChange + paddingTop + marginBottom + 'px'; + } + // Remove all the inline styles, and let the height be adaptive again. + setTimeout(() => { + tabContent.style.transition = ''; + tabContent.style.height = ''; + }, 250); + }, 1000); + if (!CONFIG.stickytabs) return; + const offset = nav.parentNode.getBoundingClientRect().top + window.scrollY + 10; + window.anime({ + targets : document.scrollingElement, + duration : 500, + easing : 'linear', + scrollTop: offset + }); + }); + }); + + window.dispatchEvent(new Event('tabs:register')); + }, + + registerCanIUseTag: function() { + // Get responsive height passed from iframe. + window.addEventListener('message', ({ data }) => { + if (typeof data === 'string' && data.includes('ciu_embed')) { + const featureID = data.split(':')[1]; + const height = data.split(':')[2]; + document.querySelector(`iframe[data-feature=${featureID}]`).style.height = parseInt(height, 10) + 5 + 'px'; + } + }, false); + }, + + registerActiveMenuItem: function() { + document.querySelectorAll('.menu-item a[href]').forEach(target => { + const isSamePath = target.pathname === location.pathname || target.pathname === location.pathname.replace('index.html', ''); + const isSubPath = !CONFIG.root.startsWith(target.pathname) && location.pathname.startsWith(target.pathname); + target.classList.toggle('menu-item-active', target.hostname === location.hostname && (isSamePath || isSubPath)); + }); + }, + + registerLangSelect: function() { + const selects = document.querySelectorAll('.lang-select'); + selects.forEach(sel => { + sel.value = CONFIG.page.lang; + sel.addEventListener('change', () => { + const target = sel.options[sel.selectedIndex]; + document.querySelectorAll('.lang-select-label span').forEach(span => { + span.innerText = target.text; + }); + // Disable Pjax to force refresh translation of menu item + window.location.href = target.dataset.href; + }); + }); + }, + + registerSidebarTOC: function() { + this.sections = [...document.querySelectorAll('.post-toc:not(.placeholder-toc) li a.nav-link')].map(element => { + const target = document.getElementById(decodeURI(element.getAttribute('href')).replace('#', '')); + // TOC item animation navigate. + element.addEventListener('click', event => { + event.preventDefault(); + const offset = target.getBoundingClientRect().top + window.scrollY; + window.anime({ + targets : document.scrollingElement, + duration : 500, + easing : 'linear', + scrollTop: offset, + complete : () => { + history.pushState(null, document.title, element.href); + } + }); + }); + return target; + }); + this.updateActiveNav(); + }, + + registerPostReward: function() { + const button = document.querySelector('.reward-container button'); + if (!button) return; + button.addEventListener('click', () => { + document.querySelector('.post-reward').classList.toggle('active'); + }); + }, + + activateNavByIndex: function(index) { + const nav = document.querySelector('.post-toc:not(.placeholder-toc) .nav'); + if (!nav) return; + + const navItemList = nav.querySelectorAll('.nav-item'); + const target = navItemList[index]; + if (!target || target.classList.contains('active-current')) return; + + const singleHeight = navItemList[navItemList.length - 1].offsetHeight; + + nav.querySelectorAll('.active').forEach(navItem => { + navItem.classList.remove('active', 'active-current'); + }); + target.classList.add('active', 'active-current'); + + let activateEle = target.querySelector('.nav-child') || target.parentElement; + let navChildHeight = 0; + + while (nav.contains(activateEle)) { + if (activateEle.classList.contains('nav-item')) { + activateEle.classList.add('active'); + } else { // .nav-child or .nav + // scrollHeight isn't reliable for transitioning child items. + // The last nav-item in a list has a margin-bottom of 5px. + navChildHeight += (singleHeight * activateEle.childElementCount) + 5; + activateEle.style.setProperty('--height', `${navChildHeight}px`); + } + activateEle = activateEle.parentElement; + } + + // Scrolling to center active TOC element if TOC content is taller then viewport. + const tocElement = document.querySelector(CONFIG.scheme === 'Pisces' || CONFIG.scheme === 'Gemini' ? '.sidebar-panel-container' : '.sidebar'); + if (!document.querySelector('.sidebar-toc-active')) return; + window.anime({ + targets : tocElement, + duration : 200, + easing : 'linear', + scrollTop: tocElement.scrollTop - (tocElement.offsetHeight / 2) + target.getBoundingClientRect().top - tocElement.getBoundingClientRect().top + }); + }, + + updateSidebarPosition: function() { + if (window.innerWidth < 1200 || CONFIG.scheme === 'Pisces' || CONFIG.scheme === 'Gemini') return; + // Expand sidebar on post detail page by default, when post has a toc. + const hasTOC = document.querySelector('.post-toc:not(.placeholder-toc)'); + let display = CONFIG.page.sidebar; + if (typeof display !== 'boolean') { + // There's no definition sidebar in the page front-matter. + display = CONFIG.sidebar.display === 'always' || (CONFIG.sidebar.display === 'post' && hasTOC); + } + if (display) { + window.dispatchEvent(new Event('sidebar:show')); + } + }, + + activateSidebarPanel: function(index) { + const sidebar = document.querySelector('.sidebar-inner'); + const activeClassNames = ['sidebar-toc-active', 'sidebar-overview-active']; + if (sidebar.classList.contains(activeClassNames[index])) return; + + const panelContainer = sidebar.querySelector('.sidebar-panel-container'); + const tocPanel = panelContainer.firstElementChild; + const overviewPanel = panelContainer.lastElementChild; + + let postTOCHeight = tocPanel.scrollHeight; + // For TOC activation, try to use the animated TOC height + if (index === 0) { + const nav = tocPanel.querySelector('.nav'); + if (nav) { + postTOCHeight = parseInt(nav.style.getPropertyValue('--height'), 10); + } + } + const panelHeights = [ + postTOCHeight, + overviewPanel.scrollHeight + ]; + panelContainer.style.setProperty('--inactive-panel-height', `${panelHeights[1 - index]}px`); + panelContainer.style.setProperty('--active-panel-height', `${panelHeights[index]}px`); + + sidebar.classList.replace(activeClassNames[1 - index], activeClassNames[index]); + }, + + getScript: function(src, options = {}, legacyCondition) { + if (typeof options === 'function') { + return this.getScript(src, { + condition: legacyCondition + }).then(options); + } + const { + condition = false, + attributes: { + id = '', + async = false, + defer = false, + crossOrigin = '', + dataset = {}, + ...otherAttributes + } = {}, + parentNode = null + } = options; + return new Promise((resolve, reject) => { + if (condition) { + resolve(); + } else { + const script = document.createElement('script'); + + if (id) script.id = id; + if (crossOrigin) script.crossOrigin = crossOrigin; + script.async = async; + script.defer = defer; + Object.assign(script.dataset, dataset); + Object.entries(otherAttributes).forEach(([name, value]) => { + script.setAttribute(name, String(value)); + }); + + script.onload = resolve; + script.onerror = reject; + + if (typeof src === 'object') { + const { url, integrity } = src; + script.src = url; + if (integrity) { + script.integrity = integrity; + script.crossOrigin = 'anonymous'; + } + } else { + script.src = src; + } + (parentNode || document.head).appendChild(script); + } + }); + }, + + loadComments: function(selector, legacyCallback) { + if (legacyCallback) { + return this.loadComments(selector).then(legacyCallback); + } + return new Promise(resolve => { + const element = document.querySelector(selector); + if (!CONFIG.comments.lazyload || !element) { + resolve(); + return; + } + const intersectionObserver = new IntersectionObserver((entries, observer) => { + const entry = entries[0]; + if (!entry.isIntersecting) return; + + resolve(); + observer.disconnect(); + }); + intersectionObserver.observe(element); + }); + } +}; diff --git a/themes/next/test/helpers/font.js b/themes/next/test/helpers/font.js new file mode 100644 index 0000000..7119e10 --- /dev/null +++ b/themes/next/test/helpers/font.js @@ -0,0 +1,86 @@ +'use strict'; + +require('chai').should(); +const Hexo = require('hexo'); +const hexo = new Hexo(); + +const fontStyles = ':300,300italic,400,400italic,700,700italic'; +const fontHost = 'https://fonts.googleapis.com'; + +describe('font', () => { + const nextFont = require('../../scripts/helpers/font').bind(hexo); + + before(() => { + hexo.theme.font = {}; + }); + + it('font disabled', () => { + hexo.theme.font.enable = false; + hexo.theme.font.title = { + family : 'Amatic SC', + external: true + }; + nextFont().should.eql(''); + }); + + it('no external font', () => { + hexo.theme.font.enable = true; + hexo.theme.font.title = { + family : 'Amatic SC', + external: false + }; + nextFont().should.eql(''); + }); + + it('trivial', () => { + hexo.theme.font.enable = true; + hexo.theme.font.title = { + family : 'Amatic SC', + external: true + }; + hexo.theme.font.headings = { + family : 'Palatino', + external: false + }; + nextFont().should.eql(``); + }); + + it('multiple', () => { + hexo.theme.font.enable = true; + hexo.theme.font.title = { + family : 'Amatic SC', + external: true + }; + hexo.theme.font.headings = { + family : 'Palatino', + external: true + }; + nextFont().should.eql(``); + }); + + it('duplicate', () => { + hexo.theme.font.enable = true; + hexo.theme.font.title = { + family : 'Palatino', + external: true + }; + hexo.theme.font.headings = { + family : 'Palatino', + external: true + }; + nextFont().should.eql(``); + }); + + it('fallback font', () => { + hexo.theme.font.enable = true; + hexo.theme.font.title = { + family : 'Roboto Slab, Noto Serif SC', + external: true + }; + hexo.theme.font.headings = { + family : 'Palatino', + external: true + }; + nextFont().should.eql(``); + }); +}); diff --git a/themes/next/test/helpers/index.js b/themes/next/test/helpers/index.js new file mode 100644 index 0000000..3ef5dde --- /dev/null +++ b/themes/next/test/helpers/index.js @@ -0,0 +1,6 @@ +'use strict'; + +describe('Helpers', () => { + require('./font'); + require('./next-url'); +}); diff --git a/themes/next/test/helpers/next-url.js b/themes/next/test/helpers/next-url.js new file mode 100644 index 0000000..87879c8 --- /dev/null +++ b/themes/next/test/helpers/next-url.js @@ -0,0 +1,50 @@ +'use strict'; + +require('chai').should(); +const Hexo = require('hexo'); +const hexo = new Hexo(); + +function btoa(str) { + return Buffer.from(str).toString('base64'); +} + +describe('next-url', () => { + const nextUrl = require('../../scripts/helpers/next-url').bind(hexo); + + before(() => { + hexo.config.url = 'https://example.com'; + hexo.url_for = require('hexo/dist/plugins/helper/url_for').bind(hexo); + }); + + it('text', () => { + nextUrl('/child/', 'Text').should.eql('Text'); + }); + + it('icon', () => { + nextUrl('/child/', '').should.eql(''); + }); + + it('class', () => { + nextUrl('/child/', 'Text', { class: 'theme-link' }).should.eql('Text'); + }); + + it('external', () => { + nextUrl('https://theme-next.js.org', 'Text').should.eql('Text'); + }); + + it('decodeURI', () => { + (() => nextUrl('https://theme-next.js.org', 'A % B')).should.not.throw(); + }); + + it('exturl enabled', () => { + hexo.theme.exturl = true; + const encoded = btoa('https://theme-next.js.org'); + nextUrl('https://theme-next.js.org', 'Text').should.eql(`Text`); + }); + + it('class with exturl enabled', () => { + hexo.theme.exturl = true; + const encoded = btoa('https://theme-next.js.org'); + nextUrl('https://theme-next.js.org', 'Text', { class: 'theme-link' }).should.eql(`Text`); + }); +}); diff --git a/themes/next/test/index.js b/themes/next/test/index.js new file mode 100644 index 0000000..e6088b6 --- /dev/null +++ b/themes/next/test/index.js @@ -0,0 +1,7 @@ +'use strict'; + +describe('NexT', () => { + require('./helpers'); + require('./tags'); + require('./validate'); +}); diff --git a/themes/next/test/tags/button.js b/themes/next/test/tags/button.js new file mode 100644 index 0000000..f74583a --- /dev/null +++ b/themes/next/test/tags/button.js @@ -0,0 +1,33 @@ +'use strict'; + +require('chai').should(); +const Hexo = require('hexo'); +const hexo = new Hexo(); + +describe('button', () => { + const postButton = require('../../scripts/tags/button')(hexo); + + it('only url', () => { + postButton(['#']).should.eql(''); + }); + + it('url and text', () => { + postButton('#, Hello world'.split(' ')).should.eql('Hello world'); + }); + + it('url and icon (Font Awesome 4)', () => { + postButton('#,, home fa-5x'.split(' ')).should.eql(''); + }); + + it('url and icon', () => { + postButton('#,, fab fa-fort-awesome fa-5x'.split(' ')).should.eql(''); + }); + + it('url, text and title', () => { + postButton('#, Hello world,, Title'.split(' ')).should.eql('Hello world'); + }); + + it('url, text, icon and title', () => { + postButton('#, Hello world, home, Title'.split(' ')).should.eql('Hello world'); + }); +}); diff --git a/themes/next/test/tags/caniuse.js b/themes/next/test/tags/caniuse.js new file mode 100644 index 0000000..1fe0e20 --- /dev/null +++ b/themes/next/test/tags/caniuse.js @@ -0,0 +1,17 @@ +'use strict'; + +require('chai').should(); +const Hexo = require('hexo'); +const hexo = new Hexo(); + +describe('caniuse', () => { + const caniUse = require('../../scripts/tags/caniuse')(hexo); + + it('only feature', () => { + caniUse(['loading-lazy-attr']).should.eql(''); + }); + + it('feature and periods', () => { + caniUse('fetch @ future_3,future_2,future_1'.split(' ')).should.eql(''); + }); +}); diff --git a/themes/next/test/tags/center-quote.js b/themes/next/test/tags/center-quote.js new file mode 100644 index 0000000..0f20488 --- /dev/null +++ b/themes/next/test/tags/center-quote.js @@ -0,0 +1,21 @@ +'use strict'; + +require('chai').should(); +const Hexo = require('hexo'); +const hexo = new Hexo(); + +const content = 'Test **Bold** *Italic*'; +const result = '

    Test Bold Italic

    '; + +describe('center-quote', () => { + const centerQuote = require('../../scripts/tags/center-quote')(hexo); + + before(() => hexo.init().then(() => hexo.loadPlugin(require.resolve('hexo-renderer-marked')))); + + it('markdown content', () => { + centerQuote([], content).should.eql(`
    +${result} + +
    `); + }); +}); diff --git a/themes/next/test/tags/group-pictures.js b/themes/next/test/tags/group-pictures.js new file mode 100644 index 0000000..fc242a6 --- /dev/null +++ b/themes/next/test/tags/group-pictures.js @@ -0,0 +1,63 @@ +'use strict'; + +require('chai').should(); +const Hexo = require('hexo'); +const hexo = new Hexo(); + +const link = '
    '; +const image = '
    '; + +describe('group-pictures', () => { + const groupPicture = require('../../scripts/tags/group-pictures')(hexo); + + before(() => hexo.init().then(() => hexo.loadPlugin(require.resolve('hexo-renderer-marked')))); + + it('layout 3-3', () => { + groupPicture(['3-3'], ` +![](/images/sample.png) +![](/images/sample.png) +![](/images/sample.png)`).should.eql(`
    ${image}${image}${image}
    `); + }); + + it('layout 5-2', () => { + groupPicture(['5-2'], ` +![](/images/sample.png) +![](/images/sample.png) +![](/images/sample.png) +![](/images/sample.png) +![](/images/sample.png)`).should.eql(`
    ${image}${image}
    ${image}
    ${image}${image}
    `); + }); + + it('remove text', () => { + groupPicture(['3-3'], ` +![](/images/sample.png) +Text +![](/images/sample.png) +Text +![](/images/sample.png)`).should.eql(`
    ${image}${image}${image}
    `); + }); + + it('set hyperlinks', () => { + groupPicture(['4-3'], ` +![](/images/sample.png) +[![](/images/sample.png)](https://theme-next.js.org/) +[![](/images/sample.png)](https://theme-next.js.org/) +![](/images/sample.png)`).should.eql(`
    ${image}${link}
    ${link}${image}
    `); + }); + + it('set hyperlinks 2', () => { + groupPicture(['3-3'], ` +![](/images/sample.png) +[![](/images/sample.png)](https://theme-next.js.org/) +![](/images/sample.png)`).should.eql(`
    ${image}${link}${image}
    `); + }); + + it('no layout', () => { + groupPicture(['NaN-NaN'], ` +![](/images/sample.png) +![](/images/sample.png) +![](/images/sample.png) +![](/images/sample.png) +![](/images/sample.png)`).should.eql(`
    ${image}${image}${image}
    ${image}${image}
    `); + }); +}); diff --git a/themes/next/test/tags/index.js b/themes/next/test/tags/index.js new file mode 100644 index 0000000..77806a4 --- /dev/null +++ b/themes/next/test/tags/index.js @@ -0,0 +1,15 @@ +'use strict'; + +describe('Tags', () => { + require('./button'); + require('./caniuse'); + require('./center-quote'); + require('./group-pictures'); + require('./label'); + require('./link-grid'); + require('./mermaid'); + require('./note'); + require('./pdf'); + require('./tabs'); + require('./video'); +}); diff --git a/themes/next/test/tags/label.js b/themes/next/test/tags/label.js new file mode 100644 index 0000000..bf27108 --- /dev/null +++ b/themes/next/test/tags/label.js @@ -0,0 +1,21 @@ +'use strict'; + +require('chai').should(); +const Hexo = require('hexo'); +const hexo = new Hexo(); + +describe('label', () => { + const postLabel = require('../../scripts/tags/label')(hexo); + + it('only text', () => { + postLabel('@Hello world'.split(' ')).should.eql('Hello world'); + }); + + it('classes and text', () => { + postLabel('primary@Hello world'.split(' ')).should.eql('Hello world'); + }); + + it('classes and text with space', () => { + postLabel('primary @Hello world'.split(' ')).should.eql('Hello world'); + }); +}); diff --git a/themes/next/test/tags/link-grid.js b/themes/next/test/tags/link-grid.js new file mode 100644 index 0000000..8faaf94 --- /dev/null +++ b/themes/next/test/tags/link-grid.js @@ -0,0 +1,49 @@ +'use strict'; + +require('chai').should(); + +const result = ``; + +describe('link-grid', () => { + const linkGrid = require('../../scripts/tags/link-grid'); + + it('default', () => { + linkGrid([], ` +Theme NexT | https://theme-next.js.org/ | Stay Simple. Stay NexT. | /images/sample.png +Theme NexT | https://theme-next.js.org/ | Stay Simple. Stay NexT. | /images/sample.png`).should.eql(result); + }); + + it('comment', () => { + linkGrid([], ` +Theme NexT | https://theme-next.js.org/ | Stay Simple. Stay NexT. | /images/sample.png +Theme NexT | https://theme-next.js.org/ | Stay Simple. Stay NexT. | /images/sample.png +% Theme NexT | https://theme-next.js.org/ | Stay Simple. Stay NexT. | /images/sample.png`).should.eql(result); + }); + + it('default image', () => { + linkGrid(['/images/sample.png'], ` +Theme NexT | https://theme-next.js.org/ | Stay Simple. Stay NexT. | +Theme NexT | https://theme-next.js.org/ | Stay Simple. Stay NexT. |`).should.eql(result); + }); + + it('custom delimiter', () => { + linkGrid(['/images/sample.png', ','], ` +Theme NexT , https://theme-next.js.org/ , Stay Simple. Stay NexT. , /images/sample.png +Theme NexT , https://theme-next.js.org/ , Stay Simple. Stay NexT. , /images/sample.png`).should.eql(result); + }); + + it('custom delimiter and comment', () => { + linkGrid(['/images/sample.png', ',', '#'], ` +Theme NexT , https://theme-next.js.org/ , Stay Simple. Stay NexT. , /images/sample.png +Theme NexT , https://theme-next.js.org/ , Stay Simple. Stay NexT. , /images/sample.png +# Theme NexT , https://theme-next.js.org/ , Stay Simple. Stay NexT. , /images/sample.png`).should.eql(result); + }); +}); diff --git a/themes/next/test/tags/mermaid.js b/themes/next/test/tags/mermaid.js new file mode 100644 index 0000000..fc14e50 --- /dev/null +++ b/themes/next/test/tags/mermaid.js @@ -0,0 +1,21 @@ +'use strict'; + +require('chai').should(); + +const { escapeHTML } = require('hexo-util'); + +const result = `A[Hard] -->|Text| B(Round) +B --> C{Decision} +C -->|One| D[Result 1] +C -->|Two| E[Result 2]`; + +describe('mermaid', () => { + const mermaid = require('../../scripts/tags/mermaid'); + + it('default', () => { + mermaid(['graph', 'TD'], result).should.eql(`
    +graph TD
    +${escapeHTML(result)}
    +
    `); + }); +}); diff --git a/themes/next/test/tags/note.js b/themes/next/test/tags/note.js new file mode 100644 index 0000000..6d11bca --- /dev/null +++ b/themes/next/test/tags/note.js @@ -0,0 +1,63 @@ +'use strict'; + +require('chai').should(); +const Hexo = require('hexo'); +const hexo = new Hexo(); + +const content = 'Test **Bold** *Italic*'; +const result = '

    Test Bold Italic

    '; +const args = 'This is a *summary*'.split(' '); +const summary = '

    This is a summary'; + +describe('note', () => { + const postNote = require('../../scripts/tags/note')(hexo); + + before(() => hexo.init().then(() => hexo.loadPlugin(require.resolve('hexo-renderer-marked')))); + + it('only text', () => { + postNote([], content).should.eql(`

    ${result} +
    `); + }); + + it('classes and text', () => { + postNote(['primary'], content).should.eql(`
    ${result} +
    `); + }); + + it('classes, no-icon and text', () => { + postNote(['primary', 'no-icon'], content).should.eql(`
    ${result} +
    `); + }); + + it('summary and text', () => { + postNote(args, content).should.eql(`
    ${summary}

    +
    +${result} + +`); + }); + + it('classes, summary and text', () => { + postNote(['primary'].concat(args), content).should.eql(`
    ${summary}

    + +${result} + +
    `); + }); + + it('classes, no-icon, summary and text', () => { + postNote(['primary', 'no-icon'].concat(args), content).should.eql(`
    ${summary}

    + +${result} + +
    `); + }); + + it('keywords in summary', () => { + postNote(['It\'s', 'danger'], content).should.eql(`

    It’s danger

    +
    +${result} + +
    `); + }); +}); diff --git a/themes/next/test/tags/pdf.js b/themes/next/test/tags/pdf.js new file mode 100644 index 0000000..d360000 --- /dev/null +++ b/themes/next/test/tags/pdf.js @@ -0,0 +1,23 @@ +'use strict'; + +require('chai').should(); +const Hexo = require('hexo'); +const hexo = new Hexo(); + +describe('pdf', () => { + const pdf = require('../../scripts/tags/pdf')(hexo); + + before(() => { + hexo.theme.config.pdf = { + height: '500px' + }; + }); + + it('default', () => { + pdf(['https://example.com/sample.pdf']).should.eql('
    '); + }); + + it('custom height', () => { + pdf(['https://example.com/sample.pdf', '1000px']).should.eql('
    '); + }); +}); diff --git a/themes/next/test/tags/tabs.js b/themes/next/test/tags/tabs.js new file mode 100644 index 0000000..db09ab1 --- /dev/null +++ b/themes/next/test/tags/tabs.js @@ -0,0 +1,96 @@ +'use strict'; + +require('chai').should(); +const Hexo = require('hexo'); +const hexo = new Hexo(); + +const content = 'Test **Bold** *Italic*'; +const result = '

    Test Bold Italic

    '; +const container = '
    `); + }); + + it('default', () => { + postTabs(['name'], + ` +${content} + + + +${content} +`).should.eql(`${container}
  • name 1
  • name 2
  • ${result}
    ${result}
    `); + }); + + it('selected index', () => { + postTabs('name, 2'.split(' '), + ` +${content} + + + +${content} +`).should.eql(`${container}
  • name 1
  • name 2
  • ${result}
    ${result}
    `); + }); + + it('no tab selected', () => { + postTabs('name, -1'.split(' '), + ` +${content} + + + +${content} +`).should.eql(`${container}
  • name 1
  • name 2
  • ${result}
    ${result}
    `); + }); + + it('label', () => { + postTabs('name'.split(' '), + ` +${content} + + + +${content} +`).should.eql(`${container}
  • Tab 1
  • Tab 2
  • ${result}
    ${result}
    `); + }); + + it('icon (Font Awesome 4)', () => { + postTabs('name'.split(' '), + ` +${content} + + + +${content} +`).should.eql(`${container}
  • ${result}
    ${result}
    `); + }); + + it('icon', () => { + postTabs('name'.split(' '), + ` +${content} + + + +${content} +`).should.eql(`${container}
  • ${result}
    ${result}
    `); + }); + + it('label and icon', () => { + postTabs('name, -1'.split(' '), + ` +${content} + + + +${content} +`).should.eql(`${container}
  • Tab 1
  • Tab 1
  • ${result}
    ${result}
    `); + }); +}); diff --git a/themes/next/test/tags/video.js b/themes/next/test/tags/video.js new file mode 100644 index 0000000..fba2faf --- /dev/null +++ b/themes/next/test/tags/video.js @@ -0,0 +1,15 @@ +'use strict'; + +require('chai').should(); + +describe('video', () => { + const postVideo = require('../../scripts/tags/video'); + + it('default', () => { + postVideo(['https://example.com/sample.mp4']).should.eql(''); + }); + + it('poster', () => { + postVideo(['https://example.com/sample.mp4', 'https://example.com/sample.jpg']).should.eql(''); + }); +}); diff --git a/themes/next/test/validate/index.js b/themes/next/test/validate/index.js new file mode 100644 index 0000000..15d736b --- /dev/null +++ b/themes/next/test/validate/index.js @@ -0,0 +1,35 @@ +'use strict'; + +const fs = require('fs'); +const path = require('path'); +const yaml = require('js-yaml'); +const should = require('chai').should(); + +describe('Validate', () => { + it('config', () => { + const themeConfig = fs.readFileSync(path.join(__dirname, '../../_config.yml')); + should.not.throw(() => { + yaml.load(themeConfig); + }); + }); + + it('vendors', () => { + const vendorsFile = fs.readFileSync(path.join(__dirname, '../../_vendors.yml')); + should.not.throw(() => { + yaml.load(vendorsFile); + }); + }); + + it('language', () => { + const languagesPath = path.join(__dirname, '../../languages'); + should.not.throw(() => { + fs.readdirSync(languagesPath).forEach(lang => { + if (!lang.endsWith('.yml')) return; + const languagePath = path.join(languagesPath, lang); + yaml.load(fs.readFileSync(languagePath), { + filename: path.relative(__dirname, languagePath) + }); + }); + }); + }); +});