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

footer statistics #207

Merged
merged 6 commits into from
Jul 7, 2019
Merged

footer statistics #207

merged 6 commits into from
Jul 7, 2019

Conversation

fetis
Copy link
Owner

@fetis fetis commented Jun 24, 2019

Adds statistics information in the footer

Screenshot_2019-06-25 30 Seconds of angular

closes #196

builder/plugins/statistics.js Outdated Show resolved Hide resolved
builder/plugins/statistics.js Outdated Show resolved Hide resolved
@fetis
Copy link
Owner Author

fetis commented Jun 26, 2019

add commit date to footer

@fetis fetis added the site site related work label Jul 6, 2019
@fetis
Copy link
Owner Author

fetis commented Jul 6, 2019

review notes and added test.
@NothingEverHappens plz re-check

builder/__tests__/plugins/statistics.test.js Show resolved Hide resolved
builder/__tests__/plugins/statistics.test.js Show resolved Hide resolved
expect(statistics.revision).toBe('hash123');
expect(statistics.revisionAbbr).toBe('hsh');
expect(statistics.revisionDate).toBe('2019-06-07');
expect(statistics.generationDate).toMatch(/\d{4,}-\d\d-\d\d/);
Copy link
Contributor

Choose a reason for hiding this comment

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

just do .toMatchSnapshot() ?

Copy link
Owner Author

Choose a reason for hiding this comment

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

just do .toMatchSnapshot() ?

Generation date will be different every time, so snapshot will not match

Copy link
Contributor

Choose a reason for hiding this comment

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

would something like this work?

.toMatchSnapshot({
  generationDate: expect.match(/../),
});

</p>
<p>
Generated {{ generationDate }}, based on commit
<a href="https://github.com/nycJSorg/30-seconds-of-angular/tree/{{ revision }}" target="_blank">{{ revisionAbbr }}</a>
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we have it in site metadata? We're going to move the repo soon

Copy link
Owner Author

@fetis fetis Jul 6, 2019

Choose a reason for hiding this comment

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

I don't think this information belongs to metalsmith meta. It's much easier to change link in template.

Copy link
Contributor

Choose a reason for hiding this comment

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

https://github.com/nycJSorg/30-seconds-of-angular this part certainly should not be it 10 different templates

builder/public/css/style.css Outdated Show resolved Hide resolved
@kirjs kirjs merged commit 1729447 into master Jul 7, 2019
@fetis fetis deleted the statistics branch July 14, 2019 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
site site related work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add statistics
3 participants