I'd like to adjust the outdated banner for the archived pages to be something always up to date. #2928
Replies: 5 comments
-
@isiahmeadows couldn’t we rather hardcore the version number in a small script that would be generated on release by our npm script? |
Beta Was this translation helpful? Give feedback.
-
@pygy We could, if you mean something like injecting |
Beta Was this translation helpful? Give feedback.
-
I mean this (but I may be missing your intent). The latest version is v<span id=mithrilVersion></span>
<script src="latest.js"></script> // latest.js
mithrilVersion.textContent = "x.y.z" |
Beta Was this translation helpful? Give feedback.
-
Oh okay. Detecting the latest version was the point of my [
"0.1.3",
// ...
"0.2.4",
"0.2.5",
"0.2.6",
// ...
"1.0.0",
// ...
"1.1.7",
"2.0.0-rc.0",
// ...
"2.0.1",
"2.0.3",
"2.0.4",
] Note: broken and unpublished releases like 0.2.3 and 2.0.0 would be intentionally excluded. I was referring to putting the relative version (like We can then use that and knowledge of the latest version (as per |
Beta Was this translation helpful? Give feedback.
-
Now this makes complete sense, thanks for clarifying. |
Beta Was this translation helpful? Give feedback.
-
Currently, we have a "deprecated" banner on all v0.2.x stuff. I feel I could easily hack together thing where I could append a quick script to each the archived pages' bodies for a better, more informative, more useful banner. Wouldn't have to be much - I'd just use a couple simple elements to configure:
<script src="/static/warn-outdated.js"></script>
- This loads the warning label this at the end of the<body>
, as a closeable dropdown at the top. It will handle its own styling, too, so I'm not having to add more data to the page than I have to.<meta name="x-mithril-version" content="x.x.x">
- This lets our script know what the current version is, for comparison.x.x.x
is the version, where2.0.4
is for v2.0.4,0.2.1
is for v0.2.1, and so on. (I would've preferred to use a query parameter on the script, but there's no way I could reliably get the currently executing script element to check that on IE11, and a<meta>
element is much easier than the alternatives.)<head>
immediately before the first element other than<meta charset="utf-8">
.Not 100% sure about the design side, but I can get to that later when I get around to implementing this. Do note that the existing deprecation notices in the v0.1/v0.2 docs would also have to disappear.
Script-wise, I could probably get away with something as simple as this:
Edit: fix a bug in the script loading side
Beta Was this translation helpful? Give feedback.
All reactions