-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from jpazureid/wahaniya-dev
Update themes
- Loading branch information
Showing
13 changed files
with
199 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<% if (theme.google_analytics){ %> | ||
<% if (config.google_analytics){ %> | ||
<!-- Global site tag (gtag.js) - Google Analytics --> | ||
<script async src="https://www.googletagmanager.com/gtag/js?id=<%= theme.google_analytics %>"></script> | ||
<script async src="https://www.googletagmanager.com/gtag/js?id=<%= config.google_analytics %>"></script> | ||
<script> | ||
window.dataLayer = window.dataLayer || []; | ||
function gtag(){dataLayer.push(arguments);} | ||
gtag('js', new Date()); | ||
gtag('config', '<%= theme.google_analytics %>'); | ||
gtag('config', '<%= config.google_analytics %>'); | ||
</script> | ||
<!-- End Google Analytics --> | ||
<% } %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/ Last update: <a id="update-time" class="<%= class_name %>"></a> | ||
/ Contributors: <ul style="display: inline-block; list-style:none" id="contributors" class="github-contributors"> </ul> | ||
|
||
<script type="text/javascript"> | ||
const sourceUrl = "<%- source_url %>"; | ||
const urlParts = sourceUrl.split("/"); | ||
const user = urlParts[3]; | ||
const repo = urlParts[4]; | ||
const filePath = urlParts.slice(7).join("/"); | ||
const apiUrl = `https://api.github.com/repos/${user}/${repo}/commits?path=${filePath}`; | ||
function formatDate(date) { | ||
let year = date.getFullYear(); | ||
let month = date.getMonth() + 1; | ||
let day = date.getDate(); | ||
if (month < 10) { | ||
month = '0' + month; | ||
} | ||
if (day < 10) { | ||
day = '0' + day; | ||
} | ||
return year + '-' + month + '-' + day; | ||
} | ||
$.getJSON(apiUrl, function (data) { | ||
const commit = data[0]; | ||
const updateDate = new Date(commit.commit.author.date); | ||
const localDate = formatDate(updateDate); | ||
const contributors = new Map(); | ||
data.reverse().forEach(function (commit) { | ||
if (commit.author == null) { | ||
return; | ||
} else { | ||
const name = commit.author.login; | ||
const url = commit.author.html_url; | ||
const avatar = commit.author.avatar_url; | ||
contributors.set(name, { name, url, avatar }); | ||
} | ||
}); | ||
$("#update-time").text(localDate); | ||
$("#update-time").href = commit.html_url; | ||
Array.from(contributors, ([_, value]) => value).reverse().forEach(function (contributor) { | ||
$("#contributors").append(`<li class="contributor-avatar"><a href="https://github.com/${contributor.name}" title="${contributor.name}"><img src="${contributor.avatar}" alt="${contributor.name}"/></a></li>`); | ||
}); | ||
}); | ||
</script> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.