2025-2-26-fixed
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,4 +2,3 @@
|
||||
.deploy_git/
|
||||
public/
|
||||
node_modules/
|
||||
themes/
|
||||
|
||||
0
themes/.gitkeep
Normal file
0
themes/.gitkeep
Normal file
13
themes/fluid/.editorconfig
Normal file
13
themes/fluid/.editorconfig
Normal file
@ -0,0 +1,13 @@
|
||||
# editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
224
themes/fluid/.eslintrc
Normal file
224
themes/fluid/.eslintrc
Normal file
@ -0,0 +1,224 @@
|
||||
{
|
||||
"extends": [
|
||||
"eslint:recommended"
|
||||
],
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2018
|
||||
},
|
||||
"rules": {
|
||||
// Override recomennded
|
||||
"no-console": [
|
||||
2,
|
||||
{
|
||||
"allow": [
|
||||
"warn"
|
||||
]
|
||||
}
|
||||
],
|
||||
"no-empty": [
|
||||
2,
|
||||
{
|
||||
"allowEmptyCatch": true
|
||||
}
|
||||
],
|
||||
"no-unused-vars": [
|
||||
2,
|
||||
{
|
||||
"args": "none"
|
||||
}
|
||||
],
|
||||
// Possible Errors
|
||||
"no-extra-parens": [
|
||||
2,
|
||||
"all",
|
||||
{
|
||||
"conditionalAssign": false,
|
||||
"returnAssign": false,
|
||||
"nestedBinaryExpressions": false,
|
||||
"enforceForArrowConditionals": false
|
||||
}
|
||||
],
|
||||
// Best Practices
|
||||
"array-callback-return": 2,
|
||||
"block-scoped-var": 2,
|
||||
"curly": [
|
||||
2,
|
||||
"multi-line"
|
||||
],
|
||||
"dot-location": [
|
||||
2,
|
||||
"property"
|
||||
],
|
||||
"dot-notation": 2,
|
||||
"eqeqeq": [
|
||||
2,
|
||||
"smart"
|
||||
],
|
||||
"no-else-return": 2,
|
||||
"no-eval": 2,
|
||||
"no-extend-native": 2,
|
||||
"no-extra-bind": 2,
|
||||
"no-extra-label": 2,
|
||||
"no-implicit-globals": 2,
|
||||
"no-implied-eval": 2,
|
||||
"no-lone-blocks": 2,
|
||||
"no-loop-func": 2,
|
||||
"no-multi-spaces": [
|
||||
2,
|
||||
{
|
||||
"exceptions": {
|
||||
"ImportDeclaration": true,
|
||||
"VariableDeclarator": true,
|
||||
"FunctionDeclarator": true,
|
||||
"AssignmentExpression": true,
|
||||
"CallExpression": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"no-multi-str": 2,
|
||||
"no-new": 2,
|
||||
"no-new-func": 2,
|
||||
"no-new-wrappers": 2,
|
||||
"no-proto": 2,
|
||||
"no-return-assign": 2,
|
||||
"no-self-compare": 2,
|
||||
"no-sequences": 2,
|
||||
"no-throw-literal": 2,
|
||||
"no-unused-expressions": [
|
||||
2,
|
||||
{
|
||||
"allowShortCircuit": true,
|
||||
"allowTernary": true
|
||||
}
|
||||
],
|
||||
"no-useless-call": 2,
|
||||
"no-useless-concat": 2,
|
||||
"no-useless-return": 2,
|
||||
"no-void": 2,
|
||||
"no-with": 2,
|
||||
"prefer-promise-reject-errors": 2,
|
||||
"radix": 2,
|
||||
"wrap-iife": [
|
||||
2,
|
||||
"inside"
|
||||
],
|
||||
"yoda": 2,
|
||||
// Variables
|
||||
"no-label-var": 2,
|
||||
"no-shadow-restricted-names": 2,
|
||||
"no-undef-init": 2,
|
||||
// Node.js and CommonJS
|
||||
"handle-callback-err": 2,
|
||||
"no-path-concat": 2,
|
||||
// Stylistic Issues
|
||||
"array-bracket-spacing": 2,
|
||||
"block-spacing": 2,
|
||||
"brace-style": [
|
||||
2,
|
||||
"1tbs",
|
||||
{
|
||||
"allowSingleLine": true
|
||||
}
|
||||
],
|
||||
"comma-dangle": 2,
|
||||
"comma-spacing": 2,
|
||||
"comma-style": 2,
|
||||
"computed-property-spacing": 2,
|
||||
"eol-last": 2,
|
||||
"func-call-spacing": 2,
|
||||
"indent": [
|
||||
2,
|
||||
2,
|
||||
{
|
||||
"SwitchCase": 1,
|
||||
"VariableDeclarator": {
|
||||
"var": 2,
|
||||
"let": 2,
|
||||
"const": 3
|
||||
}
|
||||
}
|
||||
],
|
||||
"key-spacing": [
|
||||
2,
|
||||
{
|
||||
"align": "colon",
|
||||
"beforeColon": false
|
||||
}
|
||||
],
|
||||
"keyword-spacing": 2,
|
||||
"linebreak-style": ["off", "window"],
|
||||
"lines-around-comment": 2,
|
||||
"new-cap": [
|
||||
2,
|
||||
{
|
||||
"capIsNew": false
|
||||
}
|
||||
],
|
||||
"new-parens": 2,
|
||||
"no-array-constructor": 2,
|
||||
"no-mixed-operators": 2,
|
||||
"no-multiple-empty-lines": 2,
|
||||
"no-nested-ternary": 2,
|
||||
"no-new-object": 2,
|
||||
"no-trailing-spaces": 2,
|
||||
"no-unneeded-ternary": 2,
|
||||
"no-whitespace-before-property": 2,
|
||||
"object-curly-spacing": [
|
||||
2,
|
||||
"always"
|
||||
],
|
||||
"one-var": [
|
||||
2,
|
||||
{
|
||||
"uninitialized": "always",
|
||||
"initialized": "never"
|
||||
}
|
||||
],
|
||||
"operator-linebreak": [
|
||||
2,
|
||||
"before"
|
||||
],
|
||||
"quotes": [
|
||||
2,
|
||||
"single"
|
||||
],
|
||||
"semi": 2,
|
||||
"semi-spacing": 2,
|
||||
"space-before-blocks": 2,
|
||||
"space-before-function-paren": [
|
||||
2,
|
||||
"never"
|
||||
],
|
||||
"space-in-parens": 2,
|
||||
"space-infix-ops": 2,
|
||||
"space-unary-ops": 2,
|
||||
"template-tag-spacing": 2,
|
||||
"unicode-bom": 2,
|
||||
// ECMAScript 6
|
||||
"arrow-spacing": 2,
|
||||
"generator-star-spacing": [
|
||||
2,
|
||||
"after"
|
||||
],
|
||||
"no-confusing-arrow": [
|
||||
2,
|
||||
{
|
||||
"allowParens": true
|
||||
}
|
||||
],
|
||||
"no-duplicate-imports": 2,
|
||||
"no-useless-computed-key": 2,
|
||||
"no-useless-constructor": 2,
|
||||
"no-useless-rename": 2,
|
||||
"rest-spread-spacing": 2,
|
||||
"template-curly-spacing": 2,
|
||||
"yield-star-spacing": 2
|
||||
},
|
||||
"env": {
|
||||
"browser": true,
|
||||
"jquery": true,
|
||||
"mocha": true,
|
||||
"node": true,
|
||||
"es6": true
|
||||
}
|
||||
}
|
||||
1
themes/fluid/.gitattributes
vendored
Normal file
1
themes/fluid/.gitattributes
vendored
Normal file
@ -0,0 +1 @@
|
||||
source/lib/* linguist-vendored
|
||||
10
themes/fluid/.gitignore
vendored
Normal file
10
themes/fluid/.gitignore
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
.idea/
|
||||
.vscode/
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
*.log
|
||||
*.iml
|
||||
node_modules/
|
||||
package-lock.json
|
||||
*.lock
|
||||
674
themes/fluid/LICENSE
Normal file
674
themes/fluid/LICENSE
Normal file
@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 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 General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is 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. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
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.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
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 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. Use with the GNU Affero General Public License.
|
||||
|
||||
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 Affero 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 special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU 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 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 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 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.
|
||||
|
||||
hexo-theme-fluid is an elegant Material-Design theme for Hexo.
|
||||
Copyright (C) 2022 Fluid-dev
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
hexo-theme-fluid Copyright (C) 2022 Fluid-dev
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
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 GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
172
themes/fluid/README.md
Normal file
172
themes/fluid/README.md
Normal file
@ -0,0 +1,172 @@
|
||||
<p align="center">
|
||||
<img alt="Fluid Logo" src="https://avatars2.githubusercontent.com/t/3419353?s=280&v=4" width="128">
|
||||
</p>
|
||||
|
||||
<p align="center">一款 Material Design 风格的主题</p>
|
||||
<p align="center">An elegant Material-Design theme for Hexo</p>
|
||||
|
||||

|
||||
|
||||
<p align="center">
|
||||
<a title="Hexo Version" target="_blank" href="https://hexo.io/zh-cn/"><img alt="Hexo Version" src="https://img.shields.io/badge/Hexo-%3E%3D%205.0-orange?style=flat"></a>
|
||||
<a title="Node Version" target="_blank" href="https://nodejs.org/zh-cn/"><img alt="Node Version" src="https://img.shields.io/badge/Node-%3E%3D%2010.13.0-yellowgreen?style=flat"></a>
|
||||
<a title="License" target="_blank" href="https://github.com/fluid-dev/hexo-theme-fluid/blob/master/LICENSE"><img alt="License" src="https://img.shields.io/github/license/fluid-dev/hexo-theme-fluid.svg?style=flat"></a>
|
||||
<br>
|
||||
<a title="GitHub Release" target="_blank" href="https://github.com/fluid-dev/hexo-theme-fluid/releases"><img alt="GitHub Release" src="https://img.shields.io/github/v/release/fluid-dev/hexo-theme-fluid?style=flat"></a>
|
||||
<a title="Npm Downloads" target="_blank" href="https://www.npmjs.com/package/hexo-theme-fluid"><img alt="Npm Downloads" src="https://img.shields.io/npm/dt/hexo-theme-fluid?color=red&label=npm"></a>
|
||||
<a title="GitHub Commits" target="_blank" href="https://github.com/fluid-dev/hexo-theme-fluid/commits/master"><img alt="GitHub Commits" src="https://img.shields.io/github/commit-activity/m/fluid-dev/hexo-theme-fluid.svg?style=flat&color=brightgreen&label=commits"></a>
|
||||
<br><br>
|
||||
<a title="GitHub Watchers" target="_blank" href="https://github.com/fluid-dev/hexo-theme-fluid/watchers"><img alt="GitHub Watchers" src="https://img.shields.io/github/watchers/fluid-dev/hexo-theme-fluid.svg?label=Watchers&style=social"></a>
|
||||
<a title="GitHub Stars" target="_blank" href="https://github.com/fluid-dev/hexo-theme-fluid/stargazers"><img alt="GitHub Stars" src="https://img.shields.io/github/stars/fluid-dev/hexo-theme-fluid.svg?label=Stars&style=social"></a>
|
||||
<a title="GitHub Forks" target="_blank" href="https://github.com/fluid-dev/hexo-theme-fluid/network/members"><img alt="GitHub Forks" src="https://img.shields.io/github/forks/fluid-dev/hexo-theme-fluid.svg?label=Forks&style=social"></a>
|
||||
</p>
|
||||
|
||||
<p align="center">🇨🇳 中文简体 | <a title="English" href="README_en.md">🇬🇧 English</a></p>
|
||||
|
||||
<p align="center">
|
||||
<span>文档:</span>
|
||||
<a href="https://hexo.fluid-dev.com/docs/guide/">主题配置</a> |
|
||||
<a href="https://hexo.io/zh-cn/docs/front-matter">文章配置</a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<span>预览:</span>
|
||||
<a href="https://hexo.fluid-dev.com/">Fluid's blog</a> |
|
||||
<a href="https://zkqiang.cn">zkqiang's blog</a>
|
||||
</p>
|
||||
|
||||
## 快速开始
|
||||
|
||||
#### 1. 搭建 Hexo 博客
|
||||
|
||||
如果你还没有 Hexo 博客,请按照 [Hexo 官方文档](https://hexo.io/zh-cn/docs/) 进行安装、建站。
|
||||
|
||||
#### 2. 获取主题最新版本
|
||||
|
||||
**方式一:**
|
||||
|
||||
Hexo 5.0.0 版本以上,推荐通过 npm 直接安装,进入博客目录执行命令:
|
||||
|
||||
```sh
|
||||
npm install --save hexo-theme-fluid
|
||||
```
|
||||
|
||||
然后在博客目录下创建 `_config.fluid.yml`,将主题的 [_config.yml](https://github.com/fluid-dev/hexo-theme-fluid/blob/master/_config.yml) 内容复制进去。
|
||||
|
||||
**方式二:**
|
||||
|
||||
下载 [最新 release 版本](https://github.com/fluid-dev/hexo-theme-fluid/releases) 解压到 themes 目录,并将解压出的文件夹重命名为 `fluid`。
|
||||
|
||||
#### 3. 指定主题
|
||||
|
||||
如下修改 Hexo 博客目录中的 `_config.yml`:
|
||||
|
||||
```yaml
|
||||
theme: fluid # 指定主题
|
||||
|
||||
language: zh-CN # 指定语言,会影响主题显示的语言,按需修改
|
||||
```
|
||||
|
||||
#### 4. 创建「关于页」
|
||||
|
||||
首次使用主题的「关于页」需要手动创建:
|
||||
|
||||
```bash
|
||||
hexo new page about
|
||||
```
|
||||
|
||||
创建成功后,编辑博客目录下 `/source/about/index.md`,添加 `layout` 属性。
|
||||
|
||||
修改后的文件示例如下:
|
||||
|
||||
```yaml
|
||||
---
|
||||
title: about
|
||||
layout: about
|
||||
---
|
||||
|
||||
这里写关于页的正文,支持 Markdown, HTML
|
||||
```
|
||||
|
||||
## 更新主题
|
||||
|
||||
更新主题的方式[参照这里](https://hexo.fluid-dev.com/docs/start/#更新主题)。
|
||||
|
||||
## 功能特性
|
||||
|
||||
- [x] 无比详实的[用户文档](https://hexo.fluid-dev.com/docs/)
|
||||
- [x] 页面组件懒加载
|
||||
- [x] 多种代码高亮方案
|
||||
- [x] 多语言配置
|
||||
- [x] 内置多款评论插件
|
||||
- [x] 内置网页访问统计
|
||||
- [x] 内置文章本地搜索
|
||||
- [x] 支持暗色模式
|
||||
- [x] 支持脚注语法
|
||||
- [x] 支持 LaTeX 数学公式
|
||||
- [x] 支持 mermaid 流程图
|
||||
|
||||
## 鸣谢
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center" style="width: 240px;">
|
||||
<a href="https://flowus.cn/share/eebf2144-8db7-4d68-b31e-bc2c116871de">
|
||||
<img src="https://github-production-user-asset-6210df.s3.amazonaws.com/32983588/243899272-092eeb46-9172-4c10-9e72-53561ff37a00.png" height="200px"><br>
|
||||
<sub>首席赞助商 ORENCEAI</sub><br>
|
||||
<sub>全新的 ChatGPT 人工智能对话平台</sub>
|
||||
</a>
|
||||
</th>
|
||||
<th align="center" style="width: 240px;">
|
||||
<a href="https://www.jetbrains.com/?from=hexo-theme-fluid">
|
||||
<img src="https://raw.githubusercontent.com/fluid-dev/static/690616966f34a58d66aa15ac7b550dd7bbc03967/hexo-theme-fluid/jetbrains.svg" height="200px"><br>
|
||||
<sub>免费开发工具提供方 JetBrains</sub><br>
|
||||
<sub>专注于创建智能开发工具</sub>
|
||||
</a>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
## 贡献者
|
||||
|
||||
[](https://github.com/fluid-dev/hexo-theme-fluid/graphs/contributors)
|
||||
|
||||
英文文档翻译:[@EatRice](https://eatrice.top/) [@橙子杀手](https://ruru.eatrice.top) [@Sinetian](https://sinetian.github.io/)
|
||||
|
||||
其他贡献:[@zhugaoqi](https://github.com/zhugaoqi) [@julydate](https://github.com/julydate) [@xiyuvi](https://xiyu.pro/)
|
||||
|
||||
如你也想贡献代码,可参照[贡献指南](https://hexo.fluid-dev.com/docs/contribute/)
|
||||
|
||||
## 支持我们
|
||||
|
||||
如果你觉得这个项目有帮助,并愿意支持它的发展,可以通过以下方式支持我们的开源创作:
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center" style="width: 240px;">
|
||||
<div>
|
||||
<img src="https://github.com/fluid-dev/static/blob/master/hexo-theme-fluid/sponsor.png?s=200&v=4" height="200px" alt="微信赞赏码"><br>
|
||||
<sub>微信赞赏码</sub>
|
||||
</div>
|
||||
</th>
|
||||
<th align="center" style="width: 240px;">
|
||||
<div>
|
||||
<a href="https://etherscan.io/address/0x0021395954710be29c0BFDCB3f98f4D2fa5A1448">
|
||||
<img src="https://avatars.githubusercontent.com/u/6250754?s=200&v=4" height="200px" alt="ERC20 Token">
|
||||
</a>
|
||||
<br>
|
||||
<sub>ERC20 Token: 0x0021395954710<br>be29c0BFDCB3f98f4D2fa5A1448</sub>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
同时我们正在**寻求商业赞助**,如果贵司想在本页显著位置展示广告位(每月 6K+ Views 定向流量曝光),或者有其他赞助形式,可将联系方式发送邮件至 zkqiang#126.com (#替换为@)。
|
||||
|
||||
## Star 趋势
|
||||
|
||||
[](https://starchart.cc/fluid-dev/hexo-theme-fluid)
|
||||
142
themes/fluid/README_en.md
Normal file
142
themes/fluid/README_en.md
Normal file
@ -0,0 +1,142 @@
|
||||
<p align="center">
|
||||
<img alt="Fluid Logo" src="https://avatars2.githubusercontent.com/t/3419353?s=280&v=4" width="128">
|
||||
</p>
|
||||
|
||||
<p align="center">An elegant Material-Design theme for Hexo</p>
|
||||
|
||||

|
||||
|
||||
<p align="center">
|
||||
<a title="Hexo Version" target="_blank" href="https://hexo.io"><img alt="Hexo Version" src="https://img.shields.io/badge/Hexo-%3E%3D%205.0-orange?style=flat"></a>
|
||||
<a title="Node Version" target="_blank" href="https://nodejs.org"><img alt="Node Version" src="https://img.shields.io/badge/Node-%3E%3D%2010.13.0-yellowgreen?style=flat"></a>
|
||||
<a title="License" target="_blank" href="https://github.com/fluid-dev/hexo-theme-fluid/blob/master/LICENSE"><img alt="License" src="https://img.shields.io/github/license/fluid-dev/hexo-theme-fluid.svg?style=flat"></a>
|
||||
<br>
|
||||
<a title="GitHub Release" target="_blank" href="https://github.com/fluid-dev/hexo-theme-fluid/releases"><img alt="GitHub Release" src="https://img.shields.io/github/v/release/fluid-dev/hexo-theme-fluid?style=flat"></a>
|
||||
<a title="Npm Downloads" target="_blank" href="https://www.npmjs.com/package/hexo-theme-fluid"><img alt="Npm Downloads" src="https://img.shields.io/npm/dt/hexo-theme-fluid?color=red&label=npm"></a>
|
||||
<a title="GitHub Commits" target="_blank" href="https://github.com/fluid-dev/hexo-theme-fluid/commits/master"><img alt="GitHub Commits" src="https://img.shields.io/github/commit-activity/m/fluid-dev/hexo-theme-fluid.svg?style=flat&color=brightgreen&label=commits"></a>
|
||||
<br><br>
|
||||
<a title="GitHub Watchers" target="_blank" href="https://github.com/fluid-dev/hexo-theme-fluid/watchers"><img alt="GitHub Watchers" src="https://img.shields.io/github/watchers/fluid-dev/hexo-theme-fluid.svg?label=Watchers&style=social"></a>
|
||||
<a title="GitHub Stars" target="_blank" href="https://github.com/fluid-dev/hexo-theme-fluid/stargazers"><img alt="GitHub Stars" src="https://img.shields.io/github/stars/fluid-dev/hexo-theme-fluid.svg?label=Stars&style=social"></a>
|
||||
<a title="GitHub Forks" target="_blank" href="https://github.com/fluid-dev/hexo-theme-fluid/network/members"><img alt="GitHub Forks" src="https://img.shields.io/github/forks/fluid-dev/hexo-theme-fluid.svg?label=Forks&style=social"></a>
|
||||
</p>
|
||||
|
||||
<p align="center"><a title="Chinese" href="README.md">🇨🇳 中文简体</a> | 🇬🇧 English</p>
|
||||
|
||||
<p align="center">
|
||||
<span>Docs: </span>
|
||||
<a href="https://hexo.fluid-dev.com/docs/en/guide/">Theme guide</a>    
|
||||
<a href="https://hexo.io/docs/front-matter">Post guide</a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<span>Preview: </span>
|
||||
<a href="https://hexo.fluid-dev.com/">Fluid's blog</a>    
|
||||
<a href="https://zkqiang.cn">zkqiang's blog</a>
|
||||
</p>
|
||||
|
||||
## Quick Start
|
||||
|
||||
#### 1. Install Hexo
|
||||
|
||||
If you don't have a hexo blog, please follow [Hexo Docs](https://hexo.io/docs/) to install and initialize your blog。
|
||||
|
||||
#### 2. Install Fluid
|
||||
|
||||
**Way A:**
|
||||
|
||||
If your Hexo version >= 5.0.0, you can install Fluid via Npm:
|
||||
|
||||
```sh
|
||||
npm install --save hexo-theme-fluid
|
||||
```
|
||||
|
||||
Then create `_config.fluid.yml` in the blog directory and copy the content of [_config.yml](https://github.com/fluid-dev/hexo-theme-fluid/blob/master/_config.yml).
|
||||
|
||||
**Way B:**
|
||||
|
||||
Download the [latest release](https://github.com/fluid-dev/hexo-theme-fluid/releases), then extract it to `themes` directory and renamed to `fluid`.
|
||||
|
||||
#### 3. Set theme
|
||||
|
||||
Edit `_config.yml` in the blog root directory as follows:
|
||||
|
||||
```yaml
|
||||
theme: fluid
|
||||
```
|
||||
|
||||
#### 4. Create about page
|
||||
|
||||
The about page needs to be created manually:
|
||||
|
||||
```bash
|
||||
hexo new page about
|
||||
```
|
||||
|
||||
Then edit `/source/about/index.md` and add `layout` attribute.
|
||||
|
||||
The modified example is as follows:
|
||||
|
||||
```yaml
|
||||
---
|
||||
title: about
|
||||
layout: about
|
||||
---
|
||||
|
||||
About content
|
||||
```
|
||||
|
||||
## How to Upgrade
|
||||
|
||||
[Please follow here](https://hexo.fluid-dev.com/docs/en/start/#theme-upgrade)
|
||||
|
||||
## Features
|
||||
|
||||
- [x] Detailed [documents](https://hexo.fluid-dev.com/docs/en/)
|
||||
- [x] Widget lazyload
|
||||
- [x] Multiple code highlighting schemes
|
||||
- [x] Multiple comment plugins
|
||||
- [x] Multiple language configurations
|
||||
- [x] Multiple website analysis
|
||||
- [x] Support for local search
|
||||
- [x] Support for footnote
|
||||
- [x] Support for LaTeX
|
||||
- [x] Support for Mermaid
|
||||
- [x] Dark mode
|
||||
|
||||
## Thanks
|
||||
|
||||
<a title="Thanks to JetBrains for providing the license" href="https://www.jetbrains.com/?from=hexo-theme-fluid" target="_blank">
|
||||
<img src="https://raw.githubusercontent.com/fluid-dev/static/690616966f34a58d66aa15ac7b550dd7bbc03967/hexo-theme-fluid/jetbrains.svg" width="150" alt="JetBrains">
|
||||
</a>
|
||||
|
||||
## Contributors
|
||||
|
||||
[](https://github.com/fluid-dev/hexo-theme-fluid/graphs/contributors)
|
||||
|
||||
English docs translator: [@EatRice](https://eatrice.top/) [@橙子杀手](https://ruru.eatrice.top) [@Sinetian](https://sinetian.github.io/)
|
||||
|
||||
Contributors outside PR: [@zhugaoqi](https://github.com/zhugaoqi) [@julydate](https://github.com/julydate) [@xiyuvi](https://xiyu.pro/)
|
||||
|
||||
## Support
|
||||
|
||||
If you find this project helpful and would like to support its development, please consider making a financial contribution.
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center" style="width: 240px;">
|
||||
<div>
|
||||
<a href="https://etherscan.io/address/0x0021395954710be29c0BFDCB3f98f4D2fa5A1448">
|
||||
<img src="https://avatars.githubusercontent.com/u/6250754?s=200&v=4" height="200px" alt="ERC20 Token">
|
||||
</a>
|
||||
<br>
|
||||
<sub>ERC20 Token: 0x0021395954710<br>be29c0BFDCB3f98f4D2fa5A1448</sub>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
## Star Trending
|
||||
|
||||
[](https://starchart.cc/fluid-dev/hexo-theme-fluid)
|
||||
1165
themes/fluid/_config.yml
Normal file
1165
themes/fluid/_config.yml
Normal file
File diff suppressed because it is too large
Load Diff
70
themes/fluid/languages/de.yml
Normal file
70
themes/fluid/languages/de.yml
Normal file
@ -0,0 +1,70 @@
|
||||
name: 'Deutsch'
|
||||
|
||||
home:
|
||||
menu: 'Startseite'
|
||||
title: 'Startseite'
|
||||
|
||||
archive:
|
||||
menu: 'Archiv'
|
||||
title: 'Archiv'
|
||||
subtitle: 'Archiv'
|
||||
post_total: 'Insgesamt %d Artikel'
|
||||
|
||||
category:
|
||||
menu: 'Kategorien'
|
||||
title: 'Kategorien'
|
||||
subtitle: 'Kategorien'
|
||||
post_total: 'Insgesamt %d Artikel'
|
||||
more: 'More...'
|
||||
|
||||
tag:
|
||||
menu: 'Schlagwörter'
|
||||
title: 'Schlagwörter'
|
||||
subtitle: 'Schlagwörter'
|
||||
post_total: 'Insgesamt %d Artikel'
|
||||
|
||||
about:
|
||||
menu: 'Über'
|
||||
title: 'Über'
|
||||
subtitle: 'Über'
|
||||
|
||||
links:
|
||||
menu: 'Weblinks'
|
||||
title: 'Weblinks'
|
||||
subtitle: 'Weblinks'
|
||||
|
||||
page404:
|
||||
menu: 'Die Seite wurde nicht gefunden'
|
||||
title: 'Die Seite wurde nicht gefunden'
|
||||
subtitle: 'Die Seite wurde nicht gefunden'
|
||||
|
||||
post:
|
||||
toc: 'Inhaltsverzeichnis'
|
||||
prev_post: 'Vorheriger'
|
||||
next_post: 'Nächster'
|
||||
updated: 'Geändert am %s'
|
||||
meta:
|
||||
wordcount: '%s wörter'
|
||||
min2read: '%s minuten'
|
||||
views: '{} ansichten'
|
||||
copyright:
|
||||
author: 'Beitragsautor'
|
||||
posted: 'Veröffentlicht am'
|
||||
updated: 'Geändert am'
|
||||
licensed: 'Urheberrechtshinweis'
|
||||
CC: 'CC - Creative Commons license'
|
||||
BY: 'BY - Attribution'
|
||||
SA: 'SA - Share-alike'
|
||||
NC: 'NC - Non-commercial'
|
||||
ND: 'ND - No derivative works'
|
||||
ZERO: 'CC0 - No Copyright'
|
||||
|
||||
footer:
|
||||
pv: 'Alle Aufrufe: {}'
|
||||
uv: 'Alle Besucher: {}'
|
||||
|
||||
search:
|
||||
title: 'Suchen'
|
||||
keyword: 'Stichwort'
|
||||
|
||||
noscript_warning: 'Blog funktioniert am besten mit aktiviertem JavaScript'
|
||||
70
themes/fluid/languages/en.yml
Normal file
70
themes/fluid/languages/en.yml
Normal file
@ -0,0 +1,70 @@
|
||||
name: 'English'
|
||||
|
||||
home:
|
||||
menu: 'Home'
|
||||
title: 'Home'
|
||||
|
||||
archive:
|
||||
menu: 'Archives'
|
||||
title: 'Archives'
|
||||
subtitle: 'Archives'
|
||||
post_total: '%d posts in total'
|
||||
|
||||
category:
|
||||
menu: 'Categories'
|
||||
title: 'Categories'
|
||||
subtitle: 'Categories'
|
||||
post_total: '%d posts in total'
|
||||
more: 'More...'
|
||||
|
||||
tag:
|
||||
menu: 'Tags'
|
||||
title: 'Tags'
|
||||
subtitle: 'Tags'
|
||||
post_total: '%d posts in total'
|
||||
|
||||
about:
|
||||
menu: 'About'
|
||||
title: 'About'
|
||||
subtitle: 'About'
|
||||
|
||||
links:
|
||||
menu: 'Links'
|
||||
title: 'Links'
|
||||
subtitle: 'Links'
|
||||
|
||||
page404:
|
||||
menu: 'Page not found'
|
||||
title: 'Page not found'
|
||||
subtitle: 'Page not found'
|
||||
|
||||
post:
|
||||
toc: 'Table of Contents'
|
||||
prev_post: 'Previous'
|
||||
next_post: 'Next'
|
||||
updated: 'Last updated on %s'
|
||||
meta:
|
||||
wordcount: '%s words'
|
||||
min2read: '%s mins'
|
||||
views: '{} views'
|
||||
copyright:
|
||||
author: 'Author'
|
||||
posted: 'Posted on'
|
||||
updated: 'Updated on'
|
||||
licensed: 'Licensed under'
|
||||
CC: 'CC - Creative Commons license'
|
||||
BY: 'BY - Attribution'
|
||||
SA: 'SA - Share-alike'
|
||||
NC: 'NC - Non-commercial'
|
||||
ND: 'ND - No derivative works'
|
||||
ZERO: 'CC0 - No Copyright'
|
||||
|
||||
footer:
|
||||
pv: 'Views: {}'
|
||||
uv: 'Visitors: {}'
|
||||
|
||||
search:
|
||||
title: 'Search'
|
||||
keyword: 'Keyword'
|
||||
|
||||
noscript_warning: 'Blog works best with JavaScript enabled'
|
||||
70
themes/fluid/languages/eo.yml
Normal file
70
themes/fluid/languages/eo.yml
Normal file
@ -0,0 +1,70 @@
|
||||
name: 'Esperanto'
|
||||
|
||||
home:
|
||||
menu: 'Hejmpaĝo'
|
||||
title: 'Hejmpaĝo'
|
||||
|
||||
archive:
|
||||
menu: 'Arkivoj'
|
||||
title: 'Arkivoj'
|
||||
subtitle: 'Arkivoj'
|
||||
post_total: 'Entute %d afiŝoj'
|
||||
|
||||
category:
|
||||
menu: 'Kategorio'
|
||||
title: 'Kategorio'
|
||||
subtitle: 'Kategorio'
|
||||
post_total: 'Entute %d afiŝoj'
|
||||
more: 'More...'
|
||||
|
||||
tag:
|
||||
menu: 'Etikedoj'
|
||||
title: 'Etikedoj'
|
||||
subtitle: 'Etikedoj'
|
||||
post_total: 'Entute %d afiŝoj'
|
||||
|
||||
about:
|
||||
menu: 'Pri'
|
||||
title: 'Pri'
|
||||
subtitle: 'Pri'
|
||||
|
||||
links:
|
||||
menu: 'Ligoj'
|
||||
title: 'Ligoj'
|
||||
subtitle: 'Ligoj'
|
||||
|
||||
page404:
|
||||
menu: 'Paĝo ne trovita'
|
||||
title: 'Paĝo ne trovita'
|
||||
subtitle: 'Paĝo ne trovita'
|
||||
|
||||
post:
|
||||
toc: 'Enhavtabelo'
|
||||
prev_post: 'Antaŭa afiŝo'
|
||||
next_post: 'Sekva afiŝo'
|
||||
updated: 'Aktualizita: %s'
|
||||
meta:
|
||||
wordcount: '%s vortoj'
|
||||
min2read: '%s minutoj'
|
||||
views: '{} rigardoj'
|
||||
copyright:
|
||||
author: 'Aŭtoro'
|
||||
posted: 'Postigita'
|
||||
updated: 'Aktualizita'
|
||||
licensed: 'Lizenta'
|
||||
CC: 'CC - Creative Commons license'
|
||||
BY: 'BY - Attribution'
|
||||
SA: 'SA - Share-alike'
|
||||
NC: 'NC - Non-commercial'
|
||||
ND: 'ND - No derivative works'
|
||||
ZERO: 'CC0 - No Copyright'
|
||||
|
||||
footer:
|
||||
pv: 'Vidoj: {}'
|
||||
uv: 'Visitoj: {}'
|
||||
|
||||
search:
|
||||
title: 'Serĉi'
|
||||
keyword: 'ŝlosivorto'
|
||||
|
||||
noscript_warning: 'Blogo funkcias plej bone kun JavaScript ebligita'
|
||||
70
themes/fluid/languages/es.yml
Normal file
70
themes/fluid/languages/es.yml
Normal file
@ -0,0 +1,70 @@
|
||||
name: 'Español'
|
||||
|
||||
home:
|
||||
menu: 'Inicio'
|
||||
title: 'Inicio'
|
||||
|
||||
archive:
|
||||
menu: 'Archivo'
|
||||
title: 'Archivo'
|
||||
subtitle: 'Archivo'
|
||||
post_total: '%d artículos en total'
|
||||
|
||||
category:
|
||||
menu: 'Categorías'
|
||||
title: 'Categorías'
|
||||
subtitle: 'Categorías'
|
||||
post_total: '%d artículos en total'
|
||||
more: 'Más...'
|
||||
|
||||
tag:
|
||||
menu: 'Etiquetas'
|
||||
title: 'Etiquetas'
|
||||
subtitle: 'Etiquetas'
|
||||
post_total: '%d artículos en total'
|
||||
|
||||
about:
|
||||
menu: 'Acerca'
|
||||
title: 'Acerca'
|
||||
subtitle: 'Acerca'
|
||||
|
||||
links:
|
||||
menu: 'Enlaces'
|
||||
title: 'Enlaces'
|
||||
subtitle: 'Enlaces'
|
||||
|
||||
page404:
|
||||
menu: 'Página no encontrada'
|
||||
title: 'Página no encontrada'
|
||||
subtitle: 'Página no encontrada'
|
||||
|
||||
post:
|
||||
toc: 'Tabla de Contenidos'
|
||||
prev_post: 'Anterior'
|
||||
next_post: 'Siguiente'
|
||||
updated: 'Última actualización el %s'
|
||||
meta:
|
||||
wordcount: '%s palabras'
|
||||
min2read: '%s minutos'
|
||||
views: '{} vistas'
|
||||
copyright:
|
||||
author: 'Autor'
|
||||
posted: 'Publicado el'
|
||||
updated: 'Actualizado el'
|
||||
licensed: 'Licencia bajo'
|
||||
CC: 'CC - Licencia Creative Commons'
|
||||
BY: 'BY - Atribución'
|
||||
SA: 'SA - Compartir igual'
|
||||
NC: 'NC - No comercial'
|
||||
ND: 'ND - Sin obras derivadas'
|
||||
ZERO: 'CC0 - Sin derechos autorales'
|
||||
|
||||
footer:
|
||||
pv: 'Vistas: {}'
|
||||
uv: 'Visitantes: {}'
|
||||
|
||||
search:
|
||||
title: 'Buscar'
|
||||
keyword: 'Palabra clave'
|
||||
|
||||
noscript_warning: 'El blog funciona mejor con JavaScript habilitado'
|
||||
70
themes/fluid/languages/ja.yml
Normal file
70
themes/fluid/languages/ja.yml
Normal file
@ -0,0 +1,70 @@
|
||||
name: '日本語'
|
||||
|
||||
home:
|
||||
menu: 'ホーム'
|
||||
title: 'ホーム'
|
||||
|
||||
archive:
|
||||
menu: 'アーカイブ'
|
||||
title: 'アーカイブ'
|
||||
subtitle: 'アーカイブ'
|
||||
post_total: '全 %d 件のポスト'
|
||||
|
||||
category:
|
||||
menu: 'カテゴリ'
|
||||
title: 'カテゴリ'
|
||||
subtitle: 'カテゴリ'
|
||||
post_total: '全 %d 件のポスト'
|
||||
more: 'More...'
|
||||
|
||||
tag:
|
||||
menu: 'タグ'
|
||||
title: 'タグ'
|
||||
subtitle: 'タグ'
|
||||
post_total: '全 %d 件のポスト'
|
||||
|
||||
about:
|
||||
menu: 'プロフィール'
|
||||
title: 'プロフィール'
|
||||
subtitle: 'プロフィール'
|
||||
|
||||
links:
|
||||
menu: 'リンク'
|
||||
title: 'リンク'
|
||||
subtitle: 'リンク'
|
||||
|
||||
page404:
|
||||
menu: 'ページが見つかりませんでした'
|
||||
title: 'ページが見つかりませんでした'
|
||||
subtitle: 'ページが見つかりませんでした'
|
||||
|
||||
post:
|
||||
toc: '見出し'
|
||||
prev_post: '前の記事'
|
||||
next_post: '次の記事'
|
||||
updated: '最終更新日:%s'
|
||||
meta:
|
||||
wordcount: '%s 単語'
|
||||
min2read: '%s 分'
|
||||
views: '{} 閲覧'
|
||||
copyright:
|
||||
author: '著者'
|
||||
posted: '作成日'
|
||||
updated: '修正日'
|
||||
licensed: '著作権'
|
||||
CC: 'CC - Creative Commons license'
|
||||
BY: 'BY - Attribution'
|
||||
SA: 'SA - Share-alike'
|
||||
NC: 'NC - Non-commercial'
|
||||
ND: 'ND - No derivative works'
|
||||
ZERO: 'CC0 - No Copyright'
|
||||
|
||||
footer:
|
||||
pv: '閲覧合計数: {}'
|
||||
uv: '合計閲覧者数: {}'
|
||||
|
||||
search:
|
||||
title: '検索'
|
||||
keyword: 'キーワード'
|
||||
|
||||
noscript_warning: 'ブログは JavaScript を有効にすると最適に機能します'
|
||||
70
themes/fluid/languages/ru.yml
Normal file
70
themes/fluid/languages/ru.yml
Normal file
@ -0,0 +1,70 @@
|
||||
name: 'Русский'
|
||||
|
||||
home:
|
||||
menu: 'Главная'
|
||||
title: 'Главная'
|
||||
|
||||
archive:
|
||||
menu: 'Архивы'
|
||||
title: 'Архивы'
|
||||
subtitle: 'Архивы'
|
||||
post_total: '%d сообщений всего'
|
||||
|
||||
category:
|
||||
menu: 'Категории'
|
||||
title: 'Категории'
|
||||
subtitle: 'Категории'
|
||||
post_total: '%d сообщений всего'
|
||||
more: 'More...'
|
||||
|
||||
tag:
|
||||
menu: 'Теги'
|
||||
title: 'Теги'
|
||||
subtitle: 'Теги'
|
||||
post_total: '%d сообщений всего'
|
||||
|
||||
about:
|
||||
menu: 'О'
|
||||
title: 'О'
|
||||
subtitle: 'О'
|
||||
|
||||
links:
|
||||
menu: 'Ссылки'
|
||||
title: 'Ссылки'
|
||||
subtitle: 'Ссылки'
|
||||
|
||||
page404:
|
||||
menu: 'Страница не найдена'
|
||||
title: 'Страница не найдена'
|
||||
subtitle: 'Страница не найдена'
|
||||
|
||||
post:
|
||||
toc: 'Оглавление'
|
||||
prev_post: 'Предыдущий'
|
||||
next_post: 'Следующий'
|
||||
updated: 'Последнее обновление %s'
|
||||
meta:
|
||||
wordcount: '%s слов'
|
||||
min2read: '%s минут'
|
||||
views: '{} просмотров'
|
||||
copyright:
|
||||
author: 'Автор'
|
||||
posted: 'Опубликовано на'
|
||||
updated: 'Обновлено'
|
||||
license: 'Лицензировано под'
|
||||
CC: 'CC - Creative Commons license'
|
||||
BY: 'BY - Attribution'
|
||||
SA: 'SA - Share-alike'
|
||||
NC: 'NC - Non-commercial'
|
||||
ND: 'ND - No derivative works'
|
||||
ZERO: 'CC0 - No Copyright'
|
||||
|
||||
footer:
|
||||
pv: 'Просмотров: {}'
|
||||
uv: 'Посетителей: {}'
|
||||
|
||||
search:
|
||||
title: 'Поиск'
|
||||
keyword: 'Ключевое слово'
|
||||
|
||||
noscript_warning: 'Блог лучше всего работает с включенным JavaScript'
|
||||
70
themes/fluid/languages/zh-CN.yml
Normal file
70
themes/fluid/languages/zh-CN.yml
Normal file
@ -0,0 +1,70 @@
|
||||
name: '简体中文'
|
||||
|
||||
home:
|
||||
menu: '首页'
|
||||
title: '首页'
|
||||
|
||||
archive:
|
||||
menu: '归档'
|
||||
title: '归档'
|
||||
subtitle: '归档'
|
||||
post_total: '共计 %d 篇文章'
|
||||
|
||||
category:
|
||||
menu: '分类'
|
||||
title: '分类'
|
||||
subtitle: '分类'
|
||||
post_total: '共计 %d 篇文章'
|
||||
more: 'More...'
|
||||
|
||||
tag:
|
||||
menu: '标签'
|
||||
title: '标签'
|
||||
subtitle: '标签'
|
||||
post_total: '共计 %d 篇文章'
|
||||
|
||||
about:
|
||||
menu: '关于'
|
||||
title: '关于'
|
||||
subtitle: '关于'
|
||||
|
||||
links:
|
||||
menu: '友链'
|
||||
title: '友链'
|
||||
subtitle: '友情链接'
|
||||
|
||||
page404:
|
||||
menu: '页面不存在'
|
||||
title: '页面不存在'
|
||||
subtitle: '页面不存在'
|
||||
|
||||
post:
|
||||
toc: '目录'
|
||||
prev_post: '上一篇'
|
||||
next_post: '下一篇'
|
||||
updated: '本文最后更新于 %s'
|
||||
meta:
|
||||
wordcount: '%s 字'
|
||||
min2read: '%s 分钟'
|
||||
views: '{} 次'
|
||||
copyright:
|
||||
author: '作者'
|
||||
posted: '发布于'
|
||||
updated: '更新于'
|
||||
licensed: '许可协议'
|
||||
CC: 'CC - 知识共享许可协议'
|
||||
BY: 'BY - 署名'
|
||||
SA: 'SA - 相同方式共享'
|
||||
NC: 'NC - 非商业性使用'
|
||||
ND: 'ND - 禁止演绎'
|
||||
ZERO: 'CC0 - 无版权'
|
||||
|
||||
footer:
|
||||
pv: '总访问量 {} 次'
|
||||
uv: '总访客数 {} 人'
|
||||
|
||||
search:
|
||||
title: '搜索'
|
||||
keyword: '关键词'
|
||||
|
||||
noscript_warning: '博客在允许 JavaScript 运行的环境下浏览效果更佳'
|
||||
70
themes/fluid/languages/zh-HK.yml
Normal file
70
themes/fluid/languages/zh-HK.yml
Normal file
@ -0,0 +1,70 @@
|
||||
name: '繁體中文'
|
||||
|
||||
home:
|
||||
menu: '首頁'
|
||||
title: '首頁'
|
||||
|
||||
archive:
|
||||
menu: '歸檔'
|
||||
title: '歸檔'
|
||||
subtitle: '歸檔'
|
||||
post_total: '共有 %d 篇文章'
|
||||
|
||||
category:
|
||||
menu: '分類'
|
||||
title: '分類'
|
||||
subtitle: '分類'
|
||||
post_total: '共有 %d 篇文章'
|
||||
more: 'More...'
|
||||
|
||||
tag:
|
||||
menu: '標籤'
|
||||
title: '標籤'
|
||||
subtitle: '標籤'
|
||||
post_total: '共有 %d 篇文章'
|
||||
|
||||
about:
|
||||
menu: '關於'
|
||||
title: '關於'
|
||||
subtitle: '關於'
|
||||
|
||||
links:
|
||||
menu: '連結'
|
||||
title: '交換連結'
|
||||
subtitle: '交換連結'
|
||||
|
||||
page404:
|
||||
menu: '頁面不存在'
|
||||
title: '頁面不存在'
|
||||
subtitle: '頁面不存在'
|
||||
|
||||
post:
|
||||
toc: '目錄'
|
||||
prev_post: '上一篇'
|
||||
next_post: '下一篇'
|
||||
updated: '本文最後更新於:%s'
|
||||
meta:
|
||||
wordcount: '%s 字'
|
||||
min2read: '%s 分鐘'
|
||||
views: '{} 次'
|
||||
copyright:
|
||||
author: '作者'
|
||||
posted: '發布於'
|
||||
updated: '更新於'
|
||||
licensed: '許可協議'
|
||||
CC: 'CC - 知識共享許可協議'
|
||||
BY: 'BY - 署名'
|
||||
SA: 'SA - 相同方式共享'
|
||||
NC: 'NC - 非商業性使用'
|
||||
ND: 'ND - 禁止演繹'
|
||||
ZERO: 'CC0 - 無著作權'
|
||||
|
||||
footer:
|
||||
pv: '總訪問量 {} 次'
|
||||
uv: '總訪客數 {} 人'
|
||||
|
||||
search:
|
||||
title: '搜尋'
|
||||
keyword: '關鍵字'
|
||||
|
||||
noscript_warning: '博客在允許 JavaScript 運行的環境下瀏覽效果更佳'
|
||||
70
themes/fluid/languages/zh-TW.yml
Normal file
70
themes/fluid/languages/zh-TW.yml
Normal file
@ -0,0 +1,70 @@
|
||||
name: '正體中文'
|
||||
|
||||
home:
|
||||
menu: '首頁'
|
||||
title: '首頁'
|
||||
|
||||
archive:
|
||||
menu: '歸檔'
|
||||
title: '歸檔'
|
||||
subtitle: '歸檔'
|
||||
post_total: '共有 %d 篇文章'
|
||||
|
||||
category:
|
||||
menu: '分類'
|
||||
title: '分類'
|
||||
subtitle: '分類'
|
||||
post_total: '共有 %d 篇文章'
|
||||
more: 'More...'
|
||||
|
||||
tag:
|
||||
menu: '標籤'
|
||||
title: '標籤'
|
||||
subtitle: '標籤'
|
||||
post_total: '共有 %d 篇文章'
|
||||
|
||||
about:
|
||||
menu: '關於'
|
||||
title: '關於'
|
||||
subtitle: '關於'
|
||||
|
||||
links:
|
||||
menu: '連結'
|
||||
title: '交換連結'
|
||||
subtitle: '交換連結'
|
||||
|
||||
page404:
|
||||
menu: '頁面不存在'
|
||||
title: '頁面不存在'
|
||||
subtitle: '頁面不存在'
|
||||
|
||||
post:
|
||||
toc: '目錄'
|
||||
prev_post: '上一篇'
|
||||
next_post: '下一篇'
|
||||
updated: '本文最後更新於:%s'
|
||||
meta:
|
||||
wordcount: '%s 字'
|
||||
min2read: '%s 分鐘'
|
||||
views: '{} 次'
|
||||
copyright:
|
||||
author: '作者'
|
||||
posted: '發布於'
|
||||
updated: '更新於'
|
||||
licensed: '許可協議'
|
||||
CC: 'CC - 知識共享許可協議'
|
||||
BY: 'BY - 署名'
|
||||
SA: 'SA - 相同方式共享'
|
||||
NC: 'NC - 非商業性使用'
|
||||
ND: 'ND - 禁止演繹'
|
||||
ZERO: 'CC0 - 無著作權'
|
||||
|
||||
footer:
|
||||
pv: '總訪問量 {} 次'
|
||||
uv: '總訪客數 {} 人'
|
||||
|
||||
search:
|
||||
title: '搜尋'
|
||||
keyword: '關鍵字'
|
||||
|
||||
noscript_warning: '博客在允許 JavaScript 運行的環境下瀏覽效果更佳'
|
||||
18
themes/fluid/layout/404.ejs
Normal file
18
themes/fluid/layout/404.ejs
Normal file
@ -0,0 +1,18 @@
|
||||
<%
|
||||
page.layout = "404"
|
||||
page.title = theme.page404.title || __('page404.title')
|
||||
page.subtitle = theme.page404.subtitle || __('page404.subtitle')
|
||||
page.banner_img = theme.page404.banner_img
|
||||
page.banner_img_height = theme.page404.banner_img_height
|
||||
page.banner_mask_alpha = theme.page404.banner_mask_alpha
|
||||
%>
|
||||
|
||||
<script>
|
||||
function redirect() {
|
||||
location.href = "<%- url_for('/') %>";
|
||||
}
|
||||
|
||||
<% if (theme.page404.redirect_delay) { %>
|
||||
setTimeout(redirect, <%= parseInt(theme.page404.redirect_delay) %>)
|
||||
<% } %>
|
||||
</script>
|
||||
17
themes/fluid/layout/_partials/archive-list.ejs
Normal file
17
themes/fluid/layout/_partials/archive-list.ejs
Normal file
@ -0,0 +1,17 @@
|
||||
<div class="list-group">
|
||||
<p class="h4"><%= __(params.key + '.post_total', params.postTotal) %></p>
|
||||
<hr>
|
||||
<% var dateCursor %>
|
||||
<% page.posts.each(function (post) { %>
|
||||
<% if(date(post.date, "YYYY") !== dateCursor) { %>
|
||||
<% dateCursor = date(post.date, "YYYY") %>
|
||||
<p class="h5"><%= dateCursor %></p>
|
||||
<% } %>
|
||||
<a href="<%= url_for(post.path) %>" class="list-group-item list-group-item-action">
|
||||
<time><%= date(post.date, "MM-DD") %></time>
|
||||
<div class="list-group-item-title"><%= post.title %></div>
|
||||
</a>
|
||||
<% }) %>
|
||||
</div>
|
||||
|
||||
<%- partial('_partials/paginator') %>
|
||||
19
themes/fluid/layout/_partials/category-chains.ejs
Normal file
19
themes/fluid/layout/_partials/category-chains.ejs
Normal file
@ -0,0 +1,19 @@
|
||||
<% function render_category_chain(cat) { %>
|
||||
<a href="<%= url_for(cat.path) %>" class="category-chain-item"><%= cat.name.trim() %></a>
|
||||
<% var nextCats = categories.find({ parent: cat._id }).sort(config.index_generator.order_by || 'name').filter(cat => cat.length) %>
|
||||
<% if (nextCats.length > 0) { %>
|
||||
<span>></span>
|
||||
<%- render_category_chain(nextCats.data[0]) %>
|
||||
<% } %>
|
||||
<% } %>
|
||||
|
||||
<span class="category-chains">
|
||||
<% var catsFirst = categories.find({ parent: { $exists: false } }).sort(config.index_generator.order_by || 'name').filter(cat => cat.length) %>
|
||||
<% catsFirst.each((cat, idx) => { %>
|
||||
<% if (typeof(limit) === "undefined" || idx < limit) { %>
|
||||
<span class="category-chain">
|
||||
<%- render_category_chain(cat) %>
|
||||
</span>
|
||||
<% } %>
|
||||
<% }) %>
|
||||
</span>
|
||||
62
themes/fluid/layout/_partials/category-list.ejs
Normal file
62
themes/fluid/layout/_partials/category-list.ejs
Normal file
@ -0,0 +1,62 @@
|
||||
<% function render_categories(curCats, params = {}, depth = 0) { %>
|
||||
<% return curCats.each((cat) => { %>
|
||||
<% var subCats = site.categories.find({ parent: cat._id }).sort(params.orderBy || 'name').filter(cat => cat.length) %>
|
||||
<% var collapsed = subCats.length === 0 || depth >= theme.category.collapse_depth %>
|
||||
<% if ((params.filterIds || []).includes(cat._id)) collapsed = false %>
|
||||
<div class="<%= depth <= 0 ? 'category' : 'category-sub' %> row nomargin-x">
|
||||
<a class="<%= depth <= 0 ? 'category-item' : 'category-subitem' %> <%= collapsed ? 'collapsed' : '' %>
|
||||
list-group-item category-item-action col-10 col-md-11 col-xm-11" title="<%= cat.name.trim() %>"
|
||||
id="heading-<%= md5(cat.name) %>" role="tab" data-toggle="collapse" href="#collapse-<%= md5(cat.name) %>"
|
||||
aria-expanded="<%= collapsed ? 'false' : 'true' %>"
|
||||
>
|
||||
<%= cat.name.trim() %>
|
||||
<span class="list-group-count"><%= params.type === 'post' ? `(${ cat.posts.length })` : '' %></span>
|
||||
<i class="iconfont icon-arrowright"></i>
|
||||
</a>
|
||||
<% if(params.type !== 'post') { %>
|
||||
<a href="<%= url_for(cat.path) %>" class="category-count col-2 col-md-1 col-xm-1">
|
||||
<i class="iconfont icon-articles"></i>
|
||||
<span><%= cat.posts.length %></span>
|
||||
</a>
|
||||
<% } %>
|
||||
<div class="category-collapse collapse <%= collapsed ? '' : 'show' %>" id="collapse-<%= md5(cat.name) %>"
|
||||
role="tabpanel" aria-labelledby="heading-<%= md5(cat.name) %>">
|
||||
<% var posts = cat.posts.sort(params.postOrderBy || '-date') %>
|
||||
<% if (subCats.length > 0) { %>
|
||||
<% var filteredPosts = posts.filter((p) => {
|
||||
return p.categories.filter(catOnPost => catOnPost.parent === cat._id).length === 0;
|
||||
}) %>
|
||||
<%- render_posts(filteredPosts, cat, params) %>
|
||||
<%- render_categories(subCats, params, depth + 1) %>
|
||||
<% } else { %>
|
||||
<%- render_posts(posts, cat, params) %>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
<% }) %>
|
||||
<% } %>
|
||||
|
||||
<% function render_posts(posts, cat, params) { %>
|
||||
<div class="category-post-list">
|
||||
<% var limit = params.postLimit %>
|
||||
<% for (var idx = 0; idx < posts.length; idx++) { %>
|
||||
<% var post = posts.data[idx] %>
|
||||
<% if (idx && limit && idx >= limit) { %>
|
||||
<a href="<%= url_for(cat.path) %>" class="list-group-item list-group-item-action">
|
||||
<span class="category-post"><%- __('category.more') %></span>
|
||||
</a>
|
||||
<% break %>
|
||||
<% } else { %>
|
||||
<a href="<%= url_for(post.path) %>" title="<%= post.title %>"
|
||||
class="list-group-item list-group-item-action
|
||||
<%= (params.filterIds || []).includes(post._id) ? 'active' : '' %>">
|
||||
<span class="category-post"><%= post.title %></span>
|
||||
</a>
|
||||
<% } %>
|
||||
<% } %>
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
<div class="category-list">
|
||||
<%- render_categories(curCats, params) %>
|
||||
</div>
|
||||
8
themes/fluid/layout/_partials/comments.ejs
Normal file
8
themes/fluid/layout/_partials/comments.ejs
Normal file
@ -0,0 +1,8 @@
|
||||
<% if ((!is_post() && !is_page()) || (is_post() && theme.post.comments.enable && page.comments) || (is_page() && page.comments)) { %>
|
||||
<% var commentType = typeof page.comment === 'string' && page.comment !== '' ? page.comment : theme.post.comments.type %>
|
||||
<% if (commentType) { %>
|
||||
<article id="comments">
|
||||
<%- partial('_partials/comments/' + commentType) %>
|
||||
</article>
|
||||
<% } %>
|
||||
<% } %>
|
||||
11
themes/fluid/layout/_partials/comments/changyan.ejs
Normal file
11
themes/fluid/layout/_partials/comments/changyan.ejs
Normal file
@ -0,0 +1,11 @@
|
||||
<% if (theme.changyan.appid) { %>
|
||||
<div id="SOHUCS" sid='<%= page.permalink %>'></div>
|
||||
<script type="text/javascript">
|
||||
Fluid.utils.loadComments('#SOHUCS', function() {
|
||||
Fluid.utils.createScript("https://changyan.sohu.com/upload/changyan.js", function() {
|
||||
window.changyan.api.config(<%- JSON.stringify(theme.changyan || {}) %>)
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
<% } %>
|
||||
25
themes/fluid/layout/_partials/comments/cusdis.ejs
Normal file
25
themes/fluid/layout/_partials/comments/cusdis.ejs
Normal file
@ -0,0 +1,25 @@
|
||||
<% if (theme.cusdis.host && theme.cusdis.app_id) { %>
|
||||
<div class="cusdis" style="width:100%">
|
||||
<div id="cusdis_thread"
|
||||
data-host="<%= theme.cusdis.host %>"
|
||||
data-app-id="<%= theme.cusdis.app_id %>"
|
||||
data-page-id="<%= md5(page.path) %>"
|
||||
data-page-url="<%= page.path %>"
|
||||
data-page-title="<%= page.title %>"
|
||||
data-theme="<%= theme.dark_mode.default %>"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
Fluid.utils.loadComments('#cusdis_thread', function() {
|
||||
Fluid.utils.createScript('<%= url_join(theme.cusdis.host,
|
||||
`/js/widget/lang/${ String(theme.cusdis.lang || 'zh-cn').toLowerCase() }.js`) %>');
|
||||
Fluid.utils.createScript('<%= url_join(theme.cusdis.host, 'js/cusdis.es.js') %>');
|
||||
var schema = document.documentElement.getAttribute('data-user-color-scheme');
|
||||
if (schema) {
|
||||
document.querySelector('#cusdis_thread').dataset.theme = schema
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
<% } %>
|
||||
17
themes/fluid/layout/_partials/comments/discuss.ejs
Normal file
17
themes/fluid/layout/_partials/comments/discuss.ejs
Normal file
@ -0,0 +1,17 @@
|
||||
<% if (theme.discuss && theme.discuss.serverURLs) { %>
|
||||
<div id="discuss-comments"></div>
|
||||
<script type="text/javascript">
|
||||
Fluid.utils.loadComments('#comments', function() {
|
||||
Fluid.utils.createScript('<%= url_join(theme.static_prefix.discuss, 'discuss.js') %>', function() {
|
||||
var options = Object.assign(
|
||||
<%- JSON.stringify(theme.discuss || {}) %>,
|
||||
{ el: '#discuss-comments',
|
||||
path: <%= theme.discuss.path %>
|
||||
}
|
||||
)
|
||||
discuss.init(options)
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
<% } %>
|
||||
32
themes/fluid/layout/_partials/comments/disqus.ejs
Normal file
32
themes/fluid/layout/_partials/comments/disqus.ejs
Normal file
@ -0,0 +1,32 @@
|
||||
<% if (theme.disqus.shortname) { %>
|
||||
<div class="disqus" style="width:100%">
|
||||
<div id="disqus_thread"></div>
|
||||
<% if (theme.disqus.disqusjs) { %>
|
||||
<script>
|
||||
Fluid.utils.loadComments('#disqus_thread', function() {
|
||||
Fluid.utils.createCssLink('<%= url_join(theme.static_prefix.disqusjs, 'disqusjs.css') %>');
|
||||
Fluid.utils.createScript('<%= url_join(theme.static_prefix.disqusjs, 'disqus.js') %>', function() {
|
||||
new DisqusJS({
|
||||
shortname: '<%= theme.disqus.shortname %>',
|
||||
apikey: '<%= theme.disqus.apikey %>'
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<% } else { %>
|
||||
<script type="text/javascript">
|
||||
var disqus_config = function() {
|
||||
this.page.url = '<%= page.permalink %>';
|
||||
this.page.identifier = '<%= url_for(page.path) %>';
|
||||
};
|
||||
Fluid.utils.loadComments('#disqus_thread', function() {
|
||||
var d = document, s = d.createElement('script');
|
||||
s.src = '//' + '<%= theme.disqus.shortname %>' + '.disqus.com/embed.js';
|
||||
s.setAttribute('data-timestamp', new Date());
|
||||
(d.head || d.body).appendChild(s);
|
||||
});
|
||||
</script>
|
||||
<% } %>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
</div>
|
||||
<% } %>
|
||||
36
themes/fluid/layout/_partials/comments/giscus.ejs
Normal file
36
themes/fluid/layout/_partials/comments/giscus.ejs
Normal file
@ -0,0 +1,36 @@
|
||||
<% if (theme.giscus && theme.giscus['repo'] && theme.giscus['repo-id']) { %>
|
||||
<div id="giscus" class="giscus"></div>
|
||||
<script type="text/javascript">
|
||||
Fluid.utils.loadComments('#giscus', function() {
|
||||
var options = <%- JSON.stringify(theme.giscus || {}) %>;
|
||||
var attributes = {};
|
||||
for (let option in options) {
|
||||
if (!option.startsWith('theme-')) {
|
||||
var key = option.startsWith('data-') ? option : 'data-' + option;
|
||||
attributes[key] = options[option];
|
||||
}
|
||||
}
|
||||
var light = '<%= theme.giscus['theme-light'] || 'light' %>';
|
||||
var dark = '<%= theme.giscus['theme-dark'] || 'dark' %>';
|
||||
window.GiscusThemeLight = light;
|
||||
window.GiscusThemeDark = dark;
|
||||
attributes['data-theme'] = document.documentElement.getAttribute('data-user-color-scheme') === 'dark' ? dark : light;
|
||||
for (let attribute in attributes) {
|
||||
var value = attributes[attribute];
|
||||
if (value === undefined || value === null || value === '') {
|
||||
delete attributes[attribute];
|
||||
}
|
||||
}
|
||||
var s = document.createElement('script');
|
||||
s.setAttribute('src', 'https://giscus.app/client.js');
|
||||
s.setAttribute('crossorigin', 'anonymous');
|
||||
for (let attribute in attributes) {
|
||||
s.setAttribute(attribute, attributes[attribute]);
|
||||
}
|
||||
var ss = document.getElementsByTagName('script');
|
||||
var e = ss.length > 0 ? ss[ss.length - 1] : document.head || document.documentElement;
|
||||
e.parentNode.insertBefore(s, e.nextSibling);
|
||||
});
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
<% } %>
|
||||
19
themes/fluid/layout/_partials/comments/gitalk.ejs
Normal file
19
themes/fluid/layout/_partials/comments/gitalk.ejs
Normal file
@ -0,0 +1,19 @@
|
||||
<% if(theme.gitalk.clientID && theme.gitalk.clientSecret && theme.gitalk.repo){ %>
|
||||
<div id="gitalk-container"></div>
|
||||
<script type="text/javascript">
|
||||
Fluid.utils.loadComments('#gitalk-container', function() {
|
||||
Fluid.utils.createCssLink('<%= url_join(theme.static_prefix.internal_css, 'gitalk.css') %>')
|
||||
Fluid.utils.createScript('<%= url_join(theme.static_prefix.gitalk, 'gitalk.min.js') %>', function() {
|
||||
var options = Object.assign(
|
||||
<%- JSON.stringify(theme.gitalk || {}) %>,
|
||||
{
|
||||
id: '<%= md5(page.path) %>'
|
||||
}
|
||||
)
|
||||
var gitalk = new Gitalk(options);
|
||||
gitalk.render('gitalk-container');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
<% } %>
|
||||
10
themes/fluid/layout/_partials/comments/livere.ejs
Normal file
10
themes/fluid/layout/_partials/comments/livere.ejs
Normal file
@ -0,0 +1,10 @@
|
||||
<% if (theme.livere.uid) { %>
|
||||
<div id="lv-container" data-id="city" data-uid="<%= theme.livere.uid %>">
|
||||
<script type="text/javascript">
|
||||
Fluid.utils.loadComments('#lv-container', function() {
|
||||
Fluid.utils.createScript('https://cdn-city.livere.com/js/embed.dist.js');
|
||||
});
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
</div>
|
||||
<% } %>
|
||||
29
themes/fluid/layout/_partials/comments/remark42.ejs
Normal file
29
themes/fluid/layout/_partials/comments/remark42.ejs
Normal file
@ -0,0 +1,29 @@
|
||||
<% if (theme.remark42.host && theme.remark42.site_id) { %>
|
||||
<div id="remark42"></div>
|
||||
<script type="text/javascript">
|
||||
var schema = document.documentElement.getAttribute('data-user-color-scheme');
|
||||
if (schema !== 'light' && schema !== 'dark') {
|
||||
schema = 'light';
|
||||
}
|
||||
var remark_config = Object.assign(
|
||||
<%- JSON.stringify(theme.remark42 || {}) %>,
|
||||
{
|
||||
url: '<%= url_for(page.path) %>',
|
||||
page_title: '<%= page.title %>',
|
||||
theme: schema,
|
||||
}
|
||||
);
|
||||
|
||||
Fluid.utils.loadComments('#remark42', function() {
|
||||
(function (c) {
|
||||
for (var i = 0; i < c.length; i++) {
|
||||
var d = document, s = d.createElement('script');
|
||||
s.src = remark_config.host + '/web/' + c[i] + '.js';
|
||||
s.defer = true;
|
||||
(d.head || d.body).appendChild(s);
|
||||
}
|
||||
})(remark_config.components || ['embed']);
|
||||
});
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
<% } %>
|
||||
25
themes/fluid/layout/_partials/comments/twikoo.ejs
Normal file
25
themes/fluid/layout/_partials/comments/twikoo.ejs
Normal file
@ -0,0 +1,25 @@
|
||||
<% if (theme.twikoo && theme.twikoo.envId) { %>
|
||||
<div id="twikoo"></div>
|
||||
<script type="text/javascript">
|
||||
Fluid.utils.loadComments('#comments', function() {
|
||||
Fluid.utils.createScript('<%= url_join(theme.static_prefix.twikoo, 'twikoo.all.min.js') %>', function() {
|
||||
var options = Object.assign(
|
||||
<%- JSON.stringify(theme.twikoo || {}) %>,
|
||||
{
|
||||
el: '#twikoo',
|
||||
path: '<%= theme.twikoo.path %>',
|
||||
onCommentLoaded: function() {
|
||||
Fluid.utils.listenDOMLoaded(function() {
|
||||
var imgSelector = '#twikoo .tk-content img:not(.tk-owo-emotion)';
|
||||
Fluid.plugins.imageCaption(imgSelector);
|
||||
Fluid.plugins.fancyBox(imgSelector);
|
||||
});
|
||||
}
|
||||
}
|
||||
)
|
||||
twikoo.init(options)
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
<% } %>
|
||||
27
themes/fluid/layout/_partials/comments/utterances.ejs
Normal file
27
themes/fluid/layout/_partials/comments/utterances.ejs
Normal file
@ -0,0 +1,27 @@
|
||||
<% if (theme.utterances.repo && theme.utterances.issue_term) { %>
|
||||
<script type="text/javascript">
|
||||
Fluid.utils.loadComments('#comments', function() {
|
||||
var light = '<%= theme.utterances.theme || 'github-light' %>';
|
||||
var dark = '<%= theme.utterances.theme_dark || 'github-dark' %>';
|
||||
var schema = document.documentElement.getAttribute('data-user-color-scheme');
|
||||
if (schema === 'dark') {
|
||||
schema = dark;
|
||||
} else {
|
||||
schema = light;
|
||||
}
|
||||
window.UtterancesThemeLight = light;
|
||||
window.UtterancesThemeDark = dark;
|
||||
var s = document.createElement('script');
|
||||
s.setAttribute('src', 'https://utteranc.es/client.js');
|
||||
s.setAttribute('repo', '<%= theme.utterances.repo %>');
|
||||
s.setAttribute('issue-term', '<%= theme.utterances.issue_term %>');
|
||||
<% if (theme.utterances.label) { %>
|
||||
s.setAttribute('label', '<%= theme.utterances.label %>');
|
||||
<% } %>
|
||||
s.setAttribute('theme', schema);
|
||||
s.setAttribute('crossorigin', 'anonymous');
|
||||
document.getElementById('comments').appendChild(s);
|
||||
})
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
<% } %>
|
||||
23
themes/fluid/layout/_partials/comments/valine.ejs
Normal file
23
themes/fluid/layout/_partials/comments/valine.ejs
Normal file
@ -0,0 +1,23 @@
|
||||
<% if (theme.valine.appId && theme.valine.appKey) { %>
|
||||
<div id="valine"></div>
|
||||
<script type="text/javascript">
|
||||
Fluid.utils.loadComments('#valine', function() {
|
||||
Fluid.utils.createScript('<%= url_join(theme.static_prefix.valine, 'Valine.min.js') %>', function() {
|
||||
var options = Object.assign(
|
||||
<%- JSON.stringify(theme.valine || {}) %>,
|
||||
{
|
||||
el: "#valine",
|
||||
path: <%= theme.valine.path %>
|
||||
}
|
||||
)
|
||||
new Valine(options);
|
||||
Fluid.utils.waitElementVisible('#valine .vcontent', () => {
|
||||
var imgSelector = '#valine .vcontent img:not(.vemoji)';
|
||||
Fluid.plugins.imageCaption(imgSelector);
|
||||
Fluid.plugins.fancyBox(imgSelector);
|
||||
})
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
<% } %>
|
||||
24
themes/fluid/layout/_partials/comments/waline.ejs
Normal file
24
themes/fluid/layout/_partials/comments/waline.ejs
Normal file
@ -0,0 +1,24 @@
|
||||
<% if (theme.waline.serverURL) { %>
|
||||
<div id="waline"></div>
|
||||
<script type="text/javascript">
|
||||
Fluid.utils.loadComments('#waline', function() {
|
||||
Fluid.utils.createCssLink('<%= url_join(theme.static_prefix.waline, 'waline.css') %>')
|
||||
Fluid.utils.createScript('<%= url_join(theme.static_prefix.waline, 'waline.js') %>', function() {
|
||||
var options = Object.assign(
|
||||
<%- JSON.stringify(theme.waline || {}) %>,
|
||||
{
|
||||
el: '#waline',
|
||||
path: <%= theme.waline.path %>
|
||||
}
|
||||
)
|
||||
Waline.init(options);
|
||||
Fluid.utils.waitElementVisible('#waline .vcontent', () => {
|
||||
var imgSelector = '#waline .vcontent img:not(.vemoji)';
|
||||
Fluid.plugins.imageCaption(imgSelector);
|
||||
Fluid.plugins.fancyBox(imgSelector);
|
||||
})
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
<% } %>
|
||||
26
themes/fluid/layout/_partials/css.ejs
Normal file
26
themes/fluid/layout/_partials/css.ejs
Normal file
@ -0,0 +1,26 @@
|
||||
<%- css_ex(theme.static_prefix.bootstrap, 'css/bootstrap.min.css') %>
|
||||
|
||||
<% var css_snippets = deduplicate(page.css_snippets) %>
|
||||
<% for (var idx = 0; idx < css_snippets.length; idx++) { %>
|
||||
<%- css_snippets[idx] %>
|
||||
<% } %>
|
||||
<% page.css_snippets = [] %>
|
||||
|
||||
<!-- 主题依赖的图标库,不要自行修改 -->
|
||||
<!-- Do not modify the link that theme dependent icons -->
|
||||
<%- css('//at.alicdn.com/t/c/font_1749284_5i9bdhy70f8.css') %>
|
||||
|
||||
<%- css(theme.static_prefix.iconfont || theme.iconfont) %>
|
||||
|
||||
<%- css_ex(theme.static_prefix.internal_css, 'main.css') %>
|
||||
|
||||
<% if (theme.code.highlight.enable) { %>
|
||||
<%- css_ex(theme.static_prefix.internal_css, 'highlight.css', 'id="highlight-css"') %>
|
||||
<% if (theme.dark_mode.enable) { %>
|
||||
<%- css_ex(theme.static_prefix.internal_css, 'highlight-dark.css', 'id="highlight-css-dark"') %>
|
||||
<% } %>
|
||||
<% } %>
|
||||
|
||||
<% if (theme.custom_css) { %>
|
||||
<%- css(theme.custom_css) %>
|
||||
<% } %>
|
||||
34
themes/fluid/layout/_partials/footer.ejs
Normal file
34
themes/fluid/layout/_partials/footer.ejs
Normal file
@ -0,0 +1,34 @@
|
||||
<div class="footer-inner">
|
||||
<% if (theme.footer.content) { %>
|
||||
<div class="footer-content">
|
||||
<%- theme.footer.content %>
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
<!-- 添加 logo 贴纸 -->
|
||||
<div class="footer-logos">
|
||||
<a href="https://archlinux.org" target="_blank">
|
||||
<img src="/images/archlinux-logo.png" alt="Arch Linux Logo" width="80">
|
||||
</a>
|
||||
<a href="https://kde.org" target="_blank">
|
||||
<img src="/images/built_on_the_kde_platform.png" alt="Built on the KDE Platform" width="80">
|
||||
</a>
|
||||
<a href="https://amd.com" target="_blank">
|
||||
<img src="/images/amd.webp" alt="AMD Logo" width="80">
|
||||
</a>
|
||||
<a href="https://www.asc-events.net/" target="_blank">
|
||||
<img src="/images/asc-events.png" alt="ASC-Events" width="80">
|
||||
</a>
|
||||
<a href="https://notbyai.fyi/" target="_blank">
|
||||
<img src="/images/Written-By-Human-Not-By-AI-Badge-white@2x.png" alt="Written By Human Not By AI Badge" width="80">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<% if (theme.footer.statistics.enable) { %>
|
||||
<%- partial('_partials/footer/statistics.ejs') %>
|
||||
<% } %>
|
||||
<% if(theme.footer.beian.enable) { %>
|
||||
<!-- 备案信息 ICP for China -->
|
||||
<%- partial('_partials/footer/beian.ejs') %>
|
||||
<% } %>
|
||||
</div>
|
||||
33
themes/fluid/layout/_partials/footer/beian.ejs
Normal file
33
themes/fluid/layout/_partials/footer/beian.ejs
Normal file
@ -0,0 +1,33 @@
|
||||
<div class="beian">
|
||||
<span>
|
||||
<a href="http://beian.miit.gov.cn/" target="_blank" rel="nofollow noopener">
|
||||
<%- theme.footer.beian.icp_text %>
|
||||
</a>
|
||||
</span>
|
||||
<% if(theme.footer.beian.police_text) { %>
|
||||
<% if(theme.footer.beian.police_code) { %>
|
||||
<span>
|
||||
<a
|
||||
href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=<%= theme.footer.beian.police_code %>"
|
||||
rel="nofollow noopener"
|
||||
class="beian-police"
|
||||
target="_blank"
|
||||
>
|
||||
<% if(theme.footer.beian.police_icon) { %>
|
||||
<span style="visibility: hidden; width: 0">|</span>
|
||||
<img src="<%= url_for(theme.footer.beian.police_icon) %>" alt="police-icon"/>
|
||||
<% } %>
|
||||
<span><%- theme.footer.beian.police_text %></span>
|
||||
</a>
|
||||
</span>
|
||||
<% } else { %>
|
||||
<span class="beian-police">
|
||||
<% if(theme.footer.beian.police_icon) { %>
|
||||
<span style="visibility: hidden; width: 0">|</span>
|
||||
<img src="<%= url_for(theme.footer.beian.police_icon) %>" alt="police-icon"/>
|
||||
<% } %>
|
||||
<span class="beian-police"><%- theme.footer.beian.police_text %></span>
|
||||
</span>
|
||||
<% } %>
|
||||
<% } %>
|
||||
</div>
|
||||
57
themes/fluid/layout/_partials/footer/statistics.ejs
Normal file
57
themes/fluid/layout/_partials/footer/statistics.ejs
Normal file
@ -0,0 +1,57 @@
|
||||
<div class="statistics">
|
||||
<% let pv_texts = (theme.footer.statistics.pv_format || __('footer.pv')).split('{}') %>
|
||||
<% let uv_texts = (theme.footer.statistics.uv_format || __('footer.uv')).split('{}') %>
|
||||
|
||||
<% if (theme.footer.statistics.source === 'leancloud') { %>
|
||||
<% if (pv_texts.length >= 2) { %>
|
||||
<span id="leancloud-site-pv-container" style="display: none">
|
||||
<%- pv_texts[0] %>
|
||||
<span id="leancloud-site-pv"></span>
|
||||
<%- pv_texts[1] %>
|
||||
</span>
|
||||
<% } %>
|
||||
<% if (uv_texts.length >= 2) { %>
|
||||
<span id="leancloud-site-uv-container" style="display: none">
|
||||
<%- uv_texts[0] %>
|
||||
<span id="leancloud-site-uv"></span>
|
||||
<%- uv_texts[1] %>
|
||||
</span>
|
||||
<% } %>
|
||||
<% import_js(theme.static_prefix.internal_js, 'leancloud.js', 'defer') %>
|
||||
|
||||
<% } else if (theme.footer.statistics.source === 'busuanzi') { %>
|
||||
<% if (pv_texts.length >= 2) { %>
|
||||
<span id="busuanzi_container_site_pv" style="display: none">
|
||||
<%- pv_texts[0] %>
|
||||
<span id="busuanzi_value_site_pv"></span>
|
||||
<%- pv_texts[1] %>
|
||||
</span>
|
||||
<% } %>
|
||||
<% if (uv_texts.length >= 2) { %>
|
||||
<span id="busuanzi_container_site_uv" style="display: none">
|
||||
<%- uv_texts[0] %>
|
||||
<span id="busuanzi_value_site_uv"></span>
|
||||
<%- uv_texts[1] %>
|
||||
</span>
|
||||
<% } %>
|
||||
<% import_js(theme.static_prefix.busuanzi, 'busuanzi.pure.mini.js', 'defer') %>
|
||||
|
||||
<% } else if (theme.footer.statistics.source === 'umami') { %>
|
||||
<% if (pv_texts.length >= 2) { %>
|
||||
<span id="umami-site-pv-container" style="display: none">
|
||||
<%- pv_texts[0] %>
|
||||
<span id="umami-site-pv"></span>
|
||||
<%- pv_texts[1] %>
|
||||
</span>
|
||||
<% } %>
|
||||
<% if (uv_texts.length >= 2) { %>
|
||||
<span id="umami-site-uv-container" style="display: none">
|
||||
<%- uv_texts[0] %>
|
||||
<span id="umami-site-uv"></span>
|
||||
<%- uv_texts[1] %>
|
||||
</span>
|
||||
<% } %>
|
||||
<% import_js(theme.static_prefix.internal_js, 'umami-view.js', 'defer') %>
|
||||
<% } %>
|
||||
|
||||
</div>
|
||||
54
themes/fluid/layout/_partials/head.ejs
Normal file
54
themes/fluid/layout/_partials/head.ejs
Normal file
@ -0,0 +1,54 @@
|
||||
<%
|
||||
var separator = theme.title_join_string || theme.tab_title_separator
|
||||
var title = page.title ? [page.title, config.title].join(separator) : config.title
|
||||
var keywords = page.keywords || config.keywords
|
||||
if (keywords instanceof Array) {
|
||||
keywords = keywords.join(',')
|
||||
}
|
||||
var description = page.description || page.excerpt || (is_post() && page.content) || config.description
|
||||
if (description) {
|
||||
description = strip_html(description).substring(0, 200).trim().replace(/\n/g, ' ')
|
||||
}
|
||||
var ogImage = page.og_img || page.index_img
|
||||
var ogConfig = Object.assign({ image: ogImage && url_for(ogImage) }, theme.open_graph)
|
||||
%>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="<%= url_for(theme.apple_touch_icon) %>">
|
||||
<link rel="icon" href="<%= url_for(theme.favicon) %>">
|
||||
<% if (theme.canonical.enable) { %>
|
||||
<link rel="canonical" href="<%= url_join(config.url, page.canonical_path.replace('index.html', '')) %>"/>
|
||||
<% } %>
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<% if (theme.force_https) { %>
|
||||
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
|
||||
<% } %>
|
||||
<meta name="theme-color" content="<%= theme.color.navbar_bg_color %>">
|
||||
<meta name="author" content="<%= page.author || config.author %>">
|
||||
<meta name="keywords" content="<%= keywords %>">
|
||||
<% if (theme.open_graph.enable) { %>
|
||||
<%- open_graph(ogConfig) %>
|
||||
<% } else { %>
|
||||
<meta name="description" content="<%= description %>">
|
||||
<% } %>
|
||||
<% if ((theme.post.meta.views.enable && theme.post.meta.views.source === 'busuanzi')
|
||||
|| (theme.footer.statistics.enable && theme.footer.statistics.source === 'busuanzi')) { %>
|
||||
<meta name="referrer" content="no-referrer-when-downgrade">
|
||||
<% } %>
|
||||
<% if (theme.custom_head) { %>
|
||||
<%- theme.custom_head %>
|
||||
<% } %>
|
||||
<title><%= title %></title>
|
||||
|
||||
<%- partial('_partials/css.ejs') %>
|
||||
<%- export_config() %>
|
||||
<%- js_ex(theme.static_prefix.internal_js, 'utils.js') %>
|
||||
<%- js_ex(theme.static_prefix.internal_js, 'color-schema.js') %>
|
||||
<%- partial('_partials/plugins/analytics.ejs') %>
|
||||
|
||||
<%- inject_point('head') %>
|
||||
</head>
|
||||
8
themes/fluid/layout/_partials/header.ejs
Normal file
8
themes/fluid/layout/_partials/header.ejs
Normal file
@ -0,0 +1,8 @@
|
||||
<%
|
||||
var banner_img_height = parseFloat(page.banner_img_height || theme.index.banner_img_height)
|
||||
%>
|
||||
|
||||
<div class="header-inner" style="height: <%= banner_img_height %>vh;">
|
||||
<%- partial('_partials/header/navigation') %>
|
||||
<%- partial('_partials/header/banner') %>
|
||||
</div>
|
||||
33
themes/fluid/layout/_partials/header/banner.ejs
Normal file
33
themes/fluid/layout/_partials/header/banner.ejs
Normal file
@ -0,0 +1,33 @@
|
||||
<%
|
||||
var banner_img = page.banner_img || theme.index.banner_img
|
||||
var banner_img_height = parseFloat(page.banner_img_height || theme.index.banner_img_height)
|
||||
var banner_mask_alpha = parseFloat(page.banner_mask_alpha || theme.index.banner_mask_alpha)
|
||||
var subtitle = page.subtitle || page.title
|
||||
%>
|
||||
|
||||
<div id="banner" class="banner" <%- theme.banner && theme.banner.parallax && 'parallax=true' %>
|
||||
style="background: url('<%- url_for(banner_img) %>') no-repeat center center; background-size: cover;">
|
||||
<div class="full-bg-img">
|
||||
<div class="mask flex-center" style="background-color: rgba(0, 0, 0, <%= parseFloat(banner_mask_alpha) %>)">
|
||||
<div class="banner-text text-center fade-in-up">
|
||||
<div class="h2">
|
||||
<% if(theme.fun_features.typing.enable && in_scope(theme.fun_features.typing.scope)) { %>
|
||||
<span id="subtitle" data-typed-text="<%= subtitle %>"></span>
|
||||
<% } else { %>
|
||||
<span id="subtitle"><%- subtitle %></span>
|
||||
<% } %>
|
||||
</div>
|
||||
|
||||
<% if (is_post()) { %>
|
||||
<%- inject_point('postMetaTop') %>
|
||||
<% } %>
|
||||
</div>
|
||||
|
||||
<% if (theme.scroll_down_arrow.enable && theme.scroll_down_arrow.banner_height_limit <= banner_img_height && page.layout !== '404') { %>
|
||||
<div class="scroll-down-bar">
|
||||
<i class="iconfont icon-arrowdown"></i>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
70
themes/fluid/layout/_partials/header/navigation.ejs
Normal file
70
themes/fluid/layout/_partials/header/navigation.ejs
Normal file
@ -0,0 +1,70 @@
|
||||
<nav id="navbar" class="navbar fixed-top navbar-expand-lg navbar-dark scrolling-navbar">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="<%= url_for() %>">
|
||||
<strong><%= theme.navbar.blog_title || config.title %></strong>
|
||||
</a>
|
||||
|
||||
<button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
|
||||
data-target="#navbarSupportedContent"
|
||||
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<div class="animated-icon"><span></span><span></span><span></span></div>
|
||||
</button>
|
||||
|
||||
<!-- Collapsible content -->
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav ml-auto text-center">
|
||||
<% for(const each of theme.navbar.menu || []) { %>
|
||||
<% if (!each.submenu && !each.link) continue %>
|
||||
<% var text = each.name || __(each.key + '.menu') || __(each.key + '.title') %>
|
||||
<% if (text.indexOf('.menu') !== -1 || text.indexOf('.title') !== -1) {
|
||||
text = each.key
|
||||
} %>
|
||||
<% if (each.submenu) { %>
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" target="_self" href="javascript:;" role="button"
|
||||
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<%- each.icon ? '<i class="' + each.icon + '"></i>' : '' %>
|
||||
<span><%- text %></span>
|
||||
</a>
|
||||
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
|
||||
<% for(const subEach of each.submenu || []) { %>
|
||||
<% if (!subEach.link) continue %>
|
||||
<% var subText = subEach.name || __(subEach.key + '.title') %>
|
||||
<% if (subText.indexOf('.title') !== -1) {
|
||||
subText = subEach.key
|
||||
} %>
|
||||
<a class="dropdown-item" href="<%= url_for(subEach.link) %>" target="<%= subEach.target || '_self' %>">
|
||||
<%- subEach.icon ? '<i class="' + subEach.icon + '"></i>' : '' %>
|
||||
<span><%- subText %></span>
|
||||
</a>
|
||||
<% } %>
|
||||
</div>
|
||||
</li>
|
||||
<% } else { %>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<%= url_for(each.link) %>" target="<%= each.target || '_self' %>">
|
||||
<%- each.icon ? '<i class="' + each.icon + '"></i>' : '' %>
|
||||
<span><%- text %></span>
|
||||
</a>
|
||||
</li>
|
||||
<% } %>
|
||||
<% } %>
|
||||
<% if(theme.search.enable) { %>
|
||||
<li class="nav-item" id="search-btn">
|
||||
<a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
|
||||
<i class="iconfont icon-search"></i>
|
||||
</a>
|
||||
</li>
|
||||
<% import_js(theme.static_prefix.internal_js, 'local-search.js') %>
|
||||
<% } %>
|
||||
<% if(theme.dark_mode && theme.dark_mode.enable) { %>
|
||||
<li class="nav-item" id="color-toggle-btn">
|
||||
<a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">
|
||||
<i class="iconfont icon-dark" id="color-toggle-icon"></i>
|
||||
</a>
|
||||
</li>
|
||||
<% } %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
24
themes/fluid/layout/_partials/markdown-plugins.ejs
Normal file
24
themes/fluid/layout/_partials/markdown-plugins.ejs
Normal file
@ -0,0 +1,24 @@
|
||||
<% import_css(theme.static_prefix.github_markdown, 'github-markdown.min.css') %>
|
||||
<% import_css(theme.static_prefix.hint, 'hint.min.css') %>
|
||||
|
||||
<% if (theme.code.highlight.enable) { %>
|
||||
<%- partial('_partials/plugins/highlight.ejs') %>
|
||||
<% } %>
|
||||
<% if ((theme.code.language.enable && theme.code.language.default) || theme.code.copy_btn) { %>
|
||||
<%- partial('_partials/plugins/code-widget.ejs') %>
|
||||
<% } %>
|
||||
<% if (theme.fun_features.anchorjs.enable && page.anchorjs !== false) { %>
|
||||
<%- partial('_partials/plugins/anchorjs.ejs') %>
|
||||
<% } %>
|
||||
<% if (theme.post.image_zoom.enable && page.image_zoom !== false) { %>
|
||||
<%- partial('_partials/plugins/fancybox.ejs') %>
|
||||
<% } %>
|
||||
<% if (theme.post.image_caption.enable) { %>
|
||||
<% import_script('<script>Fluid.plugins.imageCaption();</script>') %>
|
||||
<% } %>
|
||||
<% if (theme.post.math.enable && (!theme.post.math.specific || (theme.post.math.specific && page.math))) { %>
|
||||
<%- partial('_partials/plugins/math.ejs') %>
|
||||
<% } %>
|
||||
<% if (theme.post.mermaid.enable && (!theme.post.mermaid.specific || (theme.post.mermaid.specific && page.mermaid))) { %>
|
||||
<%- partial('_partials/plugins/mermaid.ejs') %>
|
||||
<% } %>
|
||||
14
themes/fluid/layout/_partials/paginator.ejs
Normal file
14
themes/fluid/layout/_partials/paginator.ejs
Normal file
@ -0,0 +1,14 @@
|
||||
<% if (page.total > 1){ %>
|
||||
<nav aria-label="navigation">
|
||||
<span class="pagination" id="pagination">
|
||||
<%- paginator({
|
||||
prev_text: '<i class="iconfont icon-arrowleft"></i>',
|
||||
next_text: '<i class="iconfont icon-arrowright"></i>',
|
||||
mid_size: 2,
|
||||
end_size: 1,
|
||||
format: `${config.pagination_dir}/%d/${theme.scroll_down_arrow.scroll_after_turning_page ? '#board' : ''}`,
|
||||
escape: false
|
||||
}) %>
|
||||
</span>
|
||||
</nav>
|
||||
<% } %>
|
||||
70
themes/fluid/layout/_partials/plugins/analytics.ejs
Normal file
70
themes/fluid/layout/_partials/plugins/analytics.ejs
Normal file
@ -0,0 +1,70 @@
|
||||
<% if (theme.web_analytics.enable) { %>
|
||||
|
||||
<% if(theme.web_analytics.baidu) { %>
|
||||
<!-- Baidu Analytics -->
|
||||
<script async>
|
||||
if (!Fluid.ctx.dnt) {
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?<%= theme.web_analytics.baidu %>";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
}
|
||||
</script>
|
||||
<% } %>
|
||||
|
||||
<% if (theme.web_analytics.google && theme.web_analytics.google.measurement_id){ %>
|
||||
<!-- Google tag (gtag.js) -->
|
||||
<script async>
|
||||
if (!Fluid.ctx.dnt) {
|
||||
Fluid.utils.createScript("https://www.googletagmanager.com/gtag/js?id=<%= theme.web_analytics.google.measurement_id %>", function() {
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag() {
|
||||
dataLayer.push(arguments);
|
||||
}
|
||||
gtag('js', new Date());
|
||||
gtag('config', '<%= theme.web_analytics.google.measurement_id %>');
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<% } %>
|
||||
|
||||
<% if(theme.web_analytics.umami && theme.web_analytics.umami.src && theme.web_analytics.umami.website_id) { %>
|
||||
<script async>
|
||||
if (!Fluid.ctx.dnt) {
|
||||
let umami = document.createElement('script');
|
||||
umami.async = true;
|
||||
umami.src = "<%= theme.web_analytics.umami.src %>";
|
||||
umami.setAttribute("data-website-id", "<%= theme.web_analytics.umami.website_id %>");
|
||||
umami.setAttribute("data-domains", "<%= theme.web_analytics.umami.domains %>");
|
||||
document.head.appendChild(umami);
|
||||
}
|
||||
</script>
|
||||
<% } %>
|
||||
|
||||
<% if(theme.web_analytics.tencent && theme.web_analytics.tencent.sid && theme.web_analytics.tencent.cid) { %>
|
||||
<!-- Tencent Analytics -->
|
||||
<script async>
|
||||
if (!Fluid.ctx.dnt) {
|
||||
var _mtac = {};
|
||||
(function() {
|
||||
var mta = document.createElement("script");
|
||||
mta.src = "//pingjs.qq.com/h5/stats.js?v2.0.4";
|
||||
mta.setAttribute("name", "MTAH5");
|
||||
mta.setAttribute("sid", "<%= theme.web_analytics.tencent.sid %>");
|
||||
<% if(theme.web_analytics.tencent.cid) { %>
|
||||
mta.setAttribute("cid", "<%= theme.web_analytics.tencent.cid %>");
|
||||
<% } %>
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(mta, s);
|
||||
})();
|
||||
}
|
||||
</script>
|
||||
<% } %>
|
||||
|
||||
<% if(theme.web_analytics.leancloud && theme.web_analytics.leancloud.app_id && theme.web_analytics.leancloud.app_key) { %>
|
||||
<% import_js(theme.static_prefix.internal_js, 'leancloud.js', 'defer') %>
|
||||
<% } %>
|
||||
<% } %>
|
||||
39
themes/fluid/layout/_partials/plugins/anchorjs.ejs
Normal file
39
themes/fluid/layout/_partials/plugins/anchorjs.ejs
Normal file
@ -0,0 +1,39 @@
|
||||
<%
|
||||
import_script(`
|
||||
<script>
|
||||
Fluid.utils.createScript('${ url_join(theme.static_prefix.anchor, 'anchor.min.js') }', function() {
|
||||
window.anchors.options = {
|
||||
placement: CONFIG.anchorjs.placement,
|
||||
visible : CONFIG.anchorjs.visible
|
||||
};
|
||||
if (CONFIG.anchorjs.icon) {
|
||||
window.anchors.options.icon = CONFIG.anchorjs.icon;
|
||||
}
|
||||
var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
|
||||
var res = [];
|
||||
for (var item of el) {
|
||||
res.push('.markdown-body > ' + item.trim());
|
||||
}
|
||||
if (CONFIG.anchorjs.placement === 'left') {
|
||||
window.anchors.options.class = 'anchorjs-link-left';
|
||||
}
|
||||
window.anchors.add(res.join(', '));
|
||||
|
||||
Fluid.events.registerRefreshCallback(function() {
|
||||
if ('anchors' in window) {
|
||||
anchors.removeAll();
|
||||
var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
|
||||
var res = [];
|
||||
for (var item of el) {
|
||||
res.push('.markdown-body > ' + item.trim());
|
||||
}
|
||||
if (CONFIG.anchorjs.placement === 'left') {
|
||||
anchors.options.class = 'anchorjs-link-left';
|
||||
}
|
||||
anchors.add(res.join(', '));
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
`)
|
||||
%>
|
||||
7
themes/fluid/layout/_partials/plugins/code-widget.ejs
Normal file
7
themes/fluid/layout/_partials/plugins/code-widget.ejs
Normal file
@ -0,0 +1,7 @@
|
||||
<%
|
||||
if (theme.code.copy_btn) {
|
||||
import_script(`<script src=${url_join(theme.static_prefix.clipboard, 'clipboard.min.js')}></script>`)
|
||||
}
|
||||
import_script(`<script>Fluid.plugins.codeWidget();</script>
|
||||
`)
|
||||
%>
|
||||
18
themes/fluid/layout/_partials/plugins/encrypt.ejs
Normal file
18
themes/fluid/layout/_partials/plugins/encrypt.ejs
Normal file
@ -0,0 +1,18 @@
|
||||
<%
|
||||
import_script(`
|
||||
<script defer>
|
||||
if (document.getElementById('hbePass') || document.querySelector('hbe-prefix')) {
|
||||
Fluid.utils.waitElementLoaded('hbe-prefix', function() {
|
||||
var hbePrefix = document.querySelector('hbe-prefix');
|
||||
hbePrefix.parentElement.classList.add('markdown-body');
|
||||
Fluid.utils.retry(function() {
|
||||
if (Fluid.boot && Fluid.boot.refresh) {
|
||||
Fluid.boot.refresh();
|
||||
return true;
|
||||
}
|
||||
}, 100, 10);
|
||||
})
|
||||
}
|
||||
</script>
|
||||
`)
|
||||
%>
|
||||
11
themes/fluid/layout/_partials/plugins/fancybox.ejs
Normal file
11
themes/fluid/layout/_partials/plugins/fancybox.ejs
Normal file
@ -0,0 +1,11 @@
|
||||
<%
|
||||
import_css(theme.static_prefix.fancybox, 'jquery.fancybox.min.css')
|
||||
|
||||
import_script(`
|
||||
<script>
|
||||
Fluid.utils.createScript('${url_join(theme.static_prefix.fancybox, 'jquery.fancybox.min.js')}', function() {
|
||||
Fluid.plugins.fancyBox();
|
||||
});
|
||||
</script>
|
||||
`)
|
||||
%>
|
||||
13
themes/fluid/layout/_partials/plugins/highlight.ejs
Normal file
13
themes/fluid/layout/_partials/plugins/highlight.ejs
Normal file
@ -0,0 +1,13 @@
|
||||
<%
|
||||
if (theme.code.highlight.lib === 'prismjs') {
|
||||
if (!theme.code.highlight.prismjs.preprocess) {
|
||||
import_js(theme.static_prefix.prismjs, 'components/prism-core.min.js')
|
||||
import_js(theme.static_prefix.prismjs, 'plugins/autoloader/prism-autoloader.min.js')
|
||||
}
|
||||
|
||||
if (theme.code.highlight.line_number) {
|
||||
import_css(theme.static_prefix.prismjs, '/plugins/line-numbers/prism-line-numbers.min.css')
|
||||
import_js(theme.static_prefix.prismjs, '/plugins/line-numbers/prism-line-numbers.min.js')
|
||||
}
|
||||
}
|
||||
%>
|
||||
51
themes/fluid/layout/_partials/plugins/math.ejs
Normal file
51
themes/fluid/layout/_partials/plugins/math.ejs
Normal file
@ -0,0 +1,51 @@
|
||||
<% if(theme.post.math.engine === 'mathjax') { %>
|
||||
<%
|
||||
var lazy = theme.lazyload.enable && require_version(theme.static_prefix.mathjax, '3.2.0')
|
||||
|
||||
import_script(`
|
||||
<script>
|
||||
if (!window.MathJax) {
|
||||
window.MathJax = {
|
||||
tex : {
|
||||
inlineMath: { '[+]': [['$', '$']] }
|
||||
},
|
||||
loader : {
|
||||
${ lazy ? 'load: \[\'ui/lazy\'\]' : '' }
|
||||
},
|
||||
options: {
|
||||
renderActions: {
|
||||
insertedScript: [200, () => {
|
||||
document.querySelectorAll('mjx-container').forEach(node => {
|
||||
let target = node.parentNode;
|
||||
if (target.nodeName.toLowerCase() === 'li') {
|
||||
target.parentNode.classList.add('has-jax');
|
||||
}
|
||||
});
|
||||
}, '', false]
|
||||
}
|
||||
}
|
||||
};
|
||||
} else {
|
||||
MathJax.startup.document.state(0);
|
||||
MathJax.texReset();
|
||||
MathJax.typeset();
|
||||
MathJax.typesetPromise();
|
||||
}
|
||||
|
||||
Fluid.events.registerRefreshCallback(function() {
|
||||
if ('MathJax' in window && MathJax.startup.document && typeof MathJax.startup.document.state === 'function') {
|
||||
MathJax.startup.document.state(0);
|
||||
MathJax.texReset();
|
||||
MathJax.typeset();
|
||||
MathJax.typesetPromise();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
`)
|
||||
|
||||
import_js(theme.static_prefix.mathjax.replace('es5/', ''), 'es5/tex-mml-chtml.js')
|
||||
%>
|
||||
|
||||
<% } else if (theme.post.math.engine === 'katex') { %>
|
||||
<% import_css(theme.static_prefix.katex, 'katex.min.css') %>
|
||||
<% } %>
|
||||
13
themes/fluid/layout/_partials/plugins/mermaid.ejs
Normal file
13
themes/fluid/layout/_partials/plugins/mermaid.ejs
Normal file
@ -0,0 +1,13 @@
|
||||
<script>
|
||||
Fluid.utils.createScript('<%= url_join(theme.static_prefix.mermaid, 'mermaid.min.js') %>', function() {
|
||||
mermaid.initialize(<%- JSON.stringify(theme.post.mermaid.options || {}) %>);
|
||||
|
||||
Fluid.utils.listenDOMLoaded(function() {
|
||||
Fluid.events.registerRefreshCallback(function() {
|
||||
if ('mermaid' in window) {
|
||||
mermaid.init();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
30
themes/fluid/layout/_partials/plugins/moment.ejs
Normal file
30
themes/fluid/layout/_partials/plugins/moment.ejs
Normal file
@ -0,0 +1,30 @@
|
||||
<%
|
||||
var lang = (config.language || 'zh-cn').toLowerCase();
|
||||
|
||||
import_script(`
|
||||
<script>
|
||||
var relativeDate = function() {
|
||||
var updatedTime = document.getElementById('updated-time');
|
||||
if (updatedTime) {
|
||||
var text = updatedTime.textContent;
|
||||
var reg = /\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:Z|[+-]\\d{2}:\\d{2})/;
|
||||
var matchs = text.match(reg);
|
||||
if (matchs) {
|
||||
var relativeTime = moment(matchs[0]).fromNow();
|
||||
updatedTime.textContent = text.replace(reg, relativeTime);
|
||||
}
|
||||
updatedTime.style.display = '';
|
||||
}
|
||||
};
|
||||
Fluid.utils.createScript('${url_join(theme.static_prefix.moment, 'moment.min.js')}', function() {
|
||||
if (!'${lang}'.startsWith('en')) {
|
||||
Fluid.utils.createScript('${url_join(theme.static_prefix.moment, 'locale/' + lang + '.min.js')}', function() {
|
||||
relativeDate();
|
||||
});
|
||||
} else {
|
||||
relativeDate();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
`)
|
||||
%>
|
||||
12
themes/fluid/layout/_partials/plugins/nprogress.ejs
Normal file
12
themes/fluid/layout/_partials/plugins/nprogress.ejs
Normal file
@ -0,0 +1,12 @@
|
||||
<% if (theme.fun_features.progressbar && theme.fun_features.progressbar.enable){ %>
|
||||
<%- js_ex(theme.static_prefix.nprogress, 'nprogress.min.js') %>
|
||||
<%- css_ex(theme.static_prefix.nprogress, 'nprogress.min.css') %>
|
||||
|
||||
<script>
|
||||
NProgress.configure(<%- JSON.stringify(theme.fun_features.progressbar.options || '{}') %>)
|
||||
NProgress.start()
|
||||
window.addEventListener('load', function() {
|
||||
NProgress.done();
|
||||
})
|
||||
</script>
|
||||
<% } %>
|
||||
48
themes/fluid/layout/_partials/plugins/typed.ejs
Normal file
48
themes/fluid/layout/_partials/plugins/typed.ejs
Normal file
@ -0,0 +1,48 @@
|
||||
<% if(theme.fun_features.typing.enable && in_scope(theme.fun_features.typing.scope) && page.subtitle !== false) { %>
|
||||
<%- js_ex(theme.static_prefix.typed, '/typed.min.js') %>
|
||||
<script>
|
||||
(function (window, document) {
|
||||
var typing = Fluid.plugins.typing;
|
||||
var subtitle = document.getElementById('subtitle');
|
||||
if (!subtitle || !typing) {
|
||||
return;
|
||||
}
|
||||
var text = subtitle.getAttribute('data-typed-text');
|
||||
<% if (is_home() && theme.index.slogan.api && theme.index.slogan.api.enable) { %>
|
||||
jQuery.ajax({
|
||||
type: '<%= theme.index.slogan.api.method %>',
|
||||
url: '<%- theme.index.slogan.api.url %>',
|
||||
headers: <%- JSON.stringify(theme.index.slogan.api.headers || {}) %>,
|
||||
dataType: 'json',
|
||||
success: function(result) {
|
||||
var apiText;
|
||||
if (result) {
|
||||
var keys = '<%= theme.index.slogan.api.keys %>'.split(',');
|
||||
if (result instanceof Array) {
|
||||
result = result[0];
|
||||
}
|
||||
for (const k of keys) {
|
||||
var value = result[k];
|
||||
if (typeof value === 'string') {
|
||||
apiText = value;
|
||||
break;
|
||||
} else if (value instanceof Object) {
|
||||
result = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
apiText ? typing(apiText) : typing(text);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
if (error) {
|
||||
console.error('Failed to request <%= theme.index.slogan.api.url %>:', error);
|
||||
}
|
||||
typing(text);
|
||||
}
|
||||
})
|
||||
<% } else { %>
|
||||
typing(text);
|
||||
<% } %>
|
||||
})(window, document);
|
||||
</script>
|
||||
<% } %>
|
||||
18
themes/fluid/layout/_partials/post/category-bar.ejs
Normal file
18
themes/fluid/layout/_partials/post/category-bar.ejs
Normal file
@ -0,0 +1,18 @@
|
||||
<%
|
||||
var parent = page.categories.filter(c => !c.parent)
|
||||
if (Array.isArray(page.category_bar)) {
|
||||
parent = page.categories.filter(cat => page.category_bar.indexOf(cat.name) !== -1)
|
||||
}
|
||||
var filterIds = page.categories.map(c => c._id)
|
||||
filterIds.push(page._id)
|
||||
%>
|
||||
|
||||
<%- partial('_partials/category-list', {
|
||||
curCats : parent,
|
||||
params: {
|
||||
type : 'post',
|
||||
filterIds: filterIds,
|
||||
postLimit: theme.post.category_bar.post_limit,
|
||||
postOrderBy: theme.post.category_bar.post_order_by || config.index_generator.order_by
|
||||
}
|
||||
}) %>
|
||||
64
themes/fluid/layout/_partials/post/copyright.ejs
Normal file
64
themes/fluid/layout/_partials/post/copyright.ejs
Normal file
@ -0,0 +1,64 @@
|
||||
<% if (theme.post.copyright.enable && page.copyright !== false) { %>
|
||||
<%
|
||||
var license = theme.post.copyright.license || ''
|
||||
if (typeof page.copyright === 'string') {
|
||||
license = page.copyright
|
||||
} else if (typeof page.license === 'string') {
|
||||
license = page.license
|
||||
}
|
||||
license = license.toUpperCase()
|
||||
%>
|
||||
|
||||
<div class="license-box my-3">
|
||||
<div class="license-title">
|
||||
<div><%= page.title %></div>
|
||||
<div><%= decode_url(page.permalink) %></div>
|
||||
</div>
|
||||
<div class="license-meta">
|
||||
<% if (theme.post.copyright.author.enable && (page.author || config.author)) { %>
|
||||
<div class="license-meta-item">
|
||||
<div><%- __('post.copyright.author') %></div>
|
||||
<div><%- page.author || config.author %></div>
|
||||
</div>
|
||||
<% } %>
|
||||
<% if (theme.post.copyright.post_date.enable && page.date) { %>
|
||||
<div class="license-meta-item license-meta-date">
|
||||
<div><%- __('post.copyright.posted') %></div>
|
||||
<div><%= full_date(page.date, theme.post.copyright.post_date.format || 'LL') %></div>
|
||||
</div>
|
||||
<% } %>
|
||||
<% if (theme.post.copyright.update_date.enable && page.updated && compare_date(page.date, page.updated)) { %>
|
||||
<div class="license-meta-item license-meta-date">
|
||||
<div><%- __('post.copyright.updated') %></div>
|
||||
<div><%= full_date(page.updated, theme.post.copyright.update_date.format || 'LL') %></div>
|
||||
</div>
|
||||
<% } %>
|
||||
<% if (license) { %>
|
||||
<div class="license-meta-item">
|
||||
<div><%- __('post.copyright.licensed') %></div>
|
||||
<div>
|
||||
<% if (['BY', 'BY-SA', 'BY-ND', 'BY-NC', 'BY-NC-SA', 'BY-NC-ND'].indexOf(license) !== -1) { %>
|
||||
<% var items = license.split('-') %>
|
||||
<% for (var idx = 0; idx < items.length; idx++) { %>
|
||||
<a class="print-no-link" target="_blank" href="https://creativecommons.org/licenses/<%= license.toLowerCase() %>/4.0/">
|
||||
<span class="hint--top hint--rounded" aria-label="<%- __('post.copyright.' + items[idx]) %>">
|
||||
<i class="iconfont icon-cc-<%= items[idx].toLowerCase() %>"></i>
|
||||
</span>
|
||||
</a>
|
||||
<% } %>
|
||||
<% } else if (license === 'ZERO') { %>
|
||||
<a class="print-no-link" target="_blank" href="https://creativecommons.org/publicdomain/zero/1.0/">
|
||||
<span class="hint--top hint--rounded" aria-label="<%- __('post.copyright.ZERO') %>">
|
||||
<i class="iconfont icon-cc-zero"></i>
|
||||
</span>
|
||||
</a>
|
||||
<% } else { %>
|
||||
<%- license %>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
<div class="license-icon iconfont"></div>
|
||||
</div>
|
||||
<% } %>
|
||||
16
themes/fluid/layout/_partials/post/meta-bottom.ejs
Normal file
16
themes/fluid/layout/_partials/post/meta-bottom.ejs
Normal file
@ -0,0 +1,16 @@
|
||||
<div class="post-metas my-3">
|
||||
<% if (page.categories && page.categories.length > 0) { %>
|
||||
<div class="post-meta mr-3 d-flex align-items-center">
|
||||
<i class="iconfont icon-category"></i>
|
||||
<%- partial('_partials/category-chains', { categories: page.categories }) %>
|
||||
</div>
|
||||
<% } %>
|
||||
<% if (page.tags && page.tags.length > 0 ) { %>
|
||||
<div class="post-meta">
|
||||
<i class="iconfont icon-tags"></i>
|
||||
<% page.tags.each(function(tag) { %>
|
||||
<a href="<%= url_for(tag.path) %>" class="print-no-link">#<%- tag.name %></a>
|
||||
<% }) %>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
71
themes/fluid/layout/_partials/post/meta-top.ejs
Normal file
71
themes/fluid/layout/_partials/post/meta-top.ejs
Normal file
@ -0,0 +1,71 @@
|
||||
<% if (page.meta !== false) { %>
|
||||
<div class="mt-3">
|
||||
<% if (theme.post.meta.author && theme.post.meta.author.enable && (page.author || config.author)) { %>
|
||||
<span class="post-meta mr-2">
|
||||
<i class="iconfont icon-author" aria-hidden="true"></i>
|
||||
<%- page.author || config.author %>
|
||||
</span>
|
||||
<% } %>
|
||||
<% if (theme.post.meta.date.enable) { %>
|
||||
<span class="post-meta">
|
||||
<i class="iconfont icon-date-fill" aria-hidden="true"></i>
|
||||
<time datetime="<%= full_date(page.date, 'YYYY-MM-DD HH:mm') %>" pubdate>
|
||||
<%= full_date(page.date, theme.post.meta.date.format) %>
|
||||
</time>
|
||||
</span>
|
||||
<% } %>
|
||||
</div>
|
||||
|
||||
<div class="mt-1">
|
||||
<% if (theme.post.meta.wordcount.enable) { %>
|
||||
<span class="post-meta mr-2">
|
||||
<i class="iconfont icon-chart"></i>
|
||||
<% if (theme.post.meta.wordcount.format) { %>
|
||||
<!-- compatible with older versions-->
|
||||
<%- theme.post.meta.wordcount.format.replace('{}', wordcount(page)) %>
|
||||
<% } else { %>
|
||||
<%- __('post.meta.wordcount', wordcount(page)) %>
|
||||
<% } %>
|
||||
</span>
|
||||
<% } %>
|
||||
|
||||
<% if (theme.post.meta.min2read.enable) { %>
|
||||
<span class="post-meta mr-2">
|
||||
<i class="iconfont icon-clock-fill"></i>
|
||||
<% var awl = parseInt(theme.post.meta.min2read.awl, 10) %>
|
||||
<% var wpm = parseInt(theme.post.meta.min2read.wpm, 10) %>
|
||||
<% if (theme.post.meta.min2read.format) { %>
|
||||
<!-- compatible with older versions-->
|
||||
<%- theme.post.meta.min2read.format.replace('{}', min2read(page, { awl: awl, wpm: wpm })) %>
|
||||
<% } else { %>
|
||||
<%- __('post.meta.min2read', min2read(page, { awl: awl, wpm: wpm })) %>
|
||||
<% } %>
|
||||
</span>
|
||||
<% } %>
|
||||
|
||||
<% var views_texts = (theme.post.meta.views.format || __('post.meta.views')).split('{}') %>
|
||||
<% if (theme.post.meta.views.enable && views_texts.length >= 2) { %>
|
||||
<% if (theme.post.meta.views.source === 'leancloud') { %>
|
||||
<span id="leancloud-page-views-container" class="post-meta" style="display: none">
|
||||
<i class="iconfont icon-eye" aria-hidden="true"></i>
|
||||
<%- views_texts[0] %><span id="leancloud-page-views"></span><%- views_texts[1] %>
|
||||
</span>
|
||||
<% import_js(theme.static_prefix.internal_js, 'leancloud.js', 'defer') %>
|
||||
|
||||
<% } else if (theme.post.meta.views.source === 'busuanzi') { %>
|
||||
<span id="busuanzi_container_page_pv" style="display: none">
|
||||
<i class="iconfont icon-eye" aria-hidden="true"></i>
|
||||
<%- views_texts[0] %><span id="busuanzi_value_page_pv"></span><%- views_texts[1] %>
|
||||
</span>
|
||||
<% import_js(theme.static_prefix.busuanzi, 'busuanzi.pure.mini.js', 'defer') %>
|
||||
|
||||
<% } else if (theme.post.meta.views.source === 'umami') { %>
|
||||
<span id="umami-page-views-container" class="post-meta" style="display: none">
|
||||
<i class="iconfont icon-eye" aria-hidden="true"></i>
|
||||
<%- views_texts[0] %><span id="umami-page-views"></span><%- views_texts[1] %>
|
||||
</span>
|
||||
<% import_js(theme.static_prefix.internal_js, 'umami-view.js', 'defer') %>
|
||||
<% } %>
|
||||
<% } %>
|
||||
</div>
|
||||
<% } %>
|
||||
10
themes/fluid/layout/_partials/post/sidebar-left.ejs
Normal file
10
themes/fluid/layout/_partials/post/sidebar-left.ejs
Normal file
@ -0,0 +1,10 @@
|
||||
<% if(theme.post.toc.enable && theme.post.toc.placement === 'left' && page.toc !== false){ %>
|
||||
<aside class="sidebar" style="padding-left: 2rem; margin-right: -1rem">
|
||||
<%- partial('_partials/post/toc') %>
|
||||
</aside>
|
||||
<% } else if (theme.post.category_bar.enable && theme.post.category_bar.placement !== 'right' && !page.hide &&
|
||||
(!theme.post.category_bar.specific || (theme.post.category_bar.specific && page.category_bar))) { %>
|
||||
<aside class="sidebar category-bar" style="margin-right: -1rem">
|
||||
<%- partial('_partials/post/category-bar') %>
|
||||
</aside>
|
||||
<% } %>
|
||||
10
themes/fluid/layout/_partials/post/sidebar-right.ejs
Normal file
10
themes/fluid/layout/_partials/post/sidebar-right.ejs
Normal file
@ -0,0 +1,10 @@
|
||||
<% if(theme.post.toc.enable && theme.post.toc.placement !== 'left' && page.toc !== false){ %>
|
||||
<aside class="sidebar" style="margin-left: -1rem">
|
||||
<%- partial('_partials/post/toc') %>
|
||||
</aside>
|
||||
<% } else if (theme.post.category_bar.enable && theme.post.category_bar.placement === 'right' && !page.hide &&
|
||||
(!theme.post.category_bar.specific || (theme.post.category_bar.specific && page.category_bar))) { %>
|
||||
<aside class="sidebar category-bar" style="margin-left: -1rem">
|
||||
<%- partial('_partials/post/category-bar') %>
|
||||
</aside>
|
||||
<% } %>
|
||||
49
themes/fluid/layout/_partials/post/toc.ejs
Normal file
49
themes/fluid/layout/_partials/post/toc.ejs
Normal file
@ -0,0 +1,49 @@
|
||||
<div id="toc">
|
||||
<p class="toc-header">
|
||||
<i class="iconfont icon-list"></i>
|
||||
<span><%- __('post.toc') %></span>
|
||||
</p>
|
||||
<div class="toc-body" id="toc-body"></div>
|
||||
</div>
|
||||
|
||||
<%
|
||||
import_script(`
|
||||
<script>
|
||||
Fluid.utils.createScript('${url_join(theme.static_prefix.tocbot, 'tocbot.min.js')}', function() {
|
||||
var toc = jQuery('#toc');
|
||||
if (toc.length === 0 || !window.tocbot) { return; }
|
||||
var boardCtn = jQuery('#board-ctn');
|
||||
var boardTop = boardCtn.offset().top;
|
||||
|
||||
window.tocbot.init(Object.assign({
|
||||
tocSelector : '#toc-body',
|
||||
contentSelector : '.markdown-body',
|
||||
linkClass : 'tocbot-link',
|
||||
activeLinkClass : 'tocbot-active-link',
|
||||
listClass : 'tocbot-list',
|
||||
isCollapsedClass: 'tocbot-is-collapsed',
|
||||
collapsibleClass: 'tocbot-is-collapsible',
|
||||
scrollSmooth : true,
|
||||
includeTitleTags: true,
|
||||
headingsOffset : -boardTop,
|
||||
}, CONFIG.toc));
|
||||
if (toc.find('.toc-list-item').length > 0) {
|
||||
toc.css('visibility', 'visible');
|
||||
}
|
||||
|
||||
Fluid.events.registerRefreshCallback(function() {
|
||||
if ('tocbot' in window) {
|
||||
tocbot.refresh();
|
||||
var toc = jQuery('#toc');
|
||||
if (toc.length === 0 || !tocbot) {
|
||||
return;
|
||||
}
|
||||
if (toc.find('.toc-list-item').length > 0) {
|
||||
toc.css('visibility', 'visible');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
`)
|
||||
%>
|
||||
31
themes/fluid/layout/_partials/scripts.ejs
Normal file
31
themes/fluid/layout/_partials/scripts.ejs
Normal file
@ -0,0 +1,31 @@
|
||||
<%- partial('_partials/plugins/nprogress.ejs') %>
|
||||
<%- js_ex(theme.static_prefix.jquery, 'jquery.min.js') %>
|
||||
<%- js_ex(theme.static_prefix.bootstrap, 'js/bootstrap.min.js') %>
|
||||
<%- js_ex(theme.static_prefix.internal_js, 'events.js') %>
|
||||
<%- js_ex(theme.static_prefix.internal_js, 'plugins.js') %>
|
||||
|
||||
<%- partial('_partials/plugins/typed.ejs') %>
|
||||
|
||||
<% if (theme.lazyload.enable){ %>
|
||||
<% if (theme.lazyload.onlypost) { %>
|
||||
<% if (is_post() || is_page()) { %>
|
||||
<%- js_ex(theme.static_prefix.internal_js, 'img-lazyload.js') %>
|
||||
<% } %>
|
||||
<% } else { %>
|
||||
<%- js_ex(theme.static_prefix.internal_js, 'img-lazyload.js') %>
|
||||
<% } %>
|
||||
<% } %>
|
||||
|
||||
<% var script_snippets = deduplicate(page.script_snippets) %>
|
||||
<% for (var idx = 0; idx < script_snippets.length; idx++) { %>
|
||||
<%- script_snippets[idx] %>
|
||||
<% } %>
|
||||
<% page.script_snippets = [] %>
|
||||
|
||||
<% if (theme.custom_js) { %>
|
||||
<%- js(theme.custom_js) %>
|
||||
<% } %>
|
||||
|
||||
<!-- 主题的启动项,将它保持在最底部 -->
|
||||
<!-- the boot of the theme, keep it at the bottom -->
|
||||
<%- js_ex(theme.static_prefix.internal_js, 'boot.js') %>
|
||||
20
themes/fluid/layout/_partials/search.ejs
Normal file
20
themes/fluid/layout/_partials/search.ejs
Normal file
@ -0,0 +1,20 @@
|
||||
<div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header text-center">
|
||||
<h4 class="modal-title w-100 font-weight-bold"><%= __('search.title') %></h4>
|
||||
<button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body mx-3">
|
||||
<div class="md-form mb-5">
|
||||
<input type="text" id="local-search-input" class="form-control validate">
|
||||
<label data-error="x" data-success="v" for="local-search-input"><%= __('search.keyword') %></label>
|
||||
</div>
|
||||
<div class="list-group" id="local-search-result"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
53
themes/fluid/layout/about.ejs
Normal file
53
themes/fluid/layout/about.ejs
Normal file
@ -0,0 +1,53 @@
|
||||
<%
|
||||
page.layout = "about"
|
||||
page.title = theme.about.title || __('about.title')
|
||||
page.subtitle = theme.about.subtitle || __('about.subtitle')
|
||||
page.banner_img = page.banner_img || theme.about.banner_img
|
||||
page.banner_img_height = page.banner_img_height || theme.about.banner_img_height
|
||||
page.banner_mask_alpha = page.banner_mask_alpha || theme.about.banner_mask_alpha
|
||||
%>
|
||||
|
||||
<div class="text-center">
|
||||
<div class="about-info">
|
||||
<div class="about-name"><%- theme.about.name %></div>
|
||||
<div class="about-intro"><%- theme.about.introduce || theme.about.intro %></div>
|
||||
<div class="about-icons">
|
||||
<% for(const each of theme.about.icons || []) { %>
|
||||
<% if (!each.class) continue; %>
|
||||
<% var cls = each.class %>
|
||||
<% var isQr = each.qrcode %>
|
||||
<a <%= isQr ? '' : ('href=' + url_for(each.link)) %> class="<%= isQr ? 'qr-trigger' : '' %>
|
||||
<%= !isQr && each.tip ? 'hint--bottom hint--rounded' : '' %>"
|
||||
<% if (!isQr && each.tip) { %>aria-label="<%= each.tip %>"<% } %>
|
||||
target="<%= isQr ? '_self' : '_blank' %>"
|
||||
>
|
||||
<i class="<%= cls %>" aria-hidden="true"></i>
|
||||
<% if (isQr) { %>
|
||||
<img class="qr-img" src="<%= url_for(each.qrcode) %>" alt="qrcode" />
|
||||
<% } %>
|
||||
</a>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<article class="about-content page-content mt-5">
|
||||
<div class="markdown-body">
|
||||
<%- page.content %>
|
||||
</div>
|
||||
|
||||
<% if(page.comments) { %>
|
||||
<!-- Comments -->
|
||||
<article id="comments">
|
||||
<% var type %>
|
||||
<% if (typeof page.comment === 'string' && page.comment !== '') { %>
|
||||
<% type = '_partials/comments/' + page.comment %>
|
||||
<% } else { %>
|
||||
<% type = '_partials/comments/' + theme.post.comments.type %>
|
||||
<% } %>
|
||||
<%- partial(type) %>
|
||||
</article>
|
||||
<% } %>
|
||||
</article>
|
||||
|
||||
<%- partial('_partials/markdown-plugins') %>
|
||||
10
themes/fluid/layout/archive.ejs
Normal file
10
themes/fluid/layout/archive.ejs
Normal file
@ -0,0 +1,10 @@
|
||||
<%
|
||||
page.layout = "archive"
|
||||
page.title = theme.archive.title || __('archive.title')
|
||||
page.subtitle = theme.archive.subtitle || __('archive.subtitle')
|
||||
page.banner_img = theme.archive.banner_img
|
||||
page.banner_img_height = theme.archive.banner_img_height
|
||||
page.banner_mask_alpha = theme.archive.banner_mask_alpha
|
||||
%>
|
||||
|
||||
<%- partial('_partials/archive-list.ejs', { params: { key: page.layout, postTotal: site.posts.length } }) %>
|
||||
19
themes/fluid/layout/categories.ejs
Normal file
19
themes/fluid/layout/categories.ejs
Normal file
@ -0,0 +1,19 @@
|
||||
<%
|
||||
page.layout = 'categories'
|
||||
page.title = theme.category.title || __('category.title')
|
||||
page.subtitle = theme.category.subtitle || __('category.subtitle')
|
||||
page.banner_img = theme.category.banner_img
|
||||
page.banner_img_height = theme.category.banner_img_height
|
||||
page.banner_mask_alpha = theme.category.banner_mask_alpha
|
||||
var orderBy = theme.category.order_by || 'name'
|
||||
var curCats = site.categories.find({ parent: { $exists: false } }).sort(orderBy).filter(cat => cat.length)
|
||||
%>
|
||||
|
||||
<%- partial('_partials/category-list', {
|
||||
curCats: curCats,
|
||||
params: {
|
||||
orderBy: orderBy,
|
||||
postLimit : theme.category.post_limit,
|
||||
postOrderBy: theme.category.post_order_by || config.index_generator.order_by
|
||||
}
|
||||
}) %>
|
||||
12
themes/fluid/layout/category.ejs
Normal file
12
themes/fluid/layout/category.ejs
Normal file
@ -0,0 +1,12 @@
|
||||
<%
|
||||
page.layout = "category"
|
||||
page.title = [__('category.title'), page.category].join(" - ")
|
||||
page.subtitle = [__('category.subtitle'), page.category].join(" - ")
|
||||
page.banner_img = theme.category.banner_img
|
||||
page.banner_img_height = theme.category.banner_img_height
|
||||
page.banner_mask_alpha = theme.category.banner_mask_alpha
|
||||
|
||||
var cat = site.categories.find({name: page.category}).filter(cat => cat.length).data[0]
|
||||
%>
|
||||
|
||||
<%- partial('_partials/archive-list.ejs', { params: { key: page.layout, postTotal: cat ? cat.posts.length : 0 } }) %>
|
||||
65
themes/fluid/layout/index.ejs
Normal file
65
themes/fluid/layout/index.ejs
Normal file
@ -0,0 +1,65 @@
|
||||
<%
|
||||
if (theme.index.slogan.enable) {
|
||||
page.subtitle = theme.index.slogan.text || config.subtitle || ''
|
||||
}
|
||||
page.banner_img = theme.index.banner_img
|
||||
page.banner_img_height = theme.index.banner_img_height
|
||||
page.banner_mask_alpha = theme.index.banner_mask_alpha
|
||||
%>
|
||||
|
||||
<% page.posts.each(function (post) { %>
|
||||
<div class="row mx-auto index-card">
|
||||
<% var post_url = url_for(post.path), index_img = post.index_img || theme.post.default_index_img %>
|
||||
<% if (index_img) { %>
|
||||
<div class="col-12 col-md-4 m-auto index-img">
|
||||
<a href="<%= post_url %>" target="<%- theme.index.post_url_target %>">
|
||||
<img src="<%= url_for(index_img) %>" alt="<%= post.title %>">
|
||||
</a>
|
||||
</div>
|
||||
<% } %>
|
||||
<article class="col-12 col-md-<%= index_img ? '8' : '12' %> mx-auto index-info">
|
||||
<h2 class="index-header">
|
||||
<% if (theme.index.post_sticky && theme.index.post_sticky.enable && post.sticky > 0) { %>
|
||||
<i class="index-pin <%= theme.index.post_sticky && theme.index.post_sticky.icon %>" title="Pin on top"></i>
|
||||
<% } %>
|
||||
<a href="<%= post_url %>" target="<%- theme.index.post_url_target %>">
|
||||
<%= post.title %>
|
||||
</a>
|
||||
</h2>
|
||||
|
||||
<% var excerpt = post.description || post.excerpt || (theme.index.auto_excerpt.enable && !post.encrypt && post.content) %>
|
||||
<a class="index-excerpt <%= index_img ? '' : 'index-excerpt__noimg' %>" href="<%= post_url %>" target="<%- theme.index.post_url_target %>">
|
||||
<div>
|
||||
<%- strip_html(excerpt).substring(0, 200).trim().replace(/\n/g, ' ') %>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<div class="index-btm post-metas">
|
||||
<% if (theme.index.post_meta.date) { %>
|
||||
<div class="post-meta mr-3">
|
||||
<i class="iconfont icon-date"></i>
|
||||
<time datetime="<%= full_date(post.date, 'YYYY-MM-DD HH:mm') %>" pubdate>
|
||||
<%- date(post.date, config.date_format) %>
|
||||
</time>
|
||||
</div>
|
||||
<% } %>
|
||||
<% if (theme.index.post_meta.category && post.categories.length > 0) { %>
|
||||
<div class="post-meta mr-3 d-flex align-items-center">
|
||||
<i class="iconfont icon-category"></i>
|
||||
<%- partial('_partials/category-chains', { categories: post.categories, limit: 1 }) %>
|
||||
</div>
|
||||
<% } %>
|
||||
<% if (theme.index.post_meta.tag && post.tags.length > 0) { %>
|
||||
<div class="post-meta">
|
||||
<i class="iconfont icon-tags"></i>
|
||||
<% post.tags.each(function(tag){ %>
|
||||
<a href="<%= url_for(tag.path) %>">#<%- tag.name %></a>
|
||||
<% }) %>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
<% }) %>
|
||||
|
||||
<%- partial('_partials/paginator') %>
|
||||
73
themes/fluid/layout/layout.ejs
Normal file
73
themes/fluid/layout/layout.ejs
Normal file
@ -0,0 +1,73 @@
|
||||
<%
|
||||
var banner_img_height = parseFloat(page.banner_img_height || theme.index.banner_img_height)
|
||||
var colorSchema = theme.dark_mode && theme.dark_mode.enable && theme.dark_mode.default ? theme.dark_mode.default : ''
|
||||
%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="<%= config.language %>" <%= colorSchema ? `data-default-color-scheme=${colorSchema}` : '' %>>
|
||||
|
||||
<%- partial('_partials/head.ejs') %>
|
||||
|
||||
<body>
|
||||
<%- inject_point('bodyBegin') %>
|
||||
|
||||
<header>
|
||||
<%- inject_point('header') %>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<% if(is_post() || page.layout === '404') { %>
|
||||
<%- body %>
|
||||
<% } else { %>
|
||||
<div class="container nopadding-x-md">
|
||||
<div id="board"
|
||||
<%- banner_img_height >= 100 && theme.banner && theme.banner.parallax ? 'style="margin-top: 0"' : '' %>>
|
||||
<% if(page.layout === 'about') { %>
|
||||
<div class="about-avatar">
|
||||
<img src="<%= url_for(theme.about.avatar) %>" class="img-fluid" alt="avatar">
|
||||
</div>
|
||||
<% } %>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-10 m-auto">
|
||||
<%- body %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
<% if (theme.scroll_top_arrow.enable) { %>
|
||||
<a id="scroll-top-button" aria-label="TOP" href="#" role="button">
|
||||
<i class="iconfont icon-arrowup" aria-hidden="true"></i>
|
||||
</a>
|
||||
<% } %>
|
||||
|
||||
<% if (theme.search.enable) { %>
|
||||
<%- partial('_partials/search.ejs') %>
|
||||
<% } %>
|
||||
|
||||
<% if (theme.custom_html) { %>
|
||||
<div class="col-lg-7 mx-auto nopadding-x-md">
|
||||
<div class="container custom mx-auto">
|
||||
<%- theme.custom_html %>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
<%- inject_point('footer') %>
|
||||
</footer>
|
||||
|
||||
<!-- Scripts -->
|
||||
<%- partial('_partials/scripts.ejs') %>
|
||||
|
||||
<%- inject_point('bodyEnd') %>
|
||||
|
||||
<noscript>
|
||||
<div class="noscript-warning"><%- __('noscript_warning') %></div>
|
||||
</noscript>
|
||||
</body>
|
||||
</html>
|
||||
40
themes/fluid/layout/links.ejs
Normal file
40
themes/fluid/layout/links.ejs
Normal file
@ -0,0 +1,40 @@
|
||||
<%
|
||||
page.layout = "links"
|
||||
page.title = theme.links.title || __('links.title')
|
||||
page.subtitle = theme.links.subtitle || __('links.subtitle')
|
||||
page.banner_img = theme.links.banner_img
|
||||
page.banner_img_height = theme.links.banner_img_height
|
||||
page.banner_mask_alpha = theme.links.banner_mask_alpha
|
||||
page.comment = theme.links.comments.type
|
||||
%>
|
||||
|
||||
<div class="row links">
|
||||
<% for(const each of theme.links.items || []) { %>
|
||||
<% if (!each.title || !each.link) continue %>
|
||||
<div class="card col-lg-4 col-md-6 col-sm-12">
|
||||
<a href="<%= url_for(each.link) %>" class="card-body hover-with-bg" target="_blank" rel="noopener">
|
||||
<div class="card-content">
|
||||
<% if (each.avatar || each.image) { %>
|
||||
<div class="link-avatar my-auto">
|
||||
<img src="<%= url_for(each.avatar || each.image) %>" alt="<%= each.title %>"
|
||||
onerror="this.onerror=null; this.src=this.srcset='<%= url_for(theme.links.onerror_avatar) %>'"/>
|
||||
</div>
|
||||
<% } %>
|
||||
<div class="link-text">
|
||||
<div class="link-title"><%- each.title %></div>
|
||||
<div class="link-intro"><%- each.intro || '' %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
|
||||
<% if(theme.links.custom && theme.links.custom.enable && theme.links.custom.content) { %>
|
||||
<!-- Custom -->
|
||||
<div class="custom mx-auto">
|
||||
<%- theme.links.custom.content %>
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
<%- inject_point('linksComments') %>
|
||||
18
themes/fluid/layout/page.ejs
Normal file
18
themes/fluid/layout/page.ejs
Normal file
@ -0,0 +1,18 @@
|
||||
<%
|
||||
var layout = page.layout
|
||||
page.title = page.title || __(`${ layout }.title`)
|
||||
page.subtitle = page.subtitle || page.title || __(`${ layout }.subtitle`)
|
||||
page.banner_img = page.banner_img || theme.page.banner_img
|
||||
page.banner_img_height = page.banner_img_height || theme.page.banner_img_height
|
||||
page.banner_mask_alpha = page.banner_mask_alpha || theme.page.banner_mask_alpha
|
||||
%>
|
||||
|
||||
<article class="page-content">
|
||||
<%- page.content %>
|
||||
|
||||
<%- inject_point('pageComments') %>
|
||||
</article>
|
||||
|
||||
<% if (/<[^>]+? class="[^"]*?markdown-body[^"]*?"/gims.test(page.content)) { %>
|
||||
<%- partial('_partials/markdown-plugins') %>
|
||||
<% } %>
|
||||
103
themes/fluid/layout/post.ejs
Normal file
103
themes/fluid/layout/post.ejs
Normal file
@ -0,0 +1,103 @@
|
||||
<%
|
||||
page.banner_img = page.banner_img || theme.post.banner_img
|
||||
page.banner_img_height = page.banner_img_height || theme.post.banner_img_height
|
||||
page.banner_mask_alpha = page.banner_mask_alpha || theme.post.banner_mask_alpha
|
||||
%>
|
||||
|
||||
<div class="container-fluid nopadding-x">
|
||||
<div class="row nomargin-x">
|
||||
<div class="side-col d-none d-lg-block col-lg-2">
|
||||
<%- inject_point('postLeft') %>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-8 nopadding-x-md">
|
||||
<div class="container nopadding-x-md" id="board-ctn">
|
||||
<div id="board">
|
||||
<article class="post-content mx-auto">
|
||||
<h1 id="seo-header"><%= page.subtitle || page.title %></h1>
|
||||
<% if (theme.post.updated.enable && theme.post.updated && compare_date(page.date, page.updated)) { %>
|
||||
<p id="updated-time" class="note note-<%= theme.post.updated.note_class || 'info' %>" style="<%= theme.post.updated.relative ? 'display: none' : '' %>">
|
||||
<% if (theme.post.updated.relative) { %>
|
||||
<% if (theme.post.updated.content) { %>
|
||||
<!-- compatible with older versions-->
|
||||
<%- theme.post.updated.content %><%- date(page.updated, 'YYYY-MM-DDTHH:mm:ssZ') %>
|
||||
<% } else { %>
|
||||
<%- __('post.updated', date(page.updated, 'YYYY-MM-DDTHH:mm:ssZ')) %>
|
||||
<% } %>
|
||||
<%- partial('_partials/plugins/moment.ejs') %>
|
||||
<% } else { %>
|
||||
<% if (theme.post.updated.content) { %>
|
||||
<!-- compatible with older versions-->
|
||||
<%- theme.post.updated.content %><%- date(page.updated, theme.post.updated.date_format) %>
|
||||
<% } else { %>
|
||||
<%- __('post.updated', date(page.updated, theme.post.updated.date_format)) %>
|
||||
<% } %>
|
||||
<% } %>
|
||||
</p>
|
||||
<% } %>
|
||||
<% if (page.encrypt === true) { %>
|
||||
<%- inject_point('postMarkdownBegin') %>
|
||||
<%- page.content %>
|
||||
<%- partial('_partials/plugins/encrypt') %>
|
||||
<%- inject_point('postMarkdownEnd') %>
|
||||
<% } else { %>
|
||||
<div class="markdown-body">
|
||||
<%- inject_point('postMarkdownBegin') %>
|
||||
<%- page.content %>
|
||||
<%- inject_point('postMarkdownEnd') %>
|
||||
</div>
|
||||
<% } %>
|
||||
<hr/>
|
||||
<div>
|
||||
<%- inject_point('postMetaBottom') %>
|
||||
|
||||
<%- inject_point('postCopyright') %>
|
||||
|
||||
<% if (theme.post.prev_next.enable && !page.hide) { %>
|
||||
<div class="post-prevnext my-3">
|
||||
<article class="post-prev col-6">
|
||||
<% const prev = prev_post(page) %>
|
||||
<% if (prev) { %>
|
||||
<a href="<%= url_for(prev.path) %>" title="<%= prev.title %>">
|
||||
<i class="iconfont icon-arrowleft"></i>
|
||||
<span class="hidden-mobile"><%= prev.title %></span>
|
||||
<span class="visible-mobile"><%- __('post.prev_post') %></span>
|
||||
</a>
|
||||
<% } %>
|
||||
</article>
|
||||
<article class="post-next col-6">
|
||||
<% const next = next_post(page) %>
|
||||
<% if (next) { %>
|
||||
<a href="<%= url_for(next.path) %>" title="<%= next.title %>">
|
||||
<span class="hidden-mobile"><%= next.title %></span>
|
||||
<span class="visible-mobile"><%- __('post.next_post') %></span>
|
||||
<i class="iconfont icon-arrowright"></i>
|
||||
</a>
|
||||
<% } %>
|
||||
</article>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
|
||||
<%- inject_point('postComments') %>
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="side-col d-none d-lg-block col-lg-2">
|
||||
<%- inject_point('postRight') %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%- partial('_partials/markdown-plugins') %>
|
||||
|
||||
<% if(theme.post.custom && theme.post.custom.enable && theme.post.custom.content && page.custom !== false) { %>
|
||||
<!-- Custom -->
|
||||
<div class="col-lg-7 mx-auto nopadding-x-md">
|
||||
<div class="container custom post-custom mx-auto">
|
||||
<%- page.custom || theme.post.custom.content %>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
12
themes/fluid/layout/tag.ejs
Normal file
12
themes/fluid/layout/tag.ejs
Normal file
@ -0,0 +1,12 @@
|
||||
<%
|
||||
page.layout = "tag"
|
||||
page.title = [__('tag.title'), page.tag].join(" - ")
|
||||
page.subtitle = [__('tag.subtitle'), page.tag].join(" - ")
|
||||
page.banner_img = theme.tag.banner_img
|
||||
page.banner_img_height = theme.tag.banner_img_height
|
||||
page.banner_mask_alpha = theme.tag.banner_mask_alpha
|
||||
|
||||
var tag = site.tags.find({name: page.tag}).filter(tag => tag.length).data[0]
|
||||
%>
|
||||
|
||||
<%- partial('_partials/archive-list.ejs', { params: { key: page.layout, postTotal: tag ? tag.posts.length : 0 } }) %>
|
||||
26
themes/fluid/layout/tags.ejs
Normal file
26
themes/fluid/layout/tags.ejs
Normal file
@ -0,0 +1,26 @@
|
||||
<%
|
||||
page.layout = "tags"
|
||||
page.title = theme.tag.title || __('tag.title')
|
||||
page.subtitle = theme.tag.subtitle || __('tag.subtitle')
|
||||
page.banner_img = theme.tag.banner_img
|
||||
page.banner_img_height = theme.tag.banner_img_height
|
||||
page.banner_mask_alpha = theme.tag.banner_mask_alpha
|
||||
|
||||
var min_font = theme.tag.tagcloud.min_font || 15
|
||||
var max_font = theme.tag.tagcloud.max_font || 30
|
||||
var unit = theme.tag.tagcloud.unit || 'px'
|
||||
var start_color = theme.tag.tagcloud.start_color || '#BBBBEE'
|
||||
var end_color = theme.tag.tagcloud.end_color || '#337ab7'
|
||||
%>
|
||||
|
||||
<div class="text-center tagcloud">
|
||||
<%- tagcloud({
|
||||
min_font: min_font,
|
||||
max_font: max_font,
|
||||
amount: 999,
|
||||
unit: unit,
|
||||
color: true,
|
||||
start_color,
|
||||
end_color
|
||||
}) %>
|
||||
</div>
|
||||
35
themes/fluid/package.json
Normal file
35
themes/fluid/package.json
Normal file
@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "hexo-theme-fluid",
|
||||
"version": "1.9.8",
|
||||
"description": "An elegant Material-Design theme for Hexo.",
|
||||
"main": "package.json",
|
||||
"files": [
|
||||
"languages",
|
||||
"layout",
|
||||
"scripts",
|
||||
"source",
|
||||
"_config.yml"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/fluid-dev/hexo-theme-fluid.git"
|
||||
},
|
||||
"keywords": [
|
||||
"hexo",
|
||||
"theme",
|
||||
"fluid",
|
||||
"material"
|
||||
],
|
||||
"author": "Fluid-dev (https://github.com/fluid-dev)",
|
||||
"license": "GPL-V3",
|
||||
"bugs": {
|
||||
"url": "https://github.com/fluid-dev/hexo-theme-fluid/issues"
|
||||
},
|
||||
"homepage": "https://hexo.fluid-dev.com/docs",
|
||||
"engines": {
|
||||
"node": ">=8.10.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"nunjucks": "^3.0.0"
|
||||
}
|
||||
}
|
||||
16
themes/fluid/scripts/events/index.js
Normal file
16
themes/fluid/scripts/events/index.js
Normal file
@ -0,0 +1,16 @@
|
||||
/* global hexo */
|
||||
|
||||
'use strict';
|
||||
|
||||
hexo.on('generateBefore', () => {
|
||||
require('./lib/merge-configs')(hexo);
|
||||
require('./lib/compatible-configs')(hexo);
|
||||
require('./lib/injects')(hexo);
|
||||
require('./lib/highlight')(hexo);
|
||||
require('./lib/lazyload')(hexo);
|
||||
require('./lib/footnote')(hexo);
|
||||
});
|
||||
|
||||
hexo.on('generateAfter', () => {
|
||||
require('./lib/hello')(hexo);
|
||||
});
|
||||
71
themes/fluid/scripts/events/lib/compatible-configs.js
Normal file
71
themes/fluid/scripts/events/lib/compatible-configs.js
Normal file
@ -0,0 +1,71 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = (hexo) => {
|
||||
const isZh = hexo.theme.i18n.languages[0].search(/zh-CN/i) !== -1;
|
||||
|
||||
// Breaking change at v1.8.3 2020/09/03
|
||||
if (hexo.theme.config.highlight && !hexo.theme.config.code) {
|
||||
if (isZh) {
|
||||
hexo.log.warn('[Fluid] 检测到弃用的配置项: "highlight" 已被修改为 "code:highlight",请根据新版本更新');
|
||||
} else {
|
||||
hexo.log.warn('[Fluid] Deprecated config detected: "highlight" has been modified to "code:highlight", please update according to the release.');
|
||||
}
|
||||
hexo.theme.config.code = {
|
||||
copy_btn : hexo.theme.config.highlight.copy_btn,
|
||||
highlight: {
|
||||
enable : hexo.theme.config.highlight.enable,
|
||||
lib : 'highlightjs',
|
||||
highlightjs: {
|
||||
style: hexo.theme.config.highlight.style
|
||||
},
|
||||
prismjs: {
|
||||
style : 'default',
|
||||
preprocess: true
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Some configs that require hexo >= 5.0
|
||||
if (parseInt(hexo.version[0], 10) < 5) {
|
||||
if (isZh) {
|
||||
hexo.log.warn('[Fluid] 检测到 Hexo 版本低于 5.0.0,部分功能可能会受影响');
|
||||
} else {
|
||||
hexo.log.warn('[Fluid] Hexo version < 5.0.0 detected, some features may not be available.');
|
||||
}
|
||||
if (hexo.theme.config.code.highlight.lib === 'prismjs' && hexo.theme.config.code.highlight.prismjs.preprocess) {
|
||||
hexo.theme.config.code.highlight.prismjs.preprocess = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Breaking change at v1.8.7 2020/12/02
|
||||
if (hexo.theme.config.index.post_default_img) {
|
||||
if (isZh) {
|
||||
hexo.log.warn('[Fluid] 检测到弃用的配置项: "index:post_default_img" 已被修改为 "post:default_index_img",请根据新版本更新');
|
||||
} else {
|
||||
hexo.log.warn('[Fluid] Deprecated config detected: "index:post_default_img" has been modified to "post:default_index_img", please update according to the release.');
|
||||
}
|
||||
hexo.theme.config.post.default_index_img = hexo.theme.config.index.post_default_img;
|
||||
}
|
||||
|
||||
// Breaking change at v1.8.7 2020/12/10
|
||||
if (hexo.theme.config.banner_parallax) {
|
||||
if (isZh) {
|
||||
hexo.log.warn('[Fluid] 检测到弃用的配置项: "banner_parallax" 已被修改为 "banner:parallax",请根据新版本更新');
|
||||
} else {
|
||||
hexo.log.warn('[Fluid] Deprecated config detected: "banner_parallax" has been modified to "banner:parallax", please update according to the release.');
|
||||
}
|
||||
if (!hexo.theme.config.banner) {
|
||||
hexo.theme.config.banner = {};
|
||||
}
|
||||
hexo.theme.config.banner.parallax = hexo.theme.config.banner_parallax;
|
||||
}
|
||||
|
||||
// Breaking change at v1.8.11 2021/05/14
|
||||
if (hexo.theme.config.valine.appid) {
|
||||
hexo.theme.config.valine.appId = hexo.theme.config.valine.appid;
|
||||
}
|
||||
if (hexo.theme.config.valine.appkey) {
|
||||
hexo.theme.config.valine.appKey = hexo.theme.config.valine.appkey;
|
||||
}
|
||||
};
|
||||
117
themes/fluid/scripts/events/lib/footnote.js
Normal file
117
themes/fluid/scripts/events/lib/footnote.js
Normal file
@ -0,0 +1,117 @@
|
||||
'use strict';
|
||||
|
||||
const { stripHTML } = require('hexo-util');
|
||||
|
||||
// Register footnotes filter
|
||||
module.exports = (hexo) => {
|
||||
const config = hexo.theme.config;
|
||||
if (config.post.footnote.enable) {
|
||||
hexo.extend.filter.register('before_post_render', (page) => {
|
||||
if (page.footnote !== false) {
|
||||
page.content = renderFootnotes(page.content, page.footnote);
|
||||
}
|
||||
return page;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Modified from https://github.com/kchen0x/hexo-reference
|
||||
*
|
||||
* Render markdown footnotes
|
||||
* @param {String} text
|
||||
* @param {String} header
|
||||
* @returns {String} text
|
||||
*/
|
||||
function renderFootnotes(text, header) {
|
||||
const reFootnoteContent = /\[\^(\d+)]: ?([\S\s]+?)(?=\[\^(?:\d+)]|\n\n|$)/g;
|
||||
const reInlineFootnote = /\[\^(\d+)]\((.+?)\)/g;
|
||||
const reFootnoteIndex = /\[\^(\d+)]/g;
|
||||
const reCodeBlock = /<pre>[\s\S]*?<\/pre>/g;
|
||||
|
||||
let footnotes = [];
|
||||
let html = '';
|
||||
let codeBlocks = [];
|
||||
|
||||
// extract code block
|
||||
text = text.replace(reCodeBlock, function(match) {
|
||||
codeBlocks.push(match);
|
||||
return 'CODE_BLOCK_PLACEHOLDER';
|
||||
});
|
||||
|
||||
// threat all inline footnotes
|
||||
text = text.replace(reInlineFootnote, function(match, index, content) {
|
||||
footnotes.push({
|
||||
index : index,
|
||||
content: content ? content.trim() : ''
|
||||
});
|
||||
// remove content of inline footnote
|
||||
return '[^' + index + ']';
|
||||
});
|
||||
|
||||
// threat all footnote contents
|
||||
text = text.replace(reFootnoteContent, function(match, index, content) {
|
||||
footnotes.push({
|
||||
index : index,
|
||||
content: content ? content.trim() : ''
|
||||
});
|
||||
// remove footnote content
|
||||
return '';
|
||||
});
|
||||
|
||||
// create map for looking footnotes array
|
||||
function createLookMap(field) {
|
||||
let map = {};
|
||||
for (let i = 0; i < footnotes.length; i++) {
|
||||
const item = footnotes[i];
|
||||
const key = item[field];
|
||||
map[key] = item;
|
||||
}
|
||||
return map;
|
||||
}
|
||||
const indexMap = createLookMap('index');
|
||||
|
||||
// render (HTML) footnotes reference
|
||||
text = text.replace(reFootnoteIndex,
|
||||
function(match, index) {
|
||||
if (!indexMap[index]) {
|
||||
return match;
|
||||
}
|
||||
const tooltip = indexMap[index].content;
|
||||
return '<sup id="fnref:' + index + '" class="footnote-ref">'
|
||||
+ '<a href="#fn:' + index + '" rel="footnote">'
|
||||
+ '<span class="hint--top hint--rounded" aria-label="'
|
||||
+ stripHTML(tooltip)
|
||||
+ '">[' + index + ']</span></a></sup>';
|
||||
});
|
||||
|
||||
// sort footnotes by their index
|
||||
footnotes.sort(function(a, b) {
|
||||
return a.index - b.index;
|
||||
});
|
||||
|
||||
// render footnotes (HTML)
|
||||
footnotes.forEach(function(item) {
|
||||
html += '<li><span id="fn:' + item.index + '" class="footnote-text">';
|
||||
html += '<span>';
|
||||
const fn = hexo.render.renderSync({ text: item.content, engine: 'markdown' });
|
||||
html += fn.replace(/(<p>)|(<\/p>)/g, '').replace(/<br>/g, '');
|
||||
html += '<a href="#fnref:' + item.index + '" rev="footnote" class="footnote-backref"> ↩</a></span></span></li>';
|
||||
});
|
||||
|
||||
// add footnotes at the end of the content
|
||||
if (footnotes.length) {
|
||||
text += '<section class="footnotes">';
|
||||
text += header || config.post.footnote.header || '';
|
||||
text += '<div class="footnote-list">';
|
||||
text += '<ol>' + html + '</ol>';
|
||||
text += '</div></section>';
|
||||
}
|
||||
|
||||
// restore code block
|
||||
text = text.replace(/CODE_BLOCK_PLACEHOLDER/g, function() {
|
||||
return codeBlocks.shift();
|
||||
});
|
||||
|
||||
return text;
|
||||
}
|
||||
};
|
||||
43
themes/fluid/scripts/events/lib/hello.js
Normal file
43
themes/fluid/scripts/events/lib/hello.js
Normal file
@ -0,0 +1,43 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = (hexo) => {
|
||||
if (hexo.theme.has_hello) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (hexo.theme.i18n.languages[0].search(/zh-CN/i) !== -1) {
|
||||
hexo.log.info(`
|
||||
------------------------------------------------
|
||||
| |
|
||||
| ________ __ _ __ |
|
||||
| |_ __ |[ | (_) | ] |
|
||||
| | |_ \\_| | | __ _ __ .--.| | |
|
||||
| | _| | |[ | | | [ |/ /'\`\\' | |
|
||||
| _| |_ | | | \\_/ |, | || \\__/ | |
|
||||
| |_____| [___]'.__.'_/[___]'.__.;__] |
|
||||
| |
|
||||
| 感谢使用 Fluid 主题 |
|
||||
| 文档: https://hexo.fluid-dev.com/docs/ |
|
||||
| |
|
||||
------------------------------------------------
|
||||
`);
|
||||
} else {
|
||||
hexo.log.info(`
|
||||
------------------------------------------------
|
||||
| |
|
||||
| ________ __ _ __ |
|
||||
| |_ __ |[ | (_) | ] |
|
||||
| | |_ \\_| | | __ _ __ .--.| | |
|
||||
| | _| | |[ | | | [ |/ /'\`\\' | |
|
||||
| _| |_ | | | \\_/ |, | || \\__/ | |
|
||||
| |_____| [___]'.__.'_/[___]'.__.;__] |
|
||||
| |
|
||||
| Thank you for using Fluid theme |
|
||||
| Docs: https://hexo.fluid-dev.com/docs/en/ |
|
||||
| |
|
||||
------------------------------------------------
|
||||
`);
|
||||
}
|
||||
|
||||
hexo.theme.has_hello = true;
|
||||
};
|
||||
156
themes/fluid/scripts/events/lib/highlight.js
Normal file
156
themes/fluid/scripts/events/lib/highlight.js
Normal file
@ -0,0 +1,156 @@
|
||||
'use strict';
|
||||
|
||||
let css;
|
||||
try {
|
||||
css = require('css');
|
||||
} catch (error) {
|
||||
if (error.code === 'MODULE_NOT_FOUND') {
|
||||
css = require('@adobe/css-tools');
|
||||
} else {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
const fs = require('fs');
|
||||
const objUtil = require('../../utils/object');
|
||||
const resolveModule = require('../../utils/resolve');
|
||||
|
||||
module.exports = (hexo) => {
|
||||
|
||||
function resolveHighlight(name) {
|
||||
if (!name) {
|
||||
name = 'github-gist';
|
||||
}
|
||||
const cssName = name.toLowerCase().replace(/([^0-9])\s+?([^0-9])/g, '$1-$2').replace(/\s/g, '');
|
||||
let file = resolveModule('highlight.js', `styles/${cssName}.css`);
|
||||
if (cssName === 'github-gist' && !fs.existsSync(file)) {
|
||||
file = resolveModule('highlight.js', 'styles/github.css');
|
||||
}
|
||||
let backgroundColor;
|
||||
if (fs.existsSync(file)) {
|
||||
const content = fs.readFileSync(file, 'utf8');
|
||||
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') {
|
||||
backgroundColor = declaration.value;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
hexo.log.error(`[Fluid] highlightjs style '${name}' not found`);
|
||||
return {};
|
||||
}
|
||||
if (backgroundColor === 'white' || backgroundColor === '#ffffff') {
|
||||
backgroundColor = '#fff';
|
||||
}
|
||||
return { file, backgroundColor };
|
||||
}
|
||||
|
||||
function resolvePrism(name) {
|
||||
if (!name) {
|
||||
name = 'default';
|
||||
}
|
||||
let cssName = name.toLowerCase().replace(/[\s-]/g, '');
|
||||
if (cssName === 'prism' || cssName === 'default') {
|
||||
cssName = '';
|
||||
} else if (cssName === 'tomorrownight') {
|
||||
cssName = 'tomorrow';
|
||||
}
|
||||
let file = resolveModule('prismjs', `themes/${cssName ? 'prism-' + cssName : 'prism'}.css`);
|
||||
if (!fs.existsSync(file)) {
|
||||
file = resolveModule('prism-themes', `themes/${cssName}.css`);
|
||||
}
|
||||
if (!fs.existsSync(file)) {
|
||||
hexo.log.error(`[Fluid] prismjs style '${name}' not found`);
|
||||
return {};
|
||||
}
|
||||
return { file };
|
||||
}
|
||||
|
||||
const config = hexo.theme.config;
|
||||
if (!config.code || !config.code.highlight.enable) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (config.code.highlight.lib === 'highlightjs') {
|
||||
// Force set hexo config
|
||||
hexo.config.prismjs = objUtil.merge({}, hexo.config.prismjs, {
|
||||
enable: false
|
||||
});
|
||||
hexo.config.highlight = objUtil.merge({}, hexo.config.highlight, {
|
||||
enable : true,
|
||||
hljs : true,
|
||||
wrap : false,
|
||||
auto_detect: true,
|
||||
line_number: config.code.highlight.line_number || false
|
||||
});
|
||||
hexo.config.syntax_highlighter = 'highlight.js'; // hexo v7.0.0+ config
|
||||
hexo.theme.config.code.highlight.highlightjs = objUtil.merge({}, hexo.theme.config.code.highlight.highlightjs, {
|
||||
light: resolveHighlight(hexo.theme.config.code.highlight.highlightjs.style),
|
||||
dark : hexo.theme.config.dark_mode.enable && resolveHighlight(hexo.theme.config.code.highlight.highlightjs.style_dark)
|
||||
});
|
||||
|
||||
hexo.extend.filter.register('after_post_render', (page) => {
|
||||
if (hexo.config.highlight.line_number) {
|
||||
page.content = page.content.replace(/<figure[^>]+?highlight.+?<td[^>]+?code[^>]+?>.*?(<pre.+?<\/pre>).+?<\/figure>/gims, (str, p1) => {
|
||||
if (/<code[^>]+?mermaid[^>]+?>/ims.test(p1)) {
|
||||
return p1.replace(/(class="[^>]*?)hljs([^>]*?")/gims, '$1$2').replace(/<br>/gims, '\n');
|
||||
}
|
||||
return str;
|
||||
});
|
||||
} else {
|
||||
page.content = page.content.replace(/(?<!<div class="code-wrapper">)<pre.+?<\/pre>/gims, (str) => {
|
||||
if (/<code[^>]+?mermaid[^>]+?>/ims.test(str)) {
|
||||
return str.replace(/(class=".*?)hljs(.*?")/gims, '$1$2');
|
||||
}
|
||||
return `<div class="code-wrapper">${str}</div>`;
|
||||
});
|
||||
}
|
||||
|
||||
// 适配缩进型代码块
|
||||
page.content = page.content.replace(/<pre><code>/gims, (str) => {
|
||||
return '<pre><code class="hljs">';
|
||||
});
|
||||
|
||||
return page;
|
||||
});
|
||||
} else if (config.code.highlight.lib === 'prismjs') {
|
||||
// Force set hexo config
|
||||
hexo.config.highlight = objUtil.merge({}, hexo.config.highlight, {
|
||||
enable: false
|
||||
});
|
||||
hexo.config.prismjs = objUtil.merge({}, hexo.config.prismjs, {
|
||||
enable : true,
|
||||
preprocess : config.code.highlight.prismjs.preprocess || false,
|
||||
line_number: config.code.highlight.line_number || false
|
||||
});
|
||||
hexo.config.syntax_highlighter = 'prismjs'; // hexo v7.0.0+ config
|
||||
hexo.theme.config.code.highlight.prismjs = objUtil.merge({}, hexo.theme.config.code.highlight.prismjs, {
|
||||
light: resolvePrism(hexo.theme.config.code.highlight.prismjs.style),
|
||||
dark : hexo.theme.config.dark_mode.enable && resolvePrism(hexo.theme.config.code.highlight.prismjs.style_dark)
|
||||
});
|
||||
|
||||
hexo.extend.filter.register('after_post_render', (page) => {
|
||||
page.content = page.content.replace(/(?<!<div class="code-wrapper">)<pre.+?<\/pre>/gims, (str) => {
|
||||
if (/<code[^>]+?mermaid[^>]+?>/ims.test(str)) {
|
||||
if (hexo.config.highlight.line_number) {
|
||||
str = str.replace(/<span[^>]+?line-numbers-rows[^>]+?>.+?<\/span><\/code>/, '</code>');
|
||||
}
|
||||
str = str.replace(/<pre[^>]*?>/gims, '<pre>')
|
||||
.replace(/(class=".*?)language-mermaid(.*?")/gims, '$1mermaid$2')
|
||||
.replace(/<span[^>]+?>(.+?)<\/span>/gims, '$1');
|
||||
return str;
|
||||
}
|
||||
return `<figure><div class="code-wrapper">${str}</div></figure>`;
|
||||
});
|
||||
|
||||
// 适配缩进型代码块
|
||||
page.content = page.content.replace(/<pre><code>/gims, (str) => {
|
||||
return '<pre class="language-none"><code class="language-none">';
|
||||
});
|
||||
|
||||
return page;
|
||||
});
|
||||
}
|
||||
};
|
||||
118
themes/fluid/scripts/events/lib/injects.js
Normal file
118
themes/fluid/scripts/events/lib/injects.js
Normal file
@ -0,0 +1,118 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Modified from https://github.com/next-theme/hexo-theme-next/blob/master/scripts/events/lib/injects.js
|
||||
*/
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const defaultExtname = '.ejs';
|
||||
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
const points = {
|
||||
views: [
|
||||
'head',
|
||||
'header',
|
||||
'bodyBegin',
|
||||
'bodyEnd',
|
||||
'footer',
|
||||
'postMetaTop',
|
||||
'postMetaBottom',
|
||||
'postMarkdownBegin',
|
||||
'postMarkdownEnd',
|
||||
'postLeft',
|
||||
'postRight',
|
||||
'postCopyright',
|
||||
'postComments',
|
||||
'pageComments',
|
||||
'linksComments'
|
||||
],
|
||||
styles: [
|
||||
'variable',
|
||||
'mixin',
|
||||
'style'
|
||||
]
|
||||
};
|
||||
|
||||
// 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);
|
||||
});
|
||||
};
|
||||
50
themes/fluid/scripts/events/lib/lazyload.js
Normal file
50
themes/fluid/scripts/events/lib/lazyload.js
Normal file
@ -0,0 +1,50 @@
|
||||
'use strict';
|
||||
|
||||
const urlJoin = require('../../utils/url-join');
|
||||
|
||||
module.exports = (hexo) => {
|
||||
const config = hexo.theme.config;
|
||||
const loadingImage = urlJoin(hexo.config.root, config.lazyload.loading_img
|
||||
|| urlJoin(config.static_prefix.internal_img, 'loading.gif'));
|
||||
if (!config.lazyload || !config.lazyload.enable || !loadingImage) {
|
||||
return;
|
||||
}
|
||||
if (config.lazyload.onlypost) {
|
||||
hexo.extend.filter.register('after_post_render', (page) => {
|
||||
if (page.layout !== 'post' && !page.lazyload) {
|
||||
return;
|
||||
}
|
||||
if (page.lazyload !== false) {
|
||||
page.content = lazyImages(page.content, loadingImage);
|
||||
page.content = lazyComments(page.content);
|
||||
}
|
||||
return page;
|
||||
});
|
||||
} else {
|
||||
hexo.extend.filter.register('after_render:html', (html, data) => {
|
||||
if (!data.page || data.page.lazyload !== false) {
|
||||
html = lazyImages(html, loadingImage);
|
||||
html = lazyComments(html);
|
||||
return html;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const lazyImages = (htmlContent, loadingImage) => {
|
||||
return htmlContent.replace(/<img[^>]+?src=(".*?")[^>]*?>/gims, (str, p1) => {
|
||||
if (/lazyload/i.test(str)) {
|
||||
return str;
|
||||
}
|
||||
return str.replace(p1, `${p1} srcset="${loadingImage}" lazyload`);
|
||||
});
|
||||
};
|
||||
|
||||
const lazyComments = (htmlContent) => {
|
||||
return htmlContent.replace(/<[^>]+?id="comments"[^>]*?>/gims, (str) => {
|
||||
if (/lazyload/i.test(str)) {
|
||||
return str;
|
||||
}
|
||||
return str.replace('id="comments"', 'id="comments" lazyload');
|
||||
});
|
||||
};
|
||||
93
themes/fluid/scripts/events/lib/merge-configs.js
Normal file
93
themes/fluid/scripts/events/lib/merge-configs.js
Normal file
@ -0,0 +1,93 @@
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const objUtil = require('../../utils/object');
|
||||
const { isNotEmptyObject } = require('../../utils/object');
|
||||
|
||||
module.exports = (hexo) => {
|
||||
const isZh = hexo.theme.i18n.languages[0].search(/zh-CN/i) !== -1;
|
||||
|
||||
let dataConfig = {};
|
||||
let dataStaticConfig = {};
|
||||
|
||||
if (hexo.locals.get instanceof Function) {
|
||||
const data = hexo.locals.get('data');
|
||||
if (data && isNotEmptyObject(data.fluid_config)) {
|
||||
dataConfig = data.fluid_config;
|
||||
} else if (!configFromRoot(hexo)) {
|
||||
if (isZh) {
|
||||
hexo.log.warn('[Fluid] 推荐你使用覆盖配置功能: https://hexo.fluid-dev.com/docs/guide/#%E8%A6%86%E7%9B%96%E9%85%8D%E7%BD%AE');
|
||||
} else {
|
||||
hexo.log.warn('[Fluid] It is recommended that you use override configuration: https://hexo.fluid-dev.com/docs/en/guide/#override-configuration');
|
||||
}
|
||||
}
|
||||
if (data && isNotEmptyObject(data.fluid_static_prefix)) {
|
||||
dataStaticConfig = data.fluid_static_prefix;
|
||||
}
|
||||
|
||||
const { language } = hexo.config;
|
||||
const { i18n } = hexo.theme;
|
||||
const langConfigMap = {};
|
||||
for (const key in data) {
|
||||
if (Object.prototype.hasOwnProperty.call(data, key)) {
|
||||
if (/^languages\/.+$/.test(key)) {
|
||||
langConfigMap[key.replace('languages/', '')] = data[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isNotEmptyObject(langConfigMap)) {
|
||||
const mergeLang = (lang) => {
|
||||
if (langConfigMap[lang]) {
|
||||
i18n.set(lang, objUtil.merge({}, i18n.get([lang]), langConfigMap[lang]));
|
||||
}
|
||||
};
|
||||
if (Array.isArray(language)) {
|
||||
for (const lang of language) {
|
||||
mergeLang(lang);
|
||||
}
|
||||
} else {
|
||||
mergeLang(language);
|
||||
}
|
||||
if (isZh) {
|
||||
hexo.log.debug('[Fluid] 读取 source/_data/languages/*.yml 文件覆盖语言配置');
|
||||
} else {
|
||||
hexo.log.debug('[Fluid] Merge language config from source/_data/languages/*.yml');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isNotEmptyObject(hexo.config.theme_config)) {
|
||||
hexo.theme.config = objUtil.merge({}, hexo.theme.config, hexo.config.theme_config);
|
||||
if (isZh) {
|
||||
hexo.log.debug('[Fluid] 读取 _config.yml 中 theme_config 配置项覆盖主题配置');
|
||||
} else {
|
||||
hexo.log.debug('[Fluid] Merge theme config from theme_config in _config.yml');
|
||||
}
|
||||
}
|
||||
|
||||
if (isNotEmptyObject(dataStaticConfig)) {
|
||||
hexo.theme.config.static_prefix = objUtil.merge({}, hexo.theme.config.static_prefix, dataStaticConfig);
|
||||
if (isZh) {
|
||||
hexo.log.debug('[Fluid] 读取 source/_data/fluid_static_prefix.yml 文件覆盖主题配置');
|
||||
} else {
|
||||
hexo.log.debug('[Fluid] Merge theme config from source/_data/fluid_static_prefix.yml');
|
||||
}
|
||||
}
|
||||
|
||||
if (isNotEmptyObject(dataConfig)) {
|
||||
hexo.theme.config = objUtil.merge({}, hexo.theme.config, dataConfig);
|
||||
if (isZh) {
|
||||
hexo.log.debug('[Fluid] 读取 source/_data/fluid_config.yml 文件覆盖主题配置');
|
||||
} else {
|
||||
hexo.log.debug('[Fluid] Merge theme config from source/_data/fluid_config.yml');
|
||||
}
|
||||
}
|
||||
|
||||
hexo.log.debug('[Fluid] Output theme config:\n', JSON.stringify(hexo.theme.config, undefined, 2));
|
||||
};
|
||||
|
||||
const configFromRoot = (hexo) => {
|
||||
const configPath = path.join(hexo.base_dir, '_config.fluid.yml');
|
||||
return fs.existsSync(configPath);
|
||||
};
|
||||
27
themes/fluid/scripts/filters/default-injects.js
Normal file
27
themes/fluid/scripts/filters/default-injects.js
Normal file
@ -0,0 +1,27 @@
|
||||
/* global hexo */
|
||||
|
||||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
|
||||
hexo.extend.filter.register('theme_inject', function(injects) {
|
||||
injects.header.file('default', path.join(hexo.theme_dir, 'layout/_partials/header.ejs'));
|
||||
injects.footer.file('default', path.join(hexo.theme_dir, 'layout/_partials/footer.ejs'));
|
||||
|
||||
injects.postLeft.file('default', path.join(hexo.theme_dir, 'layout/_partials/post/sidebar-left.ejs'));
|
||||
injects.postRight.file('default', path.join(hexo.theme_dir, 'layout/_partials/post/sidebar-right.ejs'));
|
||||
injects.postMetaTop.file('default', path.join(hexo.theme_dir, 'layout/_partials/post/meta-top.ejs'));
|
||||
injects.postMetaBottom.file('default', path.join(hexo.theme_dir, 'layout/_partials/post/meta-bottom.ejs'));
|
||||
if (hexo.theme.config.post.copyright.enable) {
|
||||
injects.postCopyright.file('default', path.join(hexo.theme_dir, 'layout/_partials/post/copyright.ejs'));
|
||||
}
|
||||
if (hexo.theme.config.post.comments.enable) {
|
||||
injects.postComments.file('default', path.join(hexo.theme_dir, 'layout/_partials/comments.ejs'));
|
||||
}
|
||||
|
||||
injects.pageComments.file('default', path.join(hexo.theme_dir, 'layout/_partials/comments.ejs'));
|
||||
|
||||
if (hexo.theme.config.links.comments.enable) {
|
||||
injects.linksComments.file('default', path.join(hexo.theme_dir, 'layout/_partials/comments.ejs'));
|
||||
}
|
||||
}, -99);
|
||||
20
themes/fluid/scripts/filters/locals.js
Normal file
20
themes/fluid/scripts/filters/locals.js
Normal file
@ -0,0 +1,20 @@
|
||||
/* global hexo */
|
||||
|
||||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
|
||||
hexo.extend.filter.register('template_locals', locals => {
|
||||
const { env, config } = hexo;
|
||||
const { __ } = locals;
|
||||
const { i18n } = hexo.theme;
|
||||
locals.hexo_version = env.version;
|
||||
locals.fluid_version = require(path.normalize(path.join(hexo.theme_dir, 'package.json'))).version;
|
||||
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);
|
||||
locals.page.lang = locals.page.lang || locals.page.language;
|
||||
});
|
||||
55
themes/fluid/scripts/filters/post-filter.js
Normal file
55
themes/fluid/scripts/filters/post-filter.js
Normal file
@ -0,0 +1,55 @@
|
||||
/* global hexo */
|
||||
|
||||
'use strict';
|
||||
|
||||
// 生成前过滤文章
|
||||
hexo.extend.filter.register('before_generate', function() {
|
||||
this._bindLocals();
|
||||
|
||||
const allPages = this.locals.get('pages');
|
||||
allPages.data.map((page) => {
|
||||
if (page.comment !== true) {
|
||||
page.comments = typeof page.comment === 'string' && page.comment !== '';
|
||||
} else {
|
||||
page.comments = true;
|
||||
}
|
||||
return page;
|
||||
});
|
||||
this.locals.set('pages', allPages);
|
||||
|
||||
const allPosts = this.locals.get('posts');
|
||||
allPosts.data.map((post) => {
|
||||
if (post.comment === false) {
|
||||
post.comments = false;
|
||||
}
|
||||
return post;
|
||||
});
|
||||
const hidePosts = allPosts.filter(post => post.hide);
|
||||
const normalPosts = allPosts.filter(post => !post.hide);
|
||||
const indexPost = allPosts.filter(post => !post.hide && !post.archive)
|
||||
|
||||
this.locals.set('all_posts', allPosts);
|
||||
this.locals.set('hide_posts', hidePosts);
|
||||
this.locals.set('posts', normalPosts);
|
||||
this.locals.set('index_posts', indexPost);
|
||||
});
|
||||
|
||||
const original_post_generator = hexo.extend.generator.get('post');
|
||||
|
||||
hexo.extend.generator.register('post', function(locals) {
|
||||
// 发送时需要把过滤的页面也加入
|
||||
return original_post_generator.bind(this)({
|
||||
posts: new locals.posts.constructor(
|
||||
locals.posts.data.concat(locals.hide_posts.data)
|
||||
)
|
||||
});
|
||||
});
|
||||
|
||||
// 渲染文章后的过滤
|
||||
hexo.extend.filter.register('after_post_render', (page) => {
|
||||
// 移除 hexo-renderer-pandoc 生成的 <colgroup>
|
||||
page.content = page.content.replace(/<colgroup>.+?<\/colgroup>/gims, '');
|
||||
// 移除 hexo-renderer-pandoc 生成的 <span class="footnote-text">...<br>...</span>
|
||||
page.content = page.content.replace(/(class="footnote-text".+?)<br.+?>(.+?rev="footnote")/gims, '$1$2');
|
||||
return page;
|
||||
});
|
||||
22
themes/fluid/scripts/generators/index-generator.js
Normal file
22
themes/fluid/scripts/generators/index-generator.js
Normal file
@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
const pagination = require('hexo-pagination');
|
||||
|
||||
module.exports = function(locals) {
|
||||
const config = this.config;
|
||||
const posts = locals.index_posts.sort(config.index_generator.order_by);
|
||||
|
||||
posts.data.sort((a, b) => (b.sticky || 0) - (a.sticky || 0));
|
||||
|
||||
const paginationDir = config.pagination_dir || 'page';
|
||||
const path = config.index_generator.path || '';
|
||||
|
||||
return pagination(path, posts, {
|
||||
perPage: config.index_generator.per_page,
|
||||
layout: 'index',
|
||||
format: paginationDir + '/%d/',
|
||||
data: {
|
||||
__index: true
|
||||
}
|
||||
});
|
||||
};
|
||||
68
themes/fluid/scripts/generators/local-search.js
Normal file
68
themes/fluid/scripts/generators/local-search.js
Normal file
@ -0,0 +1,68 @@
|
||||
/* global hexo */
|
||||
|
||||
'use strict';
|
||||
|
||||
hexo.extend.generator.register('_hexo_generator_search', function(locals) {
|
||||
const config = this.theme.config;
|
||||
if (!config.search.enable) {
|
||||
return;
|
||||
}
|
||||
|
||||
const nunjucks = require('nunjucks');
|
||||
const env = new nunjucks.Environment();
|
||||
const pathFn = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
env.addFilter('uriencode', function(str) {
|
||||
return encodeURI(str);
|
||||
});
|
||||
|
||||
env.addFilter('noControlChars', function(str) {
|
||||
// eslint-disable-next-line no-control-regex
|
||||
return str && str.replace(/[\x00-\x1F\x7F]/g, '');
|
||||
});
|
||||
|
||||
env.addFilter('urlJoin', function(str) {
|
||||
const base = str[0];
|
||||
const relative = str[1];
|
||||
return relative
|
||||
? base.replace(/\/+$/, '') + '/' + relative.replace(/^\/+/, '')
|
||||
: base;
|
||||
});
|
||||
|
||||
const searchTmplSrc = pathFn.join(hexo.theme_dir, './source/xml/local-search.xml');
|
||||
const searchTmpl = nunjucks.compile(fs.readFileSync(searchTmplSrc, 'utf8'), env);
|
||||
|
||||
const searchConfig = config.search;
|
||||
let searchField = searchConfig.field;
|
||||
const content = searchConfig.content && true;
|
||||
|
||||
let posts, pages;
|
||||
|
||||
if (searchField.trim() !== '') {
|
||||
searchField = searchField.trim();
|
||||
if (searchField === 'post') {
|
||||
posts = locals.posts.sort('-date');
|
||||
} else if (searchField === 'page') {
|
||||
pages = locals.pages;
|
||||
} else {
|
||||
posts = locals.posts.sort('-date');
|
||||
pages = locals.pages;
|
||||
}
|
||||
} else {
|
||||
posts = locals.posts.sort('-date');
|
||||
}
|
||||
|
||||
const xml = searchTmpl.render({
|
||||
config : config,
|
||||
posts : posts,
|
||||
pages : pages,
|
||||
content: content,
|
||||
url : hexo.config.root
|
||||
});
|
||||
|
||||
return {
|
||||
path: searchConfig.generate_path || '/local-search.xml',
|
||||
data: xml
|
||||
};
|
||||
});
|
||||
55
themes/fluid/scripts/generators/pages.js
Normal file
55
themes/fluid/scripts/generators/pages.js
Normal file
@ -0,0 +1,55 @@
|
||||
/* global hexo */
|
||||
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
// generate 404 page
|
||||
if (!fs.existsSync(path.join(hexo.source_dir, '404.html'))) {
|
||||
hexo.extend.generator.register('_404', function(locals) {
|
||||
if (this.theme.config.page404.enable !== false) {
|
||||
return {
|
||||
path : '404.html',
|
||||
data : locals.theme,
|
||||
layout: '404'
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// generate tags Page
|
||||
hexo.extend.generator.register('_tags', function(locals) {
|
||||
if (this.theme.config.tag.enable !== false) {
|
||||
return {
|
||||
path : 'tags/index.html',
|
||||
data : locals.theme,
|
||||
layout: 'tags'
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// generate categories Page
|
||||
hexo.extend.generator.register('_categories', function(locals) {
|
||||
if (this.theme.config.category.enable !== false) {
|
||||
return {
|
||||
path : 'categories/index.html',
|
||||
data : locals.theme,
|
||||
layout: 'categories'
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// generate links page
|
||||
hexo.extend.generator.register('_links', function(locals) {
|
||||
if (this.theme.config.links.enable !== false) {
|
||||
return {
|
||||
path : 'links/index.html',
|
||||
data : locals.theme,
|
||||
layout: 'links'
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// generate index page
|
||||
hexo.extend.generator.register('index', require('./index-generator'));
|
||||
25
themes/fluid/scripts/helpers/date.js
Normal file
25
themes/fluid/scripts/helpers/date.js
Normal file
@ -0,0 +1,25 @@
|
||||
/* global hexo */
|
||||
|
||||
'use strict';
|
||||
|
||||
const moment = require('moment');
|
||||
const { isMoment } = moment;
|
||||
|
||||
hexo.extend.helper.register('compare_date', function(date1, date2) {
|
||||
if (!date1) {
|
||||
return -1;
|
||||
}
|
||||
if (!date2) {
|
||||
return 1;
|
||||
}
|
||||
const m1 = isMoment(date1) ? date1 : moment(date1);
|
||||
const m2 = isMoment(date2) ? date2 : moment(date2);
|
||||
const diff = m1.diff(m2);
|
||||
if (diff < 0) {
|
||||
return -1;
|
||||
} else if (diff > 0) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
9
themes/fluid/scripts/helpers/engine.js
Normal file
9
themes/fluid/scripts/helpers/engine.js
Normal file
@ -0,0 +1,9 @@
|
||||
/* global hexo */
|
||||
|
||||
'use strict';
|
||||
|
||||
hexo.extend.helper.register('inject_point', function(point) {
|
||||
return this.theme.injects[point]
|
||||
.map(item => this.partial(item.layout, item.locals, item.options))
|
||||
.join('');
|
||||
});
|
||||
40
themes/fluid/scripts/helpers/export-config.js
Normal file
40
themes/fluid/scripts/helpers/export-config.js
Normal file
@ -0,0 +1,40 @@
|
||||
/* global hexo */
|
||||
|
||||
'use strict';
|
||||
|
||||
const url = require('url');
|
||||
const urlJoin = require('../utils/url-join');
|
||||
|
||||
/**
|
||||
* Export theme config to js
|
||||
*/
|
||||
hexo.extend.helper.register('export_config', function () {
|
||||
let { config, theme, fluid_version } = this;
|
||||
const exportConfig = {
|
||||
hostname: url.parse(config.url).hostname || config.url,
|
||||
root: config.root,
|
||||
version: fluid_version,
|
||||
typing: theme.fun_features.typing,
|
||||
anchorjs: theme.fun_features.anchorjs,
|
||||
progressbar: theme.fun_features.progressbar,
|
||||
code_language: theme.code.language,
|
||||
copy_btn: theme.code.copy_btn,
|
||||
image_caption: theme.post.image_caption,
|
||||
image_zoom: theme.post.image_zoom,
|
||||
toc: theme.post.toc,
|
||||
lazyload: theme.lazyload,
|
||||
web_analytics: theme.web_analytics,
|
||||
search_path: urlJoin(config.root, theme.search.path),
|
||||
include_content_in_search: theme.search.content,
|
||||
};
|
||||
return `<script id="fluid-configs">
|
||||
var Fluid = window.Fluid || {};
|
||||
Fluid.ctx = Object.assign({}, Fluid.ctx)
|
||||
var CONFIG = ${JSON.stringify(exportConfig)};
|
||||
|
||||
if (CONFIG.web_analytics.follow_dnt) {
|
||||
var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
|
||||
Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
|
||||
}
|
||||
</script>`;
|
||||
});
|
||||
24
themes/fluid/scripts/helpers/import.js
Normal file
24
themes/fluid/scripts/helpers/import.js
Normal file
@ -0,0 +1,24 @@
|
||||
/* global hexo */
|
||||
|
||||
'use strict';
|
||||
|
||||
hexo.extend.helper.register('import_js', function(base, relative, ex = '') {
|
||||
if (!Array.isArray(this.page.script_snippets)) {
|
||||
this.page.script_snippets = [];
|
||||
}
|
||||
this.page.script_snippets.push(this.js_ex(base, relative, ex));
|
||||
});
|
||||
|
||||
hexo.extend.helper.register('import_script', function(snippet) {
|
||||
if (!Array.isArray(this.page.script_snippets)) {
|
||||
this.page.script_snippets = [];
|
||||
}
|
||||
this.page.script_snippets.push(snippet);
|
||||
});
|
||||
|
||||
hexo.extend.helper.register('import_css', function(base, relative, ex = '') {
|
||||
if (!Array.isArray(this.page.css_snippets)) {
|
||||
this.page.css_snippets = [];
|
||||
}
|
||||
this.page.css_snippets.push(this.css_ex(base, relative, ex));
|
||||
});
|
||||
7
themes/fluid/scripts/helpers/injects.js
Normal file
7
themes/fluid/scripts/helpers/injects.js
Normal file
@ -0,0 +1,7 @@
|
||||
/* global hexo */
|
||||
|
||||
'use strict';
|
||||
|
||||
hexo.extend.helper.register('point_injected', function(type) {
|
||||
return hexo.theme.config.injects[type] && hexo.theme.config.injects[type].length > 0;
|
||||
});
|
||||
25
themes/fluid/scripts/helpers/page.js
Normal file
25
themes/fluid/scripts/helpers/page.js
Normal file
@ -0,0 +1,25 @@
|
||||
/* global hexo */
|
||||
|
||||
'use strict';
|
||||
|
||||
hexo.extend.helper.register('prev_post', function prev_post(post) {
|
||||
const prev = post.prev;
|
||||
if (!prev) {
|
||||
return null;
|
||||
}
|
||||
if (prev.hide) {
|
||||
return prev_post(prev);
|
||||
}
|
||||
return prev;
|
||||
});
|
||||
|
||||
hexo.extend.helper.register('next_post', function next_post(post) {
|
||||
const next = post.next;
|
||||
if (!next) {
|
||||
return null;
|
||||
}
|
||||
if (next.hide) {
|
||||
return next_post(next);
|
||||
}
|
||||
return next;
|
||||
});
|
||||
50
themes/fluid/scripts/helpers/scope.js
Normal file
50
themes/fluid/scripts/helpers/scope.js
Normal file
@ -0,0 +1,50 @@
|
||||
/* global hexo */
|
||||
|
||||
'use strict';
|
||||
|
||||
const pageInScope = (page, scope) => {
|
||||
switch (scope) {
|
||||
case 'home':
|
||||
return Boolean(page.__index);
|
||||
case 'post':
|
||||
case 'posts':
|
||||
return Boolean(page.__post);
|
||||
case 'archives':
|
||||
case 'archive':
|
||||
return Boolean(page.archive);
|
||||
case 'categories':
|
||||
case 'category':
|
||||
return page.layout === 'categories' || page.layout === 'category';
|
||||
case 'tags':
|
||||
case 'tag':
|
||||
return page.layout === 'tags' || page.layout === 'tag';
|
||||
case 'about':
|
||||
return page.layout === 'about';
|
||||
case 'links':
|
||||
case 'link':
|
||||
return page.layout === 'links';
|
||||
case '404':
|
||||
return page.layout === '404';
|
||||
case 'page':
|
||||
case 'custom':
|
||||
return Boolean(page.__page);
|
||||
}
|
||||
};
|
||||
|
||||
hexo.extend.helper.register('in_scope', function(scope) {
|
||||
if (!scope || scope.length === 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Array.isArray(scope)) {
|
||||
for (const each of scope) {
|
||||
if (pageInScope(this.page, each)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return pageInScope(this.page, scope);
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
17
themes/fluid/scripts/helpers/url.js
Normal file
17
themes/fluid/scripts/helpers/url.js
Normal file
@ -0,0 +1,17 @@
|
||||
/* global hexo */
|
||||
|
||||
'use strict';
|
||||
|
||||
const urlJoin = require('../utils/url-join');
|
||||
|
||||
hexo.extend.helper.register('css_ex', function(base, relative, ex = '') {
|
||||
return `<link ${ex} rel="stylesheet" href="${this.url_for(urlJoin(base, relative))}" />`;
|
||||
});
|
||||
|
||||
hexo.extend.helper.register('js_ex', function(base, relative, ex = '') {
|
||||
return `<script ${ex} src="${this.url_for(urlJoin(base, relative))}" ></script>`;
|
||||
});
|
||||
|
||||
hexo.extend.helper.register('url_join', function(base, relative) {
|
||||
return this.url_for(urlJoin(base, relative));
|
||||
});
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user