- Replace WP Packages logo/title with 文派包源 across layout, index, detail - Remove Roots sponsor banner, sponsor section, and tag-request dialog - Update navigation and footer links to wenpai.net - Localize homepage copy, stats labels, and search UI to Chinese - Remove untagged-plugin callouts and WPackagist migration links
77 lines
9.7 KiB
HTML
77 lines
9.7 KiB
HTML
{{define "layout"}}<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
<title>{{template "title" .}}</title>
|
|
{{template "meta_seo" .}}
|
|
<link rel="icon" href="/favicon.ico" sizes="32x32">
|
|
<link rel="icon" href="/icon.svg" type="image/svg+xml">
|
|
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
|
|
<link rel="manifest" href="/manifest.webmanifest">
|
|
<link rel="alternate" type="application/atom+xml" title="文派包源 — Recently Updated Packages" href="/feed.xml">
|
|
{{template "og_meta" .}}
|
|
{{template "json_ld" .}}
|
|
<link rel="stylesheet" href="{{assetPath "/assets/styles/app.css"}}">
|
|
<link rel="stylesheet" href="{{assetPath "/assets/styles/fonts.css"}}">
|
|
{{if .CDNURL}}<link rel="preconnect" href="{{.CDNURL}}" crossorigin>{{end}}
|
|
<script src="{{assetPath "/assets/scripts/htmx.min.js"}}"></script>
|
|
<script>
|
|
function copyCmd(el,txt){navigator.clipboard.writeText(txt);const svg=el.querySelector('button svg')||el.querySelector('svg:last-of-type')||el.querySelector('svg');if(!svg||svg.dataset.copied)return;svg.dataset.copied='1';const orig=svg.innerHTML;const oc=svg.style.color;svg.style.transition='opacity 150ms,color 200ms';svg.style.opacity='0';setTimeout(()=>{svg.innerHTML='<path stroke-linecap="round" stroke-linejoin="round" d="m4.5 12.75 6 6 9-13.5"/>';svg.style.color='#16a34a';svg.style.opacity='1'},150);setTimeout(()=>{svg.style.opacity='0';setTimeout(()=>{svg.innerHTML=orig;svg.style.color=oc;svg.style.opacity='1';delete svg.dataset.copied},150)},1500)}
|
|
document.addEventListener('keydown',e=>{if(e.key==='/'&&!e.ctrlKey&&!e.metaKey&&!['INPUT','TEXTAREA','SELECT'].includes(document.activeElement.tagName)){e.preventDefault();const s=document.querySelector('input[name="search"]');if(s)s.focus()}});
|
|
document.addEventListener('htmx:afterRequest',e=>{const xhr=e.detail.xhr;if(!xhr)return;const u=new URL(xhr.responseURL);if(u.pathname==='/packages-partial'){const p=u.searchParams;p.delete('');const q=p.toString();history.pushState(null,'',q?'/?'+q:'/')}});
|
|
document.addEventListener('DOMContentLoaded',()=>{const b=document.getElementById('rename-banner');const c=document.getElementById('rename-banner-close');if(!b||!c)return;const k='wp-packages-rename-banner-dismissed';try{if(localStorage.getItem(k)==='1'){b.remove();return}}catch{}c.addEventListener('click',()=>{try{localStorage.setItem(k,'1')}catch{}b.remove()})});
|
|
document.addEventListener('DOMContentLoaded',()=>{const t=document.getElementById('nav-menu-toggle');const m=document.getElementById('nav-menu');if(!t||!m)return;function close(){m.classList.add('hidden');t.setAttribute('aria-expanded','false');t.querySelector('svg').innerHTML='<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"/>';}t.addEventListener('click',()=>{const open=m.classList.toggle('hidden');t.setAttribute('aria-expanded',!open);t.querySelector('svg').innerHTML=open?'<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"/>':'<path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12"/>'});document.addEventListener('click',e=>{if(!m.classList.contains('hidden')&&!m.contains(e.target)&&!t.contains(e.target))close()})});
|
|
</script>
|
|
</head>
|
|
<body class="min-h-screen flex flex-col bg-white text-gray-900 font-sans">
|
|
<header class="sticky top-0 z-50 border-b border-gray-200/50 bg-white/80 backdrop-blur-xl">
|
|
<div class="mx-auto max-w-6xl px-4 sm:px-6 lg:px-8">
|
|
<div class="flex h-14 items-center justify-between">
|
|
<div class="flex items-center gap-2.5 shrink-0">
|
|
<a href="/" class="text-base font-bold tracking-tight text-brand-primary">文派包源</a>
|
|
<a href="https://wenpai.net" class="hidden sm:inline-flex items-center gap-1 text-[13px] text-brand-primary font-medium hover:text-brand-primary/80 transition-colors" rel="noopener">
|
|
<span class="text-gray-500 font-normal mr-0.5">by</span>
|
|
wenpai.net</a>
|
|
</div>
|
|
<nav aria-label="Main" class="flex items-center gap-1">
|
|
<a href="/" class="hidden nav:inline-flex rounded-md px-2 py-1.5 text-sm {{if eq .Path "/"}}text-gray-900 font-medium{{else}}text-gray-500 hover:text-gray-900{{end}} transition-colors">Packages</a>
|
|
<a href="/docs" class="hidden nav:inline-flex rounded-md px-2 py-1.5 text-sm {{if eq .Path "/docs"}}text-gray-900 font-medium{{else}}text-gray-500 hover:text-gray-900{{end}} transition-colors">Docs</a>
|
|
<a href="/docs#migrate" class="hidden nav:inline-flex rounded-md px-2 py-1.5 text-sm text-gray-500 hover:text-gray-900 transition-colors">Migrate from WPackagist</a>
|
|
<a href="/status" class="hidden nav:inline-flex rounded-md px-2 py-1.5 text-sm {{if eq .Path "/status"}}text-gray-900 font-medium{{else}}text-gray-500 hover:text-gray-900{{end}} transition-colors">Status</a>
|
|
<a href="https://discourse.roots.io/" class="hidden nav:inline-flex rounded-md px-2 py-1.5 text-sm text-gray-500 hover:text-gray-900 transition-colors" rel="noopener">Community</a>
|
|
<a href="https://github.com/roots/wp-packages" class="inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm text-gray-500 hover:text-gray-900 transition-colors" rel="noopener"><svg class="w-4 h-4" viewBox="0 0 24 24" fill="currentColor"><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg>GitHub</a>
|
|
<a href="https://wenpai.net" class="inline-flex items-center rounded-lg bg-brand-primary px-3.5 py-1.5 text-sm font-medium text-white hover:bg-brand-primary/85 transition-colors" rel="noopener">文派官网</a>
|
|
<button id="nav-menu-toggle" type="button" class="nav:hidden inline-flex items-center justify-center rounded-md p-1.5 text-gray-500 hover:text-gray-900 transition-colors" aria-label="Toggle menu" aria-expanded="false">
|
|
<svg class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"/></svg>
|
|
</button>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
<div id="nav-menu" class="hidden nav:hidden border-t border-gray-200/50">
|
|
<div class="mx-auto max-w-6xl px-4 sm:px-6 lg:px-8 py-3 flex flex-col gap-1">
|
|
<a href="/" class="rounded-md px-3 py-2 text-sm {{if eq .Path "/"}}text-gray-900 font-medium bg-gray-50{{else}}text-gray-500 hover:text-gray-900 hover:bg-gray-50{{end}} transition-colors">Packages</a>
|
|
<a href="/docs" class="rounded-md px-3 py-2 text-sm {{if eq .Path "/docs"}}text-gray-900 font-medium bg-gray-50{{else}}text-gray-500 hover:text-gray-900 hover:bg-gray-50{{end}} transition-colors">Docs</a>
|
|
<a href="/docs#migrate" class="rounded-md px-3 py-2 text-sm text-gray-500 hover:text-gray-900 hover:bg-gray-50 transition-colors">Migrate from WPackagist</a>
|
|
<a href="/status" class="rounded-md px-3 py-2 text-sm {{if eq .Path "/status"}}text-gray-900 font-medium bg-gray-50{{else}}text-gray-500 hover:text-gray-900 hover:bg-gray-50{{end}} transition-colors">Status</a>
|
|
<a href="https://discourse.roots.io/" class="rounded-md px-3 py-2 text-sm text-gray-500 hover:text-gray-900 hover:bg-gray-50 transition-colors" rel="noopener">Community</a>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
<main class="flex-1">{{template "content" .}}</main>
|
|
<footer class="border-t border-gray-200/50">
|
|
<div class="mx-auto max-w-6xl px-4 sm:px-6 lg:px-8 py-8">
|
|
<nav aria-label="Footer" class="flex flex-wrap justify-center items-center gap-x-6 gap-y-2 mb-4">
|
|
<a href="/" class="text-sm text-gray-500 hover:text-gray-900 transition-colors">Packages</a>
|
|
<a href="/docs" class="text-sm text-gray-500 hover:text-gray-900 transition-colors">Docs</a>
|
|
<a href="/status" class="text-sm text-gray-500 hover:text-gray-900 transition-colors">Status</a>
|
|
</nav>
|
|
<div class="flex flex-wrap justify-center items-center gap-x-6 gap-y-2 mb-6">
|
|
<a href="https://github.com/roots/wp-packages" class="inline-flex items-center gap-1.5 text-sm text-gray-500 hover:text-gray-900 transition-colors" rel="noopener"><svg class="w-4 h-4" viewBox="0 0 24 24" fill="currentColor"><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg>GitHub</a>
|
|
<a href="https://wenpai.net" class="inline-flex items-center gap-1.5 text-sm text-gray-500 hover:text-gray-900 transition-colors" rel="noopener">文派官网</a>
|
|
</div>
|
|
<p class="text-sm text-gray-500 flex items-center justify-center gap-1">Powered by <a href="https://wp-packages.org" class="font-medium text-brand-primary hover:text-brand-primary/80 transition-colors" rel="noopener">WP Packages</a> · Mirrored by <a href="https://wenpai.net" class="font-medium text-brand-primary hover:text-brand-primary/80 transition-colors" rel="noopener">WenPai</a></p>
|
|
</div>
|
|
</footer>
|
|
</body>
|
|
</html>{{end}}
|