-
Notifications
You must be signed in to change notification settings - Fork 23
Massive update for modernization, layout improvements, and content #89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This brings in Bootstrap 5.3.8, JQuery 3.7.1, and removes all except the material-kit.css "Product Page" file which forms the basis of the current theme of CodeMeta's website.
This prepares us for cleaning up the extra/duplicate static assets.
This directory included image files which after investigation were deemed not in current use on the website and could be safely removed. If this assertion is wrong and they are needed later, this commit can be reverted without harm to the current theme, or the images can be retrieved from git history.
Glyphicon.css is no longer necessary in Bootstrap 5.x, and the duplicated material-kit was a hack to change the theme base color to blue from purple.
material-kit.js no longer calls bootstrapMaterialDesign which seems neither compatible with current bootstrap nor maintained.
Default mode is either system preference if supported, or light mode if not. Highlight.js removed from config.toml as it did not seem to be in use. The "monokai" theme for codeblocks has been changed to "pygments" theme to support dark/light mode switching. It's not amazing on dark mode but it's better than eye strain.
…odemeta#79) The publication of RSS can be disabled by adding to the config.toml: [outputs] home = ["HTML"] section = ["HTML"]
This partial uses a json file of: name, url, logo, currently uses the five acknowledgements on the front page. This is not included anywhere yet, but it's the first part of breaking up the front page into reusable sections.
Does not have functionality yet
Aside from the codeblocks (styling of which is not entirely in our control), this puts us with 0 violations according to the IBM Accessibility 7.3 guidelines which seem to be quite strict.
Without doing this on small screens they're below the news rather than with the CodeMeta copy
This can make use of multiple rss feeds in the data/feeds directory the items get merged and sorted by pubDate
This is linked to from the bottom of the truncated news sidebar
Additionally update github workflow for changes to the feed location
progval
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks
.github/workflows/news.yml
Outdated
| - uses: actions/checkout@v4 | ||
| - name: Download File | ||
| run: | | ||
| curl https://www.softwareheritage.org/tag/codemeta/feed/ --output ./data/softwareheritage.xml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there other sources we could add too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @moranegg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there are, I'll need to refactor the live-refresh JS a bit. I left it as it is because it was working enough for rollout with the one feed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@progval not yet :)
I hope we get some feedback on this during a SciCodes consortium meeting.
For this PR, this is fine as is.
| Reproducibility | ||
| : Tracking the software libraries and applications used in research, using | ||
| CodeMeta's _versions_ and _dependencies_ metadata, ensures that important | ||
| findings can be reviewed and verified with greater accuracy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Off-topic for this PR, but I find that dependency metadata in Codemeta is either missing or unusable because it's underspecified
| Edited Use cases | ||
| CodeMeta meeting in Portland | ||
| Created 20160415 (use cases group pulled from here 230pm 20160516) https://docs.google.com/document/d/1SalOP_tLw7FC6jnoz5hJBB2jA7xBClKqc88wgmJu5Ro/edit | ||
| Created 20160415 (use cases group pulled from here 230pm 20160516) [PDF export of google doc notes](/CodeMeta_Software_Use_Cases-Day2PM_WrkngGrp.pdf) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx
layouts/shortcodes/news.md
Outdated
| let url = `https://softwareheritage.org/tag/codemeta/feed/`; | ||
| let response = await fetch(url, { | ||
| method: "GET", | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is there a request here in addition to the curl in the Github Actions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Originally it was just going to be a list of links on the page. It was easy enough to make it update periodically. The scope crept a bit to want immediate updates...
I left the action in place because it being pulled in daily gives the page something to build a placeholder list that's only ever slightly out of date. That way it's basically seamless and there's not a huge jump in the page when the JS lags during loading and parsing the feed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see.
| {{ range .Paginator.Pages }} | ||
| <div class="article"> | ||
| <h2><a href="{{ .RelPermalink }}">{{if .Params.image }} <img src="{{ .Params.image }}" height="50px"/> {{ end }}{{ .Title }}</a></h2> | ||
| <h2><a href="{{ .RelPermalink }}">{{if .Params.image }} <img alt="{{ substr .Params.image 5 -4 }} logo" src="{{ .Params.image }}" height="50px"/> {{ end }}{{ .Title }}</a></h2> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are typical values of the alt here? I'm worried it would be redundant with the text (eg. make a screen reader say "Foo logo Foo" instead of just "Foo")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's more "Foo logo Crosswalk for Foo" but sometimes it's "Foo logo Crosswalk for Bar". It could be a blank alt I guess...
| function formatAMPM(date) { | ||
| var hours = date.getUTCHours(); | ||
| var minutes = date.getUTCMinutes(); | ||
| var ampm = hours >= 12 ? 'PM' : 'AM'; | ||
| hours = hours % 12; | ||
| hours = hours ? hours : 12; // the hour '0' should be '12' | ||
| minutes = minutes < 10 ? '0'+minutes : minutes; | ||
| var strTime = hours + ':' + minutes + ' ' + ampm; | ||
| return strTime; | ||
| } | ||
|
|
||
| async function fetchCodeMetaPostsFromSWHWordPress() { | ||
| let url = `https://softwareheritage.org/tag/codemeta/feed/`; | ||
| let response = await fetch(url, { | ||
| method: "GET", | ||
| }); | ||
|
|
||
| const text = await response.text(); | ||
| const parser = new DOMParser(); | ||
| const doc = parser.parseFromString(text, "text/xml"); | ||
| const items = doc.getElementsByTagName("item"); | ||
|
|
||
| $("#newslinks ul").empty(); | ||
| for (let i = 0 ; i < items.length ; ++i) { | ||
| const title = items[i].querySelector("title").textContent; | ||
| const link = items[i].querySelector("link").textContent; | ||
| const date = new Date(items[i].querySelector("pubDate").textContent); | ||
| const desc = items[i].querySelector("description").textContent; | ||
|
|
||
| const year = date.getUTCFullYear(); | ||
| const months = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]; | ||
| const month = months[date.getUTCMonth()]; | ||
| const day = date.getUTCDate().toString().padStart(2, '0'); | ||
| const timestr = formatAMPM(date); | ||
|
|
||
| const utc = `${month} ${day}, ${year} ${timestr} UTC` | ||
|
|
||
| if (i <= ({{ .Site.Params.newslimit }} - 1 )) | ||
| $("#newslinks ul").append( | ||
| `<li class="ps-2 refreshed"> | ||
| <a class="list-group-item newslink lh-base p-2" href="${link}">${title}</a> | ||
| <small class="p-2 text-secondary-emphasis">${utc}</small> | ||
| </li>` | ||
| ) | ||
| }; | ||
| } | ||
|
|
||
| fetchCodeMetaPostsFromSWHWordPress(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this meant to duplicate layouts/shortcodes/news.md?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't but it's where I got to. I'll tidy it up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deduped the bits that didn't vary, and multi-feed support added.
content/create.md
Outdated
| <iframe id="generator" title="CodeMeta Generator" onload="iframeResize()" src="/codemeta-generator" class="d-inline-block w-100" frameborder="0"> | ||
| If there is no form visible here, you can also access the [CodeMeta Generator](https://codemeta.github.io/codemeta-generator) directly. This may be due to browser security settings. | ||
| </iframe> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm really not sure why it's not displaying full-height for you here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the rationale for preferring the iframe solution was the loss of the site's menu when sent directly to the generator, but @moranegg can clarify more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we also want the button on the front page to go there directly or should it still point to /create ?
I have a weak preference for the former.
Co-authored-by: Val Lorentz <[email protected]>
layouts/shortcodes/news.md
Outdated
| let url = `https://softwareheritage.org/tag/codemeta/feed/`; | ||
| let response = await fetch(url, { | ||
| method: "GET", | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see.
|
Thanks, @meldra! |
|
@moranegg I think we're ready for merge. Sorry I didn't notice it was still in draft. |


This PR is massive and involves a bunch of structural changes.
It updates the framework of the site from Material-Kit based
on Bootstrap 4, to vanilla Bootstrap 5.3. JQuery jumps from
3.2.1 to 3.7.1. Unused libraries from the kit have also been
removed. The general appearance of the site has been
preserved on request.
There is now a dark theme, and within the scope of this site
(so not the the hugo-managed codeblocks) there should not be
any violations per the IBM Equal Access Accessibility Checker.
Several layouts were added. There is now a layout that puts the
table of contents in a left sidebar, and a landing page layout
for the front page.
The original front page content has been relocated and the front
page now introduces CodeMeta; its purpose, adoption, and its use
cases. Crosswalks are also introduced.
Finally, the supporters of CodeMeta now get more appropriate
visibility for their contributions.