Sketch plugin to update placeholders with with metadata about last save, such as timestamp or increment, and about page numbering.
When updating your shared design, it is handy to have some meta information. Think of versioning, titles or page numbers. But it is often hard to keep track of this information.
This plugin will update this information automatically.
For the version indicator, you can use date/time, use a generated image or use an increment. For a title you can use the artboard title. And for documents with multiple pages, you can use page numbering.
- Open the .sketchplugin-file
- Sketch will open and tell you the plugin is installed
- Open a sketch file, or create a new one
- Insert an artboard
- Insert a text layer inside this artboard
- Name it
[lastupdated](or one of the other supported strings)
- Create or move a different element on the artboard
- The text layer will update its value after a few seconds
The plugin will update text or images in placeholder layers. So you can design your own version indicator.
Placeholders which the plugin monitors (this example is on January, 31st 2020 at 3:31:59 PM):
[lastupdated]: 31-1-2020 15:31
[lastupdatedUS]: 1/31/2020 15:31
[lastupdated-image]: Blockies image. can only be used on shapes (like a rectangle) on the artboard, or on images within a symbol.
[lastupdated-artboard-title]: -Artboard Wizzy3
[lastupdated-artboard-title-nodash]: Artboard Wizzy3
[lastupdated-increment]: 1 - this is updated once per document save
[lastupdated-size-bytes]: 237234 - this is updated on document save
[lastupdated-is-autosaved]: 0 - this is updated on document save
And for page numbering: These are updated when adding, removing or changing an artboard, or when adding a page number placeholder.
[lastupdated-totalpages]: 5 - total number of artboards on the page
[lastupdated-currentpagenr]: 3 - artboard number, using the order of the layers on the page. Count starts at 1
[lastupdated-pagenr-next]: 4 - artboard number of the next artboard. It is empty when there is no following artboard
[lastupdated-pagenr-prev]: 2 - artboard number of the previous artboard. It is empty when there is no previous artboard
[lastupdated-pagenr-prev-nodash]: The suffix of
-nodashexcludes artboards with titles starting with '-'
The placeholders are updated on elements as well as symbol overrides inside an artboard.
This plugin didn't exist for some great inspiration:
- Supports artboard title:
- Supports page numbering:
- Supports artboard title:
- Most placeholders will be updated onDocumentChanged, after 5 seconds
- Only [lastupdated-size-bytes] and [lastupdated-autosaved] are updated onDocumentSaved
- An update is not triggered anymore when changing placeholders (to prevent loops)
- The document is no longer marked as changed after saving (except when using [size-bytes] and [autosaved])
- Marks document as changed on document change instead of selection change (finally). This will prevent unnecessary saves and might be a bit faster.
- Add [lastupdated-size-bytes] and [lastupdated-autosaved] to possible placeholders Unfortunately, a double save is needed to save the updated placeholders in the Sketch file.
- Updates the placeholders when saving the document. This makes selecting stuff much faster.
- Now the correct month number is used in month-placeholders
- Automatically updates on select
- Supports date and time:
- Supports Blockies:
- Supports increment:
Feel free to add a pull request or mention the plugin. Thanks for using it (if so)!