SSWConsulting / SSW.Website

Generator for ssw.com.au
https://www.ssw.com.au
Apache License 2.0
8 stars 7 forks source link

✨ Homepage - Add button to check changes history #2217

Open jeoffreyfischer opened 7 months ago

jeoffreyfischer commented 7 months ago

https://www.ssw.com.au/

Description As per my conversation with @adamcogan, we need to create a button to see the history of who modified the SSW homepage. The button should link to https://github.com/SSWConsulting/SSW.Website/commits/main/ https://github.com/SSWConsulting/SSW.Website/commits/main/content/pages/home.mdx

Screenshot

image Figure: SSW Homepage

andrewwaltosssw commented 4 months ago

As per my conversation with @hveraus, Ken will create some mockups for this feature and link them in this issue once they are ready

hveraus commented 4 months ago

@jeoffreyfischer @johnxu16 @andrewwaltosssw

Hi guys, I am thinking of just adding a new sentence after the deployment.

"Content updated on May 2, 2024. " and make the date clickable.

Image

johnxu16 commented 4 months ago

@jeoffreyfischer @johnxu16 @andrewwaltosssw

Hi guys, I am thinking of just adding a new sentence after the deployment.

"Content updated on May 2, 2024. " and make the date clickable.

Image

This footer exists in all pages. Do we only need this on home page or every page?

For fetching the actual date of the home.mdx updated, we may utilize github api for fetching it which add unexpected complexity. Can we change "Content updated on May 2, 2024" to something like "Page update history"

johnxu16 commented 4 months ago

Note: If it is required to get the latest update time of a specific file, we can use github graphql api as follows

Tested on https://docs.github.com/en/graphql/overview/explorer

query {
  repository(owner: "SSWConsulting", name: "SSW.Website"){
    defaultBranchRef {
      name
      target {
        ... on Commit {
          history(path: "content/pages/home.mdx", first: 1) {
            nodes {
              author {
                name
              }
              abbreviatedOid
              committedDate
            }
          }
        }
      }
    }
  }
}