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

Fetch our own stars! #28

Merged
merged 5 commits into from
Jul 5, 2018
Merged

Fetch our own stars! #28

merged 5 commits into from
Jul 5, 2018

Conversation

TomasHubelbauer
Copy link
Member

I'm lumping in some unrelated code formatting, I think en.json was updated by the build somehow to remove unused keys? The rest is probably VS Code. Happy to revert formatting to be just the stars.

I'm lumping in some unrelated code formatting, I think `en.json` was updated by the build somehow to remove unused keys? The rest is probably VS Code. Happy to revert formatting to be just the stars.
@vercel
Copy link

vercel bot commented Jul 5, 2018

This pull request is automatically deployed with Now.

To access deployments, click Details below or on the icon next to each push.

@TomasHubelbauer
Copy link
Member Author

Oh BTW no styling, maybe later?

@TomasHubelbauer
Copy link
Member Author

Closes #24

@TomasHubelbauer
Copy link
Member Author

Looks like I didn't break anything obvious hehe

@vercel
Copy link

vercel bot commented Jul 5, 2018

Now cannot deploy because all the allocated instances are in use.
You can either upgrade your plan or down scale existing deployments.

@vercel
Copy link

vercel bot commented Jul 5, 2018

Now cannot deploy because all the allocated instances are in use.
You can either upgrade your plan or down scale existing deployments.

return (
<div>
<a href="https://github.com/isomorphic-git/isomorphic-git">GitHub <span id="gitHubStars" /></a>
<script dangerouslySetInnerHTML={{ __html: script }} />
Copy link
Member

Choose a reason for hiding this comment

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

Hahaha this is so not the "right" way to populate a React component, but I love it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm actually not sure if I understand this right, I just wasn't getting any invocations on componentDidMount and I figured Docusaurus just runs the server method of the rendering pipeline and stores the serialized result in static files. I've documented this in the comment but if this is not accurate I'd love to fix it up because this is dirty - but let dirty than having the script in the HTML template I think because at least it's collocated with what it mutates. :-D

@vercel
Copy link

vercel bot commented Jul 5, 2018

Now cannot deploy because all the allocated instances are in use.
You can either upgrade your plan or down scale existing deployments.

headers: { accept: 'application/vnd.github.v3+json' }
})
const data = await response.json()
document.querySelector('#gitHubStars').textContent = '(' + data.stargazers_count + ' stars)'
Copy link
Member

Choose a reason for hiding this comment

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

maybe ⭐ emoji instead of the word "stars"?

@vercel
Copy link

vercel bot commented Jul 5, 2018

Now cannot deploy because all the allocated instances are in use.
You can either upgrade your plan or down scale existing deployments.

@billiegoose
Copy link
Member

I like it! Merge it whenever you feel likeit.

@TomasHubelbauer TomasHubelbauer merged commit 47ffe84 into source Jul 5, 2018
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.

None yet

2 participants