first commit
This commit is contained in:
commit
4b1696db17
674
LICENSE
Normal file
674
LICENSE
Normal file
@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://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.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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 <https://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:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
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
|
||||
<https://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
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
57
README.md
Normal file
57
README.md
Normal file
@ -0,0 +1,57 @@
|
||||
# Earth
|
||||
|
||||
Halo 2.0 的默认主题。
|
||||
|
||||

|
||||
|
||||
## 使用方式
|
||||
|
||||
1. 手动从以下地址下载主题包并在 Console 的主题管理界面安装,安装方式可参考:<https://docs.halo.run/user-guide/themes>
|
||||
|
||||
- https://www.halo.run/store/apps/app-KgWqR
|
||||
- https://github.com/halo-dev/theme-earth/releases
|
||||
|
||||
3. 如果安装了[应用市场](https://www.halo.run/store/apps/app-VYJbF)插件,可以直接在应用市场中搜索`Earth`并安装。
|
||||
|
||||
## 插件支持
|
||||
|
||||
Earth 主题支持以下 Halo 插件:
|
||||
|
||||
- 友情链接(/links):<https://halo.run/store/apps/app-hfbQg>
|
||||
- 图库(/photos):<https://halo.run/store/apps/app-BmQJW>
|
||||
- 瞬间(/moments):<https://halo.run/store/apps/app-SnwWD>
|
||||
|
||||
为了获得更好的体验,你还可以安装以下插件(如果需要):
|
||||
|
||||
- highlight.js 代码高亮:<https://halo.run/store/apps/app-sqpgf>
|
||||
- lightgallery.js 灯箱:<https://halo.run/store/apps/app-OoggD>
|
||||
|
||||
## 开发
|
||||
|
||||
```bash
|
||||
git clone git@github.com:halo-dev/theme-earth.git ~/halo2-dev/themes/theme-earth
|
||||
```
|
||||
|
||||
```bash
|
||||
cd ~/halo2-dev/themes/theme-earth
|
||||
```
|
||||
|
||||
```bash
|
||||
pnpm install
|
||||
```
|
||||
|
||||
```bash
|
||||
pnpm dev
|
||||
```
|
||||
|
||||
主题开发文档可查阅:<https://docs.halo.run/2.0.0-SNAPSHOT/developer-guide/theme/prepare>
|
||||
|
||||
## 构建
|
||||
|
||||
> 如果你使用的是 Windows 操作系统,请安装 `make` 命令并在 Git Bash 或 WSL 中执行。
|
||||
|
||||
```bash
|
||||
make build
|
||||
```
|
||||
|
||||
然后将 `dist` 目录压缩成 `ZIP` 格式压缩包即可在 Halo 后台上传安装。
|
||||
55
i18n/default.properties
Normal file
55
i18n/default.properties
Normal file
@ -0,0 +1,55 @@
|
||||
common.previousPage=Previous
|
||||
common.nextPage=Next
|
||||
common.more=More
|
||||
common.all=All
|
||||
common.noPosts=No Posts
|
||||
common.comment=Comment
|
||||
common.edit=Edit
|
||||
common.publishedOn=Published on {0}
|
||||
common.visitCount={0} Visits
|
||||
|
||||
widget.categories.title=Categories
|
||||
widget.popularPosts.title=Popular Posts
|
||||
widget.tags.title=Tags
|
||||
widget.latestComments.title=Latest Comments
|
||||
widget.profile.postCount.label=Posts
|
||||
widget.profile.categoryCount.label=Categories
|
||||
widget.profile.commentCount.label=Comments
|
||||
widget.profile.visitCount.label=Visits
|
||||
|
||||
page.archives.title=Archives
|
||||
page.archives.date={0} / {1}
|
||||
page.links.title=Links
|
||||
page.moments.title=Moments
|
||||
page.photos.title=Photos
|
||||
page.tags.title=Tags
|
||||
page.tags.morePosts=More Posts
|
||||
page.tag.title=Tag: {0}
|
||||
page.categories.title=Categories
|
||||
page.category.title=Category: {0}
|
||||
page.author.title=Author: {0}
|
||||
page.error.backToHome=Back to Home
|
||||
page.post.toc=Table of Contents
|
||||
|
||||
fragment.header.search=Search
|
||||
fragment.header.menu=Menu
|
||||
fragment.header.console=Console
|
||||
fragment.header.logout=Logout
|
||||
fragment.header.login=Login
|
||||
fragment.layout.toTop=Back to Top
|
||||
fragment.tagFilter.allTags=All Tags
|
||||
fragment.shareModal.title=Share
|
||||
fragment.shareModal.copy=Copy
|
||||
fragment.shareModal.copied=Copied
|
||||
fragment.postCard.pinned=Pinned
|
||||
|
||||
jsModule.colorSchemeSwitcher.dark=Dark
|
||||
jsModule.colorSchemeSwitcher.light=Light
|
||||
jsModule.colorSchemeSwitcher.auto=Auto
|
||||
jsModule.share.qzone=QQ Zone
|
||||
jsModule.share.weibo=Weibo
|
||||
jsModule.share.douban=Douban
|
||||
jsModule.share.wechat=WeChat
|
||||
jsModule.share.native=System
|
||||
jsModule.share.windowTitle=Share
|
||||
jsModule.upvote.networkError=Network request failed, please try again later
|
||||
55
i18n/es.properties
Normal file
55
i18n/es.properties
Normal file
@ -0,0 +1,55 @@
|
||||
common.previousPage=Página Anterior
|
||||
common.nextPage=Página Siguiente
|
||||
common.more=Más
|
||||
common.all=Todo
|
||||
common.noPosts=No hay Publicaciones
|
||||
common.comment=Comentario
|
||||
common.edit=Editar
|
||||
common.publishedOn=Publicado el {0}
|
||||
common.visitCount={0} Lecturas
|
||||
|
||||
widget.categories.title=Categorías
|
||||
widget.popularPosts.title=Publicaciones Populares
|
||||
widget.tags.title=Etiquetas
|
||||
widget.latestComments.title=Últimos Comentarios
|
||||
widget.profile.postCount.label=Número de Publicaciones
|
||||
widget.profile.categoryCount.label=Número de Categorías
|
||||
widget.profile.commentCount.label=Número de Comentarios
|
||||
widget.profile.visitCount.label=Visitas
|
||||
|
||||
page.archives.title=Archivos
|
||||
page.archives.date=Año {0} Mes {1}
|
||||
page.links.title=Enlaces
|
||||
page.moments.title=Momentos
|
||||
page.photos.title=Galería
|
||||
page.tags.title=Etiquetas
|
||||
page.tags.morePosts=Más Publicaciones
|
||||
page.tag.title=Etiqueta: {0}
|
||||
page.categories.title=Categorías
|
||||
page.category.title=Categoría: {0}
|
||||
page.author.title=Autor: {0}
|
||||
page.error.backToHome=Volver al Inicio
|
||||
page.post.toc=Tabla de Contenidos
|
||||
|
||||
fragment.header.search=Buscar
|
||||
fragment.header.menu=Menú
|
||||
fragment.header.console=Consola
|
||||
fragment.header.logout=Cerrar Sesión
|
||||
fragment.header.login=Iniciar Sesión
|
||||
fragment.layout.toTop=Volver Arriba
|
||||
fragment.tagFilter.allTags=Todas las Etiquetas
|
||||
fragment.shareModal.title=Compartir
|
||||
fragment.shareModal.copy=Copiar
|
||||
fragment.shareModal.copied=Copiado
|
||||
fragment.postCard.pinned=Fijado
|
||||
|
||||
jsModule.colorSchemeSwitcher.dark=Oscuro
|
||||
jsModule.colorSchemeSwitcher.light=Claro
|
||||
jsModule.colorSchemeSwitcher.auto=Seguir Sistema
|
||||
jsModule.share.qzone=QQ Zona
|
||||
jsModule.share.weibo=Weibo
|
||||
jsModule.share.douban=Douban
|
||||
jsModule.share.wechat=WeChat
|
||||
jsModule.share.native=Compartir del Sistema
|
||||
jsModule.share.windowTitle=Compartir
|
||||
jsModule.upvote.networkError=Error de red, por favor intente nuevamente más tarde
|
||||
55
i18n/zh_CN.properties
Normal file
55
i18n/zh_CN.properties
Normal file
@ -0,0 +1,55 @@
|
||||
common.previousPage=上一页
|
||||
common.nextPage=下一页
|
||||
common.more=更多
|
||||
common.all=全部
|
||||
common.noPosts=没有文章
|
||||
common.comment=评论
|
||||
common.edit=编辑
|
||||
common.publishedOn=发布于 {0}
|
||||
common.visitCount={0} 阅读
|
||||
|
||||
widget.categories.title=分类目录
|
||||
widget.popularPosts.title=热门文章
|
||||
widget.tags.title=标签
|
||||
widget.latestComments.title=最新评论
|
||||
widget.profile.postCount.label=文章数
|
||||
widget.profile.categoryCount.label=分类数
|
||||
widget.profile.commentCount.label=评论数
|
||||
widget.profile.visitCount.label=访问量
|
||||
|
||||
page.archives.title=归档
|
||||
page.archives.date={0} 年 {1} 月
|
||||
page.links.title=链接
|
||||
page.moments.title=瞬间
|
||||
page.photos.title=图库
|
||||
page.tags.title=标签
|
||||
page.tags.morePosts=更多文章
|
||||
page.tag.title=标签:{0}
|
||||
page.categories.title=分类
|
||||
page.category.title=分类:{0}
|
||||
page.author.title=作者:{0}
|
||||
page.error.backToHome=返回首页
|
||||
page.post.toc=目录
|
||||
|
||||
fragment.header.search=搜索
|
||||
fragment.header.menu=菜单
|
||||
fragment.header.console=控制台
|
||||
fragment.header.logout=退出登录
|
||||
fragment.header.login=登录
|
||||
fragment.layout.toTop=回到顶部
|
||||
fragment.tagFilter.allTags=所有标签
|
||||
fragment.shareModal.title=分享
|
||||
fragment.shareModal.copy=复制
|
||||
fragment.shareModal.copied=已复制
|
||||
fragment.postCard.pinned=置顶
|
||||
|
||||
jsModule.colorSchemeSwitcher.dark=暗色
|
||||
jsModule.colorSchemeSwitcher.light=亮色
|
||||
jsModule.colorSchemeSwitcher.auto=跟随系统
|
||||
jsModule.share.qzone=QQ 空间
|
||||
jsModule.share.weibo=微博
|
||||
jsModule.share.douban=豆瓣
|
||||
jsModule.share.wechat=微信
|
||||
jsModule.share.native=系统分享
|
||||
jsModule.share.windowTitle=分享
|
||||
jsModule.upvote.networkError=网络请求失败,请稍后再试
|
||||
55
i18n/zh_TW.properties
Normal file
55
i18n/zh_TW.properties
Normal file
@ -0,0 +1,55 @@
|
||||
common.previousPage=上一頁
|
||||
common.nextPage=下一頁
|
||||
common.more=更多
|
||||
common.all=全部
|
||||
common.noPosts=沒有文章
|
||||
common.comment=評論
|
||||
common.edit=編輯
|
||||
common.publishedOn=發布於 {0}
|
||||
common.visitCount={0} 閱讀
|
||||
|
||||
widget.categories.title=分類目錄
|
||||
widget.popularPosts.title=熱門文章
|
||||
widget.tags.title=標籤
|
||||
widget.latestComments.title=最新評論
|
||||
widget.profile.postCount.label=文章數
|
||||
widget.profile.categoryCount.label=分類數
|
||||
widget.profile.commentCount.label=評論數
|
||||
widget.profile.visitCount.label=訪問量
|
||||
|
||||
page.archives.title=歸檔
|
||||
page.archives.date={0} 年 {1} 月
|
||||
page.links.title=連結
|
||||
page.moments.title=瞬間
|
||||
page.photos.title=圖庫
|
||||
page.tags.title=標籤
|
||||
page.tags.morePosts=更多文章
|
||||
page.tag.title=標籤:{0}
|
||||
page.categories.title=分類
|
||||
page.category.title=分類:{0}
|
||||
page.author.title=作者:{0}
|
||||
page.error.backToHome=返回首頁
|
||||
page.post.toc=目錄
|
||||
|
||||
fragment.header.search=搜索
|
||||
fragment.header.menu=菜單
|
||||
fragment.header.console=控制台
|
||||
fragment.header.logout=退出登入
|
||||
fragment.header.login=登入
|
||||
fragment.layout.toTop=回到頂部
|
||||
fragment.tagFilter.allTags=所有標籤
|
||||
fragment.shareModal.title=分享
|
||||
fragment.shareModal.copy=複製
|
||||
fragment.shareModal.copied=已複製
|
||||
fragment.postCard.pinned=置頂
|
||||
|
||||
jsModule.colorSchemeSwitcher.dark=暗色
|
||||
jsModule.colorSchemeSwitcher.light=亮色
|
||||
jsModule.colorSchemeSwitcher.auto=跟隨系統
|
||||
jsModule.share.qzone=QQ 空間
|
||||
jsModule.share.weibo=微博
|
||||
jsModule.share.douban=豆瓣
|
||||
jsModule.share.wechat=微信
|
||||
jsModule.share.native=系統分享
|
||||
jsModule.share.windowTitle=分享
|
||||
jsModule.upvote.networkError=網路請求失敗,請稍後再試
|
||||
502
settings.yaml
Normal file
502
settings.yaml
Normal file
@ -0,0 +1,502 @@
|
||||
apiVersion: v1alpha1
|
||||
kind: Setting
|
||||
metadata:
|
||||
name: theme-earth-setting
|
||||
spec:
|
||||
forms:
|
||||
- group: layout
|
||||
label: 布局
|
||||
formSchema:
|
||||
- $formkit: select
|
||||
name: post_list_layout
|
||||
label: 文章列表布局
|
||||
value: grid_3
|
||||
options:
|
||||
- label: 网格(一行三列)
|
||||
value: grid_3
|
||||
- label: 网格(一行两列)
|
||||
value: grid_2
|
||||
- label: 单条
|
||||
value: single
|
||||
help: "选择单条时,文章卡片的图片将位于左侧"
|
||||
- $formkit: select
|
||||
name: header_widget
|
||||
id: header_widget
|
||||
label: 首页顶部模块
|
||||
value: site_title
|
||||
options:
|
||||
- label: 无
|
||||
value: none
|
||||
- label: 最新一篇文章
|
||||
value: latest_post
|
||||
- label: 文章网格(最新五篇文章)
|
||||
value: latest_post_grid
|
||||
- label: 站点标题
|
||||
value: site_title
|
||||
- $formkit: select
|
||||
if: "$get(header_widget).value !== none"
|
||||
name: header_background_type
|
||||
id: header_background_type
|
||||
key: header_background_type
|
||||
label: 首页顶部背景
|
||||
value: image
|
||||
options:
|
||||
- label: 手动设置
|
||||
value: manual
|
||||
- label: 图片
|
||||
value: image
|
||||
- $formkit: text
|
||||
if: "$get(header_widget).value !== none && $get(header_background_type).value === manual"
|
||||
name: header_background
|
||||
id: header_background
|
||||
key: header_background
|
||||
label: 首页顶部背景
|
||||
- $formkit: attachment
|
||||
if: "$get(header_widget).value !== none && $get(header_background_type).value === image"
|
||||
name: header_background_image
|
||||
id: header_background_image
|
||||
key: header_background_image
|
||||
label: 首页顶部背景图片
|
||||
value: /themes/theme-earth/assets/images/default-background-2023-10-12.jpeg
|
||||
- $formkit: color
|
||||
if: "$get(header_widget).value === site_title"
|
||||
name: title_color
|
||||
id: title_color
|
||||
key: title_color
|
||||
label: 标题文字颜色
|
||||
value: "#ffffff"
|
||||
- $formkit: checkbox
|
||||
name: content_header
|
||||
label: 显示文章页面顶部背景
|
||||
value: true
|
||||
|
||||
- group: global
|
||||
label: 全局
|
||||
formSchema:
|
||||
- $formkit: select
|
||||
name: logo_type
|
||||
id: logo_type
|
||||
label: 菜单栏 Logo 类型
|
||||
value: image
|
||||
options:
|
||||
- label: 文字
|
||||
value: text
|
||||
- label: 图片
|
||||
value: image
|
||||
- $formkit: checkbox
|
||||
name: show_scroll_button
|
||||
label: 显示滚动到顶部按钮
|
||||
value: true
|
||||
|
||||
- group: style
|
||||
label: 样式
|
||||
formSchema:
|
||||
- $formkit: select
|
||||
name: color_scheme
|
||||
label: 默认配色
|
||||
value: system
|
||||
options:
|
||||
- label: 跟随系统
|
||||
value: system
|
||||
- label: 深色
|
||||
value: dark
|
||||
- label: 浅色
|
||||
value: light
|
||||
|
||||
- $formkit: checkbox
|
||||
name: enable_change_color_scheme
|
||||
label: 允许访客切换配色
|
||||
value: true
|
||||
|
||||
- group: post
|
||||
label: 文章
|
||||
formSchema:
|
||||
- $formkit: select
|
||||
name: content_style
|
||||
label: 内容样式
|
||||
value: "tailwind"
|
||||
options:
|
||||
- label: GitHub 风格
|
||||
value: github
|
||||
- label: Tailwind CSS Typography
|
||||
value: tailwind
|
||||
- $formkit: select
|
||||
name: title_position
|
||||
label: 标题位置
|
||||
value: "content"
|
||||
options:
|
||||
- value: "content"
|
||||
label: "正文中"
|
||||
- value: "cover"
|
||||
label: "封面中"
|
||||
- $formkit: text
|
||||
name: cover_height
|
||||
label: 封面图高度
|
||||
value: "24rem"
|
||||
- $formkit: checkbox
|
||||
name: show_upvote_button
|
||||
label: 显示点赞按钮
|
||||
value: true
|
||||
- $formkit: checkbox
|
||||
name: show_share_button
|
||||
id: show_share_button
|
||||
label: 显示分享按钮
|
||||
value: true
|
||||
- $formkit: select
|
||||
if: $get(show_share_button).value
|
||||
name: share_item_ids
|
||||
key: share_item_ids
|
||||
id: share_item_ids
|
||||
multiple: true
|
||||
sortable: true
|
||||
label: 分享平台
|
||||
value:
|
||||
- wechat
|
||||
- x
|
||||
- telegram
|
||||
- facebook
|
||||
- qq
|
||||
- qzone
|
||||
- weibo
|
||||
- douban
|
||||
- native
|
||||
options:
|
||||
- label: 微信
|
||||
value: wechat
|
||||
- label: X
|
||||
value: x
|
||||
- label: Telegram
|
||||
value: telegram
|
||||
- label: Facebook
|
||||
value: facebook
|
||||
- label: QQ
|
||||
value: qq
|
||||
- label: QQ 空间
|
||||
value: qzone
|
||||
- label: 微博
|
||||
value: weibo
|
||||
- label: 豆瓣
|
||||
value: douban
|
||||
- label: 系统分享
|
||||
value: native
|
||||
- $formkit: checkbox
|
||||
name: show_deprecated_items
|
||||
key: show_deprecated_items
|
||||
id: show_deprecated_items
|
||||
label: 显示已过时选项
|
||||
value: false
|
||||
help: 这些选项将在未来的版本移除,请尽快使用替代方案
|
||||
- $formkit: repeater
|
||||
if: $get(show_deprecated_items).value
|
||||
name: share_items
|
||||
key: share_items
|
||||
id: share_items
|
||||
label: 分享按钮
|
||||
help: 此选项已过时,请使用上方新提供的分享平台设置项
|
||||
value:
|
||||
- id: wechat
|
||||
- id: x
|
||||
- id: telegram
|
||||
- id: facebook
|
||||
- id: qq
|
||||
- id: qzone
|
||||
- id: weibo
|
||||
- id: douban
|
||||
- id: native
|
||||
children:
|
||||
- $formkit: select
|
||||
name: id
|
||||
label: 分享平台
|
||||
options:
|
||||
- label: 微信
|
||||
value: wechat
|
||||
- label: X
|
||||
value: x
|
||||
- label: Telegram
|
||||
value: telegram
|
||||
- label: Facebook
|
||||
value: facebook
|
||||
- label: QQ
|
||||
value: qq
|
||||
- label: QQ 空间
|
||||
value: qzone
|
||||
- label: 微博
|
||||
value: weibo
|
||||
- label: 豆瓣
|
||||
value: douban
|
||||
- label: 系统分享
|
||||
value: native
|
||||
- group: sidebar
|
||||
label: 侧边栏
|
||||
formSchema:
|
||||
- $formkit: repeater
|
||||
name: widgets
|
||||
label: 小部件
|
||||
value:
|
||||
- value: popular-posts
|
||||
- value: categories
|
||||
- value: tags
|
||||
children:
|
||||
- $formkit: select
|
||||
name: value
|
||||
label: 部件
|
||||
options:
|
||||
- label: 站点资料
|
||||
value: profile
|
||||
- label: 热门文章
|
||||
value: popular-posts
|
||||
- label: 文章分类
|
||||
value: categories
|
||||
- label: 文章标签
|
||||
value: tags
|
||||
|
||||
- $formkit: group
|
||||
name: profile
|
||||
value:
|
||||
logo:
|
||||
children:
|
||||
- $formkit: attachment
|
||||
name: logo
|
||||
label: 站点资料 Logo
|
||||
|
||||
- $formkit: repeater
|
||||
name: social_media
|
||||
label: 社交媒体
|
||||
value: []
|
||||
children:
|
||||
- $formkit: select
|
||||
name: icon
|
||||
label: 图标
|
||||
options:
|
||||
- label: 电子邮箱
|
||||
value: i-tabler-mail
|
||||
- label: 微信
|
||||
value: i-simple-icons-wechat
|
||||
- label: 腾讯 QQ
|
||||
value: i-simple-icons-tencentqq
|
||||
- label: 新浪微博
|
||||
value: i-simple-icons-sinaweibo
|
||||
- label: 知乎
|
||||
value: i-simple-icons-zhihu
|
||||
- label: 豆瓣
|
||||
value: i-simple-icons-douban
|
||||
- label: 哔哩哔哩
|
||||
value: i-simple-icons-bilibili
|
||||
- label: 抖音 / TikTok
|
||||
value: i-simple-icons-tiktok
|
||||
- label: Telegram
|
||||
value: i-simple-icons-telegram
|
||||
- label: Facebook
|
||||
value: i-simple-icons-facebook
|
||||
- label: Instagram
|
||||
value: i-simple-icons-instagram
|
||||
- label: LinkedIn
|
||||
value: i-simple-icons-linkedin
|
||||
- label: Twitter
|
||||
value: i-simple-icons-twitter
|
||||
- label: Slack
|
||||
value: i-simple-icons-slack
|
||||
- label: Discord
|
||||
value: i-simple-icons-discord
|
||||
- label: YouTube
|
||||
value: i-simple-icons-youtube
|
||||
- label: Steam
|
||||
value: i-simple-icons-steam
|
||||
- label: GitHub
|
||||
value: i-simple-icons-github
|
||||
- label: GitLab
|
||||
value: i-simple-icons-gitlab
|
||||
- label: RSS
|
||||
value: i-simple-icons-rss
|
||||
- $formkit: text
|
||||
name: name
|
||||
label: 名称
|
||||
- $formkit: text
|
||||
name: url
|
||||
label: 链接
|
||||
validation: "required"
|
||||
- $formkit: select
|
||||
name: url_type
|
||||
label: 链接类型
|
||||
value: normal
|
||||
help: "如果选择了图片类型,那么在访客点击之后会使用弹框的形式加载"
|
||||
options:
|
||||
- label: 跳转链接
|
||||
value: normal
|
||||
- label: 图片
|
||||
value: image
|
||||
|
||||
- group: footer
|
||||
label: 页脚
|
||||
formSchema:
|
||||
- $formkit: select
|
||||
name: style
|
||||
id: style
|
||||
key: style
|
||||
label: 页脚风格
|
||||
value: style_1
|
||||
options:
|
||||
- label: 风格一
|
||||
value: style_1
|
||||
- label: 风格二
|
||||
value: style_2
|
||||
|
||||
- $formkit: attachment
|
||||
name: logo
|
||||
label: Logo
|
||||
help: 如果不设置,将使用站点设置的 Logo
|
||||
|
||||
- $formkit: text
|
||||
name: title
|
||||
label: 标题
|
||||
help: 如果不设置,将使用站点设置的标题
|
||||
|
||||
- $formkit: textarea
|
||||
rows: 3
|
||||
name: slogan
|
||||
id: slogan
|
||||
key: slogan
|
||||
if: "$get(style).value === style_2"
|
||||
label: 标语
|
||||
|
||||
- $formkit: select
|
||||
if: "$get(style).value === style_1"
|
||||
name: right_menu
|
||||
id: right_menu
|
||||
key: right_menu
|
||||
label: 右侧菜单
|
||||
action: "/api/v1alpha1/menus"
|
||||
autoSelect: false
|
||||
clearable: true
|
||||
requestOption:
|
||||
labelField: "spec.displayName"
|
||||
valueField: "metadata.name"
|
||||
|
||||
- $formkit: select
|
||||
if: "$get(style).value === style_2"
|
||||
name: menu_names
|
||||
id: menu_names
|
||||
key: menu_names
|
||||
label: 菜单组
|
||||
value: []
|
||||
multiple: true
|
||||
sortable: true
|
||||
action: "/api/v1alpha1/menus"
|
||||
requestOption:
|
||||
labelField: "spec.displayName"
|
||||
valueField: "metadata.name"
|
||||
|
||||
- $formkit: repeater
|
||||
name: social_media
|
||||
label: 社交媒体
|
||||
value: []
|
||||
children:
|
||||
- $formkit: select
|
||||
name: icon
|
||||
label: 图标
|
||||
options:
|
||||
- label: 电子邮箱
|
||||
value: i-tabler-mail
|
||||
- label: 微信
|
||||
value: i-simple-icons-wechat
|
||||
- label: 腾讯 QQ
|
||||
value: i-simple-icons-tencentqq
|
||||
- label: 新浪微博
|
||||
value: i-simple-icons-sinaweibo
|
||||
- label: 知乎
|
||||
value: i-simple-icons-zhihu
|
||||
- label: 豆瓣
|
||||
value: i-simple-icons-douban
|
||||
- label: 哔哩哔哩
|
||||
value: i-simple-icons-bilibili
|
||||
- label: 抖音 / TikTok
|
||||
value: i-simple-icons-tiktok
|
||||
- label: Telegram
|
||||
value: i-simple-icons-telegram
|
||||
- label: Facebook
|
||||
value: i-simple-icons-facebook
|
||||
- label: Instagram
|
||||
value: i-simple-icons-instagram
|
||||
- label: LinkedIn
|
||||
value: i-simple-icons-linkedin
|
||||
- label: Twitter
|
||||
value: i-simple-icons-twitter
|
||||
- label: Slack
|
||||
value: i-simple-icons-slack
|
||||
- label: Discord
|
||||
value: i-simple-icons-discord
|
||||
- label: YouTube
|
||||
value: i-simple-icons-youtube
|
||||
- label: Steam
|
||||
value: i-simple-icons-steam
|
||||
- label: GitHub
|
||||
value: i-simple-icons-github
|
||||
- label: GitLab
|
||||
value: i-simple-icons-gitlab
|
||||
- label: RSS
|
||||
value: i-simple-icons-rss
|
||||
- $formkit: text
|
||||
name: name
|
||||
label: 名称
|
||||
- $formkit: text
|
||||
name: url
|
||||
label: 链接
|
||||
validation: "required"
|
||||
- $formkit: select
|
||||
name: url_type
|
||||
label: 链接类型
|
||||
value: normal
|
||||
help: "如果选择了图片类型,那么在访客点击之后会使用弹框的形式加载"
|
||||
options:
|
||||
- label: 跳转链接
|
||||
value: normal
|
||||
- label: 图片
|
||||
value: image
|
||||
|
||||
- $formkit: checkbox
|
||||
name: show_deprecated_items
|
||||
key: show_deprecated_items
|
||||
id: show_deprecated_items
|
||||
label: 显示已过时选项
|
||||
value: false
|
||||
help: 这些选项将在未来的版本移除,请尽快使用替代方案
|
||||
|
||||
- $formkit: menuRadio
|
||||
if: "$get(show_deprecated_items).value"
|
||||
name: menu
|
||||
id: menu
|
||||
key: menu
|
||||
label: 右侧菜单
|
||||
help: 此选项已过时,请使用上方新提供的右侧菜单设置项
|
||||
|
||||
- $formkit: repeater
|
||||
if: "$get(show_deprecated_items).value"
|
||||
name: menus
|
||||
id: menus
|
||||
key: menus
|
||||
label: 菜单组
|
||||
value: []
|
||||
help: 此选项已过时,请使用上方新提供的菜单组设置项
|
||||
children:
|
||||
- $formkit: menuRadio
|
||||
name: name
|
||||
label: 菜单
|
||||
validation: "required"
|
||||
- group: beian
|
||||
label: 备案设置
|
||||
formSchema:
|
||||
- $formkit: text
|
||||
name: icp_text
|
||||
label: ICP备案号
|
||||
- $formkit: text
|
||||
name: icp_link
|
||||
label: ICP备案跳转链接
|
||||
value: https://beian.miit.gov.cn/
|
||||
|
||||
- $formkit: text
|
||||
name: gongan_text
|
||||
label: 公安联网备案号
|
||||
- $formkit: text
|
||||
name: gongan_link
|
||||
label: 公安联网备案跳转链接
|
||||
value: https://beian.mps.gov.cn/#/query/webSearch
|
||||
99
templates/archives.html
Normal file
99
templates/archives.html
Normal file
@ -0,0 +1,99 @@
|
||||
<!doctype html>
|
||||
<html
|
||||
xmlns:th="https://www.thymeleaf.org"
|
||||
th:replace="~{modules/layout :: html(title = |#{page.archives.title} - ${site.title}|, hero = null, content = ~{::content}, head = null, footer = null, sidebar = null, contentClass = '')}"
|
||||
>
|
||||
<th:block th:fragment="content">
|
||||
<div class="rounded-xl bg-white p-4 dark:bg-slate-800">
|
||||
<h1 class="mb-6 text-2xl font-medium dark:text-slate-50" th:text="#{page.archives.title}"></h1>
|
||||
<div class="flex flex-col gap-4">
|
||||
<th:block th:each="archive : ${archives.items}">
|
||||
<th:block th:each="month : ${archive.months}">
|
||||
<div class="grid grid-cols-12 gap-4">
|
||||
<div class="col-span-12 sm:col-span-3">
|
||||
<h2
|
||||
class="sticky top-20 mt-2 text-lg font-medium dark:text-slate-50"
|
||||
th:text="#{page.archives.date(${archive.year},${month.month})}"
|
||||
></h2>
|
||||
</div>
|
||||
<div class="col-span-12 sm:col-span-9">
|
||||
<th:block th:each="post : ${month.posts}">
|
||||
<div
|
||||
class="my-2 rounded-xl border border-gray-300 bg-white shadow-sm hover:border-gray-400 hover:shadow dark:border-slate-600 dark:bg-slate-700 dark:hover:border-slate-700"
|
||||
>
|
||||
<div class="relative flex flex-col gap-2 p-4">
|
||||
<div class="flex min-w-0 flex-wrap items-center justify-between gap-4">
|
||||
<div class="col-span-7 flex flex-nowrap truncate">
|
||||
<a
|
||||
th:href="${post.status.permalink}"
|
||||
class="truncate text-xl font-medium text-gray-900 hover:text-gray-500 hover:underline dark:text-slate-50 dark:hover:text-white"
|
||||
th:text="${post.spec.title}"
|
||||
></a>
|
||||
</div>
|
||||
<div class="col-span-3 col-start-11">
|
||||
<p
|
||||
class="truncate text-sm text-gray-600 dark:text-slate-100"
|
||||
th:text="${#dates.format(post.spec.publishTime, 'yyyy-MM-dd')}"
|
||||
></p>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
th:if="${not #lists.isEmpty(post.categories)} or ${not #lists.isEmpty(post.tags)}"
|
||||
class="flex flex-wrap items-center gap-2"
|
||||
>
|
||||
<a
|
||||
th:if="${#lists.size(post.categories)} gt 0"
|
||||
th:href="@{${post.categories[0].status.permalink}}"
|
||||
th:title="${post.categories[0].spec.displayName}"
|
||||
th:text="${post.categories[0].spec.displayName}"
|
||||
class="mr-1 text-sm font-medium text-gray-800 hover:text-gray-900 dark:text-slate-500 dark:hover:text-slate-600"
|
||||
>
|
||||
</a>
|
||||
<a
|
||||
th:each="tag : ${post.tags}"
|
||||
th:href="@{${tag.status.permalink}}"
|
||||
th:title="${tag.spec.displayName}"
|
||||
th:text="|#${tag.spec.displayName}|"
|
||||
class="cursor-pointer text-sm italic text-gray-600 hover:text-gray-900 dark:text-slate-400 dark:hover:text-slate-500"
|
||||
>
|
||||
</a>
|
||||
</div>
|
||||
<div class="line-clamp-2 text-sm font-light dark:text-slate-200">
|
||||
<th:block th:text="${post.status.excerpt}"></th:block>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
</th:block>
|
||||
</div>
|
||||
|
||||
<div th:if="${archives.total == 0}" class="mt-6 flex items-center justify-center">
|
||||
<span class="text-sm font-light text-gray-600" th:text="#{common.noPosts}"></span>
|
||||
</div>
|
||||
|
||||
<div class="mt-6 flex items-center justify-between" th:if="${archives.hasPrevious() || archives.hasNext()}">
|
||||
<a
|
||||
th:href="@{${archives.prevUrl}}"
|
||||
class="whitespace-no-wrap group inline-flex items-center justify-center gap-1 rounded-md border border-gray-200 bg-white px-4 py-1 text-sm font-medium leading-6 text-gray-600 shadow-sm hover:bg-gray-50 focus:shadow-none focus:outline-none dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:hover:bg-slate-600 dark:hover:text-white"
|
||||
>
|
||||
<span class="i-tabler-arrow-left text-lg transition-all group-hover:-translate-x-1"></span>
|
||||
<span th:text="#{common.previousPage}"></span>
|
||||
</a>
|
||||
<span
|
||||
class="text-sm text-gray-900 dark:text-slate-50"
|
||||
th:text="|${archives.page} / ${archives.totalPages}|"
|
||||
></span>
|
||||
<a
|
||||
th:href="@{${archives.nextUrl}}"
|
||||
class="whitespace-no-wrap group inline-flex items-center justify-center gap-1 rounded-md border border-gray-200 bg-white px-4 py-1 text-sm font-medium leading-6 text-gray-600 shadow-sm hover:bg-gray-50 focus:shadow-none focus:outline-none dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:hover:bg-slate-600 dark:hover:text-white"
|
||||
>
|
||||
<span th:text="#{common.nextPage}"></span>
|
||||
<span class="i-tabler-arrow-right text-lg transition-all group-hover:translate-x-1"></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
</html>
|
||||
5
templates/assets/dist/main.iife.js
vendored
Normal file
5
templates/assets/dist/main.iife.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
templates/assets/dist/style.css
vendored
Normal file
1
templates/assets/dist/style.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
templates/assets/images/default-avatar.svg
Normal file
1
templates/assets/images/default-avatar.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1668076453637" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1575" data-spm-anchor-id="a313x.7781069.0.i1" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><path d="M500.736 85.333333c229.76 0 416 186.24 416 416S730.496 917.333333 500.736 917.333333s-416-186.24-416-416S270.976 85.333333 500.736 85.333333z m172.565333 109.12l0.234667-0.490666c-3.050667 6.826667-6.101333 13.44-9.216 19.84l-6.229333 12.522666c-34.496 67.2-72.96 107.221333-125.226667 107.221334-13.525333 0-22.314667 0.618667-28.352 1.941333l-3.818667 0.896c-0.085333 0-0.128-0.021333-0.128-0.064l-0.128 0.256a14.805333 14.805333 0 0 0-0.32 5.610667l0.426667 3.797333 0.832 4.736 1.237333 5.696 0.810667 3.2 2.005333 7.125333c0.362667 1.28 0.768 2.581333 1.194667 3.946667l2.858667 8.64c1.066667 3.050667 2.197333 6.272 3.477333 9.664 20.053333 53.546667 6.997333 106.112-29.098667 134.997333-39.317333 31.466667-92.629333 21.973333-112.277333-27.925333l-6.037333-15.146667-5.162667-12.544-3.050667-7.061333-3.434666-7.466667-3.114667-6.058666-1.173333-2.069334-2.261334-3.605333c-4.053333-5.909333-7.68-8.362667-12.16-9.322667l-3.178666-0.448-3.541334-0.106666-17.130666 0.213333-10.816-0.064c-23.893333-0.448-38.933333-3.712-53.248-14.634667-24.106667-18.410667-26.773333-47.616-12.992-83.072l1.92-4.650666c10.090667-23.872 8.832-40.661333-4.714667-55.402667A350.442667 350.442667 0 0 0 148.736 501.333333c0 194.410667 157.610667 352 352 352 31.424 0 61.866667-4.117333 90.837333-11.84 4.693333-27.861333-6.037333-50.026667-33.728-70.570666l-4.010666-2.88c-84.138667-58.56-87.893333-151.402667-22.592-191.146667 50.688-30.869333 105.6-31.488 146.432 8.597333l3.776 3.882667c8.106667 8.64 13.013333 12.074667 16.789333 13.162667l1.962667 0.426666 2.453333 0.128 2.24-0.085333 4.970667-0.533333 11.242666-1.514667c7.701333-1.088 13.546667-1.770667 20.096-2.218667 38.08-2.666667 62.933333 12.16 80.853334 46.506667a350.570667 350.570667 0 0 0 30.677333-143.914667c0-131.712-72.32-246.506667-179.434667-306.88z m-108.8 437.12c-22.869333 13.930667-22.186667 48.341333 21.674667 80.917334l4.224 3.029333c39.829333 27.733333 62.016 62.421333 65.706667 101.76a353.173333 353.173333 0 0 0 123.669333-101.333333l-1.066667-4.394667-2.346666-8.746667-1.130667-3.946666-2.218667-7.189334-1.109333-3.242666-2.176-5.781334c-6.933333-16.896-13.866667-20.778667-24.064-20.053333l-5.76 0.490667-6.272 0.746666-15.893333 2.176-7.68 0.853334-6.186667 0.384a61.546667 61.546667 0 0 1-8.533333-0.341334l-5.696-0.810666-1.258667-0.213334c-19.242667-3.392-35.925333-13.845333-53.653333-32.768-17.706667-18.922667-41.429333-19.072-70.208-1.557333zM500.757333 149.333333c-84.992 0-162.965333 30.122667-223.786666 80.298667 30.869333 32.362667 37.973333 74.112 20.309333 120.021333l-2.133333 5.312a91.285333 91.285333 0 0 0-4.074667 11.456l-0.341333 1.28 5.226666 0.426667 4.416 0.213333 2.496 0.042667h12.778667l12.842667-0.149333c38.101333 0 57.706667 11.370667 77.717333 48.256l4.309333 8.298666 4.352 9.109334 4.458667 9.941333 4.586667 10.837333 7.253333 17.941334c2.773333 7.082667 5.098667 7.509333 12.714667 1.408 13.973333-11.178667 19.733333-34.346667 9.173333-62.570667-19.818667-52.864-22.741333-88.042667-3.648-113.621333 15.658667-20.970667 36.437333-27.178667 72.256-28.138667l11.2-0.149333c23.488 0 54.101333-39.68 82.026667-101.269334A350.997333 350.997333 0 0 0 500.736 149.333333z" fill="#2868d2" p-id="1576"></path></svg>
|
||||
|
After Width: | Height: | Size: 3.5 KiB |
BIN
templates/assets/images/default-background-2023-10-12.jpeg
Normal file
BIN
templates/assets/images/default-background-2023-10-12.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 223 KiB |
BIN
templates/assets/images/default-background.png
Normal file
BIN
templates/assets/images/default-background.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 58 KiB |
BIN
templates/assets/images/gongan_beian.png
Normal file
BIN
templates/assets/images/gongan_beian.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
6
templates/assets/js/qrious.min.js
vendored
Normal file
6
templates/assets/js/qrious.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
37
templates/assets/qrcode-share.html
Normal file
37
templates/assets/qrcode-share.html
Normal file
@ -0,0 +1,37 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>二维码分享</title>
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100vh;
|
||||
}
|
||||
img {
|
||||
width: 300px;
|
||||
height: 300px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<canvas id="canvas"></canvas>
|
||||
</body>
|
||||
<script src="/themes/theme-earth/assets/js/qrious.min.js"></script>
|
||||
<script>
|
||||
(function () {
|
||||
const url = window.location.search.split("=")[1];
|
||||
new QRious({
|
||||
element: document.getElementById("canvas"),
|
||||
value: url,
|
||||
size: 260,
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
</html>
|
||||
1219
templates/assets/styles/github-markdown.css
Normal file
1219
templates/assets/styles/github-markdown.css
Normal file
File diff suppressed because it is too large
Load Diff
34
templates/author.html
Normal file
34
templates/author.html
Normal file
@ -0,0 +1,34 @@
|
||||
<!doctype html>
|
||||
<html
|
||||
xmlns:th="https://www.thymeleaf.org"
|
||||
th:replace="~{modules/layout :: html(title = |#{page.author.title(${author.spec.displayName})} - ${site.title}|, hero = ~{::hero}, content = ~{::content}, head = null, footer = null, sidebar = null, contentClass = null)}"
|
||||
>
|
||||
<th:block th:fragment="hero">
|
||||
<th:block
|
||||
th:replace="~{modules/hero :: hero(isHome = false, cover = ${theme.config.layout.header_background_image}, title = #{page.author.title(${author.spec.displayName})})}"
|
||||
/>
|
||||
</th:block>
|
||||
<th:block th:fragment="content">
|
||||
<div
|
||||
id="post-list"
|
||||
th:if="${posts.total gt 0}"
|
||||
th:with="postItems=${posts.items},list_layout=${theme.config.layout.post_list_layout}"
|
||||
class="grid grid-cols-1 gap-6"
|
||||
th:classappend="|${list_layout == 'grid_3' ? 'md:grid-cols-2 xl:grid-cols-3' : ''} ${list_layout == 'grid_2' ? 'md:grid-cols-2' : ''}|"
|
||||
>
|
||||
<th:block th:each="post : ${postItems}">
|
||||
<th:block
|
||||
th:replace="~{modules/post-card :: post-card(${post},true,true,true,${list_layout == 'single' ? 'column' : 'row'})}"
|
||||
/>
|
||||
</th:block>
|
||||
</div>
|
||||
|
||||
<div th:if="${posts.total == 0}" class="mt-6 flex items-center justify-center">
|
||||
<span class="text-sm font-light text-gray-600 dark:text-slate-200" th:text="#{common.noPosts}"></span>
|
||||
</div>
|
||||
|
||||
<th:block
|
||||
th:replace="~{modules/pagination :: pagination(context = |${author.status.permalink}/|, prevUrl = ${posts.prevUrl}, nextUrl = ${posts.nextUrl}, totalPages = ${posts.totalPages}, page = ${posts.page}, hasPrevious = ${posts.hasPrevious()}, hasNext = ${posts.hasNext()})}"
|
||||
/>
|
||||
</th:block>
|
||||
</html>
|
||||
41
templates/categories.html
Normal file
41
templates/categories.html
Normal file
@ -0,0 +1,41 @@
|
||||
<!doctype html>
|
||||
<html
|
||||
xmlns:th="https://www.thymeleaf.org"
|
||||
th:replace="~{modules/layout :: html(title = |#{page.categories.title} - ${site.title}|, hero = null, content = ~{::content}, head = null, footer = null, sidebar = null, contentClass = null)}"
|
||||
>
|
||||
<th:block th:fragment="content">
|
||||
<th:block th:replace="~{modules/category-filter}" />
|
||||
|
||||
<th:block th:with="categories = ${categoryFinder.listAsTree()}">
|
||||
<th:block
|
||||
th:with="posts = ${postFinder.listByCategory(1,10,categories[0].metadata.name)},list_layout=${theme.config.layout.post_list_layout}"
|
||||
>
|
||||
<div
|
||||
id="post-list"
|
||||
th:if="${posts.total gt 0}"
|
||||
class="mt-6 grid grid-cols-1 gap-6"
|
||||
th:classappend="|${list_layout == 'grid_3' ? 'md:grid-cols-2 xl:grid-cols-3' : ''} ${list_layout == 'grid_2' ? 'md:grid-cols-2' : ''}|"
|
||||
>
|
||||
<th:block th:each="post : ${posts.items}">
|
||||
<th:block
|
||||
th:replace="~{modules/post-card :: post-card(${post},true,true,true,${list_layout == 'single' ? 'column' : 'row'})}"
|
||||
/>
|
||||
</th:block>
|
||||
</div>
|
||||
|
||||
<div th:if="${posts.total == 0}" class="mt-6 flex items-center justify-center">
|
||||
<span class="text-sm font-light text-gray-600" th:text="#{common.noPosts}"></span>
|
||||
</div>
|
||||
<div th:if="${posts.total gt 10}" class="mt-10 flex justify-end">
|
||||
<a
|
||||
class="group inline-flex items-center gap-2 truncate text-sm text-gray-600 hover:text-gray-900 dark:text-slate-100 dark:hover:text-slate-200"
|
||||
th:href="@{${categories[0].status.permalink}}"
|
||||
>
|
||||
<span th:text="#{page.tags.morePosts}"></span>
|
||||
<span class="i-tabler-chevron-right -translate-x-1 text-lg transition-all group-hover:translate-x-0"></span>
|
||||
</a>
|
||||
</div>
|
||||
</th:block>
|
||||
</th:block>
|
||||
</th:block>
|
||||
</html>
|
||||
31
templates/category.html
Normal file
31
templates/category.html
Normal file
@ -0,0 +1,31 @@
|
||||
<!doctype html>
|
||||
<html
|
||||
xmlns:th="https://www.thymeleaf.org"
|
||||
th:replace="~{modules/layout :: html(title = |#{page.category.title(${category.spec.displayName})} - ${site.title}|, hero = null, content = ~{::content}, head = null, footer = null, sidebar = null, contentClass = null)}"
|
||||
>
|
||||
<th:block th:fragment="content">
|
||||
<th:block th:replace="~{modules/category-filter}" />
|
||||
|
||||
<div
|
||||
id="post-list"
|
||||
th:if="${posts.total gt 0}"
|
||||
th:with="postItems=${posts.items},list_layout=${theme.config.layout.post_list_layout}"
|
||||
class="mt-6 grid grid-cols-1 gap-6"
|
||||
th:classappend="|${list_layout == 'grid_3' ? 'md:grid-cols-2 xl:grid-cols-3' : ''} ${list_layout == 'grid_2' ? 'md:grid-cols-2' : ''}|"
|
||||
>
|
||||
<th:block th:each="post : ${postItems}">
|
||||
<th:block
|
||||
th:replace="~{modules/post-card :: post-card(${post},true,true,true,${list_layout == 'single' ? 'column' : 'row'})}"
|
||||
/>
|
||||
</th:block>
|
||||
</div>
|
||||
|
||||
<div th:if="${posts.total == 0}" class="mt-6 flex items-center justify-center">
|
||||
<span class="text-sm font-light text-gray-600 dark:text-slate-200" th:text="#{common.noPosts}"></span>
|
||||
</div>
|
||||
|
||||
<th:block
|
||||
th:replace="~{modules/pagination :: pagination(context = |${category.status.permalink}/|, prevUrl = ${posts.prevUrl}, nextUrl = ${posts.nextUrl}, totalPages = ${posts.totalPages}, page = ${posts.page}, hasPrevious = ${posts.hasPrevious()}, hasNext = ${posts.hasNext()})}"
|
||||
/>
|
||||
</th:block>
|
||||
</html>
|
||||
27
templates/error/error.html
Normal file
27
templates/error/error.html
Normal file
@ -0,0 +1,27 @@
|
||||
<!doctype html>
|
||||
<html
|
||||
xmlns:th="https://www.thymeleaf.org"
|
||||
th:replace="~{modules/layout :: html(title = ${error.status} + ' | ' + ${#strings.defaultString(error.title, 'Internal server error')} + ' - ' +${site.title}, hero = null, header = null, content = ~{::content}, head = null, footer = null, sidebar = null, contentClass = null)}"
|
||||
>
|
||||
<th:block th:fragment="content">
|
||||
<section class="flex items-center dark:bg-gray-900 dark:text-gray-100">
|
||||
<div class="container mx-auto my-8 flex flex-col items-center justify-center px-5">
|
||||
<div class="max-w-md text-center">
|
||||
<h2 class="mb-8 text-9xl font-extrabold dark:text-gray-600" th:text="${error.status}"></h2>
|
||||
<p
|
||||
class="mb-8 text-2xl font-semibold md:text-3xl"
|
||||
th:text="${#strings.defaultString(error.title, 'Internal server error')}"
|
||||
></p>
|
||||
<p th:if="${not #strings.isEmpty(error.detail)}" class="mb-8 text-gray-500" th:text="${error.detail}"></p>
|
||||
<a
|
||||
th:href="@{${site.url}}"
|
||||
class="whitespace-no-wrap group inline-flex items-center justify-center gap-1 rounded-md border border-gray-200 bg-white px-4 py-1 text-sm font-medium leading-6 text-gray-600 shadow-sm hover:bg-gray-50 focus:shadow-none focus:outline-none dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:hover:bg-slate-600 dark:hover:text-white"
|
||||
>
|
||||
<span class="i-tabler-arrow-left text-lg transition-all group-hover:-translate-x-1"></span>
|
||||
<span th:text="#{page.error.backToHome}"></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</th:block>
|
||||
</html>
|
||||
31
templates/index.html
Normal file
31
templates/index.html
Normal file
@ -0,0 +1,31 @@
|
||||
<!doctype html>
|
||||
<html
|
||||
xmlns:th="https://www.thymeleaf.org"
|
||||
th:replace="~{modules/layout :: html(title = ${site.title}, hero = null, content = ~{::content}, head = null, footer = null, sidebar = null, contentClass = null)}"
|
||||
>
|
||||
<th:block th:fragment="content">
|
||||
<th:block th:replace="~{modules/category-filter}" />
|
||||
|
||||
<div
|
||||
id="post-list"
|
||||
th:if="${posts.total gt 0}"
|
||||
th:with="postItems=${posts.items},list_layout=${theme.config.layout.post_list_layout}"
|
||||
class="mt-6 grid grid-cols-1 gap-6"
|
||||
th:classappend="|${list_layout == 'grid_3' ? 'md:grid-cols-2 xl:grid-cols-3' : ''} ${list_layout == 'grid_2' ? 'md:grid-cols-2' : ''}|"
|
||||
>
|
||||
<th:block th:each="post : ${postItems}">
|
||||
<th:block
|
||||
th:replace="~{modules/post-card :: post-card(${post},true,true,true,${list_layout == 'single' ? 'column' : 'row'})}"
|
||||
/>
|
||||
</th:block>
|
||||
</div>
|
||||
|
||||
<div th:if="${posts.total == 0}" class="mt-6 flex items-center justify-center">
|
||||
<span class="text-sm font-light text-gray-600" th:text="#{common.noPosts}"></span>
|
||||
</div>
|
||||
|
||||
<th:block
|
||||
th:replace="~{modules/pagination :: pagination(context = '/', prevUrl = ${posts.prevUrl}, nextUrl = ${posts.nextUrl}, totalPages = ${posts.totalPages}, page = ${posts.page}, hasPrevious = ${posts.hasPrevious()}, hasNext = ${posts.hasNext()})}"
|
||||
/>
|
||||
</th:block>
|
||||
</html>
|
||||
43
templates/links.html
Normal file
43
templates/links.html
Normal file
@ -0,0 +1,43 @@
|
||||
<!doctype html>
|
||||
<html
|
||||
xmlns:th="https://www.thymeleaf.org"
|
||||
th:replace="~{modules/layout :: html(title = |#{page.links.title} - ${site.title}|, hero = null, content = ~{::content}, head = null, footer = null, sidebar = null, contentClass = '')}"
|
||||
>
|
||||
<th:block th:fragment="content">
|
||||
<div class="rounded-xl bg-white p-4 dark:bg-slate-800">
|
||||
<h1 class="mb-3 text-2xl font-medium dark:text-slate-50" th:text="#{page.links.title}"></h1>
|
||||
<div class="flex flex-col gap-4">
|
||||
<th:block th:each="group : ${groups}">
|
||||
<h2 class="mt-2 text-lg font-medium dark:text-slate-50" th:text="${group.spec.displayName}"></h2>
|
||||
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
|
||||
<a th:each="link : ${group.links}" th:href="${link.spec.url}" target="_blank">
|
||||
<div
|
||||
class="relative flex items-center space-x-3 rounded border border-gray-300 bg-white px-5 py-4 shadow-sm hover:border-gray-400 hover:shadow dark:border-slate-600 dark:bg-slate-700 dark:hover:border-slate-700"
|
||||
>
|
||||
<div class="flex-shrink-0">
|
||||
<img class="size-12 rounded-full" th:src="${link.spec.logo}" th:alt="${link.spec.displayName}" />
|
||||
</div>
|
||||
<div class="min-w-0 flex-1">
|
||||
<div>
|
||||
<p
|
||||
class="truncate text-sm font-medium text-gray-900 dark:text-slate-100"
|
||||
th:text="${link.spec.displayName}"
|
||||
></p>
|
||||
<p
|
||||
class="truncate text-sm text-gray-500 dark:text-slate-400"
|
||||
th:text="${link.spec.description}"
|
||||
></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</th:block>
|
||||
</div>
|
||||
<hr th:if="${haloCommentEnabled}" class="my-10 dark:border-slate-700" />
|
||||
<div th:if="${haloCommentEnabled}">
|
||||
<halo:comment group="plugin.halo.run" kind="Plugin" th:attr="name=${pluginName}" />
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
</html>
|
||||
59
templates/modules/category-filter.html
Normal file
59
templates/modules/category-filter.html
Normal file
@ -0,0 +1,59 @@
|
||||
<ul id="filters" class="flex flex-wrap gap-2">
|
||||
<li>
|
||||
<a
|
||||
href="/"
|
||||
class="inline-flex h-9 cursor-pointer items-center rounded px-3 font-medium text-gray-500 transition-all hover:bg-gray-100 hover:text-gray-900 hover:shadow-sm dark:text-slate-200 dark:hover:bg-slate-700 dark:hover:text-slate-50"
|
||||
th:classappend="${_templateId == 'index'} ? '!text-gray-900 !bg-gray-100 dark:!bg-slate-700 dark:!text-slate-50'"
|
||||
>
|
||||
<span class="truncate text-base" th:text="#{common.all}"> </span>
|
||||
</a>
|
||||
</li>
|
||||
<th:block th:with="categories = ${categoryFinder.listAsTree()}">
|
||||
<li
|
||||
x-data="dropdown"
|
||||
@mouseenter="open()"
|
||||
@mouseleave="close()"
|
||||
class="relative cursor-pointer transition-all"
|
||||
th:each="categoryItem,categoryStat : ${categories}"
|
||||
>
|
||||
<div
|
||||
class="group inline-flex h-9 cursor-pointer items-center gap-1 overflow-hidden rounded font-medium text-gray-500 transition-all hover:bg-gray-100 hover:text-gray-900 hover:shadow-sm dark:text-slate-200 dark:hover:bg-slate-700 dark:hover:text-slate-50"
|
||||
th:classappend="(${category} and ${category.metadata.name == categoryItem.metadata.name}) or (not ${category} and ${categoryStat.index == 0} and ${_templateId == 'categories'}) ? '!text-gray-900 !bg-gray-100 dark:!bg-slate-700 dark:!text-slate-50'"
|
||||
>
|
||||
<a
|
||||
class="truncate px-3 text-base"
|
||||
th:href="@{${categoryItem.status.permalink}}"
|
||||
th:text="${categoryItem.spec.displayName}"
|
||||
th:classappend="${#lists.isEmpty(categoryItem.children) ? '' : '!pr-1'}"
|
||||
>
|
||||
</a>
|
||||
<button
|
||||
th:if="${not #lists.isEmpty(categoryItem.children)}"
|
||||
@click="open()"
|
||||
class="h-full px-2 text-lg group-hover:bg-gray-200 dark:group-hover:bg-slate-600"
|
||||
>
|
||||
<span
|
||||
class="i-tabler-chevron-right block transition-all duration-300"
|
||||
x-bind:class="show ? 'rotate-90' : ''"
|
||||
></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<ul
|
||||
th:if="${not #lists.isEmpty(categoryItem.children)}"
|
||||
@mouseenter="open()"
|
||||
@mouseleave="close()"
|
||||
x-show="show"
|
||||
x-transition:enter="transition ease-out duration-100"
|
||||
x-transition:enter-start="transform opacity-0 scale-95"
|
||||
x-transition:enter-end="transform opacity-100 scale-100"
|
||||
x-transition:leave="transition ease-in duration-75"
|
||||
x-transition:leave-start="transform opacity-100 scale-100"
|
||||
x-transition:leave-end="transform opacity-0 scale-95"
|
||||
class="absolute left-0 z-10 mt-2 w-60 overflow-hidden rounded bg-white p-2 shadow dark:bg-slate-800"
|
||||
>
|
||||
<li th:replace="~{modules/category-tree :: single(categories=${categoryItem.children})}" />
|
||||
</ul>
|
||||
</li>
|
||||
</th:block>
|
||||
</ul>
|
||||
19
templates/modules/category-tree.html
Normal file
19
templates/modules/category-tree.html
Normal file
@ -0,0 +1,19 @@
|
||||
<ul th:fragment="next (categories)" class="my-3 ml-3 space-y-1 border-l pl-2 dark:border-slate-700">
|
||||
<li th:fragment="single (categories)" th:each="category : ${categories}">
|
||||
<a
|
||||
th:href="@{${category.status.permalink}}"
|
||||
th:title="${category.spec.displayName}"
|
||||
class="group flex items-center justify-between rounded px-2 py-1 transition-all hover:bg-gray-100 dark:hover:bg-slate-700"
|
||||
>
|
||||
<span class="text-sm opacity-80 dark:text-slate-50" th:text="${category.spec.displayName}"> </span>
|
||||
<span
|
||||
class="rounded bg-gray-100 px-1 py-0.5 text-xs tabular-nums opacity-70 group-hover:bg-white dark:bg-slate-600 dark:text-slate-50 dark:group-hover:bg-slate-500"
|
||||
th:text="${category.postCount ?: 0}"
|
||||
>
|
||||
</span>
|
||||
</a>
|
||||
<th:block th:if="${not #lists.isEmpty(category.children)}">
|
||||
<th:block th:replace="~{modules/category-tree :: next (categories=${category.children})}"></th:block>
|
||||
</th:block>
|
||||
</li>
|
||||
</ul>
|
||||
72
templates/modules/featured-post-card.html
Normal file
72
templates/modules/featured-post-card.html
Normal file
@ -0,0 +1,72 @@
|
||||
<div
|
||||
th:fragment="featured-post-card(post)"
|
||||
class="group grid cursor-pointer grid-cols-1 overflow-hidden rounded-xl bg-white shadow-md transition-all duration-500 hover:shadow-lg dark:bg-slate-800 sm:grid-cols-5"
|
||||
>
|
||||
<div th:if="${not #strings.isEmpty(post.spec.cover)}" class="aspect-h-9 aspect-w-16 col-span-3">
|
||||
<a th:href="@{${post.status.permalink}}" th:title="${post.spec.title}">
|
||||
<img
|
||||
th:src="${post.spec.cover}"
|
||||
th:alt="${post.spec.title}"
|
||||
th:srcset="|${thumbnail.gen(post.spec.cover, 's')} 400w,
|
||||
${thumbnail.gen(post.spec.cover, 'm')} 800w,
|
||||
${thumbnail.gen(post.spec.cover, 'l')} 1200w,
|
||||
${thumbnail.gen(post.spec.cover, 'xl')} 1600w|"
|
||||
sizes="(max-width: 1600px) 100vw, 1600px"
|
||||
class="size-full object-cover transition-all duration-500"
|
||||
/>
|
||||
</a>
|
||||
</div>
|
||||
<div class="relative col-span-2 grid h-full grid-cols-1 content-between gap-2 p-4">
|
||||
<div class="space-y-2">
|
||||
<div
|
||||
th:if="${not #lists.isEmpty(post.categories)} or ${not #lists.isEmpty(post.tags)}"
|
||||
class="flex flex-wrap items-center gap-2"
|
||||
>
|
||||
<a
|
||||
th:if="${#lists.size(post.categories)} gt 0"
|
||||
th:href="@{${post.categories[0].status.permalink}}"
|
||||
th:title="${post.categories[0].spec.displayName}"
|
||||
th:text="${post.categories[0].spec.displayName}"
|
||||
class="mr-1 text-sm font-medium text-gray-800 hover:text-gray-900 dark:text-slate-500 dark:hover:text-slate-600"
|
||||
>
|
||||
</a>
|
||||
<a
|
||||
th:each="tag : ${post.tags}"
|
||||
th:href="@{${tag.status.permalink}}"
|
||||
th:title="${tag.spec.displayName}"
|
||||
th:text="|#${tag.spec.displayName}|"
|
||||
class="cursor-pointer text-sm italic text-gray-600 hover:text-gray-900 dark:text-slate-400 dark:hover:text-slate-500"
|
||||
>
|
||||
</a>
|
||||
</div>
|
||||
<h1
|
||||
class="line-clamp-2 cursor-pointer text-2xl font-medium transition-all hover:text-gray-500 hover:underline dark:text-slate-50 dark:hover:text-white"
|
||||
>
|
||||
<a th:href="@{${post.status.permalink}}" th:text="${post.spec.title}"></a>
|
||||
</h1>
|
||||
<p class="font-sm line-clamp-6 font-light dark:text-slate-200" th:text="${post.status.excerpt}"></p>
|
||||
</div>
|
||||
<div class="mt-4 flex items-center justify-start gap-2">
|
||||
<a th:href="@{${post.owner.permalink}}" th:title="${post.owner.displayName}">
|
||||
<img
|
||||
th:src="${post.owner.avatar ?: #theme.assets('/images/default-avatar.svg')}"
|
||||
th:title="${post.owner.displayName}"
|
||||
th:alt="${post.owner.displayName}"
|
||||
class="size-8 rounded-full border drop-shadow-sm dark:border-slate-700"
|
||||
/>
|
||||
</a>
|
||||
<a
|
||||
th:href="@{${post.owner.permalink}}"
|
||||
th:title="${post.owner.displayName}"
|
||||
class="text-sm font-medium text-gray-900 hover:text-gray-600 dark:text-slate-100 dark:hover:text-slate-200"
|
||||
th:if="${#strings.isEmpty(post.owner.avatar)}"
|
||||
th:text="${post.owner.displayName}"
|
||||
></a>
|
||||
<span
|
||||
class="text-sm tabular-nums text-gray-600 dark:text-slate-300"
|
||||
th:text="#{common.publishedOn(${#dates.format(post.spec.publishTime,'yyyy-MM-dd')})}"
|
||||
>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
22
templates/modules/footer-social.html
Normal file
22
templates/modules/footer-social.html
Normal file
@ -0,0 +1,22 @@
|
||||
<th:block th:with="social_media = ${theme.config.footer.social_media}">
|
||||
<div th:unless="${#lists.isEmpty(social_media)}" class="mt-4 flex justify-center space-x-6 sm:mt-0">
|
||||
<th:block th:each="item : ${social_media}">
|
||||
<a
|
||||
th:if="${item.url_type == 'normal'}"
|
||||
th:href="${item.url}"
|
||||
class="text-gray-500 hover:text-gray-900 dark:hover:text-white"
|
||||
th:title="${item.name}"
|
||||
>
|
||||
<div th:classappend="${item.icon}" class="size-5"></div>
|
||||
</a>
|
||||
<span
|
||||
th:if="${item.url_type == 'image'}"
|
||||
th:attr="x-data=|{openImageModal:false,image: '${item.url}', alt: '${item.name}'}|"
|
||||
class="cursor-pointer text-gray-500 hover:text-gray-900 dark:hover:text-white"
|
||||
>
|
||||
<div th:classappend="${item.icon}" class="size-5" @click="openImageModal = true"></div>
|
||||
<th:block th:replace="~{modules/image-view-modal}" />
|
||||
</span>
|
||||
</th:block>
|
||||
</div>
|
||||
</th:block>
|
||||
193
templates/modules/footer.html
Normal file
193
templates/modules/footer.html
Normal file
@ -0,0 +1,193 @@
|
||||
<footer th:if="${theme.config.footer.style == 'style_1'}" class="mt-10 bg-white py-8 dark:bg-slate-800">
|
||||
<div class="mx-auto max-w-7xl px-4 sm:flex sm:items-center sm:justify-between lg:px-6">
|
||||
<a href="/" class="mb-4 flex items-center justify-center sm:mb-0 sm:justify-start">
|
||||
<img
|
||||
th:if="${not #strings.isEmpty(theme.config.footer.logo)} or ${not #strings.isEmpty(site.logo)}"
|
||||
th:src="${theme.config.footer.logo ?: site.logo}"
|
||||
class="mr-3 size-8"
|
||||
th:alt="${site.title}"
|
||||
/>
|
||||
<span
|
||||
class="self-center whitespace-nowrap text-2xl font-semibold dark:text-slate-50"
|
||||
th:text="${theme.config.footer.title ?: site.title}"
|
||||
>
|
||||
</span>
|
||||
</a>
|
||||
<th:block
|
||||
th:unless="${#strings.isEmpty(theme.config.footer.right_menu)} and ${#strings.isEmpty(theme.config.footer.menu)}"
|
||||
>
|
||||
<ul
|
||||
th:with="menu = ${menuFinder.getByName(theme.config.footer.right_menu ?: theme.config.footer.menu)}"
|
||||
class="mb-6 flex flex-wrap items-center justify-center space-x-4 text-sm text-gray-500 dark:text-slate-200 sm:mb-0 sm:justify-start md:space-x-6"
|
||||
>
|
||||
<li th:each="menuItem : ${menu.menuItems}">
|
||||
<a
|
||||
th:href="@{${menuItem.status.href}}"
|
||||
class="transition-all hover:text-gray-900 hover:underline dark:hover:text-white"
|
||||
th:text="${menuItem.status.displayName}"
|
||||
th:target="${menuItem.spec.target?.value}"
|
||||
></a>
|
||||
</li>
|
||||
</ul>
|
||||
</th:block>
|
||||
|
||||
<th:block th:replace="~{modules/footer-social}" />
|
||||
</div>
|
||||
<hr class="my-6 border-gray-100 dark:border-slate-700 sm:mx-auto lg:my-8" />
|
||||
<div class="space-y-1">
|
||||
<span
|
||||
class="mx-auto block max-w-7xl px-4 text-center text-sm text-gray-500 dark:text-slate-300 lg:px-6"
|
||||
th:if="${not #strings.isEmpty(theme.config.beian.icp_text)}"
|
||||
>
|
||||
<a
|
||||
href="https://beian.miit.gov.cn/"
|
||||
class="hover:underline"
|
||||
target="_blank"
|
||||
th:href="${theme.config.beian.icp_link}"
|
||||
th:text="${theme.config.beian.icp_text}"
|
||||
></a>
|
||||
</span>
|
||||
<div
|
||||
th:if="${not #strings.isEmpty(theme.config.beian.gongan_text)}"
|
||||
class="mx-auto block max-w-7xl px-4 text-center text-sm text-gray-500 dark:text-slate-300 lg:px-6"
|
||||
>
|
||||
<p class="flex items-center justify-center gap-1">
|
||||
<img th:src="@{/assets/images/gongan_beian.png}" class="size-4" alt="gongan_beian" />
|
||||
<a
|
||||
href="https://beian.mps.gov.cn/#/query/webSearch"
|
||||
class="hover:underline"
|
||||
target="_blank"
|
||||
th:href="${theme.config.beian.gongan_link}"
|
||||
th:text="${theme.config.beian.gongan_text}"
|
||||
></a>
|
||||
</p>
|
||||
</div>
|
||||
<span class="mx-auto block max-w-7xl px-4 text-center text-sm text-gray-500 dark:text-slate-300 lg:px-6">
|
||||
©
|
||||
<th:block th:text="${#dates.format(new java.util.Date().getTime(), 'yyyy')}" />
|
||||
<a href="/" class="hover:underline" th:text="${site.title}"></a>. All Rights Reserved. Powered by
|
||||
<a href="https://halo.run" class="hover:underline" target="_blank">Halo</a>.
|
||||
</span>
|
||||
<span class="mx-auto block max-w-7xl px-4 text-center text-sm text-gray-500 dark:text-slate-300 lg:px-6">
|
||||
<halo:footer />
|
||||
</span>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<footer th:if="${theme.config.footer.style == 'style_2'}" class="mt-10 bg-white py-8 dark:bg-slate-800">
|
||||
<div class="mx-auto max-w-7xl px-4 md:flex md:justify-between md:gap-10 lg:px-6">
|
||||
<div class="mb-6 max-w-full md:mb-0 md:max-w-md">
|
||||
<a href="/" class="mb-6 flex items-center">
|
||||
<img
|
||||
th:if="${not #strings.isEmpty(theme.config.footer.logo)} or ${not #strings.isEmpty(site.logo)}"
|
||||
th:src="${theme.config.footer.logo ?: site.logo}"
|
||||
class="mr-3 h-8"
|
||||
th:alt="${site.title}"
|
||||
/>
|
||||
<span
|
||||
class="self-center whitespace-nowrap text-2xl font-semibold dark:text-slate-50"
|
||||
th:text="${theme.config.footer.title ?: site.title}"
|
||||
></span>
|
||||
</a>
|
||||
<span
|
||||
th:if="${not #strings.isEmpty(theme.config.footer.slogan)}"
|
||||
class="text-sm font-light text-gray-600 dark:text-slate-200"
|
||||
th:text="${theme.config.footer.slogan}"
|
||||
>
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
th:unless="${#lists.isEmpty(theme.config.footer.menu_names)}"
|
||||
class="grid grid-cols-2 gap-8 sm:grid-cols-4 sm:gap-12"
|
||||
>
|
||||
<th:block th:each="name : ${theme.config.footer.menu_names}">
|
||||
<div th:with="menu = ${menuFinder.getByName(name)}">
|
||||
<h2
|
||||
class="mb-6 text-sm font-semibold text-gray-900 dark:text-slate-50"
|
||||
th:text="${menu.spec.displayName}"
|
||||
></h2>
|
||||
<ul th:with="menuItems = ${menu.menuItems}" class="text-sm text-gray-500 dark:text-slate-200">
|
||||
<li th:each="menuItem : ${menuItems}" class="mb-4">
|
||||
<a
|
||||
th:href="@{${menuItem.status.href}}"
|
||||
class="transition-all hover:text-gray-900 hover:underline dark:hover:text-white"
|
||||
th:text="${menuItem.status.displayName}"
|
||||
th:target="${menuItem.spec.target?.value}"
|
||||
></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</th:block>
|
||||
</div>
|
||||
|
||||
<!--/*Compatibility solution, will be removed in the future*/-->
|
||||
<div
|
||||
th:if="${#lists.isEmpty(theme.config.footer.menu_names)} and ${not #lists.isEmpty(theme.config.footer.menus)}"
|
||||
class="grid grid-cols-2 gap-8 sm:grid-cols-4 sm:gap-12"
|
||||
>
|
||||
<th:block th:each="menuName : ${theme.config.footer.menus}">
|
||||
<div th:with="menu = ${menuFinder.getByName(menuName.name)}">
|
||||
<h2
|
||||
class="mb-6 text-sm font-semibold text-gray-900 dark:text-slate-50"
|
||||
th:text="${menu.spec.displayName}"
|
||||
></h2>
|
||||
<ul th:with="menuItems = ${menu.menuItems}" class="text-sm text-gray-500 dark:text-slate-200">
|
||||
<li th:each="menuItem : ${menuItems}" class="mb-4">
|
||||
<a
|
||||
th:href="@{${menuItem.status.href}}"
|
||||
class="transition-all hover:text-gray-900 hover:underline dark:hover:text-white"
|
||||
th:text="${menuItem.status.displayName}"
|
||||
th:target="${menuItem.spec.target?.value}"
|
||||
></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</th:block>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="my-6 border-gray-200 dark:border-slate-700 sm:mx-auto lg:my-8" />
|
||||
<div class="mx-auto flex max-w-7xl flex-col px-4 sm:flex-row sm:items-center sm:justify-between lg:px-6">
|
||||
<div class="flex flex-col space-y-1 text-center sm:text-left">
|
||||
<span class="text-sm text-gray-500 dark:text-slate-300 sm:text-center">
|
||||
©
|
||||
<th:block th:text="${#dates.format(new java.util.Date().getTime(), 'yyyy')}" />
|
||||
<a href="/" class="hover:underline" th:text="${site.title}"></a>. All Rights Reserved. Powered by
|
||||
<a href="https://halo.run" class="hover:underline" target="_blank">Halo</a>.
|
||||
</span>
|
||||
|
||||
<div class="flex flex-col gap-1 sm:flex-row">
|
||||
<span
|
||||
class="block text-center text-sm text-gray-500 sm:text-left"
|
||||
th:if="${not #strings.isEmpty(theme.config.beian.icp_text)}"
|
||||
>
|
||||
<a
|
||||
href="https://beian.miit.gov.cn/"
|
||||
class="hover:underline"
|
||||
target="_blank"
|
||||
th:href="${theme.config.beian.icp_link}"
|
||||
th:text="${theme.config.beian.icp_text}"
|
||||
></a>
|
||||
</span>
|
||||
<div
|
||||
th:if="${not #strings.isEmpty(theme.config.beian.gongan_text)}"
|
||||
class="inline-flex items-center justify-center gap-1 text-sm text-gray-500 sm:justify-start"
|
||||
>
|
||||
<img th:src="@{/assets/images/gongan_beian.png}" class="size-4" alt="gongan_beian" />
|
||||
<a
|
||||
href="https://beian.mps.gov.cn/#/query/webSearch"
|
||||
class="hover:underline"
|
||||
target="_blank"
|
||||
th:href="${theme.config.beian.gongan_link}"
|
||||
th:text="${theme.config.beian.gongan_text}"
|
||||
></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="text-sm text-gray-500 dark:text-slate-300">
|
||||
<halo:footer />
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<th:block th:replace="~{modules/footer-social}" />
|
||||
</div>
|
||||
</footer>
|
||||
242
templates/modules/header.html
Normal file
242
templates/modules/header.html
Normal file
@ -0,0 +1,242 @@
|
||||
<header
|
||||
id="header-menu"
|
||||
class="sticky top-0 z-10 flex h-16 bg-white py-3 shadow-sm transition-all dark:bg-gray-800"
|
||||
x-data="{ open : false }"
|
||||
th:with="menu = ${menuFinder.getPrimary()}"
|
||||
>
|
||||
<div class="mx-auto flex h-full w-full max-w-7xl justify-between px-4 lg:px-6">
|
||||
<div class="flex h-full items-center gap-6">
|
||||
<div class="mr-2 h-full">
|
||||
<a href="/" class="inline-flex h-full items-center">
|
||||
<img
|
||||
th:if="${theme.config.global.logo_type == 'image'} and ${not #strings.isEmpty(site.logo)}"
|
||||
th:src="${site.logo}"
|
||||
th:alt="Logo"
|
||||
class="h-full w-auto"
|
||||
/>
|
||||
<span
|
||||
th:if="${theme.config.global.logo_type == 'text'} or ${#strings.isEmpty(site.logo)}"
|
||||
id="site-title"
|
||||
class="text-lg font-medium text-gray-900 dark:text-slate-100"
|
||||
th:text="${site.title}"
|
||||
></span>
|
||||
</a>
|
||||
</div>
|
||||
<ul th:if="${menu != null} and ${not #lists.isEmpty(menu.menuItems)}" class="hidden items-center gap-8 sm:flex">
|
||||
<li
|
||||
th:each="menuItem : ${menu.menuItems}"
|
||||
class="relative cursor-pointer text-sm font-medium transition-all"
|
||||
x-data="dropdown"
|
||||
@mouseenter="open()"
|
||||
@mouseleave="close()"
|
||||
>
|
||||
<a
|
||||
class="text-gray-600 hover:text-blue-600 dark:text-slate-50 dark:hover:text-gray-300"
|
||||
th:href="@{${menuItem.status.href}}"
|
||||
th:text="${menuItem.status.displayName}"
|
||||
th:target="${menuItem.spec.target?.value}"
|
||||
></a>
|
||||
<ul
|
||||
th:if="${not #lists.isEmpty(menuItem.children)}"
|
||||
@mouseenter="open()"
|
||||
@mouseleave="close()"
|
||||
x-show="show"
|
||||
x-transition:enter="transition ease-out duration-100"
|
||||
x-transition:enter-start="transform opacity-0 scale-95"
|
||||
x-transition:enter-end="transform opacity-100 scale-100"
|
||||
x-transition:leave="transition ease-in duration-75"
|
||||
x-transition:leave-start="transform opacity-100 scale-100"
|
||||
x-transition:leave-end="transform opacity-0 scale-95"
|
||||
class="menu-dropdown absolute left-0 z-10 mt-2 w-40 divide-y divide-gray-50 overflow-hidden rounded bg-white shadow dark:divide-slate-600 dark:bg-slate-700"
|
||||
>
|
||||
<li
|
||||
th:each="childMenuItem : ${menuItem.children}"
|
||||
class="flex w-full items-center text-left text-sm hover:bg-gray-50 dark:hover:bg-slate-600"
|
||||
>
|
||||
<a
|
||||
class="size-full truncate px-4 py-2 text-gray-600 hover:text-blue-600 dark:text-slate-50 dark:hover:text-gray-300"
|
||||
th:href="@{${childMenuItem.status.href}}"
|
||||
th:text="${childMenuItem.status.displayName}"
|
||||
th:target="${childMenuItem.spec.target?.value}"
|
||||
></a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<ul x-data="colorSchemeSwitcher" class="flex items-center gap-4">
|
||||
<li class="sm:hidden" x-on:click="open = true">
|
||||
<div class="i-tabler-menu-2 text-lg text-gray-600 hover:text-blue-600 dark:text-slate-100"></div>
|
||||
</li>
|
||||
<li
|
||||
th:if="${theme.config.style.enable_change_color_scheme}"
|
||||
x-data="dropdown"
|
||||
class="relative cursor-pointer transition-all"
|
||||
@mouseenter="open()"
|
||||
@mouseleave="close()"
|
||||
>
|
||||
<div
|
||||
class="cursor-pointer text-lg text-gray-600 transition-all hover:text-blue-600 dark:text-slate-100"
|
||||
:class="colorScheme.icon"
|
||||
></div>
|
||||
<ul
|
||||
@mouseenter="open()"
|
||||
@mouseleave="close()"
|
||||
x-show="show"
|
||||
x-transition:enter="transition ease-out duration-100"
|
||||
x-transition:enter-start="transform opacity-0 scale-95"
|
||||
x-transition:enter-end="transform opacity-100 scale-100"
|
||||
x-transition:leave="transition ease-in duration-75"
|
||||
x-transition:leave-start="transform opacity-100 scale-100"
|
||||
x-transition:leave-end="transform opacity-0 scale-95"
|
||||
class="absolute right-0 z-10 mt-2 w-40 divide-y divide-gray-50 overflow-hidden rounded bg-white shadow dark:divide-slate-600 dark:bg-slate-700"
|
||||
>
|
||||
<template x-for="colorScheme in colorSchemes">
|
||||
<li
|
||||
class="flex w-full items-center gap-2 px-4 py-2 text-sm text-gray-600 hover:bg-gray-50 hover:text-blue-600 dark:text-slate-50 dark:hover:bg-slate-600 dark:hover:text-gray-300"
|
||||
@click="[main.setColorScheme(colorScheme.value,true),currentValue = colorScheme.value]"
|
||||
>
|
||||
<span :class="colorScheme.icon"></span>
|
||||
<span x-text="colorScheme.label"></span>
|
||||
</li>
|
||||
</template>
|
||||
</ul>
|
||||
</li>
|
||||
<!-- https://github.com/halo-sigs/plugin-search-widget -->
|
||||
<li th:if="${pluginFinder.available('PluginSearchWidget')}">
|
||||
<a
|
||||
href="javascript:SearchWidget.open()"
|
||||
th:title="#{fragment.header.search}"
|
||||
class="text-gray-600 hover:text-blue-600 dark:text-slate-100"
|
||||
>
|
||||
<div class="i-tabler-search text-lg"></div>
|
||||
</a>
|
||||
</li>
|
||||
<li
|
||||
x-data="dropdown"
|
||||
class="relative cursor-pointer transition-all"
|
||||
th:with="currentUser = ${contributorFinder.getContributor(#authentication.name)}"
|
||||
@mouseenter="open()"
|
||||
@mouseleave="close()"
|
||||
>
|
||||
<div>
|
||||
<div class="size-5 text-gray-600 hover:text-blue-600 dark:text-slate-100">
|
||||
<img
|
||||
class="size-5 rounded-full"
|
||||
th:src="${currentUser.avatar ?: #theme.assets('/images/default-avatar.svg')}"
|
||||
th:alt="${currentUser.displayName}"
|
||||
/>
|
||||
</div>
|
||||
<ul
|
||||
@mouseenter="open()"
|
||||
@mouseleave="close()"
|
||||
x-show="show"
|
||||
x-transition:enter="transition ease-out duration-100"
|
||||
x-transition:enter-start="transform opacity-0 scale-95"
|
||||
x-transition:enter-end="transform opacity-100 scale-100"
|
||||
x-transition:leave="transition ease-in duration-75"
|
||||
x-transition:leave-start="transform opacity-100 scale-100"
|
||||
x-transition:leave-end="transform opacity-0 scale-95"
|
||||
class="absolute right-0 z-10 mt-2 w-40 divide-y divide-gray-50 overflow-hidden rounded bg-white shadow dark:divide-slate-600 dark:bg-slate-700"
|
||||
>
|
||||
<li
|
||||
sec:authorize="isAuthenticated()"
|
||||
class="flex w-full items-center text-left text-sm hover:bg-gray-50 dark:hover:bg-slate-600"
|
||||
>
|
||||
<a
|
||||
class="size-full truncate px-4 py-2 text-gray-600 hover:text-blue-600 dark:text-slate-50 dark:hover:text-gray-300"
|
||||
href="/console"
|
||||
target="_blank"
|
||||
th:text="#{fragment.header.console}"
|
||||
>
|
||||
</a>
|
||||
</li>
|
||||
<li
|
||||
sec:authorize="isAuthenticated()"
|
||||
class="flex w-full items-center text-left text-sm hover:bg-gray-50 dark:hover:bg-slate-600"
|
||||
>
|
||||
<a
|
||||
class="size-full truncate px-4 py-2 text-gray-600 hover:text-blue-600 dark:text-slate-50 dark:hover:text-gray-300"
|
||||
href="/logout"
|
||||
th:text="#{fragment.header.logout}"
|
||||
>
|
||||
</a>
|
||||
</li>
|
||||
<li
|
||||
sec:authorize="isAnonymous()"
|
||||
class="flex w-full items-center text-left text-sm hover:bg-gray-50 dark:hover:bg-slate-600"
|
||||
>
|
||||
<a
|
||||
class="size-full truncate px-4 py-2 text-gray-600 hover:text-blue-600 dark:text-slate-50 dark:hover:text-gray-300"
|
||||
href="/login"
|
||||
onclick="this.href = '/login?redirect_uri=' + encodeURIComponent(window.location.href)"
|
||||
th:text="#{fragment.header.login}"
|
||||
>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div th:if="${menu != null} and ${not #lists.isEmpty(menu.menuItems)}">
|
||||
<div
|
||||
class="fixed inset-0 z-50 bg-gray-800/40 opacity-100 backdrop-blur-sm dark:bg-black/80"
|
||||
aria-hidden="true"
|
||||
x-show="open"
|
||||
x-transition:enter="ease-in-out duration-300"
|
||||
x-transition:enter-start="opacity-0"
|
||||
x-transition:enter-end="opacity-100"
|
||||
x-transition:leave="ease-in-out duration-300"
|
||||
x-transition:leave-start="opacity-100"
|
||||
x-transition:leave-end="opacity-0"
|
||||
></div>
|
||||
<div
|
||||
class="fixed inset-x-4 top-8 z-50 origin-top scale-100 rounded-lg bg-white p-4 dark:bg-slate-900"
|
||||
tabindex="-1"
|
||||
x-show="open"
|
||||
x-transition:enter="ease-out duration-200"
|
||||
x-transition:enter-start="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
||||
x-transition:enter-end="opacity-100 translate-y-0 sm:scale-100"
|
||||
x-transition:leave="ease-in duration-100"
|
||||
x-transition:leave-start="opacity-100 translate-y-0 sm:scale-100"
|
||||
x-transition:leave-end="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
||||
@click.outside="open = false"
|
||||
>
|
||||
<div class="flex flex-row-reverse items-center justify-between">
|
||||
<button
|
||||
class="i-tabler-x p-1 text-xl text-gray-600 dark:text-slate-300"
|
||||
type="button"
|
||||
tabindex="0"
|
||||
@click="open = false"
|
||||
></button>
|
||||
<h2 class="text-sm font-medium text-gray-600 dark:text-slate-300" th:text="#{fragment.header.menu}"></h2>
|
||||
</div>
|
||||
<nav class="mt-6">
|
||||
<ul class="-my-2 divide-y divide-gray-100 text-sm text-gray-800 dark:divide-slate-800 dark:text-slate-100">
|
||||
<li th:each="menuItem : ${menu.menuItems}">
|
||||
<a
|
||||
class="flex items-center justify-between gap-1 py-2"
|
||||
th:href="@{${menuItem.status.href}}"
|
||||
th:target="${menuItem.spec.target?.value}"
|
||||
>
|
||||
<span th:text="${menuItem.status.displayName}"></span>
|
||||
</a>
|
||||
<ul class="divide-y divide-gray-100 dark:divide-slate-800" th:if="${not #lists.isEmpty(menuItem.children)}">
|
||||
<li th:each="childMenuItem : ${menuItem.children}" class="flex w-full items-center text-left text-sm">
|
||||
<a
|
||||
class="size-full truncate px-4 py-2 text-gray-600 dark:text-slate-200"
|
||||
th:href="@{${childMenuItem.status.href}}"
|
||||
th:text="${childMenuItem.status.displayName}"
|
||||
th:target="${childMenuItem.spec.target?.value}"
|
||||
></a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
60
templates/modules/hero.html
Normal file
60
templates/modules/hero.html
Normal file
@ -0,0 +1,60 @@
|
||||
<section th:fragment="hero(isHome, cover, title)">
|
||||
<div
|
||||
th:if="${theme.config.layout.header_widget != 'none'} and ${isHome}"
|
||||
class="bg-cover bg-center bg-no-repeat"
|
||||
th:styleappend="${theme.config.layout.header_background_type == 'image' ? 'background-image: url(' + theme.config.layout.header_background_image + ');' : 'background: ' + theme.config.layout.header_background + ';'}"
|
||||
th:classappend="${theme.config.layout.header_widget == 'site_title' ? 'h-96' : ''}"
|
||||
>
|
||||
<th:block th:switch="${theme.config.layout.header_widget}">
|
||||
<th:block th:case="latest_post" th:with="posts = ${postFinder.list(1,1)}">
|
||||
<div class="mx-auto max-w-7xl px-4 py-6 lg:px-6" th:if="${posts.total gt 0}">
|
||||
<th:block th:replace="~{modules/featured-post-card :: featured-post-card(post=${posts.items[0]})}" />
|
||||
</div>
|
||||
</th:block>
|
||||
<th:block th:case="latest_post_grid" th:with="posts = ${postFinder.list(1,5)}">
|
||||
<div
|
||||
class="mx-auto grid max-w-7xl grid-cols-1 gap-3 px-4 py-6 sm:grid-cols-5 lg:px-6"
|
||||
th:if="${posts.total gt 0}"
|
||||
>
|
||||
<div class="col-span-1 sm:col-span-3">
|
||||
<th:block
|
||||
th:replace="~{modules/post-card :: post-card(post=${posts.items[0]},cover=true,animation=false,border=false,direction='row')}"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-span-1 grid grid-cols-1 gap-3 sm:col-span-2 sm:grid-cols-2">
|
||||
<th:block th:each="post,postStat : ${posts.items}">
|
||||
<th:block th:if="${postStat.index != 0}">
|
||||
<th:block
|
||||
th:replace="~{modules/post-card :: post-card(post=${post},cover=false,animation=false,border=false,direction='row')}"
|
||||
/>
|
||||
</th:block>
|
||||
</th:block>
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
<th:block th:case="site_title">
|
||||
<div class="mx-auto flex h-full max-w-7xl flex-col items-center justify-center gap-3 px-4 py-6 lg:px-6">
|
||||
<span class="text-5xl" th:style="|color:${theme.config.layout.title_color}|" th:text="${site.title}"></span>
|
||||
<span
|
||||
class="text-sm font-light"
|
||||
th:style="|color:${theme.config.layout.title_color}|"
|
||||
th:text="${site.subtitle}"
|
||||
></span>
|
||||
</div>
|
||||
</th:block>
|
||||
</th:block>
|
||||
</div>
|
||||
<th:block th:if="${theme.config.layout.content_header} and ${not #strings.isEmpty(cover)}">
|
||||
<div class="relative">
|
||||
<div
|
||||
class="before:z-1 relative h-96 bg-cover bg-center bg-no-repeat before:absolute before:inset-0 before:bg-black/40"
|
||||
th:style="|background-image: url('${cover}')|"
|
||||
></div>
|
||||
<header
|
||||
class="pattern-header-text absolute top-1/2 mx-auto flex w-full flex-col items-center justify-center gap-3"
|
||||
>
|
||||
<h1 class="text-5xl text-white" th:text="${title}"></h1>
|
||||
</header>
|
||||
</div>
|
||||
</th:block>
|
||||
</section>
|
||||
45
templates/modules/image-view-modal.html
Normal file
45
templates/modules/image-view-modal.html
Normal file
@ -0,0 +1,45 @@
|
||||
<template x-teleport="body">
|
||||
<div>
|
||||
<div
|
||||
class="fixed inset-0 z-50 bg-gray-800/40 opacity-100 backdrop-blur-sm dark:bg-black/80"
|
||||
aria-hidden="true"
|
||||
x-show="openImageModal"
|
||||
x-transition:enter="ease-in-out duration-300"
|
||||
x-transition:enter-start="opacity-0"
|
||||
x-transition:enter-end="opacity-100"
|
||||
x-transition:leave="ease-in-out duration-300"
|
||||
x-transition:leave-start="opacity-100"
|
||||
x-transition:leave-end="opacity-0"
|
||||
></div>
|
||||
<div
|
||||
class="fixed inset-0 z-50 overflow-y-auto"
|
||||
tabindex="-1"
|
||||
x-show="openImageModal"
|
||||
x-transition:enter="ease-out duration-200"
|
||||
x-transition:enter-start="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
||||
x-transition:enter-end="opacity-100 translate-y-0 sm:scale-100"
|
||||
x-transition:leave="ease-in duration-100"
|
||||
x-transition:leave-start="opacity-100 translate-y-0 sm:scale-100"
|
||||
x-transition:leave-end="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
||||
>
|
||||
<div class="flex min-h-full flex-col items-center justify-center p-4 text-center sm:p-0">
|
||||
<div
|
||||
@click.outside="openImageModal = false"
|
||||
class="relative my-4 transform overflow-hidden rounded-lg bg-white px-4 pb-4 pt-5 text-left shadow-xl transition-all dark:bg-slate-800 dark:text-slate-100 sm:my-8 sm:w-full sm:max-w-sm sm:p-6"
|
||||
>
|
||||
<img :src="image" class="w-full" loading="lazy" :alt="alt" />
|
||||
</div>
|
||||
<div>
|
||||
<div
|
||||
@click="openImageModal = false"
|
||||
class="group inline-flex items-center justify-center rounded-full bg-white p-1.5 dark:bg-slate-800"
|
||||
>
|
||||
<i
|
||||
class="i-tabler-x block text-gray-600 hover:text-gray-900 dark:text-slate-100 dark:hover:text-slate-500"
|
||||
></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
69
templates/modules/layout.html
Normal file
69
templates/modules/layout.html
Normal file
@ -0,0 +1,69 @@
|
||||
<!doctype html>
|
||||
<html th:lang="${#locale.toLanguageTag}" th:fragment="html (title,hero,content,head,footer,sidebar,contentClass)">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2" />
|
||||
<title th:text="${title}"></title>
|
||||
<link th:unless="${#strings.isEmpty(site.logo)}" rel="preload" th:href="${site.logo}" as="image" />
|
||||
<link rel="stylesheet" th:href="@{/assets/dist/style.css?v={version}(version=${theme.spec.version})}" />
|
||||
<script th:inline="javascript">
|
||||
window.i18nResources = {
|
||||
"jsModule.colorSchemeSwitcher.dark": `[(#{jsModule.colorSchemeSwitcher.dark})]`,
|
||||
"jsModule.colorSchemeSwitcher.light": `[(#{jsModule.colorSchemeSwitcher.light})]`,
|
||||
"jsModule.colorSchemeSwitcher.auto": `[(#{jsModule.colorSchemeSwitcher.auto})]`,
|
||||
"jsModule.share.qzone": `[(#{jsModule.share.qzone})]`,
|
||||
"jsModule.share.weibo": `[(#{jsModule.share.weibo})]`,
|
||||
"jsModule.share.douban": `[(#{jsModule.share.douban})]`,
|
||||
"jsModule.share.wechat": `[(#{jsModule.share.wechat})]`,
|
||||
"jsModule.share.native": `[(#{jsModule.share.native})]`,
|
||||
"jsModule.share.windowTitle": `[(#{jsModule.share.windowTitle})]`,
|
||||
"jsModule.upvote.networkError": `[(#{jsModule.upvote.networkError})]`,
|
||||
};
|
||||
</script>
|
||||
<script th:src="@{/assets/dist/main.iife.js?v={version}(version=${theme.spec.version})}"></script>
|
||||
<th:block th:if="${head != null}">
|
||||
<th:block th:replace="${head}" />
|
||||
</th:block>
|
||||
<script>
|
||||
main.initColorScheme("[[${theme.config.style.color_scheme}]]",[[${theme.config.style.enable_change_color_scheme}]])
|
||||
</script>
|
||||
</head>
|
||||
<body class="bg-slate-50 dark:bg-slate-900">
|
||||
<th:block th:replace="~{modules/header}" />
|
||||
<th:block th:if="${hero != null}">
|
||||
<th:block th:replace="${hero}" />
|
||||
</th:block>
|
||||
<th:block th:unless="${hero != null}">
|
||||
<th:block th:replace="~{modules/hero :: hero(isHome = true, cover = null, title = null)}" />
|
||||
</th:block>
|
||||
<section
|
||||
class="mx-auto mt-6 grid max-w-7xl grid-cols-1 gap-6 px-4 md:grid-cols-[1fr_18rem] lg:px-6"
|
||||
th:classappend="${contentClass}"
|
||||
>
|
||||
<div class="z-0 min-w-0">
|
||||
<th:block th:replace="${content}" />
|
||||
</div>
|
||||
<th:block th:if="${sidebar != null}">
|
||||
<th:block th:replace="${sidebar}" />
|
||||
</th:block>
|
||||
<th:block th:if="${sidebar == null}">
|
||||
<th:block th:replace="~{modules/sidebar :: sidebar(prepend = null)}" />
|
||||
</th:block>
|
||||
</section>
|
||||
<th:block th:replace="~{modules/footer}" />
|
||||
<th:block th:if="${footer != null}">
|
||||
<th:block th:replace="${footer}" />
|
||||
</th:block>
|
||||
|
||||
<button
|
||||
th:if="${theme.config.global.show_scroll_button}"
|
||||
type="button"
|
||||
id="btn-scroll-to-top"
|
||||
th:aria-label="#{fragment.layout.toTop}"
|
||||
class="fixed bottom-5 right-5 flex items-center justify-center rounded-full bg-white p-3 opacity-0 shadow transition-all duration-300 hover:opacity-70 hover:shadow-lg dark:bg-slate-600 lg:bottom-10 lg:right-10"
|
||||
>
|
||||
<span class="i-tabler-chevron-up text-2xl text-gray-600 dark:text-slate-200"></span>
|
||||
</button>
|
||||
</body>
|
||||
</html>
|
||||
44
templates/modules/pagination.html
Normal file
44
templates/modules/pagination.html
Normal file
@ -0,0 +1,44 @@
|
||||
<div th:fragment="pagination(context,prevUrl,nextUrl,totalPages,page,hasPrevious,hasNext)">
|
||||
<div class="mt-6 flex items-center justify-between" th:if="${hasPrevious || hasNext}">
|
||||
<a
|
||||
th:href="@{${prevUrl}}"
|
||||
class="whitespace-no-wrap group inline-flex items-center justify-center gap-1 rounded-md border border-gray-200 bg-white px-4 py-1 text-sm font-medium leading-6 text-gray-600 shadow-sm hover:bg-gray-50 focus:shadow-none focus:outline-none dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:hover:bg-slate-600 dark:hover:text-white"
|
||||
th:classappend="${!hasPrevious ? 'pointer-events-none opacity-60' : ''}"
|
||||
>
|
||||
<span class="i-tabler-arrow-left text-lg transition-all group-hover:-translate-x-1"></span>
|
||||
<span th:text="#{common.previousPage}"></span>
|
||||
</a>
|
||||
<select id="pagination" class="bg-transparent text-sm text-gray-900 outline-none dark:text-slate-50">
|
||||
<option
|
||||
th:each="i : ${#numbers.sequence(1,totalPages)}"
|
||||
th:selected="${i == page}"
|
||||
th:value="${i}"
|
||||
th:text="|${i} / ${totalPages}|"
|
||||
class="bg-white text-gray-900 dark:bg-slate-700 dark:text-slate-50"
|
||||
></option>
|
||||
</select>
|
||||
<a
|
||||
th:href="@{${nextUrl}}"
|
||||
class="whitespace-no-wrap group inline-flex items-center justify-center gap-1 rounded-md border border-gray-200 bg-white px-4 py-1 text-sm font-medium leading-6 text-gray-600 shadow-sm hover:bg-gray-50 focus:shadow-none focus:outline-none dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:hover:bg-slate-600 dark:hover:text-white"
|
||||
th:classappend="${!hasNext ? 'pointer-events-none opacity-60' : ''}"
|
||||
>
|
||||
<span th:text="#{common.nextPage}"></span>
|
||||
<span class="i-tabler-arrow-right text-lg transition-all group-hover:translate-x-1"></span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<script th:inline="javascript">
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const paginationSelect = document.getElementById("pagination");
|
||||
|
||||
if (!paginationSelect) {
|
||||
return;
|
||||
}
|
||||
|
||||
paginationSelect.addEventListener("change", (event) => {
|
||||
const selectedPage = event.target.value;
|
||||
window.location.href = `[(${context})]page/${selectedPage}`;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
89
templates/modules/post-card.html
Normal file
89
templates/modules/post-card.html
Normal file
@ -0,0 +1,89 @@
|
||||
<div
|
||||
th:fragment="post-card(post,cover,animation,border,direction)"
|
||||
class="group flex flex-col overflow-hidden rounded-xl bg-white shadow-md ring-black transition-all duration-500 hover:shadow-lg dark:bg-slate-800 dark:ring-slate-700"
|
||||
th:classappend="${animation ? 'hover:-translate-y-1' : ''} + ' ' + ${border ? 'hover:ring-2' : ''} + ' ' + ${direction == 'column' ? '!grid grid-cols-1 sm:grid-cols-5' : ''}"
|
||||
>
|
||||
<div
|
||||
th:if="${cover} and ${not #strings.isEmpty(post.spec.cover)}"
|
||||
class="aspect-h-9 aspect-w-16"
|
||||
th:classappend="${direction == 'column' ? 'col-span-2' : ''}"
|
||||
>
|
||||
<a th:href="@{${post.status.permalink}}" th:title="${post.spec.title}">
|
||||
<img
|
||||
th:src="${post.spec.cover}"
|
||||
th:alt="${post.spec.title}"
|
||||
th:srcset="|${thumbnail.gen(post.spec.cover, 's')} 400w,
|
||||
${thumbnail.gen(post.spec.cover, 'm')} 800w,
|
||||
${thumbnail.gen(post.spec.cover, 'l')} 1200w|"
|
||||
sizes="(max-width: 1200px) 100vw, 1200px"
|
||||
class="size-full object-cover transition-all duration-500"
|
||||
th:classappend="${animation} ? 'group-hover:scale-105'"
|
||||
/>
|
||||
</a>
|
||||
<div th:if="${post.spec.pinned}" class="absolute !left-2 !top-1.5" th:title="#{fragment.postCard.pinned}">
|
||||
<div class="i-bx-arrow-to-top !size-5 text-sky-600"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="relative col-span-3 grid h-full grid-cols-1 content-between gap-2 p-4"
|
||||
th:with="list_layout=${theme.config.layout.post_list_layout}"
|
||||
th:classappend="${#strings.isEmpty(post.spec.cover) ? 'col-span-5' : ''}"
|
||||
>
|
||||
<div class="space-y-2">
|
||||
<div
|
||||
th:if="${not #lists.isEmpty(post.categories)} or ${not #lists.isEmpty(post.tags)}"
|
||||
class="flex flex-wrap items-center gap-2"
|
||||
>
|
||||
<a
|
||||
th:if="${#lists.size(post.categories)} gt 0"
|
||||
th:href="@{${post.categories[0].status.permalink}}"
|
||||
th:title="${post.categories[0].spec.displayName}"
|
||||
th:text="${post.categories[0].spec.displayName}"
|
||||
class="mr-1 text-sm font-medium text-gray-800 hover:text-gray-900 dark:text-slate-500 dark:hover:text-slate-600"
|
||||
>
|
||||
</a>
|
||||
<a
|
||||
th:each="tag : ${post.tags}"
|
||||
th:href="@{${tag.status.permalink}}"
|
||||
th:title="${tag.spec.displayName}"
|
||||
th:text="|#${tag.spec.displayName}|"
|
||||
class="cursor-pointer text-sm italic text-gray-600 hover:text-gray-900 dark:text-slate-400 dark:hover:text-slate-500"
|
||||
>
|
||||
</a>
|
||||
</div>
|
||||
<h1
|
||||
class="line-clamp-2 cursor-pointer text-2xl font-medium transition-all hover:text-gray-500 hover:underline dark:text-slate-50 dark:hover:text-white"
|
||||
th:classappend="|${direction == 'column' ? 'sm:line-clamp-2' : ''} ${list_layout == 'grid_2' ? 'sm:line-clamp-3' : ''} ${list_layout == 'grid_3' ? 'sm:line-clamp-4' : ''}|"
|
||||
>
|
||||
<a th:href="@{${post.status.permalink}}" th:text="${post.spec.title}" th:title="${post.spec.title}"></a>
|
||||
</h1>
|
||||
<p
|
||||
class="font-sm line-clamp-2 font-light dark:text-slate-200"
|
||||
th:text="${post.status.excerpt}"
|
||||
th:classappend="${list_layout == 'grid_3' ? 'sm:line-clamp-3' : ''}"
|
||||
></p>
|
||||
</div>
|
||||
<div class="mt-4 flex items-center justify-start gap-2">
|
||||
<a th:href="@{${post.owner.permalink}}" th:title="${post.owner.displayName}">
|
||||
<img
|
||||
th:src="${post.owner.avatar ?: #theme.assets('/images/default-avatar.svg')}"
|
||||
th:title="${post.owner.displayName}"
|
||||
th:alt="${post.owner.displayName}"
|
||||
class="size-8 rounded-full border drop-shadow-sm dark:border-slate-700"
|
||||
/>
|
||||
</a>
|
||||
<a
|
||||
th:href="@{${post.owner.permalink}}"
|
||||
th:title="${post.owner.displayName}"
|
||||
class="text-sm font-medium text-gray-900 hover:text-gray-600 dark:text-slate-100 dark:hover:text-slate-200"
|
||||
th:if="${#strings.isEmpty(post.owner.avatar)}"
|
||||
th:text="${post.owner.displayName}"
|
||||
></a>
|
||||
<span
|
||||
class="text-sm tabular-nums text-gray-600 dark:text-slate-300"
|
||||
th:text="#{common.publishedOn(${#dates.format(post.spec.publishTime,'yyyy-MM-dd')})}"
|
||||
>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
75
templates/modules/share-modal.html
Normal file
75
templates/modules/share-modal.html
Normal file
@ -0,0 +1,75 @@
|
||||
<template x-teleport="body">
|
||||
<div>
|
||||
<div
|
||||
class="fixed inset-0 z-50 bg-gray-800/40 opacity-100 backdrop-blur-sm dark:bg-black/80"
|
||||
aria-hidden="true"
|
||||
x-show="shareModal"
|
||||
x-transition:enter="ease-in-out duration-300"
|
||||
x-transition:enter-start="opacity-0"
|
||||
x-transition:enter-end="opacity-100"
|
||||
x-transition:leave="ease-in-out duration-300"
|
||||
x-transition:leave-start="opacity-100"
|
||||
x-transition:leave-end="opacity-0"
|
||||
></div>
|
||||
<div
|
||||
class="fixed inset-0 z-50 overflow-y-auto"
|
||||
tabindex="-1"
|
||||
x-show="shareModal"
|
||||
x-transition:enter="ease-out duration-200"
|
||||
x-transition:enter-start="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
||||
x-transition:enter-end="opacity-100 translate-y-0 sm:scale-100"
|
||||
x-transition:leave="ease-in duration-100"
|
||||
x-transition:leave-start="opacity-100 translate-y-0 sm:scale-100"
|
||||
x-transition:leave-end="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
||||
>
|
||||
<div class="flex min-h-full flex-col items-center justify-center p-4 text-center sm:p-0">
|
||||
<div
|
||||
@click.outside="shareModal = false"
|
||||
class="relative my-4 transform overflow-hidden rounded-lg bg-white p-4 text-left shadow-xl transition-all dark:bg-slate-800 dark:text-slate-100 sm:w-full sm:max-w-xl"
|
||||
>
|
||||
<h1 class="text-lg font-semibold" th:text="#{fragment.shareModal.title}"></h1>
|
||||
<div class="my-8">
|
||||
<div class="grid grid-cols-5 gap-6 sm:grid-cols-6">
|
||||
<template x-for="item in activeShareItems">
|
||||
<div class="inline-flex flex-col items-center justify-center gap-1.5 rounded-full">
|
||||
<div
|
||||
class="inline-flex size-12 cursor-pointer items-center justify-center rounded-full bg-gray-100 transition-all hover:bg-gray-200 dark:bg-slate-600 dark:text-slate-50 dark:hover:bg-slate-700 dark:hover:text-slate-100 sm:size-16"
|
||||
@click="handleShare(item.id)"
|
||||
>
|
||||
<div class="text-xl text-gray-900 dark:text-slate-50" :class="item.icon"></div>
|
||||
</div>
|
||||
<div class="hidden text-xs text-gray-600 dark:text-slate-100 sm:block" x-text="item.name"></div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div class="mt-10">
|
||||
<div
|
||||
class="flex flex-wrap items-center justify-center gap-1 rounded-lg bg-gray-100 px-3 py-2 dark:bg-slate-700 sm:justify-between"
|
||||
>
|
||||
<div
|
||||
class="flex-1 select-all truncate text-xs font-light text-gray-600 dark:text-slate-100"
|
||||
x-text="permalink"
|
||||
></div>
|
||||
<div
|
||||
class="flex-none cursor-pointer select-none text-sm text-gray-600 hover:text-gray-900 dark:text-slate-400 dark:hover:text-slate-500"
|
||||
@click="handleCopy"
|
||||
th:attr="x-text=|copied ? '#{fragment.shareModal.copied}' : '#{fragment.shareModal.copy}'|"
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div
|
||||
@click="shareModal = false"
|
||||
class="group inline-flex items-center justify-center rounded-full bg-white p-1.5 dark:bg-slate-800"
|
||||
>
|
||||
<i
|
||||
class="i-tabler-x block text-gray-600 hover:text-gray-900 dark:text-slate-100 dark:hover:text-slate-500"
|
||||
></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
10
templates/modules/sidebar.html
Normal file
10
templates/modules/sidebar.html
Normal file
@ -0,0 +1,10 @@
|
||||
<aside th:fragment="sidebar (prepend)" class="z-0 hidden w-72 flex-col gap-6 md:flex">
|
||||
<th:block th:with="widgets = ${theme.config.sidebar.widgets} ">
|
||||
<th:block th:if="${prepend != null}">
|
||||
<th:block th:replace="${prepend}" />
|
||||
</th:block>
|
||||
<th:block th:each="widget : ${widgets}">
|
||||
<th:block th:replace="~{'modules/widgets/'+${widget.value}}" />
|
||||
</th:block>
|
||||
</th:block>
|
||||
</aside>
|
||||
18
templates/modules/tag-filter.html
Normal file
18
templates/modules/tag-filter.html
Normal file
@ -0,0 +1,18 @@
|
||||
<div class="flex flex-col gap-4">
|
||||
<h2 class="inline-flex items-center gap-2 text-base text-gray-900 dark:text-slate-50">
|
||||
<span class="i-tabler-tags text-lg"></span>
|
||||
<th:block th:text="#{fragment.tagFilter.allTags}"></th:block>
|
||||
</h2>
|
||||
<div class="flex flex-wrap gap-2" th:with="tags = ${tagFinder.listAll()}">
|
||||
<a
|
||||
th:each="tagItem,tagStat: ${tags}"
|
||||
th:href="@{${tagItem.status.permalink}}"
|
||||
th:title="${tagItem.spec.displayName}"
|
||||
class="inline-flex items-center gap-x-1.5 rounded-full border border-gray-200 bg-white px-2.5 py-1 text-xs font-medium text-gray-800 shadow-sm hover:border-indigo-400 dark:border-slate-800 dark:bg-slate-700 dark:text-slate-200 dark:hover:border-indigo-200"
|
||||
th:classappend="(${tag} and ${tag.metadata.name == tagItem.metadata.name}) or (not ${tag} and ${tagStat.index == 0}) ? '!border-indigo-400 dark:!border-indigo-200' : ''"
|
||||
>
|
||||
<th:block th:text="|#${tagItem.spec.displayName}|" />
|
||||
<sup th:text="${tagItem.postCount ?: 0}"></sup>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
13
templates/modules/widgets/categories.html
Normal file
13
templates/modules/widgets/categories.html
Normal file
@ -0,0 +1,13 @@
|
||||
<div
|
||||
class="w-full overflow-hidden rounded-xl bg-white p-3 shadow transition-all duration-500 hover:shadow-md dark:bg-slate-800"
|
||||
>
|
||||
<h2 class="inline-flex items-center gap-2 text-base dark:text-slate-50">
|
||||
<span class="i-tabler-category text-lg"></span>
|
||||
<th:block th:text="#{widget.categories.title}"></th:block>
|
||||
</h2>
|
||||
<div class="mt-2" th:with="categories = ${categoryFinder.listAsTree()}">
|
||||
<ul class="space-y-1">
|
||||
<li th:replace="~{modules/category-tree :: single(categories=${categories})}" />
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
76
templates/modules/widgets/latest-comments.html
Normal file
76
templates/modules/widgets/latest-comments.html
Normal file
@ -0,0 +1,76 @@
|
||||
<div
|
||||
class="w-full overflow-hidden rounded-xl bg-white p-3 shadow transition-all duration-500 hover:shadow-md dark:bg-slate-800"
|
||||
>
|
||||
<h2 class="inline-flex items-center gap-2 text-base dark:text-slate-50">
|
||||
<span class="i-tabler-message-circle text-lg"></span>
|
||||
<th:block th:text="#{widget.latestComments.title}"></th:block>
|
||||
</h2>
|
||||
<div>
|
||||
<ul role="list" class="divide-y divide-gray-100 dark:divide-slate-700">
|
||||
<li class="py-3">
|
||||
<div class="flex space-x-3">
|
||||
<img class="size-6 rounded-full" src="https://ryanc.cc/avatar" alt="Comment Avatar" />
|
||||
<div class="flex-1 space-y-1">
|
||||
<div class="flex items-center justify-between">
|
||||
<h3 class="text-sm font-medium dark:text-slate-100">Phyllis McKenzie</h3>
|
||||
<p class="text-sm text-gray-500 dark:text-slate-500">1h</p>
|
||||
</div>
|
||||
<p class="text-sm text-gray-500 dark:text-slate-400">
|
||||
Fugit quae nam dolores impedit quia fuga pariatur dignissimos recusandae.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="py-3">
|
||||
<div class="flex space-x-3">
|
||||
<img class="size-6 rounded-full" src="https://ryanc.cc/avatar" alt="Comment Avatar" />
|
||||
<div class="flex-1 space-y-1">
|
||||
<div class="flex items-center justify-between">
|
||||
<h3 class="text-sm font-medium dark:text-slate-100">Willard Labadie I</h3>
|
||||
<p class="text-sm text-gray-500 dark:text-slate-500">1h</p>
|
||||
</div>
|
||||
<p class="text-sm text-gray-500 dark:text-slate-400">
|
||||
Officiis quis quos repudiandae quam delectus impedit quidem amet ut.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="py-3">
|
||||
<div class="flex space-x-3">
|
||||
<img class="size-6 rounded-full" src="https://ryanc.cc/avatar" alt="Comment Avatar" />
|
||||
<div class="flex-1 space-y-1">
|
||||
<div class="flex items-center justify-between">
|
||||
<h3 class="text-sm font-medium dark:text-slate-100">Miss Leonard Sporer</h3>
|
||||
<p class="text-sm text-gray-500 dark:text-slate-500">1h</p>
|
||||
</div>
|
||||
<p class="text-sm text-gray-500 dark:text-slate-400">Nesciunt dolores et debitis.</p>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="py-3">
|
||||
<div class="flex space-x-3">
|
||||
<img class="size-6 rounded-full" src="https://ryanc.cc/avatar" alt="Comment Avatar" />
|
||||
<div class="flex-1 space-y-1">
|
||||
<div class="flex items-center justify-between">
|
||||
<h3 class="text-sm font-medium dark:text-slate-100">Tyrone Fisher</h3>
|
||||
<p class="text-sm text-gray-500 dark:text-slate-500">1h</p>
|
||||
</div>
|
||||
<p class="text-sm text-gray-500 dark:text-slate-400">Et nesciunt dolorem eum ut corporis.</p>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="py-3">
|
||||
<div class="flex space-x-3">
|
||||
<img class="size-6 rounded-full" src="https://ryanc.cc/avatar" alt="Comment Avatar" />
|
||||
<div class="flex-1 space-y-1">
|
||||
<div class="flex items-center justify-between">
|
||||
<h3 class="text-sm font-medium dark:text-slate-100">Angie Braun V</h3>
|
||||
<p class="text-sm text-gray-500 dark:text-slate-500">1h</p>
|
||||
</div>
|
||||
<p class="text-sm text-gray-500 dark:text-slate-400">Autem labore ipsam earum reiciendis eum omnis.</p>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
33
templates/modules/widgets/popular-posts.html
Normal file
33
templates/modules/widgets/popular-posts.html
Normal file
@ -0,0 +1,33 @@
|
||||
<div
|
||||
class="w-full overflow-hidden rounded-xl bg-white p-3 shadow transition-all duration-500 hover:shadow-md dark:bg-slate-800"
|
||||
>
|
||||
<h2 class="inline-flex items-center gap-2 text-base dark:text-slate-50">
|
||||
<span class="i-tabler-stairs-up text-lg text-red-600 dark:text-red-700"></span>
|
||||
<th:block th:text="#{widget.popularPosts.title}"></th:block>
|
||||
</h2>
|
||||
<div>
|
||||
<ul
|
||||
role="list"
|
||||
class="divide-y divide-gray-100 dark:divide-slate-700"
|
||||
th:with="posts = ${postFinder.list({page: 1,size: 10,sort: {'stats.visit,desc'}})}"
|
||||
>
|
||||
<li class="py-3" th:each="post : ${posts}">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex flex-col gap-1">
|
||||
<h3 class="line-clamp-2 text-sm font-medium hover:text-gray-500 hover:underline dark:text-slate-100">
|
||||
<a th:text="${post.spec.title}" th:href="@{${post.status.permalink}}" th:title="${post.spec.title}"></a>
|
||||
</h3>
|
||||
<p
|
||||
class="text-xs tabular-nums text-gray-500 dark:text-slate-400"
|
||||
th:text="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}"
|
||||
></p>
|
||||
</div>
|
||||
<div class="inline-flex items-center gap-1 text-xs text-gray-600 dark:text-slate-500">
|
||||
<span class="i-tabler-eye"></span>
|
||||
<span th:text="${post.stats.visit ?: 0}" class="tabular-nums"> </span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
82
templates/modules/widgets/profile.html
Normal file
82
templates/modules/widgets/profile.html
Normal file
@ -0,0 +1,82 @@
|
||||
<div
|
||||
class="w-full overflow-hidden rounded-xl bg-white p-3 shadow transition-all duration-500 hover:shadow-md dark:bg-slate-800"
|
||||
th:with="stats = ${siteStatsFinder.getStats()}"
|
||||
>
|
||||
<div class="flex flex-col items-center justify-center gap-4">
|
||||
<div th:if="${not #strings.isEmpty(theme.config.sidebar.profile.logo)}" class="relative h-24 w-24">
|
||||
<img
|
||||
th:src="${theme.config.sidebar.profile.logo}"
|
||||
th:alt="${site.title}"
|
||||
width="96"
|
||||
height="96"
|
||||
class="size-full rounded-full object-cover"
|
||||
/>
|
||||
</div>
|
||||
<div><h1 class="text-2xl font-medium dark:text-slate-50" th:text="${site.title}"></h1></div>
|
||||
<div th:if="${not #strings.isEmpty(site.subtitle)}">
|
||||
<p class="text-center text-sm text-gray-700 dark:text-slate-300" th:text="${site.subtitle}"></p>
|
||||
</div>
|
||||
<div class="grid grid-cols-4 gap-5">
|
||||
<div class="inline-flex flex-col items-center">
|
||||
<span class="text-xl font-medium tabular-nums text-gray-900 dark:text-slate-100" th:text="${stats.post}"></span>
|
||||
<span
|
||||
class="text-xs font-light text-gray-600 dark:text-slate-300"
|
||||
th:text="#{widget.profile.postCount.label}"
|
||||
></span>
|
||||
</div>
|
||||
<div class="inline-flex flex-col items-center">
|
||||
<span
|
||||
class="text-xl font-medium tabular-nums text-gray-900 dark:text-slate-100"
|
||||
th:text="${stats.category}"
|
||||
></span>
|
||||
<span
|
||||
class="text-xs font-light text-gray-600 dark:text-slate-300"
|
||||
th:text="#{widget.profile.categoryCount.label}"
|
||||
></span>
|
||||
</div>
|
||||
<div class="inline-flex flex-col items-center">
|
||||
<span
|
||||
class="text-xl font-medium tabular-nums text-gray-900 dark:text-slate-100"
|
||||
th:text="${stats.comment}"
|
||||
></span>
|
||||
<span
|
||||
class="text-xs font-light text-gray-600 dark:text-slate-300"
|
||||
th:text="#{widget.profile.commentCount.label}"
|
||||
></span>
|
||||
</div>
|
||||
<div class="inline-flex flex-col items-center">
|
||||
<span class="text-xl font-medium tabular-nums text-gray-900 dark:text-slate-100" th:text="${stats.visit}"></span
|
||||
><span
|
||||
class="text-xs font-light text-gray-600 dark:text-slate-300"
|
||||
th:text="#{widget.profile.visitCount.label}"
|
||||
></span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
th:with="social_medias = ${theme.config.sidebar.social_media}"
|
||||
class="flex flex-wrap items-center justify-center gap-5"
|
||||
>
|
||||
<th:block th:each="social_media : ${social_medias}">
|
||||
<a
|
||||
th:if="${social_media.url_type == 'normal'}"
|
||||
th:aria-label="${social_media.name}"
|
||||
class="flex cursor-pointer items-center justify-center rounded p-1 hover:bg-gray-100 dark:hover:bg-slate-700"
|
||||
th:href="${social_media.url}"
|
||||
target="_blank"
|
||||
>
|
||||
<span class="text-gray-600 dark:text-slate-400" th:classappend="${social_media.icon}"></span>
|
||||
</a>
|
||||
|
||||
<span
|
||||
th:if="${social_media.url_type == 'image'}"
|
||||
th:attr="x-data=|{openImageModal:false,image: '${social_media.url}', alt: '${social_media.name}'}|"
|
||||
class="flex cursor-pointer items-center justify-center rounded p-1 hover:bg-gray-100 dark:hover:bg-slate-700"
|
||||
@click="openImageModal = true"
|
||||
>
|
||||
<div th:classappend="${social_media.icon}" class="text-gray-600 dark:text-slate-400"></div>
|
||||
<th:block th:replace="~{modules/image-view-modal}" />
|
||||
</span>
|
||||
</th:block>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
28
templates/modules/widgets/tags.html
Normal file
28
templates/modules/widgets/tags.html
Normal file
@ -0,0 +1,28 @@
|
||||
<div
|
||||
class="w-full overflow-hidden rounded-xl bg-white p-3 shadow transition-all duration-500 hover:shadow-md dark:bg-slate-800"
|
||||
>
|
||||
<div class="flex items-center justify-between">
|
||||
<h2 class="inline-flex items-center gap-2 text-base dark:text-slate-50">
|
||||
<span class="i-tabler-tags text-lg"></span>
|
||||
<th:block th:text="#{widget.tags.title}"></th:block>
|
||||
</h2>
|
||||
<a
|
||||
class="group inline-flex items-center gap-2 text-sm text-gray-600 transition-all hover:text-gray-900 dark:text-slate-400 dark:hover:text-slate-300"
|
||||
th:href="@{/tags}"
|
||||
>
|
||||
<span th:text="#{common.more}"></span>
|
||||
<span class="i-tabler-chevron-right -translate-x-1 text-lg transition-all group-hover:translate-x-0"></span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="mt-2 flex flex-wrap gap-2" th:with="tags = ${tagFinder.list(1,50)}">
|
||||
<a
|
||||
th:each="tag : ${tags}"
|
||||
th:href="@{${tag.status.permalink}}"
|
||||
th:title="${tag.spec.displayName}"
|
||||
class="inline-flex items-center gap-x-1.5 rounded-full border border-gray-200 bg-white px-2.5 py-1 text-xs font-medium text-gray-800 shadow-sm hover:border-indigo-400 dark:border-slate-800 dark:bg-slate-700 dark:text-slate-200 dark:hover:border-indigo-200"
|
||||
>
|
||||
<th:block th:text="|#${tag.spec.displayName}|" />
|
||||
<sup th:text="${tag.postCount ?: 0}"></sup>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
167
templates/moments.html
Normal file
167
templates/moments.html
Normal file
@ -0,0 +1,167 @@
|
||||
<!doctype html>
|
||||
<html
|
||||
xmlns:th="https://www.thymeleaf.org"
|
||||
th:replace="~{modules/layout :: html(title = |#{page.moments.title} - ${site.title}|, hero = null, content = ~{::content}, head = null, footer = null, sidebar = null, contentClass = '')}"
|
||||
>
|
||||
<th:block th:fragment="content">
|
||||
<div class="rounded-xl bg-white p-4 dark:bg-slate-800">
|
||||
<h1 class="mb-9 text-2xl font-medium dark:text-slate-50" th:text="#{page.moments.title}"></h1>
|
||||
<div class="mb-8">
|
||||
<nav class="flex flex-wrap gap-4" aria-label="Tabs">
|
||||
<a
|
||||
th:href="@{/moments}"
|
||||
class="rounded bg-gray-100 px-1 py-0.5 text-sm text-gray-900 hover:bg-gray-200 dark:bg-slate-600 dark:text-slate-50 dark:hover:bg-slate-700 dark:hover:text-slate-100"
|
||||
th:classappend="${#lists.isEmpty(param.tag) ? '!bg-gray-200 dark:!bg-slate-700 dark:!text-slate-100 ring-2 ring-gray-300 dark:ring-slate-600' : ''}"
|
||||
>
|
||||
<span th:text="#{common.all}"></span>
|
||||
</a>
|
||||
<a
|
||||
th:each="tag : ${tags}"
|
||||
th:href="@{|?tag=${tag.name}|}"
|
||||
class="rounded bg-gray-100 px-1 py-0.5 text-sm text-gray-900 hover:bg-gray-200 dark:bg-slate-600 dark:text-slate-50 dark:hover:bg-slate-700 dark:hover:text-slate-100"
|
||||
th:classappend="${#lists.contains(param.tag, tag.name) ? '!bg-gray-200 dark:!bg-slate-700 dark:!text-slate-100 ring-2 ring-gray-300 dark:ring-slate-600' : ''}"
|
||||
>
|
||||
<span th:text="|#${tag.name}|"></span>
|
||||
<sup th:text="${tag.momentCount}"></sup>
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
<div>
|
||||
<ul
|
||||
role="list"
|
||||
class="divide-y divide-gray-100 dark:divide-slate-700"
|
||||
x-data="upvote('moment','moment.halo.run','moments')"
|
||||
>
|
||||
<li
|
||||
th:each="moment : ${moments.items}"
|
||||
th:attr="x-data=|{name:'${moment.metadata.name}',showComment:false}|"
|
||||
th:with="content=${moment.spec.content}"
|
||||
class="animated fadeIn flex w-full items-start gap-2 py-5"
|
||||
>
|
||||
<img
|
||||
th:src="${moment.owner.avatar ?: #theme.assets('/images/default-avatar.svg')}"
|
||||
th:title="${moment.owner.displayName}"
|
||||
th:alt="${moment.owner.displayName}"
|
||||
class="size-12 rounded-full"
|
||||
/>
|
||||
<div class="ml-6" style="width: calc(100% - 4.75rem)">
|
||||
<div
|
||||
th:utext="${content.html}"
|
||||
class="moment-content prose prose-base !max-w-none break-words dark:prose-invert prose-pre:p-0"
|
||||
></div>
|
||||
<div
|
||||
th:unless="${#lists.isEmpty(moment.spec.content.medium)}"
|
||||
class="moment-media mt-4 grid w-full grid-cols-3 gap-2 sm:w-1/2"
|
||||
>
|
||||
<div class="aspect-h-1 aspect-w-1" th:each="media : ${moment.spec.content.medium}">
|
||||
<img
|
||||
th:if="${#strings.equals(media.type,'PHOTO')}"
|
||||
class="transform-gpu rounded-lg object-cover"
|
||||
th:src="${media.url}"
|
||||
th:srcset="|${thumbnail.gen(media.url, 's')} 400w,
|
||||
${thumbnail.gen(media.url, 'm')} 800w,
|
||||
${thumbnail.gen(media.url, 'l')} 1200w|"
|
||||
sizes="(max-width: 1200px) 100vw, 1200px"
|
||||
/>
|
||||
<div
|
||||
th:if="${#strings.equals(media.type,'VIDEO')}"
|
||||
x-data="{openVideoModal:false}"
|
||||
class="aspect-h-1 aspect-w-1"
|
||||
>
|
||||
<video th:src="${media.url}" class="rounded-lg object-cover"></video>
|
||||
<div
|
||||
th:if="${#strings.equals(media.type,'VIDEO')}"
|
||||
class="absolute flex size-full cursor-pointer items-center justify-center rounded-lg bg-gray-50 opacity-50 transition-all hover:opacity-70"
|
||||
@click="openVideoModal = true"
|
||||
>
|
||||
<i class="i-tabler-play !size-7"></i>
|
||||
</div>
|
||||
<template x-teleport="body">
|
||||
<div>
|
||||
<div
|
||||
class="fixed inset-0 z-50 bg-gray-800/40 opacity-100 backdrop-blur-sm"
|
||||
aria-hidden="true"
|
||||
x-show="openVideoModal"
|
||||
x-transition:enter="ease-in-out duration-300"
|
||||
x-transition:enter-start="opacity-0"
|
||||
x-transition:enter-end="opacity-100"
|
||||
x-transition:leave="ease-in-out duration-300"
|
||||
x-transition:leave-start="opacity-100"
|
||||
x-transition:leave-end="opacity-0"
|
||||
></div>
|
||||
<div
|
||||
class="fixed inset-0 z-50 overflow-y-auto"
|
||||
tabindex="-1"
|
||||
x-show="openVideoModal"
|
||||
x-transition:enter="ease-out duration-200"
|
||||
x-transition:enter-start="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
||||
x-transition:enter-end="opacity-100 translate-y-0 sm:scale-100"
|
||||
x-transition:leave="ease-in duration-100"
|
||||
x-transition:leave-start="opacity-100 translate-y-0 sm:scale-100"
|
||||
x-transition:leave-end="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
||||
>
|
||||
<div class="flex min-h-full flex-col items-center justify-center p-4 text-center sm:p-0">
|
||||
<div
|
||||
@click.outside="openVideoModal = false"
|
||||
class="relative my-4 transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:w-full sm:max-w-xl"
|
||||
>
|
||||
<video th:src="${media.url}" class="w-full" controls></video>
|
||||
</div>
|
||||
<div>
|
||||
<div
|
||||
@click="openVideoModal = false"
|
||||
class="group inline-flex items-center justify-center rounded-full bg-white p-1.5"
|
||||
>
|
||||
<i class="i-tabler-x block text-gray-600 group-hover:text-gray-900"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-3 flex items-center gap-4">
|
||||
<div
|
||||
class="inline-flex cursor-pointer items-center text-sm text-gray-400 transition-all hover:text-red-700 dark:text-slate-400 dark:hover:text-red-700"
|
||||
x-bind:class="{'!text-red-700': upvoted(name)}"
|
||||
@click="handleUpvote(name)"
|
||||
>
|
||||
<i x-show="upvoted(name)" class="i-tabler-heart-filled size-3"></i>
|
||||
<i x-show="!upvoted(name)" class="i-tabler-heart size-3"></i>
|
||||
<span
|
||||
class="ml-1"
|
||||
th:attr="data-upvote-moment-name=${moment.metadata.name}"
|
||||
th:text="${moment.stats.upvote}"
|
||||
>
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
class="inline-flex cursor-pointer items-center text-sm text-gray-400 transition-all hover:text-black dark:text-slate-400 dark:hover:text-slate-300"
|
||||
:class="{'!text-black dark:!text-slate-300':showComment}"
|
||||
x-on:click="showComment = !showComment"
|
||||
>
|
||||
<i class="i-tabler-message-circle size-3"></i>
|
||||
<span class="ml-1" th:text="${moment.stats.approvedComment}"> </span>
|
||||
</div>
|
||||
<div class="inline-flex items-center text-sm text-gray-400 transition-all dark:text-slate-400">
|
||||
<i class="i-tabler-calendar size-3"></i>
|
||||
<span class="ml-1" th:text="${#dates.format(moment.spec.releaseTime,'yyyy-MM-dd')}"> </span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-2" x-show="showComment">
|
||||
<halo:comment group="moment.halo.run" kind="Moment" th:attr="name=${moment.metadata.name}" />
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<th:block
|
||||
th:replace="~{modules/pagination :: pagination(context = '/moments/', prevUrl = ${moments.prevUrl}, nextUrl = ${moments.nextUrl}, totalPages = ${moments.totalPages}, page = ${moments.page}, hasPrevious = ${moments.hasPrevious()}, hasNext = ${moments.hasNext()})}"
|
||||
/>
|
||||
</div>
|
||||
</th:block>
|
||||
</html>
|
||||
117
templates/page.html
Normal file
117
templates/page.html
Normal file
@ -0,0 +1,117 @@
|
||||
<!doctype html>
|
||||
<html
|
||||
xmlns:th="https://www.thymeleaf.org"
|
||||
th:replace="~{modules/layout :: html(title = ${singlePage.spec.title} + ' - ' + ${site.title}, hero = ~{::hero}, content = ~{::content}, head = ~{::head}, footer = ~{::footer}, sidebar = null, contentClass = ${theme.config.layout.content_header} and ${not #strings.isEmpty(singlePage.spec.cover)} ? '!-mt-20' : '')}"
|
||||
>
|
||||
<th:block th:fragment="head">
|
||||
<link
|
||||
th:if="${theme.config.post.content_style == 'github'}"
|
||||
rel="stylesheet"
|
||||
th:href="@{/assets/styles/github-markdown.css?v={version}(version=${theme.spec.version})}"
|
||||
/>
|
||||
</th:block>
|
||||
<th:block th:fragment="hero">
|
||||
<section th:unless="${#strings.isEmpty(singlePage.spec.cover)}">
|
||||
<div class="relative flex items-center" th:styleappend="|height:${theme.config.post.cover_height ?: '24rem'}|">
|
||||
<div
|
||||
class="before:z-1 relative size-full bg-cover bg-center bg-no-repeat before:absolute before:inset-0 before:bg-black/40"
|
||||
th:style="|background-image: url('${singlePage.spec.cover}')|"
|
||||
></div>
|
||||
<header
|
||||
class="pattern-header-text absolute top-1/3 mx-auto flex w-full flex-col items-center justify-center gap-3"
|
||||
th:if="${theme.config.post.title_position == 'cover'}"
|
||||
>
|
||||
<h1 class="text-center text-2xl text-white sm:text-5xl" th:text="${singlePage.spec.title}"></h1>
|
||||
</header>
|
||||
</div>
|
||||
</section>
|
||||
</th:block>
|
||||
<th:block th:fragment="content">
|
||||
<div class="rounded-xl bg-white p-4 dark:bg-slate-800">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="inline-flex items-center justify-start gap-2">
|
||||
<a
|
||||
th:unless="${#strings.isEmpty(singlePage.owner.avatar)}"
|
||||
th:href="@{${singlePage.owner.permalink}}"
|
||||
th:title="${singlePage.owner.displayName}"
|
||||
>
|
||||
<img
|
||||
th:src="${singlePage.owner.avatar}"
|
||||
th:alt="${singlePage.owner.displayName}"
|
||||
class="size-10 rounded-full"
|
||||
/>
|
||||
</a>
|
||||
<div class="flex flex-col gap-0.5">
|
||||
<a
|
||||
th:href="@{${singlePage.owner.permalink}}"
|
||||
class="text-sm font-semibold text-gray-900 hover:text-gray-600 dark:text-slate-100 dark:hover:text-slate-200"
|
||||
th:text="${singlePage.owner.displayName}"
|
||||
th:title="${singlePage.owner.displayName}"
|
||||
></a>
|
||||
<div class="flex items-center gap-2 text-xs font-light text-gray-600 dark:text-slate-100">
|
||||
<span th:text="#{common.publishedOn(${#dates.format(singlePage.spec.publishTime,'yyyy-MM-dd')})}"></span>
|
||||
<span class="text-gray-300 dark:text-slate-200">/</span>
|
||||
<span th:text="#{common.visitCount(${singlePage.stats?.visit ?:0})}"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inline-flex flex-row gap-1">
|
||||
<div
|
||||
sec:authorize="isAuthenticated()"
|
||||
th:attr="x-data=|uiPermission('${#authentication.name}','system:singlepages:manage')|"
|
||||
class="flex items-center justify-between"
|
||||
id="edit-button"
|
||||
>
|
||||
<template x-if="shouldDisplay">
|
||||
<a
|
||||
th:href="|/console/single-pages/editor?name=${singlePage.metadata.name}&returnToView=true|"
|
||||
class="inline-flex items-center justify-center gap-1 whitespace-nowrap rounded-md border border-gray-200 bg-white px-4 py-1 text-sm font-medium leading-6 text-gray-600 shadow-sm hover:bg-gray-50 focus:shadow-none focus:outline-none dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:hover:bg-slate-600 dark:hover:text-white"
|
||||
>
|
||||
<span class="i-tabler-edit text-lg transition-all group-hover:-translate-x-1"></span>
|
||||
<span th:text="#{common.edit}"></span>
|
||||
</a>
|
||||
</template>
|
||||
</div>
|
||||
<a
|
||||
th:if="${haloCommentEnabled}"
|
||||
href="#comment"
|
||||
class="group inline-flex cursor-pointer items-center gap-0.5 rounded-lg"
|
||||
>
|
||||
<div
|
||||
class="inline-flex items-center justify-center rounded-full p-2 transition-all group-hover:bg-gray-100 dark:group-hover:bg-slate-700"
|
||||
>
|
||||
<div
|
||||
class="i-tabler-message-circle text-lg text-gray-600 group-hover:text-indigo-500 dark:text-slate-500"
|
||||
></div>
|
||||
</div>
|
||||
<span
|
||||
class="text-sm text-gray-600 group-hover:text-indigo-500 dark:text-slate-500"
|
||||
th:text="${singlePage.stats?.comment ?:0}"
|
||||
></span>
|
||||
</a>
|
||||
<div th:if="${false}" class="cursor-pointer rounded-lg p-1 hover:bg-gray-100 dark:hover:bg-slate-600">
|
||||
<div
|
||||
class="i-tabler-share text-lg text-gray-600 hover:text-gray-900 dark:text-slate-100 dark:hover:text-slate-50"
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h1
|
||||
th:if="${#strings.isEmpty(singlePage.spec.cover)} or ${theme.config.post.title_position == 'content'}"
|
||||
class="my-3 text-3xl font-medium dark:text-slate-50"
|
||||
th:text="${singlePage.spec.title}"
|
||||
></h1>
|
||||
|
||||
<article
|
||||
class="!max-w-none break-words"
|
||||
th:classappend="${theme.config.post.content_style == 'github' ? 'markdown-body' : 'tailwind-typography'}"
|
||||
th:utext="${singlePage.content.content}"
|
||||
></article>
|
||||
<hr th:if="${haloCommentEnabled}" class="my-10 dark:border-slate-700" />
|
||||
<div id="comment" th:if="${haloCommentEnabled}">
|
||||
<h2 class="mb-2 text-base font-medium text-gray-900 dark:text-slate-50" th:text="#{common.comment}"></h2>
|
||||
<halo:comment group="content.halo.run" kind="SinglePage" th:attr="name=${singlePage.metadata.name}" />
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
</html>
|
||||
51
templates/photos.html
Normal file
51
templates/photos.html
Normal file
@ -0,0 +1,51 @@
|
||||
<!doctype html>
|
||||
<html
|
||||
xmlns:th="https://www.thymeleaf.org"
|
||||
th:replace="~{modules/layout :: html(title = |#{page.photos.title} - ${site.title}|, hero = null, content = ~{::content}, head = null, footer = null, sidebar = null, contentClass = '')}"
|
||||
>
|
||||
<th:block th:fragment="content">
|
||||
<div class="rounded-xl bg-white p-4 dark:bg-slate-800">
|
||||
<h1 class="mb-9 text-2xl font-medium dark:text-slate-50" th:text="#{page.photos.title}"></h1>
|
||||
<div class="mb-8">
|
||||
<nav class="flex flex-wrap gap-4" aria-label="Tabs">
|
||||
<a
|
||||
th:href="@{/photos}"
|
||||
class="rounded bg-gray-100 px-1 py-0.5 text-sm text-gray-900 hover:bg-gray-200 dark:bg-slate-600 dark:text-slate-50 dark:hover:bg-slate-700 dark:hover:text-slate-100"
|
||||
th:classappend="${#lists.isEmpty(param.group) ? '!bg-gray-200 dark:!bg-slate-700 dark:!text-slate-100 ring-2 ring-gray-300 dark:ring-slate-600' : ''}"
|
||||
>
|
||||
<span th:text="#{common.all}"></span>
|
||||
</a>
|
||||
<a
|
||||
th:each="group : ${photoFinder.groupBy()}"
|
||||
th:href="@{|/photos?group=${group.metadata.name}|}"
|
||||
class="rounded bg-gray-100 px-1 py-0.5 text-sm text-gray-900 hover:bg-gray-200 dark:bg-slate-600 dark:text-slate-50 dark:hover:bg-slate-700 dark:hover:text-slate-100"
|
||||
th:classappend="${#lists.contains(param.group, group.metadata.name) ? '!bg-gray-200 dark:!bg-slate-700 dark:!text-slate-100 ring-2 ring-gray-300 dark:ring-slate-600' : ''}"
|
||||
th:text="${group.spec.displayName}"
|
||||
>
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div
|
||||
id="photos"
|
||||
class="columns-1 gap-3 pb-12 sm:columns-2 sm:gap-3 md:columns-3 lg:columns-4 [&>div:not(:first-child)]:mt-3"
|
||||
>
|
||||
<div th:each="photo : ${photos.items}" class="group relative h-auto max-w-full">
|
||||
<img
|
||||
class="animated fadeIn transform-gpu rounded-lg transition-all"
|
||||
th:src="${photo.spec.url}"
|
||||
th:srcset="|${thumbnail.gen(photo.spec.url, 's')} 400w,
|
||||
${thumbnail.gen(photo.spec.url, 'm')} 800w,
|
||||
${thumbnail.gen(photo.spec.url, 'l')} 1200w|"
|
||||
sizes="(max-width: 1200px) 100vw, 1200px"
|
||||
th:alt="${photo.spec.displayName}"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<th:block
|
||||
th:replace="~{modules/pagination :: pagination(context = '/photos/', prevUrl = ${photos.prevUrl}, nextUrl = ${photos.nextUrl}, totalPages = ${photos.totalPages}, page = ${photos.page}, hasPrevious = ${photos.hasPrevious()}, hasNext = ${photos.hasNext()})}"
|
||||
/>
|
||||
</div>
|
||||
</th:block>
|
||||
</html>
|
||||
203
templates/post.html
Normal file
203
templates/post.html
Normal file
@ -0,0 +1,203 @@
|
||||
<!doctype html>
|
||||
<html
|
||||
xmlns:th="https://www.thymeleaf.org"
|
||||
th:replace="~{modules/layout :: html(title = ${post.spec.title} + ' - ' + ${site.title}, hero = ~{::hero}, content = ~{::content}, head = ~{::head}, footer = ~{::footer}, sidebar = ~{::sidebar}, contentClass = ${theme.config.layout.content_header} and ${not #strings.isEmpty(post.spec.cover)} ? '!-mt-20' : '')}"
|
||||
>
|
||||
<th:block th:fragment="head">
|
||||
<link
|
||||
th:if="${theme.config.post.content_style == 'github'}"
|
||||
rel="stylesheet"
|
||||
th:href="@{/assets/styles/github-markdown.css?v={version}(version=${theme.spec.version})}"
|
||||
/>
|
||||
</th:block>
|
||||
<th:block th:fragment="hero">
|
||||
<section th:unless="${#strings.isEmpty(post.spec.cover)}">
|
||||
<div class="relative flex items-center" th:styleappend="|height:${theme.config.post.cover_height ?: '24rem'}|">
|
||||
<div
|
||||
class="before:z-1 relative size-full bg-cover bg-center bg-no-repeat before:absolute before:inset-0 before:bg-black/40"
|
||||
th:style="|background-image: url('${post.spec.cover}')|"
|
||||
></div>
|
||||
<header
|
||||
class="pattern-header-text absolute top-1/3 mx-auto flex w-full flex-col items-center justify-center gap-3"
|
||||
th:if="${theme.config.post.title_position == 'cover'}"
|
||||
>
|
||||
<h1 class="text-center text-2xl text-white sm:text-5xl" th:text="${post.spec.title}"></h1>
|
||||
</header>
|
||||
</div>
|
||||
</section>
|
||||
</th:block>
|
||||
<th:block th:fragment="footer">
|
||||
<script>
|
||||
main.generateToc();
|
||||
</script>
|
||||
</th:block>
|
||||
<th:block th:fragment="sidebar_prepend">
|
||||
<div
|
||||
class="toc-container sticky top-20 z-[5] w-full cursor-pointer rounded-xl bg-white p-3 shadow transition-all duration-500 hover:shadow-md dark:bg-slate-800"
|
||||
>
|
||||
<h2 class="inline-flex items-center gap-2 text-base dark:text-slate-50">
|
||||
<span class="i-tabler-list text-lg"></span>
|
||||
<th:block th:text="#{page.post.toc}"></th:block>
|
||||
</h2>
|
||||
<div class="toc mt-2 max-h-64 overflow-auto"></div>
|
||||
</div>
|
||||
</th:block>
|
||||
<th:block th:fragment="sidebar">
|
||||
<th:block th:replace="~{modules/sidebar :: sidebar(prepend = ~{::sidebar_prepend})}"></th:block>
|
||||
</th:block>
|
||||
<th:block th:fragment="content">
|
||||
<div x-data="upvote('post','content.halo.run','posts')" class="rounded-xl bg-white p-4 dark:bg-slate-800">
|
||||
<div
|
||||
th:attr="x-data=|{name:'${post.metadata.name}'}|"
|
||||
class="flex flex-col items-center justify-between gap-2 sm:flex-row"
|
||||
>
|
||||
<div class="flex w-full items-center justify-start gap-2">
|
||||
<a
|
||||
th:unless="${#strings.isEmpty(post.owner.avatar)}"
|
||||
th:href="@{${post.owner.permalink}}"
|
||||
th:title="${post.owner.displayName}"
|
||||
>
|
||||
<img th:src="${post.owner.avatar}" class="size-10 rounded-full" th:alt="${post.owner.displayName}" />
|
||||
</a>
|
||||
<div class="flex flex-col gap-0.5">
|
||||
<a
|
||||
th:href="@{${post.owner.permalink}}"
|
||||
th:title="${post.owner.displayName}"
|
||||
class="text-sm font-semibold text-gray-900 hover:text-gray-600 dark:text-slate-100 dark:hover:text-slate-200"
|
||||
th:text="${post.owner.displayName}"
|
||||
></a>
|
||||
<div class="flex items-center gap-2 text-xs font-light text-gray-600 dark:text-slate-100">
|
||||
<span th:text="#{common.publishedOn(${#dates.format(post.spec.publishTime,'yyyy-MM-dd')})}"></span>
|
||||
<span class="text-gray-300 dark:text-slate-200">/</span>
|
||||
<span th:text="#{common.visitCount(${post.stats?.visit ?:0})}"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-row items-center gap-1.5 self-end">
|
||||
<div
|
||||
sec:authorize="isAuthenticated()"
|
||||
th:attr="x-data=|uiPermission('${#authentication.name}','system:posts:manage')|"
|
||||
class="flex items-center justify-between"
|
||||
id="edit-button"
|
||||
>
|
||||
<template x-if="shouldDisplay">
|
||||
<a
|
||||
th:href="|/console/posts/editor?name=${post.metadata.name}&returnToView=true|"
|
||||
class="inline-flex items-center justify-center gap-1 whitespace-nowrap rounded-md border border-gray-200 bg-white px-4 py-1 text-sm font-medium leading-6 text-gray-600 shadow-sm hover:bg-gray-50 focus:shadow-none focus:outline-none dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:hover:bg-slate-600 dark:hover:text-white"
|
||||
>
|
||||
<span class="i-tabler-edit text-lg transition-all group-hover:-translate-x-1"></span>
|
||||
<span th:text="#{common.edit}"></span>
|
||||
</a>
|
||||
</template>
|
||||
</div>
|
||||
<div
|
||||
th:if="${theme.config.post.show_upvote_button}"
|
||||
@click="handleUpvote(name)"
|
||||
class="group inline-flex cursor-pointer items-center rounded-lg"
|
||||
>
|
||||
<div
|
||||
class="inline-flex items-center justify-center rounded-full p-2 transition-all group-hover:bg-gray-100 dark:group-hover:bg-slate-700"
|
||||
>
|
||||
<div
|
||||
class="i-tabler-heart text-lg text-gray-600 group-hover:text-red-600 dark:text-slate-500"
|
||||
x-show="!upvoted(name)"
|
||||
></div>
|
||||
<div class="i-tabler-heart-filled text-lg text-red-600" x-show="upvoted(name)"></div>
|
||||
</div>
|
||||
<span
|
||||
th:attr="data-upvote-post-name=${post.metadata.name}"
|
||||
class="text-sm text-gray-600 group-hover:text-red-600 dark:text-slate-500"
|
||||
th:text="${post.stats?.upvote ?:0}"
|
||||
></span>
|
||||
</div>
|
||||
<a
|
||||
th:if="${haloCommentEnabled}"
|
||||
href="#comment"
|
||||
class="group inline-flex cursor-pointer items-center gap-0.5 rounded-lg"
|
||||
>
|
||||
<div
|
||||
class="inline-flex items-center justify-center rounded-full p-2 transition-all group-hover:bg-gray-100 dark:group-hover:bg-slate-700"
|
||||
>
|
||||
<div
|
||||
class="i-tabler-message-circle text-lg text-gray-600 group-hover:text-indigo-500 dark:text-slate-500"
|
||||
></div>
|
||||
</div>
|
||||
<span
|
||||
class="text-sm text-gray-600 group-hover:text-indigo-500 dark:text-slate-500"
|
||||
th:text="${post.stats?.comment ?:0}"
|
||||
></span>
|
||||
</a>
|
||||
|
||||
<div
|
||||
th:if="${theme.config.post.show_share_button}"
|
||||
th:attr="x-data=|share(${theme.config.post.share_items},${theme.config.post.share_item_ids})|"
|
||||
class="group inline-flex cursor-pointer items-center gap-0.5 rounded-lg"
|
||||
@click="shareModal = true"
|
||||
>
|
||||
<div
|
||||
class="inline-flex items-center justify-center rounded-full p-2 transition-all group-hover:bg-gray-100 dark:group-hover:bg-slate-700"
|
||||
>
|
||||
<div class="i-tabler-share text-lg text-gray-600 group-hover:text-green-500 dark:text-slate-500"></div>
|
||||
</div>
|
||||
<th:block th:replace="~{modules/share-modal}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h1
|
||||
th:if="${#strings.isEmpty(post.spec.cover)} or ${theme.config.post.title_position == 'content'}"
|
||||
class="mt-3 text-3xl font-medium dark:text-slate-50"
|
||||
th:text="${post.spec.title}"
|
||||
></h1>
|
||||
<div class="mt-3 flex gap-2">
|
||||
<a
|
||||
th:each="tag : ${post.tags}"
|
||||
th:href="@{${tag.status.permalink}}"
|
||||
th:title="${tag.spec.displayName}"
|
||||
th:text="|#${tag.spec.displayName}|"
|
||||
class="cursor-pointer text-sm italic text-gray-600 hover:text-gray-900 dark:text-slate-400 dark:hover:text-slate-500"
|
||||
>
|
||||
</a>
|
||||
</div>
|
||||
<article
|
||||
id="content"
|
||||
class="!max-w-none break-words"
|
||||
th:classappend="${theme.config.post.content_style == 'github' ? 'markdown-body' : 'tailwind-typography'}"
|
||||
th:utext="${post.content.content}"
|
||||
></article>
|
||||
<div
|
||||
class="mt-10 flex flex-col sm:flex-row sm:justify-between"
|
||||
th:with="postCursor = ${postFinder.cursor(post.metadata.name)}"
|
||||
>
|
||||
<div class="flex justify-start">
|
||||
<a
|
||||
th:if="${postCursor.hasPrevious()}"
|
||||
role="navigation"
|
||||
class="group inline-flex items-center gap-2 truncate text-sm text-gray-600 hover:text-gray-900 dark:text-slate-100 dark:hover:text-slate-200"
|
||||
th:href="@{${postCursor.previous.status.permalink}}"
|
||||
th:title="${postCursor.previous.spec.title}"
|
||||
>
|
||||
<span class="i-tabler-chevron-left translate-x-1 text-lg transition-all group-hover:-translate-x-0"></span>
|
||||
<span th:text="${#strings.abbreviate(postCursor.previous.spec.title,20)}"></span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<a
|
||||
th:if="${postCursor.hasNext()}"
|
||||
role="navigation"
|
||||
class="group inline-flex items-center gap-2 truncate text-sm text-gray-600 hover:text-gray-900 dark:text-slate-100 dark:hover:text-slate-200"
|
||||
th:href="@{${postCursor.next.status.permalink}}"
|
||||
th:title="${postCursor.next.spec.title}"
|
||||
>
|
||||
<span th:text="${#strings.abbreviate(postCursor.next.spec.title,20)}"></span>
|
||||
<span class="i-tabler-chevron-right -translate-x-1 text-lg transition-all group-hover:translate-x-0"></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<hr th:if="${haloCommentEnabled}" class="my-10 dark:border-slate-700" />
|
||||
<div id="comment" th:if="${haloCommentEnabled}">
|
||||
<h2 class="mb-2 text-base font-medium text-gray-900 dark:text-slate-50" th:text="#{common.comment}"></h2>
|
||||
<halo:comment group="content.halo.run" kind="Post" th:attr="name=${post.metadata.name}" />
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
</html>
|
||||
33
templates/tag.html
Normal file
33
templates/tag.html
Normal file
@ -0,0 +1,33 @@
|
||||
<!doctype html>
|
||||
<html
|
||||
xmlns:th="https://www.thymeleaf.org"
|
||||
th:replace="~{modules/layout :: html(title = |#{page.tag.title(${tag.spec.displayName})} - ${site.title}|, hero = null, content = ~{::content}, head = null, footer = null, sidebar = null, contentClass = null)}"
|
||||
>
|
||||
<th:block th:fragment="content">
|
||||
<div class="rounded-xl bg-white p-4 shadow transition-all duration-500 hover:shadow-md dark:bg-slate-800">
|
||||
<th:block th:replace="~{modules/tag-filter}" />
|
||||
</div>
|
||||
|
||||
<div
|
||||
id="post-list"
|
||||
th:if="${posts.total gt 0}"
|
||||
th:with="postItems=${posts.items},list_layout=${theme.config.layout.post_list_layout}"
|
||||
class="mt-6 grid grid-cols-1 gap-6"
|
||||
th:classappend="|${list_layout == 'grid_3' ? 'md:grid-cols-2 xl:grid-cols-3' : ''} ${list_layout == 'grid_2' ? 'md:grid-cols-2' : ''}|"
|
||||
>
|
||||
<th:block th:each="post : ${postItems}">
|
||||
<th:block
|
||||
th:replace="~{modules/post-card :: post-card(${post},true,true,true,${list_layout == 'single' ? 'column' : 'row'})}"
|
||||
/>
|
||||
</th:block>
|
||||
</div>
|
||||
|
||||
<div th:if="${posts.total == 0}" class="mt-6 flex items-center justify-center">
|
||||
<span class="text-sm font-light text-gray-600 dark:text-slate-200" th:text="#{common.noPosts}"></span>
|
||||
</div>
|
||||
|
||||
<th:block
|
||||
th:replace="~{modules/pagination :: pagination(context = |${tag.status.permalink}/|, prevUrl = ${posts.prevUrl}, nextUrl = ${posts.nextUrl}, totalPages = ${posts.totalPages}, page = ${posts.page}, hasPrevious = ${posts.hasPrevious()}, hasNext = ${posts.hasNext()})}"
|
||||
/>
|
||||
</th:block>
|
||||
</html>
|
||||
43
templates/tags.html
Normal file
43
templates/tags.html
Normal file
@ -0,0 +1,43 @@
|
||||
<!doctype html>
|
||||
<html
|
||||
xmlns:th="https://www.thymeleaf.org"
|
||||
th:replace="~{modules/layout :: html(title = |#{page.tags.title} - ${site.title}|, hero = null, content = ~{::content}, head = null, footer = null, sidebar = null, contentClass = null)}"
|
||||
>
|
||||
<th:block th:fragment="content">
|
||||
<div class="rounded-xl bg-white p-4 shadow transition-all duration-500 hover:shadow-md dark:bg-slate-800">
|
||||
<th:block th:replace="~{modules/tag-filter}" />
|
||||
</div>
|
||||
|
||||
<th:block th:with="tag = ${tagFinder.list(1,1).items[0]}">
|
||||
<th:block th:if="${tag}" th:with="posts = ${postFinder.listByTag(1,10,tag.metadata.name)}">
|
||||
<div
|
||||
id="post-list"
|
||||
th:if="${posts.total gt 0}"
|
||||
th:with="postItems=${posts.items},list_layout=${theme.config.layout.post_list_layout}"
|
||||
class="mt-6 grid grid-cols-1 gap-6"
|
||||
th:classappend="|${list_layout == 'grid_3' ? 'md:grid-cols-2 xl:grid-cols-3' : ''} ${list_layout == 'grid_2' ? 'md:grid-cols-2' : ''}|"
|
||||
>
|
||||
<th:block th:each="post : ${postItems}">
|
||||
<th:block
|
||||
th:replace="~{modules/post-card :: post-card(${post},true,true,true,${list_layout == 'single' ? 'column' : 'row'})}"
|
||||
/>
|
||||
</th:block>
|
||||
</div>
|
||||
|
||||
<div th:if="${posts.total == 0}" class="mt-6 flex items-center justify-center">
|
||||
<span class="text-sm font-light text-gray-600 dark:text-slate-200" th:text="#{common.noPosts}"></span>
|
||||
</div>
|
||||
|
||||
<div th:if="${posts.total gt 10}" class="mt-10 flex justify-end">
|
||||
<a
|
||||
class="group inline-flex items-center gap-2 truncate text-sm text-gray-600 hover:text-gray-900 dark:text-slate-100 dark:hover:text-slate-200"
|
||||
th:href="@{${tag.status.permalink}}"
|
||||
>
|
||||
<span th:text="#{page.tags.morePosts}"></span>
|
||||
<span class="i-tabler-chevron-right -translate-x-1 text-lg transition-all group-hover:translate-x-0"></span>
|
||||
</a>
|
||||
</div>
|
||||
</th:block>
|
||||
</th:block>
|
||||
</th:block>
|
||||
</html>
|
||||
25
theme.yaml
Normal file
25
theme.yaml
Normal file
@ -0,0 +1,25 @@
|
||||
apiVersion: theme.halo.run/v1alpha1
|
||||
kind: Theme
|
||||
metadata:
|
||||
name: theme-earth
|
||||
annotations:
|
||||
# Add supports for Halo App Store
|
||||
# https://halo.run/store/apps/app-KgWqR
|
||||
"store.halo.run/app-id": "app-KgWqR"
|
||||
spec:
|
||||
displayName: Earth
|
||||
author:
|
||||
name: Halo
|
||||
website: https://www.halo.run
|
||||
description: Default theme for Halo 2.0
|
||||
logo: https://www.halo.run/logo
|
||||
homepage: https://www.halo.run/store/apps/app-KgWqR
|
||||
repo: https://github.com/halo-dev/theme-earth
|
||||
issues: https://github.com/halo-dev/theme-earth/issues
|
||||
settingName: "theme-earth-setting"
|
||||
configMapName: "theme-earth-configMap"
|
||||
version: 1.12.4
|
||||
requires: ">=2.20.0"
|
||||
license:
|
||||
- name: "GPL-3.0"
|
||||
url: "https://github.com/halo-dev/theme-earth/blob/main/LICENSE"
|
||||
Loading…
x
Reference in New Issue
Block a user