Skip to content
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

New JS folder / Check Repositories last update #90

Open
wants to merge 29 commits into
base: master
Choose a base branch
from

Conversation

rxchun
Copy link
Contributor

@rxchun rxchun commented Oct 21, 2024

  • Moved body scripts to a newly created JS file, located at /js/scripts2024.js
  • Added a Javascript JSON fetch, to display a badge for each Repository, for when they were last updated.

screenshot: https://i.ibb.co/TWhmkD0/z581.jpg


You can delete the blockquote, color description if it's too animated/not professional looking.
https://github.com/q2a/q2a.github.io/pull/90/files#diff-2803cc740fbdbb5781c9d487863434e2ba1f72438c0a9797c0fd245abf6d4590R11

screenshot: https://i.ibb.co/qnGymGh/z582.jpg

Moved body scripts to a newly created JS file, located at /js/scripts2024.js
Added a Javascript JSON fetch, to display the "date" of each Repository when they were last updated.

https://i.ibb.co/TWhmkD0/z581.jpg
@rxchun rxchun changed the title Added new JS folder to hold scripts New JS folder / Check Repositories last update Oct 21, 2024
- Refactored the repository dates function.
Dates are now stored on user devices via localStorage, and are only fetched again if there's a change on the lists size (one more list item added, one less list item removed) , or 90 days / 3 months have passed since last fetched. the amount of days for the next fetch can be changed at the top of the scripts.js file.
- Current visited page now is highlighted.
- Added Breadcrumbs
- Added sidebar navigation for sections of the articles.
- Created a popup for the "Welcome to Docs" text.
- Added scroll to top button.
- Internal links fixes.
- Added Mega Menu for Documentation, to group things into sections.
@rxchun
Copy link
Contributor Author

rxchun commented Nov 18, 2024

So I wanted to break this down into multiple PRs to make it easier to review, but it wouldn't make much sense of what the end product would be overall. So sorry in advance for the long PR.

You can preview this PR live here: https://rxchun.github.io/q2adocs-preview/

What was done in this last commit:

  • Refactored the fetching of repository dates.
    Repository Dates are now stored locally on user devices via localStorage, so it won't bombard raw.github as much for every page request.

    The links will be re-fetched again if there's a change on the lists size (one more item added, one more item removed) , or 90 days / 3 months have passed since last fetched, for that user.
    The amount of days for the next fetch can be changed at the top of the scripts.js file. But 90 days seems fine, as the importance of the "up-to-date" tags are based on years. (This is only working for the Plugin and Theme lists btw.)

  • Current visited page is now highlighted at the navigation bar.

  • Added Breadcrumbs

  • Added sidebar navigation, for sections of articles.

  • Created a popup for the "Welcome to Docs" text, for the Homepage.

  • Added slugs to every page, so it can be used to create .template-home classes for the body element. Similar to .qa-template

  • Added scroll to top button.

  • Internal links fixes.

  • Added Mega Menu for Documentation, to group things into sections.

  • Included Arjun's PR Support base_url for internal links #89 for internal links.

@svivian
Copy link
Collaborator

svivian commented Nov 22, 2024

Thanks for the contribution, there's some good stuff in here. I like the dropdown menu, it's a bit easier to navigate.

The 'last updated' is an interesting idea. My main worry is that some plugins won't need updating so it looks like they're out of date but they work fine. Case in point: most of my plugins!

Maybe there is an alternate method we could use? For example Wordpress says which versions a plugin has been tested with, perhaps we could add something like that into plugin metadata.

@rxchun
Copy link
Contributor Author

rxchun commented Nov 22, 2024

My initial idea was to update the plugins metadata dates once a year, and that would reflect as up-to-date, since most people already update those when they update their plugins.

But that's an even better idea!
There's already a "min_q2a" key, I guess we could add a "max_q2a", for the latest compatibility.

I will refactor the function so that:

it looks for the max_q2a key first,
---- if there's none available, then add the badge based on date.

@rxchun
Copy link
Contributor Author

rxchun commented Nov 23, 2024

Live preview

  • So I ended up creating a second badge instead, to display the "Q2A Tested with version" if the max_q2a key is available.

  • Broke down Forked / Updated repositories into new lines, and added a .child-repository class to them.

    They're created this way, as siblings instead of children, so it's easier to create the Footers for Repositories, and not have the supposed child element come in between the content and the footer of the parent. Screenshot example here.

  • Child repository links should start with an arrow .
    People can just copy the logic when adding their repos, but I can also create a Q2A post, letting people know about all these new features.

  • There's an either or conundrum in the Addons/themes page. Because there's themes with a second repository link for a plugin, as a package. I left them like that for now, but the second link could be removed with something like this via CSS:

.repository-footer ~ .repository-footer {
    display: none;
}

Cheers!

Brought back the original Markdown Editor link by Scott, since it still works with version Q2A 1.8.8 , and these seem to be different plugins. (Aesthetic wise)

I prefer the simpler version by Scott, which other people might find preferable as well, so this gives the option to download the original one.
@rxchun
Copy link
Contributor Author

rxchun commented Nov 24, 2024

This link "Google Code Prettify and MathJax" also appears in 2 instances.

  • 1st at "integration-with-other-products" section.
  • 2nd as a child of "WYSIWYG Math Editor"

Didn't know which one to remove, so I just left it there.

…sed for 2 pages

- Seperated GithubLinks script, from main scripts, since they're only used for 2 pages.
- Reverted Gemfile.lock to original. The  extra Windows systems options weren't necessary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants