-
-
Notifications
You must be signed in to change notification settings - Fork 78
Make the PHAR "website" a little more fancy #1156
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
@benno5020 Thank you so much for doing this! I haven't reviewed the code in depth (yet), but looking at the principle, there are a couple of things I'd like to get your opinion on.
💞
Thanks for doing that 👍🏻
I don't believe this assumption is correct. Underscore prefixed pages do not get published when the site is build via the standard Jekyll publishing mechanism, except that is explicitly disabled for this GH Pages site via the
Well, the PHP script is kind of a build tool 😉 To me, it feels counter-intuitive to have an auto-generated Side-note: I wonder whether the So... what I'm currently thinking is this:
How does that sound to you ? Do you see any problems which I'm overlooking ? Now, I don't know whether you have any experience with creating a custom GH Pages deploy script ? If we would decide to go down this road, I think the file moves need to be done in a separate commit, probably as the first commit for this PR, to allow for the best chance of git keeping track of the file history correctly.
That's totally fair and something which can be left as "future scope" to be added to the publish workflow at a later date.
Iteration is good ;-) |
Hi @jrfnl,
I have restructured the files and created a workflow. |
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 @benno5020 Thank you for your continued work on this!
- We could definitely query the GitHub API, but then we'd have to think about the (unlikely) scenario that the API is down during deployment.
True - in that case, maybe we should leave the "date" bit for the next iteration and discuss that separately ?
My thoughts on this at this moment:
- We could check the GH API, and if there is no usable response fall back to the original logic ?
- Alternatively, we could check the status of the GH API from within the workflow using the https://github.com/crazy-max/ghaction-github-status action runner and fail the workflow run if the GH API has a
partial_outage
(or higher).
That would prevent deploying the phar site in a broken state and would allow for "Re-running failed build(s)" with just a few clicks once the API outage has resolved.
Side-note: we may want to use that action runner in the workflow either way to check for an outage of GH Pages before deploying...
I have restructured the files and created a workflow. You can see it in action here: https://github.com/benno5020/PHP_CodeSniffer/actions/runs/16099172225/job/45426029117 (Note that the linked workflow is not 100% identical to the one in this branch. I have since split up the PHP step.) The resulting pages can be viewed here: https://benno5020.github.io/PHP_CodeSniffer/
Great work!
I've left some questions and remarks inline.
If you'd like to see an example of a workflow which is using most of what's being discussed, you could have a look at the workflow in use for the schema.phpcodesniffer.com
website: https://github.com/PHPCSStandards/schema.phpcodesniffer.com/blob/stable/.github/workflows/update-website.yml
There is one important difference between that website and this one - the schema website does not use the gh-pages
branch, but is a repo specifically for that website. Other than that, the principles are very similar.
Feels like we're getting very close now!
@@ -0,0 +1,200 @@ | |||
@import url(https://fonts.bunny.net/css?family=open-sans:400,800); |
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 there a strong reason to use an external font file ?
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.
No, just convenience. I did pick bunny over Google fonts for GDPR reasons but did not want to look into font licenses when I wrote that bit of code.
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.
Appreciate the GDPR consideration. I was more wondering why an external font is used at all, I mean, why not use the OS system fonts ?
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.
Fanciness! Seriously though, it would have felt strange to not set a font when the goal is to achieve a more professional look. But I'm open to your suggestions :)
If you'd like to stick with Open Sans, I believe we could self-host it after downloading WOFF2 files from here: https://gwfh.mranftl.com/fonts/open-sans?subsets=latin
Here's the license: https://github.com/googlefonts/opensans/blob/main/OFL.txt
The download icon is taken from https://github.com/feathericons/feather/blob/main/icons/download.svg (MIT license). The GitHub logo is taken from https://github.com/logos
This ensures the pages still work as intended when served from a subdirectory (such as https://username.github.io/PHP_CodeSniffer/).
I think it makes sense to add this to help search engines when they encounter duplicate content in forked repositories.
* Minor textual adjustments for the homepage. * Remove modified date for the PHAR listing (as it would currently be inaccurate). * Improve code style consistency of build script. * Remove trailing spaces in style.css file.
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.
@benno5020 I'm really sorry it's taken me so long to get back to this. I've now had a final look and have added a small commit with a few minor tweaks.
Functionally, the only real change is the removal of the "modified date" as this would currently not be very informative while it is based on the commit date.
I've opened issue #1167 with the ideas discussed above for further iterative improvements and I've included the "date" issue in that ticket.
Thank you for your work on this and for contributing to PHP_CodeSniffer!
Deployment succeeded. This is now live at: https://phars.phpcodesniffer.com/ |
This PR updates the gh-pages branch by styling the pages and adding a script to generate a listing of all downloadable phars.
Description
See #107
phars.html
displays the git committer date of each file (https://git-scm.com/docs/pretty-formats). I wasn't sure what else to show asfilemtime
would not be right.phive.xml
(as mentioned here: Make the PHAR "website" a little more fancy #107 (comment)). The filenames do not always match the respective version (note the dash in e.g.<release version="4.0.0-RC1" url="https://phars.phpcodesniffer.com/phars/phpcs-4.0.0RC1.phar">
) and I didn't want to make any assumptions.Personally, I like the look of
phars.html
butindex.html
could still use some work. But in the interest of keeping things moving, I thought I should send this PR sooner rather than later.Suggested changelog entry
n/a
Related issues/external references
Fixes #107
Types of changes
(I'm not sure if this applies for the gh-pages branch.)
PR checklist