Skip to content

Commit

Permalink
feat: websites with autoLang
Browse files Browse the repository at this point in the history
docs: update README.md
  • Loading branch information
teaSummer committed Aug 8, 2024
1 parent 86eb43b commit 2eb7759
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@

`data` 目录下的文件列表:

| 文件名 | 数据含义 | 文件 |
|-------------------------------------------------------------------------------|------------------|------------------------------------------------------------------------|
| 文件名 | 数据含义 | 文件 |
|-------------------------------------------------------------------------------|------------------|--------------------------------------------------------------------------|
| [![](assets/icon/doc/link-16.svg)](#launcherjson5) launcher.json5 | 启动器列表(**Java版**| [查看![](assets/icon/doc/link-external-16.svg)](data/launcher.json5) |
| [![](assets/icon/doc/link-16.svg)](#otherForumjson5) otherForum.json5 | 其他论坛列表 | [查看![](assets/icon/doc/link-external-16.svg)](data/otherForum.json5) |
| [![](assets/icon/doc/link-16.svg)](#searchablejson5) searchable.json5 | 可供快速查询的站点列表 | [查看![](assets/icon/doc/link-external-16.svg)](data/searchable.json5) |
Expand Down Expand Up @@ -122,17 +122,19 @@

以分类作为键,值为一个数组。

在数组内,第一项为网站名称,第二项为网站地址 URL。
在数组内,每项对应的描述:
1. 第一项 - 网站名称。
2. 第二项 - 网站地址 URL。
3. 第三项 - 可选,网站简介。
4. 第四项 - 可选,填 `true` 会将`网站简介`视为语言文件中的键。

如果分类后面有 `[open]`,则该分类默认展开。

示例如下:

``` json5
{
// | 分类 |
"官方网站 (©Mojang/©微软)": [
// | 网站名称 | 网站地址 URL |
["Minecraft", "https://www.minecraft.net"],
["Minecraft教育版", "https://education.minecraft.net"],
["漏洞追踪器(反馈Bug)", "https://bugs.mojang.com"],
Expand Down
2 changes: 0 additions & 2 deletions data/utilityWebsite.json5
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// 实用网站列表
[
{
// | 分类 |
"官方网站 (©Mojang/©微软)": [
// | 网站名称 | 网站地址 URL |
["Minecraft", "https://www.minecraft.net"],
["Minecraft教育版", "https://education.minecraft.net/"],
["漏洞追踪器(反馈Bug)", "https://bugs.mojang.com"],
Expand Down
5 changes: 3 additions & 2 deletions scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,10 @@ const pre_list = ((e) => {
else dom += `<details id="${category.replace(/ .+/, '')}"><summary>${category}</summary>`;
let content;
// 生成元素
for (const [title, url, description] of block[category]) {
for (const [title, url, description, autoLang] of block[category]) {
let template = '|DOM|';
if (description) template = `<mdui-tooltip content="${description}">|DOM|</mdui-tooltip>`;
if (autoLang && description) template = `<mdui-tooltip al-aplto="content: ${description};" placement="top">|DOM|</mdui-tooltip>`;
else if (description) template = `<mdui-tooltip content="${description}" placement="top">|DOM|</mdui-tooltip>`;
// 判断是否为内部链接
if (url.startsWith('#')) {
// 内部链接
Expand Down

0 comments on commit 2eb7759

Please sign in to comment.