Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

feat: Added Git Credentials in Footer and Open issue in Header #182

Merged
merged 3 commits into from
Oct 10, 2022

Conversation

PriyanshuRj
Copy link
Contributor

- What I did
fixes #22
I created a Link to open an issue on the atsign documentation repository and added details for the last commit in the footer as specified.
Last updated on <date>
By <author> in <short commit id> (commit id can link to the commit in GitHub)
- How I did it

- How to verify it
After running the Documentation site on localhost, you can check the header and the footer of the site to verify the same.
image
image

- Description for the changelog
Updated the header of the site to add a open issue features and added details of last commit in the footer.

Copy link
Member

@XavierChanth XavierChanth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @PriyanshuRj, thanks for your solution. There are a few more improvements I would like to see included in your solution:

  1. This solution is only able to get the latest commit on the repo, It would be nice to see this information based on the page that you are on. Most times, the page that you are viewing will not have been modified in the last commit.
  2. I would rather this information be part of the hugo build process, this would allow this information to be served statically instead of through a client side script (much faster loads and no unnecessary api calls to GitHub).

It may be helpful to see what kind of Git information is already included in Hugo: https://gohugo.io/variables/git/#readout.

layouts/partials/main/footer.html Outdated Show resolved Hide resolved
@PriyanshuRj
Copy link
Contributor Author

New Look after adapting to Hugo .GitInfo
image

Copy link
Member

@XavierChanth XavierChanth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but to avoid code duplication please put your work into the main/footer partial.
The file is at layouts/partials/main/footer.html

@XavierChanth XavierChanth changed the title Added Git Credentials in Footer and Open issue in Header feat: Added Git Credentials in Footer and Open issue in Header Oct 7, 2022
@PriyanshuRj
Copy link
Contributor Author

Looks good, but to avoid code duplication please put your work into the main/footer partial. The file is at layouts/partials/main/footer.html

Actually, the git variables are not accessible in the partials so we need to pass them down which will also create extra code.

@XavierChanth
Copy link
Member

Looks good, but to avoid code duplication please put your work into the main/footer partial. The file is at layouts/partials/main/footer.html

Actually, the git variables are not accessible in the partials so we need to pass them down which will also create extra code.

Ah you are correct, the partial call doesn't have the context being passed down.
You can in pass down a . for everything, or just the Git variable context.

One of the most common mistakes with new Hugo users is failing to pass a context to the partial call. In the pattern above, note how “the dot” (.) is required as the second argument to give the partial context. You can read more about “the dot” in the Hugo templating introduction.
Source: https://gohugo.io/templates/partials/#use-partials-in-your-templates

This partial didn't have the context being passed, since it didn't need it prior to now.

@PriyanshuRj
Copy link
Contributor Author

Looks good, but to avoid code duplication please put your work into the main/footer partial. The file is at layouts/partials/main/footer.html

Actually, the git variables are not accessible in the partials so we need to pass them down which will also create extra code.

Ah you are correct, the partial call doesn't have the context being passed down. You can in pass down a . for everything, or just the Git variable context.

One of the most common mistakes with new Hugo users is failing to pass a context to the partial call. In the pattern above, note how “the dot” (.) is required as the second argument to give the partial context. You can read more about “the dot” in the Hugo templating introduction.
Source: https://gohugo.io/templates/partials/#use-partials-in-your-templates

This partial didn't have the context being passed, since it didn't need it prior to now.

Thanks got it.

@TylerTrott TylerTrott merged commit 9cac1d9 into atsign-foundation:trunk Oct 10, 2022
@JeremyTubongbanua
Copy link
Member

Amazing work @PriyanshuRj :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: Github Issues tracker + Feedback button
4 participants