slamecka/timestamp

Adds n:src and n:href macros which append timestamp as a parameter to path (e.g. main.js?512a45c4)

dev-master 2016-02-23 14:39 UTC

This package is not auto-updated.

Last update: 2024-11-09 15:08:20 UTC


README

Adds macros n:src and n:href

<script n:src="/main.js"></script>
<link n:href="style.css">

to produce code similar to

<script src="/main.js?512a45c4"></script>
<link href="style.css?512a45c4">

where 512a45c4 is timestamp which automatically changes when you modify the file (it is filesystem's mtime).

Please note that you don't have to & can't use {$basePath} with these macros because every path is constructed as $basePath . '/' . $fileName.

Install

$ composer require slamecka/timestamp:dev-master

In your config.neon

nette:
	latte:
		macros:
			- TimestampMacro

MIT license