Template:Download: Difference between revisions
Template page
More actions
Wiki lane: site structure (templates, forms, help pages) |
Wiki lane: Download box shows KB below 1 MB |
||
| Line 1: | Line 1: | ||
<includeonly><templatestyles src="Infobox/styles.css" />{{#if:{{#cmpfile:{{{file|{{PAGENAME}}}}}|size}}|{{#ifeq:{{lc:{{{compact|}}}}}|yes|<span class="cmpw-download-compact">[[Media:{{{file|{{PAGENAME}}}}}|{{{file|{{PAGENAME}}}}}]] <span class="cmpw-muted">({{#expr:{{#cmpfile:{{{file|{{PAGENAME}}}}}|size}}/1048576 round 2}} MB, by @{{#cmpfile:{{{file|{{PAGENAME}}}}}|uploader}}, [[:File:{{{file|{{PAGENAME}}}}}|details]])</span><br /><code>sha256 {{#cmpfile:{{{file|{{PAGENAME}}}}}|sha256}}</code></span>|<div class="cmpw-download"> | <includeonly><templatestyles src="Infobox/styles.css" />{{#if:{{#cmpfile:{{{file|{{PAGENAME}}}}}|size}}|{{#ifeq:{{lc:{{{compact|}}}}}|yes|<span class="cmpw-download-compact">[[Media:{{{file|{{PAGENAME}}}}}|{{{file|{{PAGENAME}}}}}]] <span class="cmpw-muted">({{#ifexpr:{{#cmpfile:{{{file|{{PAGENAME}}}}}|size}} < 1048576|{{#expr:{{#cmpfile:{{{file|{{PAGENAME}}}}}|size}}/1024 round 1}} KB|{{#expr:{{#cmpfile:{{{file|{{PAGENAME}}}}}|size}}/1048576 round 2}} MB}}, by @{{#cmpfile:{{{file|{{PAGENAME}}}}}|uploader}}, [[:File:{{{file|{{PAGENAME}}}}}|details]])</span><br /><code>sha256 {{#cmpfile:{{{file|{{PAGENAME}}}}}|sha256}}</code></span>|<div class="cmpw-download"> | ||
'''Download:''' [[Media:{{{file|{{PAGENAME}}}}}|{{{file|{{PAGENAME}}}}}]] ({{#expr:{{#cmpfile:{{{file|{{PAGENAME}}}}}|size}}/1048576 round 2}} MB)<br /> | '''Download:''' [[Media:{{{file|{{PAGENAME}}}}}|{{{file|{{PAGENAME}}}}}]] ({{#ifexpr:{{#cmpfile:{{{file|{{PAGENAME}}}}}|size}} < 1048576|{{#expr:{{#cmpfile:{{{file|{{PAGENAME}}}}}|size}}/1024 round 1}} KB|{{#expr:{{#cmpfile:{{{file|{{PAGENAME}}}}}|size}}/1048576 round 2}} MB}})<br /> | ||
'''Version:''' {{{version|<span class="cmpw-bad">not given</span>}}}<br /> | '''Version:''' {{{version|<span class="cmpw-bad">not given</span>}}}<br /> | ||
'''Upstream source:''' {{#if:{{{source|}}}|{{{source}}}|<span class="cmpw-bad">not given</span>}}<br /> | '''Upstream source:''' {{#if:{{{source|}}}|{{{source}}}|<span class="cmpw-bad">not given</span>}}<br /> | ||
Latest revision as of 10:29, 30 October 2026
Download block for hosted binaries, archives and scripts (uploads of sh, py, zip, gz, tgz, xz, run, deb, bin, rom by the trusted group must carry it on their file page).
The sha256, size, uploader and upload time are read from the stored file by the wiki itself, so a swapped file shows a
different hash at once. Give version and source (the upstream release link); give
expected_sha256 when the upstream project publishes one, and the block says whether the hosted file matches.
On a file page:
{{Download|version=1.2.3|source=https://github.com/OWNER/REPO/releases/tag/v1.2.3|expected_sha256=...}}
Elsewhere (for example in Template:Unlock): {{Download|file=Example.zip|compact=yes}}.