Automatic update of "modified:..." in .md file header
-
Hi guys,
First post so please be gentle…
I’m currently working on the website for TV Rename (www.tvrename.com) which is contains many markdown files (.md) hosted using GitHub pages.
Problem is I keep forgetting to update the “modified:” tag in the file headers viz:
title: “Quick-Start”
permalink: /manual/quickstart/
excerpt: “This guide will help you with the initial setup TV Rename.”
modified: 2018-01-24T15:53:02-04:00
sidebar:
nav: “quickstart”
redirect_from:
- /theme-setup/Is there a method (or plugin) that will automatically modify this entry when the file is saved?
Been looking for absolutely ages and haven’t found anything yet!
Cheers!
Andy B.
-
What you want is something that will set a callback on the FILEBEFORESAVE notification.
You could use PythonScript – download the latest using the Plugin Manager, or directly from the github repo releases. The Plugins > Python Script > Context-Help will bring up a help window; navigate to Notepad++ Object and scroll down to notepad.callback(function, notifications) for the syntax.
You can search this forum for “callback” to find other complete examples of how to set up a callback. (You would want to put the callback initialization in your
startup.pyin order to get it to be always enabled.) I believe there are also examples in the forum of applying a callback only to a particular type of file – for you, you’d presumably want it only if the file was a.mdmarkdown file.I assume LuaScript would also have the notification/callback feature, too (though I could be wrong).
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login