diff --git a/.changeset/shiny-balloons-reply.md b/.changeset/shiny-balloons-reply.md new file mode 100644 index 0000000..ba87ac0 --- /dev/null +++ b/.changeset/shiny-balloons-reply.md @@ -0,0 +1,5 @@ +--- +'anki-templates': patch +--- + +fix: should use builtin `Tags` field (展示内置标签字段) diff --git a/release.py b/release.py index 6990ca8..b256346 100644 --- a/release.py +++ b/release.py @@ -8,8 +8,11 @@ with open("./release.json") as file: release_config = json.load(file) +BUILTIN_FIELDS = ["Tags", "Type", "Deck", "Subdeck", "CardFlag", "Card", "FrontSide"] + def gen_apkg(id: str, locale: str): + print(f"generating {id} {locale}") folder = f"dist/{id}/{locale}" with open(f"{folder}/front.html") as f: front = f.read() @@ -17,7 +20,7 @@ def gen_apkg(id: str, locale: str): back = f.read() release = release_config[id] template = templates_config[id] - fields = template["fields"] + fields = list(filter(lambda field: field not in BUILTIN_FIELDS, template["fields"])) model = genanki.Model( release_config[id]["id"][locale], f"IKKZ_{id}_TEMPLATE_{locale}".upper(), diff --git a/src/components/card-shell.tsx b/src/components/card-shell.tsx index fd2331a..58c6001 100644 --- a/src/components/card-shell.tsx +++ b/src/components/card-shell.tsx @@ -82,7 +82,7 @@ export const CardShell: FC = ({ {tags?.length ? ( <> - {tags.join('@/ ')} + {tags.join(' / ')} ) : null}