I am trying to create my first blog post using the ghost editor. I need to add some dynamic content in the title e.g. “How to make a good youtube video in 2023”. However, I want the year in the title (2023) to be dynamic so that I don’t need to manually update it when will be in 2024.
I tried to add the title as an HTML card but it doesn’t work
<html>
<head>
<title></title>
</head>
<body>
<h1 id="year"></h1>
<script>
var dt = new Date();
var year = document.getElementById("year")
year.innerHTML = dt.getFullYear()
</script>
</body>
</html>
Nothing is displayed. It seems only the HTML is recognized, not the javascript.
Do i make something wrong ?