Skip to content

A web component/JavaScript to turn github repo links into cards with links to github pages and show the latest commits

License

Notifications You must be signed in to change notification settings

codepo8/github-include

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

github-include

A web component/JavaScript to turn github repo links into cards with links to github pages and show the latest commits.

Usage

  1. Include the script in your page
  2. 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>
  3. 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>

Settings

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…`

Demo

You can see < github-include /> in action here

About

A web component/JavaScript to turn github repo links into cards with links to github pages and show the latest commits

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published