Skip to content

Commit

Permalink
Add template function overview to README
Browse files Browse the repository at this point in the history
  • Loading branch information
muesli committed Jul 19, 2020
1 parent edee17a commit 228a8b3
Showing 1 changed file with 45 additions and 2 deletions.
47 changes: 45 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,54 @@ Render to a file:
## Templates

You can find an example template to generate a GitHub profile README under
`templates/github-profile.tpl`. Make sure to fill in the placeholders, like
the RSS-feed or social media URLs.
`templates/github-profile.tpl`. Make sure to fill in (or remove) placeholders,
like the RSS-feed or social media URLs.

Rendered it looks a little like my own profile page: https://github.com/muesli

## Functions

### Fetch repositories you recently created

```
{{range recentRepos 10}}
Name: {{.Name}}
Description: {{.Description}}
URL: {{.URL}})
Stars: {{.Stargazers}}
{{end}}
```

### Fetch recent releases you contributed to

```
{{range recentReleases 10}}
Name: {{.Name}}
Git Tag: {{.LastRelease.TagName}}
URL: {{.LastRelease.URL}}
Published: {{humanize .LastRelease.PublishedAt}}
{{end}}
```

### Fetch your latest followers

```
{{range followers 5}}
Username: {{.Login}}
URL: {{.URL}}
{{end}}
```

### Retrieve RSS feed

```
{{range rss "https://.../feed.xml" 5}}
Title: {{.Title}}
URL: {{.URL}}
Published: {{humanize .PublishedAt}}
{{end}}
```

## Template Engine

markscribe uses Go's powerful template engine. You can find its documentation
Expand Down

0 comments on commit 228a8b3

Please sign in to comment.