Шаблон:Selfsubst/now string
Материал из ANT-Inform documentation
Версия от 05:10, 2 октября 2011; Krinkle (обсуждение) (Created page with "<includeonly>{{subst:selfsubst|now string|{{{1}}}| "{{subst:#time: Y-m-d H:i:s "(UTC)"|{{subst:CURRENTTIMESTAMP}}}}" |{{subst:#ifeq:{{{2|a}}}|{{{2|b}}}||init}}}}</includeonly>...")
This template produces a self-updating time stamp of the last revision. While normal articles or templates can use magic words like {{REVISIONTIMESTAMP}}, those have no effect on scripts or css files that are used in raw form.
Usage
Using
-
var foo = {{subst:Selfsubst/now string|js}};
expands to
-
var foo = /*/{{subst:Selfsubst/now string|js|/*/ "2012-02-04 08:37:50 (UTC)" /*/}}/*/;
which in turn will, on every page save, substitute to itself with an updated version string.
The first parameter needs to be the language where this timestamp is used. The language determines how the recursive template call is hidden from the surrounding language. Currently, there are the following languages defined:
The above documentation is transcluded from Шаблон:Selfsubst/now string/doc. (edit | history) Editors can experiment in this template's sandbox (create) and testcases (create) pages. Please add categories and interwikis to the /doc subpage. Subpages of this template. |