mirror of
https://github.com/Aexiar/c.git
synced 2024-10-22 12:05:45 +00:00
msg
This commit is contained in:
commit
8c24fb476a
1
.env.development
Normal file
1
.env.development
Normal file
@ -0,0 +1 @@
|
||||
VITE_BASE_URL='/'
|
1
.env.production
Normal file
1
.env.production
Normal file
@ -0,0 +1 @@
|
||||
VITE_BASE_URL='/c/'
|
66
.github/workflows/deploy.yaml
vendored
Normal file
66
.github/workflows/deploy.yaml
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
name: Deploy
|
||||
|
||||
on:
|
||||
# 在针对 `main` 或 `master` 分支的推送上运行
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
- github-pages
|
||||
- gh-pages
|
||||
# 允许我们从 Actions 选项卡手动运行此工作流程
|
||||
workflow_dispatch:
|
||||
|
||||
# 设置 GITHUB_TOKEN 的权限,以允许部署到 GitHub Pages
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
# 只允许同时进行一次部署,跳过正在运行和最新队列之间的运行队列
|
||||
# 但是,不要取消正在进行的运行,因为我们希望允许这些生产部署完成
|
||||
concurrency:
|
||||
group: pages
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
# 构建工作
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "拉取代码"
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: "设置node.js的版本"
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: npm
|
||||
- name: "配置Github Pages"
|
||||
uses: actions/configure-pages@v5
|
||||
- name: "安装依赖"
|
||||
run: |
|
||||
npm install
|
||||
- name: "提取 git 信息"
|
||||
uses: rlespinasse/git-commit-data-action@v1
|
||||
- name: "vitepress 打包"
|
||||
run: |
|
||||
npm run docs:build
|
||||
touch docs/.vitepress/dist/.nojekyll
|
||||
- name: "上传构建"
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: docs/.vitepress/dist
|
||||
# 部署工作
|
||||
deploy:
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
name: Deploy
|
||||
steps:
|
||||
- name: "部署"
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
node_modules
|
||||
cache
|
||||
dist
|
||||
.idea
|
||||
.vscode
|
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>.
|
119
docs/.vitepress/config.mts
Normal file
119
docs/.vitepress/config.mts
Normal file
@ -0,0 +1,119 @@
|
||||
import { defineConfig } from 'vitepress'
|
||||
import { nav } from './navbar'
|
||||
import sidebar from './sidebar'
|
||||
import dayjs from 'dayjs'
|
||||
|
||||
import { loadEnv } from 'vite'
|
||||
const mode = process.env.NODE_ENV || 'development'
|
||||
const { VITE_BASE_URL } = loadEnv(mode, process.cwd())
|
||||
|
||||
console.log('Mode:', process.env.NODE_ENV)
|
||||
console.log('VITE_BASE_URL:', VITE_BASE_URL)
|
||||
|
||||
// https://vitepress.dev/reference/site-config
|
||||
export default defineConfig({
|
||||
lang: 'zh-CN', // 语言
|
||||
title: "许大仙", // 站点名称
|
||||
titleTemplate: "Hi,终于等到你", // 网页标题
|
||||
description: "许大仙前端、Java、大数据、云原生", // 站点描述
|
||||
head: [ // favicon.ico 图标等
|
||||
['link', { rel: "shortcut icon", href: `/logo.svg` }],
|
||||
// 网站 favicon.ico 图标
|
||||
['link', { rel: "icon", href: `/logo.svg`, type: "image/svg+xml" }],
|
||||
// 引入 Google Fonts
|
||||
['link', { rel: 'preconnect', href: 'https://fonts.googleapis.com' }],
|
||||
['link', { rel: 'preconnect', href: 'https://fonts.gstatic.com', crossorigin: '' }],
|
||||
['link', { href: 'https://fonts.googleapis.com/css2?family=Roboto&display=swap', rel: 'stylesheet' }],
|
||||
// 网页视口
|
||||
['meta', { name: "viewport", content: "width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no,shrink-to-fit=no" }],
|
||||
// 关键词和描述
|
||||
['meta', { name: "keywords", content: "许大仙,许大仙的博客" }],
|
||||
],
|
||||
appearance: true, // 主题模式,默认浅色且开启切换
|
||||
base: VITE_BASE_URL,
|
||||
transformHtml: (code) => {
|
||||
// 匹配所有 href 链接,并检查其中是否有 target="_blank"
|
||||
return code.replace(/href="([^"]*)"(.*?)>/g, (match, href, rest) => {
|
||||
// 如果链接包含 target="_blank" 并且以 base 开头
|
||||
if (rest.includes('target="_blank"') && href.startsWith(VITE_BASE_URL)) {
|
||||
// 去掉 href 中的 base 前缀
|
||||
const newHref = href.replace(VITE_BASE_URL, '/') // 保留一个 '/'
|
||||
return `href="${newHref}"${rest}>`
|
||||
}
|
||||
// 否则返回原链接
|
||||
return match
|
||||
})
|
||||
},
|
||||
lastUpdated: true, // 上次更新
|
||||
vite: {
|
||||
build: {
|
||||
chunkSizeWarningLimit: 1600
|
||||
},
|
||||
plugins: [],
|
||||
server: {
|
||||
port: 18088
|
||||
}
|
||||
},
|
||||
markdown: { // markdown 配置
|
||||
math: true,
|
||||
lineNumbers: true, // 行号显示
|
||||
image: {
|
||||
// 开启图片懒加载
|
||||
lazyLoading: true
|
||||
},
|
||||
// 组件插入h1标题下
|
||||
config: (md) => {
|
||||
// 创建 markdown-it 插件
|
||||
md.use((md) => {
|
||||
const defaultRender = md.render
|
||||
md.render = function (...args) {
|
||||
const [content, env] = args
|
||||
const isHomePage = env.path === '/' || env.relativePath === 'index.md' // 判断是否是首页
|
||||
|
||||
if (isHomePage) {
|
||||
return defaultRender.apply(md, args) // 如果是首页,直接渲染内容
|
||||
}
|
||||
// 调用原始渲染
|
||||
let defaultContent = defaultRender.apply(md, args)
|
||||
// 替换内容
|
||||
defaultContent = defaultContent.replace(/NOTE/g, '提醒')
|
||||
.replace(/TIP/g, '建议')
|
||||
.replace(/IMPORTANT/g, '重要')
|
||||
.replace(/WARNING/g, '警告')
|
||||
.replace(/CAUTION/g, '注意')
|
||||
// 返回渲染的内容
|
||||
return defaultContent
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
themeConfig: { // 主题设置
|
||||
lastUpdatedText: '上次更新', // 上次更新显示文本
|
||||
returnToTopLabel: '返回顶部', // 更改手机端菜单文字显示
|
||||
search: { // 本地搜索
|
||||
provider: 'local'
|
||||
},
|
||||
logo: '/logo.svg', // 左上角logo
|
||||
nav: nav, // 导航栏
|
||||
sidebar: sidebar, // 侧边栏
|
||||
socialLinks: [ // 社交链接
|
||||
{ icon: 'github', link: 'https://github.com/Aurorxa' },
|
||||
],
|
||||
docFooter: { // 自定义上下页名
|
||||
prev: '上一篇', next: '下一篇'
|
||||
},
|
||||
darkModeSwitchLabel: '深浅模式', // 手机端深浅模式文字修改
|
||||
footer: { // 页脚
|
||||
message: 'Released under the MIT License.',
|
||||
copyright: `Copyright © ${dayjs().format("YYYY")} 许大仙`
|
||||
},
|
||||
outline: { // 大纲显示 1-6 级标题
|
||||
level: [1, 6],
|
||||
label: '目录'
|
||||
},
|
||||
//大纲顶部标题
|
||||
outlineTitle: '当前页大纲',
|
||||
}
|
||||
})
|
||||
|
||||
|
19
docs/.vitepress/navbar/index.ts
Normal file
19
docs/.vitepress/navbar/index.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import { DefaultTheme } from 'vitepress'
|
||||
export const nav: DefaultTheme.NavItem[] = [
|
||||
{ text: '首页', link: '/' },
|
||||
{ text: '计组6件套', link: '/coa6/notes/', target: '_blank' },
|
||||
{
|
||||
text: '编程语言', items: [
|
||||
{ text: 'c/c++', link: '/notes/' },
|
||||
{ text: '前端', link: '/web-design/notes/', target: '_blank' },
|
||||
{ text: 'Java', link: '/java/notes/', target: '_blank' },
|
||||
{ text: '大数据', link: '/big-data/notes/', target: '_blank' },
|
||||
{ text: '云原生', link: '/linux/notes/', target: '_blank' },
|
||||
{ text: 'Go', link: '/go/notes/', target: '_blank' },
|
||||
{ text: 'Python', link: '/python/notes/', target: '_blank' },
|
||||
]
|
||||
},
|
||||
{ text: '数据库', link: '/db/notes/', target: '_blank' },
|
||||
{ text: '开源软件', link: '/open-software/notes/', target: '_blank' },
|
||||
{ text: '关于我', link: '/notes/about/' },
|
||||
]
|
168
docs/.vitepress/sidebar/index.ts
Normal file
168
docs/.vitepress/sidebar/index.ts
Normal file
@ -0,0 +1,168 @@
|
||||
import { DefaultTheme } from 'vitepress'
|
||||
import { commonDirectoryName } from '../utils/constant'
|
||||
export const sidebar: DefaultTheme.Sidebar = {
|
||||
'/notes/': [
|
||||
{
|
||||
text: 'C 语言基础',
|
||||
collapsed: true,
|
||||
items: [
|
||||
{ text: '编程基础', link: `/notes/01_c-basic/00_${commonDirectoryName}/` },
|
||||
{ text: 'C 语言入门', link: `/notes/01_c-basic/01_${commonDirectoryName}/` },
|
||||
{ text: '变量和进制', link: `/notes/01_c-basic/02_${commonDirectoryName}/` },
|
||||
{ text: '数据类型和运算符', link: `/notes/01_c-basic/03_${commonDirectoryName}/` },
|
||||
{ text: '大话小数', link: `/notes/01_c-basic/04_${commonDirectoryName}/` },
|
||||
{ text: '流程控制', link: `/notes/01_c-basic/05_${commonDirectoryName}/` },
|
||||
{ text: '内存泄漏和内存溢出', link: `/notes/01_c-basic/06_${commonDirectoryName}/` },
|
||||
{ text: '数组', link: `/notes/01_c-basic/07_${commonDirectoryName}/` },
|
||||
]
|
||||
},
|
||||
{
|
||||
text: 'C 语言进阶',
|
||||
collapsed: true,
|
||||
items: [
|
||||
{ text: '指针一', link: `/notes/02_c-leap/01_${commonDirectoryName}/` },
|
||||
{ text: '指针二', link: `/notes/02_c-leap/02_${commonDirectoryName}/` },
|
||||
{ text: '指针三', link: `/notes/02_c-leap/03_${commonDirectoryName}/` },
|
||||
{ text: '函数一', link: `/notes/02_c-leap/04_${commonDirectoryName}/` },
|
||||
{ text: '函数二', link: `/notes/02_c-leap/05_${commonDirectoryName}/` },
|
||||
{ text: '预处理器', link: `/notes/02_c-leap/06_${commonDirectoryName}/` },
|
||||
{ text: '自定义数据类型', link: `/notes/02_c-leap/07_${commonDirectoryName}/` },
|
||||
{ text: '常见的库函数', link: `/notes/02_c-leap/08_${commonDirectoryName}/` },
|
||||
{ text: '内存管理', link: `/notes/02_c-leap/09_${commonDirectoryName}/` },
|
||||
{ text: '文件操作', link: `/notes/02_c-leap/10_${commonDirectoryName}/` },
|
||||
]
|
||||
},
|
||||
{
|
||||
text: 'C 语言高级',
|
||||
collapsed: true,
|
||||
items: [
|
||||
{ text: '变量和内存分布', link: `/notes/03_senior/01_${commonDirectoryName}/` },
|
||||
{ text: '指针强化', link: `/notes/03_senior/02_${commonDirectoryName}/` },
|
||||
{ text: '结构体和文件的高级用法', link: `/notes/03_senior/03_${commonDirectoryName}/` },
|
||||
{ text: '链表和回调函数', link: `/notes/03_senior/04_${commonDirectoryName}/` },
|
||||
{ text: '编译过程和面向接口', link: `/notes/03_senior/05_${commonDirectoryName}/` },
|
||||
]
|
||||
},
|
||||
{
|
||||
text: '数据结构和算法',
|
||||
collapsed: true,
|
||||
items: [
|
||||
{ text: '变量和内存分布', link: `/notes/02_c-advance/01_${commonDirectoryName}/` },
|
||||
{ text: '指针强化', link: `/notes/02_c-advance/02_${commonDirectoryName}/` },
|
||||
{ text: '结构体和文件的高级用法', link: `/notes/02_c-advance/03_${commonDirectoryName}/` },
|
||||
{ text: '链表和回调函数', link: `/notes/02_c-advance/04_${commonDirectoryName}/` },
|
||||
{ text: '编译过程和面向接口', link: `/notes/02_c-advance/05_${commonDirectoryName}/` },
|
||||
]
|
||||
},
|
||||
{
|
||||
text: 'Socket网络通信',
|
||||
collapsed: true,
|
||||
items: [
|
||||
{ text: '变量和内存分布', link: `/notes/02_c-advance/01_${commonDirectoryName}/` },
|
||||
{ text: '指针强化', link: `/notes/02_c-advance/02_${commonDirectoryName}/` },
|
||||
{ text: '结构体和文件的高级用法', link: `/notes/02_c-advance/03_${commonDirectoryName}/` },
|
||||
{ text: '链表和回调函数', link: `/notes/02_c-advance/04_${commonDirectoryName}/` },
|
||||
{ text: '编译过程和面向接口', link: `/notes/02_c-advance/05_${commonDirectoryName}/` },
|
||||
]
|
||||
},
|
||||
{
|
||||
text: '多线程编程(基于 Linux)',
|
||||
collapsed: true,
|
||||
items: [
|
||||
{ text: '变量和内存分布', link: `/notes/02_c-advance/01_${commonDirectoryName}/` },
|
||||
{ text: '指针强化', link: `/notes/02_c-advance/02_${commonDirectoryName}/` },
|
||||
{ text: '结构体和文件的高级用法', link: `/notes/02_c-advance/03_${commonDirectoryName}/` },
|
||||
{ text: '链表和回调函数', link: `/notes/02_c-advance/04_${commonDirectoryName}/` },
|
||||
{ text: '编译过程和面向接口', link: `/notes/02_c-advance/05_${commonDirectoryName}/` },
|
||||
]
|
||||
},
|
||||
{
|
||||
text: '静态链接库和动态链接库',
|
||||
collapsed: true,
|
||||
items: [
|
||||
{ text: '变量和内存分布', link: `/notes/02_c-advance/01_${commonDirectoryName}/` },
|
||||
{ text: '指针强化', link: `/notes/02_c-advance/02_${commonDirectoryName}/` },
|
||||
{ text: '结构体和文件的高级用法', link: `/notes/02_c-advance/03_${commonDirectoryName}/` },
|
||||
{ text: '链表和回调函数', link: `/notes/02_c-advance/04_${commonDirectoryName}/` },
|
||||
{ text: '编译过程和面向接口', link: `/notes/02_c-advance/05_${commonDirectoryName}/` },
|
||||
]
|
||||
},
|
||||
{
|
||||
text: '项目构建工具',
|
||||
collapsed: true,
|
||||
items: [
|
||||
{
|
||||
text: 'meson', collapsed: true, items: [
|
||||
{ text: 'meson 入门', link: `/notes/03_build/01_${commonDirectoryName}/` },
|
||||
]
|
||||
},
|
||||
{
|
||||
text: 'Cmake', collapsed: true, items: [
|
||||
{ text: 'Cmake 入门', link: `/notes/03_build/01_${commonDirectoryName}/` },
|
||||
]
|
||||
},
|
||||
{
|
||||
text: 'Conan', link: '/notes/03_build/01_${commonDirectoryName}/'
|
||||
},
|
||||
{
|
||||
text: 'Gradle', collapsed: true, items: [
|
||||
{ text: 'Gradle 入门', link: `/notes/03_build/01_${commonDirectoryName}/` },
|
||||
]
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
text: 'Linux',
|
||||
collapsed: true,
|
||||
items: [
|
||||
{ text: 'Linux 初识和安装', link: `/notes/04_linux/01_${commonDirectoryName}/` },
|
||||
]
|
||||
},
|
||||
{
|
||||
text: 'C++ 基础',
|
||||
collapsed: true,
|
||||
items: [
|
||||
{ text: 'C++ 入门', link: `/notes/05_cpp/01_${commonDirectoryName}/` },
|
||||
{ text: '变量、数据类型、运算符', link: `/notes/05_cpp/02_${commonDirectoryName}/` },
|
||||
{ text: '流程控制', link: `/notes/05_cpp/03_${commonDirectoryName}/` },
|
||||
{ text: '数组', link: `/notes/05_cpp/04_${commonDirectoryName}/` },
|
||||
{ text: '指针', link: `/notes/05_cpp/05_${commonDirectoryName}/` },
|
||||
{ text: '函数', link: `/notes/05_cpp/06_${commonDirectoryName}/` },
|
||||
{ text: '自定义数据类型', link: `/notes/05_cpp/07_${commonDirectoryName}/` },
|
||||
{ text: '类和对象', link: `/notes/05_cpp/08_${commonDirectoryName}/` },
|
||||
{ text: 'C++ 引用', link: `/notes/05_cpp/09_${commonDirectoryName}/` },
|
||||
{ text: '继承和派生', link: `/notes/05_cpp/10_${commonDirectoryName}/` },
|
||||
{ text: 'C++ 多态和虚函数', link: `/notes/05_cpp/11_${commonDirectoryName}/` },
|
||||
{ text: '运算符重载', link: `/notes/05_cpp/12_${commonDirectoryName}/` },
|
||||
{ text: '模板', link: `/notes/05_cpp/13_${commonDirectoryName}/` },
|
||||
{ text: 'C++ 异常', link: `/notes/05_cpp/14_${commonDirectoryName}/` },
|
||||
{ text: '面向对象进阶', link: `/notes/05_cpp/15_${commonDirectoryName}/` },
|
||||
{ text: '文件操作和 IO 流', link: `/notes/05_cpp/16_${commonDirectoryName}/` },
|
||||
{ text: 'STL(标准模板库)', link: `/notes/05_cpp/17_${commonDirectoryName}/` },
|
||||
]
|
||||
},
|
||||
{
|
||||
text: 'C++ 高级',
|
||||
collapsed: true,
|
||||
items: [
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
text: 'QT 桌面开发',
|
||||
collapsed: true,
|
||||
items: [
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
text: 'Linux 高并发服务器开发',
|
||||
collapsed: true,
|
||||
items: [
|
||||
|
||||
]
|
||||
}
|
||||
],
|
||||
}
|
||||
|
||||
export default sidebar
|
81
docs/.vitepress/theme/components/ArticleMetadata.vue
Normal file
81
docs/.vitepress/theme/components/ArticleMetadata.vue
Normal file
@ -0,0 +1,81 @@
|
||||
<template>
|
||||
<div class="word">
|
||||
<p>
|
||||
<span>🔥更新:{{ dayjs(date.toLocaleDateString()).format("YYYY-MM-DD") }}</span>
|
||||
<span>📝字数: {{ wordCount }} 字</span>
|
||||
<span>⏱时长: {{ readTime }} 分钟</span>
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import dayjs from "dayjs"
|
||||
import { useData } from "vitepress"
|
||||
import { computed, ref, onMounted, watch } from "vue"
|
||||
import { countWord } from "../utils/functions"
|
||||
import { useRoute } from "vitepress"
|
||||
|
||||
const route = useRoute() // 使用 vitepress 提供的 useRoute
|
||||
|
||||
const { page } = useData()
|
||||
const date = computed(() => new Date(page.value.lastUpdated!))
|
||||
|
||||
const wordCount = ref(0)
|
||||
const imageCount = ref(0)
|
||||
|
||||
const wordTime = computed(() => {
|
||||
return (wordCount.value / 275) * 60
|
||||
});
|
||||
|
||||
const imageTime = computed(() => {
|
||||
const n = imageCount.value
|
||||
if (imageCount.value <= 10) {
|
||||
// 等差数列求和
|
||||
return n * 13 + (n * (n - 1)) / 2
|
||||
}
|
||||
return 175 + (n - 10) * 3
|
||||
});
|
||||
|
||||
// 阅读时间
|
||||
const readTime = computed(() => {
|
||||
return Math.ceil((wordTime.value + imageTime.value) / 60)
|
||||
});
|
||||
|
||||
function analyze() {
|
||||
document.querySelectorAll(".meta-des").forEach((v) => v.remove())
|
||||
const docDomContainer = window.document.querySelector("#VPContent")
|
||||
const imgs = docDomContainer?.querySelectorAll<HTMLImageElement>(
|
||||
".content-container .main img"
|
||||
);
|
||||
imageCount.value = imgs?.length || 0
|
||||
const words =
|
||||
docDomContainer?.querySelector(".content-container .main")?.textContent || ""
|
||||
wordCount.value = countWord(words)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
// 初始化时执行一次
|
||||
analyze()
|
||||
});
|
||||
|
||||
// 监听路由变化,当路径变化时重新检查
|
||||
watch(
|
||||
() => route.path,
|
||||
() => {
|
||||
analyze()
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.word {
|
||||
color: var(--vp-c-text-2);
|
||||
font-size: 15px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.icon {
|
||||
display: inline-block;
|
||||
transform: translate(0px, 2px);
|
||||
}
|
||||
</style>
|
56
docs/.vitepress/theme/components/HomeUnderline.vue
Normal file
56
docs/.vitepress/theme/components/HomeUnderline.vue
Normal file
@ -0,0 +1,56 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted } from "vue";
|
||||
import { useData } from "vitepress";
|
||||
|
||||
/**
|
||||
* 获取当前页面的数据,包括前言和其它信息。
|
||||
* @returns {Object} 包含前言(frontmatter)等数据。
|
||||
*/
|
||||
const { frontmatter: fm } = useData();
|
||||
|
||||
/**
|
||||
* 在组件挂载后,移动指定的 DOM 元素。
|
||||
* 将 `#hero-text` 元素移动到 `.VPHero .text` 元素内部。
|
||||
*/
|
||||
onMounted(() => {
|
||||
const p = document.querySelector(".VPHero .text") as HTMLElement | null;
|
||||
const s = document.querySelector("#hero-text") as HTMLElement | null;
|
||||
|
||||
if (!p || !s) return;
|
||||
|
||||
// 移除 `.VPHero .text` 元素下的所有子节点
|
||||
while (p.lastChild) p.lastChild.remove();
|
||||
|
||||
// 将 `#hero-text` 元素追加到 `.VPHero .text` 元素中
|
||||
p.append(s);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div id="hero-text">
|
||||
<span style="display: inline-block; position: relative">
|
||||
{{ fm.hero.text }}
|
||||
<svg
|
||||
style="
|
||||
color: var(--vp-c-brand);
|
||||
position: absolute;
|
||||
z-index: -1;
|
||||
top: 1em;
|
||||
left: 0.2em;
|
||||
width: calc(100% - 0.7em);
|
||||
height: auto;
|
||||
"
|
||||
width="240"
|
||||
height="11"
|
||||
viewBox="0 0 240 11"
|
||||
fill="currentColor"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M20.766 10.187c.939-.024.386-.885.552-1.401 1.105-.301.553.626.962 1.061.685-.263 1.171-1.1 1.696-1.085.044.144.15.191.044.378.697-.736 2.21-.134 2.995-1.052a.55.55 0 0 1 .127.215 3.35 3.35 0 0 1-.204-1.204c.42-.034.751-.593.94 0-.255 0-.266.23-.377.416l.426-.273c.448.813-.586.316-.553.927.84-.306 1.802-1.037 2.476-.831.182.803-1.525.339-.608 1.023l-1.033-.268c.85 1.248-.625-.057.171 1.276 1.348.177 1.47-.478 2.818-.3.276-.479-.132-.66.144-1.124 1.857-.885 1.602 1.984 2.94.846.337-.555.42-1.582 1.442-1.08l-.276.889c1.298.038.668-1.348 2.06-.784-.226.368-1.005.344-.8.444.917.689.59-.545 1.27-.569l.16.827c1.371-.181 2.863-.827 4.388-1.037-.072.249-.326.512.044.746 1.912-.478 4.123-.058 6.007.368l.68-.727c.05.015.095.04.132.074a.275.275 0 0 1 .077.118c.014.044.015.091.004.136a.27.27 0 0 1-.07.122c.74.243 0-.445.354-.732.414-.062.552.383.315.603 1.248-.636 3.586-1.401 4.973-.694l-.254.22c1.06.249 1.105-1.477 2.127-.855l-.182.129c2.293.23 4.785-.478 6.564.52.293-1.017 2.272.393 2.365-1.022 1.327.664.967.927 2.813 1.348.492.052.702-.899 1.299-1.061l.044.731.79-.794.47.87.552-.205a.66.66 0 0 1-.332-.2.517.517 0 0 1-.132-.33c.873-.354 2.177.477 2.21.831l2.078-.679c-.039.301-.387.411-.657.607 1.105-.779.226.77 1.232.053-.144-.163.06-.44.077-.588.553.435 1.691.416 2.547.205l-.149.512c1.558.1 3.271-.31 5.018-.335-.636-.224-.514-1.109 0-1.204l.226.774c.32-.478-.552-.282.122-.884.652.076.464.875.094 1.138l.784-.287c.056.23-.127.358-.165.655.309-.478 1.387.75 1.834-.096l.05.23c1.746-.03 2.53-.316 3.95-.383 0-.674.553-.535.984-1.085 1.05.196 2.21.707 3.482.63.878-.343.243-.568.635-.955.077.612 1.332.535.69.985a15.353 15.353 0 0 0 3.83-.68c-.21-.243-.447-.353-.331-.563a.738.738 0 0 1 .275.01c.09.02.173.058.245.11a.58.58 0 0 1 .169.188c.04.072.061.151.062.232l-.088.067c2.127-.956 4.973 1.706 6.669.41l-.099.068 1.763-.684c.817.1-.481.478.127.842 1.9-1.043 3.022.12 4.586-.574 1.243 1.793 4.327-.167 5.979.956l-.1-.42c.426-.421.52.234.835.33-.05-.33-.464-.378-.205-.613 3.598-.545 7.438.598 11.129.956 1.348.11.757-2.203 2.465-1.195l-.481.794c2.719-.956 5.564 0 8.233-.77-.154.182-.16.416-.425.416.552.574 2.083.034 2.094-.435.42.053.1.425.354.665.552.339 1.42-.732 1.718-.158.05.09-.16.186-.265.23.37-.278 1.719.076 1.365-.589 1 .32 1.917-.287 2.713.105.553-.736 1.713.364 1.884-.683-.077 1.08 1.752.875 2.387.377-.215.326.553.345.299.794.718 0 1.381-.206 1.265-.76 1.315 1.305 2.686-1.018 3.415.645a45.888 45.888 0 0 1 6.078-1.17c-.082 1.075-2.138.09-2.066 1.218 1.834-.425 2.906-1.343 4.719-1.066.47.153-.276.478-.437.65 1.835-.43 3.537.148 5.172-.42 0 .1-.182.21-.348.291.321-.033.741.167.713-.325l-.315.13c-.497-.718 1.304-1.468 1.365-1.841-.553 1.396 1.602.377.707 2.137a.73.73 0 0 0 .337-.263.58.58 0 0 0 .1-.383c.315.1.409.297.083.665 1.155-.254.757-.78 1.801-.75 0 .233-.221.324-.337.601.553-.478 1.078-.908 1.951-.697-.056.143.044.33-.216.325 1.509-.048 2.603-1.195 4.249-.722-.513 1.023.553.349.625 1.243l.895-.254-.348-.44c.785.034 1.492-.602 2.155-.296l-.591.354 1.47-.139-.824-.354c.807-.444-.055-1.132.978-.86-.21.086.785.029 1.177.56.398-.278.801-.57 1.376-.335.138.291-.149.984-.055 1.176.398-.736 1.834-.168 2.337-.956-.143.227-.192.49-.138.745l.337-.597c.359.2.409.296.337.669 1.105.134-.309-1.138.967-.626-.105.048-.055.138-.27.23 1.287.277 2.519-.335 3.702 0 .326.903-1.05.195-.669.955 1.724-.129 3.592-.999 5.25-.74l-.31-.106c.277-1.262 1.221.66 2.083.086-.21.086-.298.693-.237.555 1.105.234 2.343-.249 4.083-.603l-.226.32c.657.311 1.763.216 2.481.383.226-.315.641-.253.403-.731 2.166 1.912 4.305-.89 6.228.726-.238 0-.553.268-.387.273l1.702-.244c-.111-.554-.21-.34-.553-.784.124-.163.292-.298.489-.392.198-.094.419-.145.644-.148-.774.34-.028.884.287 1.205-.049-.173.072-.354.05-.526.846 1.008.199-1.11 1.376-.407l-.077.287c.458-.134.889-.478 1.37-.401.177.645-.492.282-.552.803.685 0 1.403-1.162 1.994-.507-.298.167-.718.158-1.016.325.641.77.729.583 1.221.717h-.044l1.138.378-.282-.21c.928-1.635 1.752-.25 2.951-1.3-1.166.994-.21.592-.332 1.309.288.21.724.454.586.65.553-.564.89.478 1.696-.34 0 .235.581.044.431.627.713-.163-.149-.411-.077-.703 1.133-.76 2.514 1.061 4.139.029 1.376-.397 1.658-1.171 2.94-1.515.403.392-.393.836-.393.836.267.161.581.255.906.27a1.97 1.97 0 0 0 .934-.184c-.138.196 0 .373.172.64.519-.038.386-.831 1.05-.477a3.24 3.24 0 0 1-.553.918c.619-.192 1.243-.603 1.884-.79.149.412-.409.603-.646.856.718-.153 1.851-.296 2.105-.927l-.442-.248c.26 0 .105.559-.094.669-.63.478-.862-.258-.884-.478l.459-.134c-.387-1.382-1.818.148-2.719.033l.431-.956-.973.784c-.182-.263-.287-.822.166-.956-.624-.516-.591.33-1.105-.239-.055-.086-.028-.134.033-.172l-.646.273c.132-.201-.072-.703.309-.545-1.105-.617-1.873.674-2.26-.096l.099-.057c-1.596.272-.193.721-1.414 1.534l-.713-1.83-.188.721c-.16-.033-.481-.1-.409-.387-.63.478.089.32-.287.78-.752-.699-2.172.229-2.293-.957-.31.545.729.478-.127.813-.183-1.258-.978.181-1.658-.416.254-.636.917-.273.226-.875-.486 1.076-1.386-.282-2-.096-.066.87-1.332.32-2.354.579.078-.292-1.89-.54-2.818-.885l.033-.148c-.221.87-1.182.674-1.901.832a.906.906 0 0 1 .132-.55c.102-.169.258-.31.449-.406h-.669a.979.979 0 0 1-.34.327 1.167 1.167 0 0 1-.478.151l.194-.65c-.885 0-1.813.712-2.94.244-.083.607.84 1.725-.381 2.103-.034-.335-.056-.899.27-1.028-.105.043-.381.263-.585.12l.502-.545c-.508-.258-.287.478-.701.397 0-.478-.293-.35-.221-.722.11-.038.359.205.525 0a1.931 1.931 0 0 1-.691-.264 1.649 1.649 0 0 1-.503-.487c.028.268-.028.636-.37.684-.89 0-.282-.574-.79-.832-.227.325-.78-.033-.824.674-.259 0-.293-.34-.387-.535-.469.3-2.149.033-1.657.793l.116.053s-.05 0-.078.033c-1.525.66-3.105-.478-4.608-.224V3.34c-.895.244-1.984.106-2.636.593a.711.711 0 0 1-.402-.28.553.553 0 0 1-.084-.442c-.691.158-.774.416-1.746 0 .701-.396-.221-.373.713-.287-.879-.224-1.067-.607-2.039 0 .342-.597-.641-.774-1.067-.602l.608.445c-.436.053-.88.039-1.31-.043l.254-.794c-1.784-1.004-3.315 1.578-4.647-.067-.497.545.973.411.553 1.052-.829-.124-1.658-1.286-1.929-1.29-1.132-.479-1.105 1.137-2.282.812a.818.818 0 0 1 .031.774.938.938 0 0 1-.264.323 1.11 1.11 0 0 1-.397.198c-.829-.124-.994-1.214-.464-1.434.205 0 .299.072.288.168.27-.096.629-.21.303-.526l-.116.282c-.403-.297-1.552-.292-1.271-.75-.635.257-.281.477.183.616-1.061-.435-1.658-.053-2.763-.344.171.162.326.478.155.478-1.608-.378-.724.526-1.824.636-.608-.445.249-1.033-.862-.684-.668-.306-.127-.755.149-.985-1.016.536-1.867-.387-2.442-.478l.553-.22a1.892 1.892 0 0 1-.846.12l.293.573c-.309-.105-.553-.11-.553-.348-.326.368.227.956-.42 1.434-.403-.297-1.265.286-1.392-.478 1.298.272-.127-.76.978-.866a1.102 1.102 0 0 1-.851.024c-.044-.086.044-.157.133-.2-1.233-.689-.592.846-1.879.807.171-.42-.287-.808-.497-.721.519 0 .237.712-.249 1.027-.823-.34-.906.235-1.337.187l.491.162c-.176.426-.585.364-1.165.478-.045-.33.524-.22.326-.368-.652.736-1.437-.793-2.338-.306-.409-.291-.027-.798-.387-.999-1.011.54-1.077-.588-2.133-.148.293.574.349.435-.403.985l1.735-.387-1.105.822c.525 0 1.105-.35 1.42-.249-.553.478-.481.316-.238.794-.701-.86-1.425.478-2.21-.1l.044-1.41c-1.232-.641-2.21.702-3.823.334l.513.248c-.221.56-.994.072-1.519.292.055-.478-.271-.645-.492-.956.028.349-1.177-.043-1.337.899l-.707-.627c-1.305-.267-1.503 1.33-2.763 1.157.381-.507-.183-.846.657-1.21-.414 0-.79-.095-.801.23-.276-.263-1.199.646-1.575.215-.182.206-.243.698-.713.655a.337.337 0 0 1 0-.234c0 .234-.735.31-.331.837-1.271-1.478-3.592.095-4.708-1.172-.936.165-1.883.277-2.835.335.05-.139 0-.234.16-.186-1.143-.44-.707 1.352-2.005.86-.664-.765.69-.411.276-.703-.171-1.553-1.564.21-2.437-.702l.21-.091c-.663-.555-1.608.564-2.713.454a.326.326 0 0 0 0-.234c-.746.784-2.155 1.051-3.205 1.271.326-.607.475-.32.276-.956-.47.091.138.99-.801 1.167-.304-.33-.984-.622-1.078-1.282l.89-.019c-.459-.85-1.149.034-1.613-.114l.055-.368c-1.36.124-1.376 1.06-2.835.999l.155.282c-.796.956-.674-.521-1.465.172l-.248-.956c-.871.453-1.797.82-2.763 1.094.552-.698 1.658-1.06 2.315-1.477-.519 0-1.774.072-2.044.54.21-.09.475-.325.685-.181a2.832 2.832 0 0 1-1.094.83 3.298 3.298 0 0 1-1.42.27c.171-1.832-2.713-.455-3.482-1.865-1.834.693-3.652-.258-5.796-.13.774 1.435-.625.049-.481 1.507-.497.1-.685.076-.729 0l-1.525-.86c-.365-.421.469-.326.42-.65-1.106-.106-.465-.618-1.194-1 .155.521-.37.75-1 .56l.901.659c-1.52.793-1.338-1.214-2.868-.43l.48-.478c-.79.277-2.917 0-3.674 1.204-.144-.167-.332-.564 0-.674-1.89-.148-4.183 1.31-5.664.612l.138-.358c-.348.105-.602.678-1.05.325 0-.148.138-.359 0-.378-.182.124-.923.64-1.392.44l.386-.411c-1.85-.44-2.807 1.023-4.343 1.29 0-1.051-1.475-1.376-2.21-1.53V.685c-2.15-.086-3.625.956-5.598 1.4-1.265-1.118-4.188-.392-6.194-.99.31.182 0 .818-.37.957-.475-.206-1.266.755-1.221-.21h.165c-.375-.957-1.326-.67-2.072-.675l-.083 1.267c-2.006-1.778-5.106.813-6.227-.803-.459.33-1.045.34-1.498.67v-.68a12.396 12.396 0 0 0-3.575 0l.31-.478c-.912 0-1.072 1.98-1.912 2.042l-.288-1c-1.591.053-3.232-.774-4.763.192 0-.148.055-.445.31-.478-.746 0-2.918-.588-2.587.788-.06-.903-1.657-.038-2.48.388l.104-.689c-.685.875-.701 1.11-1.696 1.377-.243-.076-.238-.526.088-.368-.812-.32-.59.655-1.574.33l.342-.435c-.823-.029-.746.2-1.177.707-.503.287-1.564-.114-1.713-.712-.094.368-.52.875-1.011.717a.38.38 0 0 1 .013-.245.442.442 0 0 1 .164-.2c-1.393-.406-2 .851-2.973.235a.553.553 0 0 0-.182-.392 9.431 9.431 0 0 1 1.89.028c0-.616-.912-.688-.255-1.563-.685.478-1.845 1.54-2.713 1.286a.84.84 0 0 1-.1-.215l.061-.072a.668.668 0 0 0-.295 0 .61.61 0 0 0-.257.125 1.992 1.992 0 0 0-.718-.158c-.128-.507-1.023-.234-1.465-.244.072.67-.508.583.06 1.119-.07-.048.078-.086.366-.125a.528.528 0 0 0 .188-.076l-.028.062c.287-.033.663-.062 1.105-.09-.332.358-.68.654-1.183.3-.204.445-.43.894-.552 1.11-.647-.914-1.83-1.377-2.022-1.946-1.321.43-3.145.368-3.918 1.663-.376.177-.459-.344-.614-.535.216-.139.476-.13.586-.316-.74.354-2.249.216-2.381 1.105-.984-.364.491-.837-.818-.636l.166-.277c-2.675-1.291-4.09 2.433-7.068.755.204.105.304.148.354.296-3.316-.645-6.709 1.038-10.018-.062-.94-.205-1 .359-1.531.818l-.249-.713-.906.88c-1.315.679-2.47-1.65-4.117-.411l.254.478c-.624-.058-1.939.387-1.873-.177-.055.09-.166.516-.425.272l-.044-.372-1.487.712c-1.199-.215.078-1.506-1.658-1.492C.895 5.105-.22 6.114.04 6.362c.178.01.347.073.478.179a.645.645 0 0 1 .24.4l-.558.225C.17 8.279-.194 9.44 1.304 10.144l.917-.732.36.521-.818.1c.513.479.784 0 1.105-.305.07.225.233.42.458.55l.907-1.114c.149.43-.376.884.292 1.094.426-.516-.502-.956.233-1.314.513.478.403.898.933.44a.447.447 0 0 1 .012.336.525.525 0 0 1-.233.27c.476-.367 1.304-.214 1.525-.817.553.598 1.658-.248 1.691.808.29-.433.74-.77 1.277-.956-.752 1.3 1.724 0 1.591 1.348.553-1.162 2.21-.617 3.255-1.3-.055.095-.16.282-.265.23.624.061.823.391 1.237.592 0-.956.967-1.195 1.448-1.797.812.87-.392 1.118-.1 1.974-.082-.755 1.272-.813.973-1.434.614.53.514.248.862 1.008.028-1.17.553-.22.962-.956.873.54.282 1.086 1.182.689.453.354-.342.808-.342.808Zm21.793-2.93-.447.057.447-.058Zm1.818-.091a7.552 7.552 0 0 0-.801 0c-.072-.23 0-.478.171-.478-.083.186.348.305.63.478Zm-4.128-4.49c.288-.109.393 0 .442.159-.172.02-.343.053-.508.1v.081a.973.973 0 0 1 .066-.34Z"
|
||||
/>
|
||||
</svg>
|
||||
</span>
|
||||
<!-- {{ fm.hero.image?.alt }} -->
|
||||
</div>
|
||||
</template>
|
151
docs/.vitepress/theme/components/Notice.vue
Normal file
151
docs/.vitepress/theme/components/Notice.vue
Normal file
@ -0,0 +1,151 @@
|
||||
<template>
|
||||
<div v-if="visible" class="notice-background" style="display: block"></div>
|
||||
|
||||
<div v-if="visible" class="notice">
|
||||
<h3 class="notice-title">🛎️本站公告({{ countdown }} 秒)</h3>
|
||||
<div class="notice-describe">
|
||||
<p>🔔本次更新:C 语言预处理器!!!</p>
|
||||
</div>
|
||||
<div class="notice-footer">
|
||||
<div class="notice-btn" @click="closetz">知道了,退下吧</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, watch } from "vue";
|
||||
import { useRoute } from "vitepress";
|
||||
|
||||
const visible = ref(false); // 初始化公告为隐藏
|
||||
const route = useRoute(); // 使用 vitepress 提供的 useRoute
|
||||
const countdown = ref(10); // 倒计时初始为10秒
|
||||
|
||||
// 检查当前页面是否需要显示公告
|
||||
function checkRoute() {
|
||||
// 假设我们只在 '/special-page' 页面显示公告
|
||||
if (route.path.endsWith("/notes/")) {
|
||||
visible.value = true;
|
||||
startCountdown(); // 开始倒计时
|
||||
} else {
|
||||
visible.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 关闭公告的函数
|
||||
function closetz() {
|
||||
visible.value = false;
|
||||
}
|
||||
|
||||
// 倒计时函数
|
||||
function startCountdown() {
|
||||
const timer = setInterval(() => {
|
||||
countdown.value--;
|
||||
if (countdown.value <= 0) {
|
||||
clearInterval(timer);
|
||||
closetz();
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
// 在组件挂载时检查路由
|
||||
onMounted(() => {
|
||||
checkRoute();
|
||||
});
|
||||
|
||||
// 监听路由变化,当路径变化时重新检查
|
||||
watch(
|
||||
() => route.path,
|
||||
() => {
|
||||
checkRoute();
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.notice-img {
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
/* 全屏遮罩层 */
|
||||
.notice-background {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
display: none;
|
||||
z-index: 99;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* 通知 */
|
||||
.notice {
|
||||
z-index: 999;
|
||||
padding: 25px;
|
||||
background: #fff;
|
||||
width: 446px;
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translateX(-50%) translateY(-50%);
|
||||
border-radius: 18px;
|
||||
box-sizing: border-box;
|
||||
box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.05), 0 1.5rem 2.2rem rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.notice {
|
||||
width: 82%;
|
||||
padding: 25px;
|
||||
}
|
||||
}
|
||||
|
||||
.notice-title {
|
||||
text-align: center;
|
||||
color: #3c3c3c;
|
||||
font-size: 20px;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.notice-describe p {
|
||||
color: #3c3c3c;
|
||||
padding: 10px 0;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.notice-describe p strong {
|
||||
color: #3c3c3c;
|
||||
}
|
||||
|
||||
.notice-describe p a {
|
||||
color: #eb0e0e;
|
||||
}
|
||||
|
||||
.notice-domain {
|
||||
background: #f3f5f7;
|
||||
text-align: center;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
/* 通知底部 */
|
||||
.notice-footer {
|
||||
padding: 20px 0 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.notice-btn {
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
border-radius: 50px;
|
||||
font-weight: 700;
|
||||
padding: 0 30px;
|
||||
color: #fff;
|
||||
background: linear-gradient(to right, #1e69f5 0%, #093ce5 100%);
|
||||
box-shadow: 0 10px 12px -4px rgb(0 0 0 / 40%);
|
||||
line-height: 40px;
|
||||
font-size: 14px;
|
||||
display: inline-block;
|
||||
text-wrap: nowrap;
|
||||
}
|
||||
</style>
|
111
docs/.vitepress/theme/components/backTop.vue
Normal file
111
docs/.vitepress/theme/components/backTop.vue
Normal file
@ -0,0 +1,111 @@
|
||||
<template>
|
||||
<Transition name="fade">
|
||||
<div
|
||||
v-show="showBackTop"
|
||||
class="vitepress-backTop-main"
|
||||
title="返回顶部"
|
||||
@click="scrollToTop()"
|
||||
>
|
||||
<svg
|
||||
t="1720595052079"
|
||||
class="icon"
|
||||
viewBox="0 0 1024 1024"
|
||||
version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="4279"
|
||||
width="200"
|
||||
height="200"
|
||||
>
|
||||
<path
|
||||