{"id":18904274,"url":"https://github.com/hugo-fixit/shortcode-caniuse","last_synced_at":"2025-04-15T03:34:24.780Z","repository":{"id":246480646,"uuid":"821264994","full_name":"hugo-fixit/shortcode-caniuse","owner":"hugo-fixit","description":"一个含有 caniuse shortcode 的 Hugo 主题组件。","archived":false,"fork":false,"pushed_at":"2024-12-07T06:17:33.000Z","size":25,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-28T15:21:29.467Z","etag":null,"topics":["caniuse-embed","hugo","hugo-fixit","shortcodes","theme-component"],"latest_commit_sha":null,"homepage":"https://caniuse.lruihao.cn","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hugo-fixit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":["https://paypal.me/Lruihao"]}},"created_at":"2024-06-28T06:56:32.000Z","updated_at":"2024-12-26T04:37:44.000Z","dependencies_parsed_at":"2024-06-28T07:58:48.838Z","dependency_job_id":"6d2c862b-6a61-487b-96a5-ae14e4cb64ec","html_url":"https://github.com/hugo-fixit/shortcode-caniuse","commit_stats":null,"previous_names":["hugo-fixit/shortcode-caniuse"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugo-fixit%2Fshortcode-caniuse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugo-fixit%2Fshortcode-caniuse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugo-fixit%2Fshortcode-caniuse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugo-fixit%2Fshortcode-caniuse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hugo-fixit","download_url":"https://codeload.github.com/hugo-fixit/shortcode-caniuse/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249002580,"owners_count":21196644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["caniuse-embed","hugo","hugo-fixit","shortcodes","theme-component"],"created_at":"2024-11-08T09:07:58.506Z","updated_at":"2025-04-15T03:34:24.774Z","avatar_url":"https://github.com/hugo-fixit.png","language":"HTML","funding_links":["https://paypal.me/Lruihao"],"categories":[],"sub_categories":[],"readme":"# Hugo shortcode for CanIUse\n\n在 Hugo 中使用 `shortcode` 方式内嵌 [CanIUse](https://caniuse.com/) 到你的文章中。\n\n![shortcode-caniuse-preview](https://github.com/hugo-fixit/shortcode-caniuse/assets/33419593/3722adc9-0759-4f9c-b381-7f0e6e1c101b)\n\n## 依赖\n\nFixIt 主题 `v0.3.9` 及以上版本。\n\n## 安装组件\n\n和 [安装主题](https://fixit.lruihao.cn/zh-cn/documentation/installation/) 一样，安装方式有多种，选择其一即可，例如通过 Hugo Modules 安装：\n\n```diff {title=\"hugo.toml\"}\n[module]\n  [[module.imports]]\n    path = \"github.com/hugo-fixit/FixIt\"\n+ [[module.imports]]\n+   path = \"github.com/hugo-fixit/shortcode-caniuse\"\n```\n\n## 注入 Partial\n\n通过 FixIt 主题开放的自定义块，在 `layouts/partials/custom.html` 文件将 `shortcode-caniuse.html` 注入到 `custom-assets` 中：\n\n```go-html-template\n{{- define \"custom-assets\" -}}\n  {{- partial \"inject/shortcode-caniuse.html\" . -}}\n{{- end -}}\n```\n\n## 使用 Shortcode\n\n`caniuse` shortcode 有以下命名参数：\n\n- **feature** _[必需]_（第一个位置参数）特性名称\n- **past** _[可选]_（第二个位置参数）显示过去 N 个版本，范围是 `0 - 5`，默认为 `2`\n- **future** _[可选]_（第三个位置参数）显示未来 N 个版本，范围是 `0 - 3`，默认为 `1`\n- **origin** _[可选]_（第四个位置参数）caniuse embed 数据源，例如：`https://caniuse-embed-x.vercel.app`\n\n\u003e 点击 `caniuse.com` 网站上功能左边 `#` 号，URL 中的 `pathname` 即为 `feature` 参数。\n\n这是一个用法示例：\n\n```markdown\n{{\u003c caniuse feature=\"flexbox\" \u003e}}\n或者\n{{\u003c caniuse \"flexbox\" \u003e}}\n```\n\n## 参考\n\n- [Can I use… Support tables for HTML5, CSS3, etc](https://caniuse.com/)\n- [The CanIUse Embed — Add support tables to your site](https://caniuse-embed.vercel.app/)\n- [贡献指南 / 开发组件](https://fixit.lruihao.cn/zh-cn/contributing/components/)\n\n## 致谢\n\n- [mdn-browser-compat-data](https://github.com/mdn/browser-compat-data)\n- [Fyrd/caniuse](https://github.com/Fyrd/caniuse)\n- [pengzhanbo/caniuse-embed](https://github.com/pengzhanbo/caniuse-embed)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugo-fixit%2Fshortcode-caniuse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhugo-fixit%2Fshortcode-caniuse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugo-fixit%2Fshortcode-caniuse/lists"}