import{t as e}from"./cache-DUthuMSu.mjs";import{t}from"./got-BBDj7u1e.mjs";import{c as n,d as r,f as i,s as a,t as o}from"./util-DndyIAOJ.mjs";const s={path:`/tag/:id`,categories:[`new-media`],example:`/huxiu/tag/291`,parameters:{id:`标签 id，可在对应标签页 URL 中找到`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!0,supportBT:!1,supportPodcast:!0,supportScihub:!1},name:`标签`,maintainers:[`xyqfer`,`HenryQW`,`nczitzk`,`TimoYoung`],handler:c,description:`更多标签请参见 [标签](https://www.huxiu.com/tags)`};async function c(c){let l=c.req.param(`id`),u=c.req.query(`limit`)?Number.parseInt(c.req.query(`limit`),10):10,d=new URL(`/v3/tag/articleList`,o).href,f=new URL(`tag/${l}.html`,i).href,{data:p}=await t.post(d,{form:{platform:`www`,tag_id:l}});return{item:await r(p.data.datalist,u,e.tryGet),...await n({currentUrl:f,apiUrl:new URL(`v3/tag/detail`,o).href,form:{platform:`www`,tag_id:l},mapData:e=>({title:e.tag_name,description:e.summary??e.share_info?.share_desc,image:e.pic_path??e.share_info?.share_img,titlePrefix:a(s.name)})})}}export{s as route};