-
Notifications
You must be signed in to change notification settings - Fork 13
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
update tech-docs-github-pages-publisher to 1.5 #150
Conversation
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.
Hi @NickWalt01, it’s not clear to me from the commits why you’ve had to change all the title lines? If the code that was previously generating them no longer works, is there a replacement for that? And if there isn’t, and this is the only way to display the titles, do we still need the metadata in the YAML front-matter on each document?
All of that should be described in the commit message and PR title/description, because as it is this change appears as if you’re just changing them for no reason I can see…
Hi @SteveMarshall I've recently updated the repo https://github.com/ministryofjustice/tech-docs-github-pages-publisher to v1.5 so that it is using the latest dependencies which involved bumping govuk_tech_docs from v2.1.0 to v3.2.0, in this version when it complies the html.md.erb files it has an issue with those html titles, I solved it by replacing them with normal markdown titles and the compilation was successful. I've updated the operations-engineering page in a similar fashion. I understand what you are saying that this merge doesnt equate to the upgrade to v1.5, that was done in the previous merge 49521c8 which then failed its CI run as the updated html proof checker inside the docker image has failed the license url link that Tony has spotted in the other PR. This PR and Tony's PR should be one bit of work that should have gone into the previous merge but I didnt spot the makefile was using v1.3 when I tested it. |
I'm not to sure on the 'do we still need the metadata in the YAML front-matter on each document?' as I dont know how it is used, there is this page that explains that they are still usable fields: https://tdt-documentation.london.cloudapps.digital/configure_project/frontmatter/#configure-page-settings |
@NickWalt01 Right, but my point is that if the titles are failing, that seems like a bug to me. Tech Docs Template uses Middleman under the covers, and Middleman's documentation explicitly uses That would suggest that there's something wrong here, and the solution would be to identify what that is (and possibly fix it upstream, if necessary) rather than just work around it. |
@NickWalt01 Not to mention, too, that the context in your first comment should probably be summarised in the commit messages if it turns out that we can't use the variables anymore… |
Ah it make sense now. The issue is that our files are missing the |
|
yeah, I didn't know what it did, as it doesn't look like ruby or markdown code. I'll run a local instance and get some images of the error when it is used with the latest versions of middleman and dependencies |
An exception is raised error when <%= current_page.data.title %> is used within the source file: It was solved by changing it to # Title The error appears to be govuk_tech_docs rather than middleman. I found this: alphagov/tech-docs-gem#284 which is similar to something I experienced: the html-proof tool was creating links that didnt exist ie because if the same title appeared in different files it didnt treat them as separate namespaces and thus failed the url check, there is a fix like this alphagov/tech-docs-gem#150 (comment) but to implement that is a bigger change across all the heading and sub headings. The examples in the gem also uses markdown for the title: https://github.com/alphagov/tech-docs-gem/blob/master/example/source/index.html.md.erb within https://github.com/alphagov/tech-docs-gem/tree/master/example/source I havent come across anything that explains how <%= current_page.data.title %> is converted to a html h1 tag or a markdown # tag. |
Hi @SteveMarshall I've found out the problem, it is in the YAML fields at the top of the page specially last_reviewed_on. When loading a date yaml field an exception occurs and thus the title yaml field cannot be read correctly. Example |
@NickWalt01 Good sleuthing 👍🏼 I wonder if it's worth raising that as a bug against https://github.com/alphagov/tech-docs-gem, or fixing it and raising a PR? |
Middleman Ruby v3.1 The issue is discussed here And explained in this article: https://www.ctrl.blog/entry/ruby-psych4.html govuk_tech_docs tech-docs-github-pages-publisher Summary |
Hi @SteveMarshall based on the last message above have decided to revert the ruby inside the image back to v2.7 which caused the issue, just need your approval to close off this PR |
@NickWalt01 To be clear, are you saying “close the PR without merging and upgrading to v1.5”? I'm happy with that or with merging it and not upgrading Ruby if that resolves the issue… |
Hi @SteveMarshall I wish to merge the bump from 1.4 to 1.5, 1.5 is using ruby 2.7, am using 1.5 on the operations-engineering website and we have managed to get the review date expiry alerts up and running again, version 1.5 mainly contains dependency updates to fix dependabot issues: https://github.com/ministryofjustice/tech-docs-github-pages-publisher/commits/main |
No description provided.