A web component/JavaScript to turn github repo links into cards with links to github pages and show the latest commits.
- Include the script in your page
- If you want to style the results yourself, use the HTML version:
<div class="github-include" data-commits="5" data-pages="🌍" data-links="true"> <a href="https://github.com/codepo8/mastodon-share"> Mastodon Share </a> </div>
- If you want to use the default style including dark/light mode, use the web component
<github-include commits="5" pages="🌍" links="true"> <a href="https://github.com/codepo8/mastodon-share">Mastodon Share</a> </github-include>
You can customise the functionality using attributes on the component or data-attributes on the HTML:
- commits
- Show the last x commits to the repository, f.e. `5`, set to `-1` to show all.
- links
- If set to `true`, the commit messages will be links to the commits.
- pages
- If set to a certain text, it will create a link to the GitHub Pages of the project with the text you provide
- commitheader
- Text to show before the commit messages - preset is `Latest commits:`
- loadingmessage
- Text to show whilst loading commit messages - preset is `loading…`