93 lines
6.6 KiB
HTML
93 lines
6.6 KiB
HTML
{{template "layout" .}}
|
|
{{define "title"}}文派包源 — WordPress Composer 镜像{{end}}
|
|
{{define "meta_seo"}}
|
|
<meta name="description" content="面向中文开发者的 WordPress 插件与主题 Composer 包源,稳定可靠。">
|
|
{{if .AppURL}}<link rel="canonical" href="{{.AppURL}}/">{{end}}
|
|
{{if and .Page (gt .Page 1)}}<meta name="robots" content="noindex, follow">{{end}}
|
|
{{end}}
|
|
{{define "json_ld"}}{{jsonLD .JSONLD}}{{end}}
|
|
{{define "og_meta"}}
|
|
<meta property="og:title" content="文派包源 — WordPress Composer 镜像">
|
|
<meta property="og:description" content="面向中文开发者的 WordPress 插件与主题 Composer 包源,稳定可靠。">
|
|
{{if .OGImage}}<meta property="og:image" content="{{.OGImage}}">{{end}}
|
|
{{if .AppURL}}<meta property="og:url" content="{{.AppURL}}">{{end}}
|
|
<meta property="og:type" content="website">
|
|
<meta name="twitter:card" content="summary_large_image">
|
|
<meta name="twitter:title" content="文派包源 — WordPress Composer 镜像">
|
|
<meta name="twitter:description" content="面向中文开发者的 WordPress 插件与主题 Composer 包源,稳定可靠。">
|
|
{{if .OGImage}}<meta name="twitter:image" content="{{.OGImage}}">{{end}}
|
|
{{end}}
|
|
{{define "content"}}
|
|
<section class="relative overflow-hidden border-b border-gray-200/50">
|
|
<div class="absolute inset-0 bg-gradient-to-b from-brand-lightest/40 to-transparent"></div>
|
|
<div class="relative mx-auto max-w-6xl px-4 sm:px-6 lg:px-8 pt-16 pb-12 sm:pt-24 sm:pb-16 text-center">
|
|
<h1 class="text-4xl sm:text-5xl lg:text-6xl font-bold tracking-tight text-gray-900 mb-6 text-balance">文派包源</h1>
|
|
<h2 class="text-xl sm:text-2xl text-gray-500 max-w-xl mx-auto mb-4 text-balance">面向中文开发者的 WordPress Composer 镜像</h2>
|
|
<h3 class="text-base text-gray-500 max-w-xl mx-auto mb-6 text-balance">快速、稳定,让 WordPress 插件与主题管理更简单</h3>
|
|
<a href="/docs" class="inline-flex items-center rounded-lg bg-brand-primary px-5 py-2.5 text-sm font-medium text-white hover:bg-brand-primary/85 transition-colors">开始使用</a>
|
|
</div>
|
|
<div class="relative border-t border-gray-200/50">
|
|
<div class="mx-auto max-w-6xl px-4 sm:px-6 lg:px-8">
|
|
<div class="grid grid-cols-1 sm:grid-cols-2 divide-y sm:divide-y-0 sm:divide-x divide-gray-200/50">
|
|
<div class="py-6 text-center">
|
|
<div class="text-2xl sm:text-3xl font-bold text-brand-primary tabular-nums">{{formatNumber .Stats.ActivePlugins}}</div>
|
|
<div class="text-sm text-gray-500 mt-0.5">插件包</div>
|
|
</div>
|
|
<div class="py-6 text-center">
|
|
<div class="text-2xl sm:text-3xl font-bold text-brand-primary tabular-nums">{{formatNumber .Stats.ActiveThemes}}</div>
|
|
<div class="text-sm text-gray-500 mt-0.5">主题包</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<section class="mx-auto max-w-6xl px-4 sm:px-6 lg:px-8 py-10">
|
|
<div class="flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4 mb-2">
|
|
<form id="filter-form" method="GET" action="/" hx-get="/packages-partial" hx-target="#package-results" hx-trigger="submit, change from:select, input from:[name=search] delay:300ms changed" hx-push-url="false" hx-swap="innerHTML" class="flex flex-col sm:flex-row items-start sm:items-center gap-2 flex-1 scroll-mt-16">
|
|
<div class="relative w-full sm:max-w-md">
|
|
<svg class="absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"/></svg>
|
|
<input type="search" name="search" value="{{.Filters.Search}}" placeholder="搜索包..." class="w-full pl-9 pr-12 h-10 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-brand-primary/20 focus:border-brand-primary">
|
|
<kbd class="absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none hidden sm:inline-flex h-5 items-center rounded border border-gray-200/80 bg-gray-100/80 px-1.5 text-[10px] font-mono text-gray-500">/</kbd>
|
|
</div>
|
|
<div class="flex items-center gap-2">
|
|
<label for="filter-type" class="sr-only">Package type</label>
|
|
<div class="relative">
|
|
<svg class="absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z"/></svg>
|
|
<select id="filter-type" name="type" class="h-10 pl-9 pr-8 text-sm border border-gray-200 rounded-lg bg-white select-chevron focus:outline-none focus:ring-2 focus:ring-brand-primary/20 focus:border-brand-primary">
|
|
<option value="">所有类型</option>
|
|
<option value="plugin"{{if eq .Filters.Type "plugin"}} selected{{end}}>插件</option>
|
|
<option value="theme"{{if eq .Filters.Type "theme"}} selected{{end}}>主题</option>
|
|
</select>
|
|
</div>
|
|
<label for="filter-sort" class="sr-only">Sort by</label>
|
|
<div class="relative">
|
|
<svg class="absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M3 7.5 7.5 3m0 0L12 7.5M7.5 3v13.5m13.5 0L16.5 21m0 0L12 16.5m4.5 4.5V7.5"/></svg>
|
|
<select id="filter-sort" name="sort" class="h-10 pl-9 pr-8 text-sm border border-gray-200 rounded-lg bg-white select-chevron focus:outline-none focus:ring-2 focus:ring-brand-primary/20 focus:border-brand-primary">
|
|
<option value="composer_installs"{{if eq .Filters.Sort "composer_installs"}} selected{{end}}>热门安装</option>
|
|
<option value="active_installs"{{if eq .Filters.Sort "active_installs"}} selected{{end}}>活跃安装</option>
|
|
<option value="name"{{if eq .Filters.Sort "name"}} selected{{end}}>名称</option>
|
|
<option value="updated"{{if eq .Filters.Sort "updated"}} selected{{end}}>最近更新</option>
|
|
</select>
|
|
</div>
|
|
<button type="submit" class="sr-only">Search</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div id="package-results">
|
|
{{template "package-results" .}}
|
|
</div>
|
|
|
|
</section>
|
|
{{if .BlogPosts}}
|
|
<section class="border-t border-gray-200/50 py-14">
|
|
<div class="mx-auto max-w-6xl px-4 sm:px-6 lg:px-8 text-center">
|
|
<h2 class="text-2xl sm:text-3xl font-bold text-gray-900 mb-6">最新动态</h2>
|
|
<ul class="space-y-2 max-w-xl mx-auto">
|
|
{{range .BlogPosts}}
|
|
<li><a href="{{.Link}}" class="text-sm font-medium text-brand-primary hover:underline">{{.Title}}</a></li>
|
|
{{end}}
|
|
</ul>
|
|
</div>
|
|
</section>
|
|
{{end}}
|
|
{{end}}
|