Skip to content

Commit

Permalink
lib/generate.js: Output /static to root of /out
Browse files Browse the repository at this point in the history
Change the generator (and other files to retain compatibility)
to output contents of /static to /out instead of /out/static.
This allows files such as favicon or manifest to be placed
in root of the webpage.

Related to #55
  • Loading branch information
myfrom committed Dec 14, 2017
1 parent cf4a35d commit 206a75c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion lib/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const rootURL = process.env.URL
const competitionOpen = new Date(dates.competition_open_starts)
const noClaims = new Date(dates.competition_open_ends)

ncp('static', 'out/static', err => {
ncp('static', 'out', err => {
if (err) {
console.error(err)
}
Expand Down
14 changes: 7 additions & 7 deletions lib/scrape.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ const GCI_API_BASE = 'https://codein.withgoogle.com/api'
const MIN_SEARCH_SCORE = 10

const CHAT_IMAGES = {
GITTER: 'static/images/logos/gitter.png',
SLACK: 'static/images/logos/slack.png',
ZULIP: 'static/images/logos/zulip.png',
ROCKET: 'static/images/logos/rocket.png',
TELEGRAM: 'static/images/logos/telegram.png',
IRC: 'static/images/logos/irc.png',
OTHER: 'static/images/chat.png',
GITTER: 'images/logos/gitter.png',
SLACK: 'images/logos/slack.png',
ZULIP: 'images/logos/zulip.png',
ROCKET: 'images/logos/rocket.png',
TELEGRAM: 'images/logos/telegram.png',
IRC: 'images/logos/irc.png',
OTHER: 'images/chat.png',
}

const GH_API_OPTIONS = {
Expand Down
24 changes: 12 additions & 12 deletions templates/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="og:title" content="GCI Current Leaders">
<meta property="og:description" content="Google Code-in 2017 Current Leaders">
<meta property="og:image" content="{{{rootURL}}}/static/images/GCI-logo.jpg">
<link rel="stylesheet" href="static/css/main.css">
<meta property="og:image" content="{{{rootURL}}}/images/GCI-logo.jpg">
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<div>
Expand Down Expand Up @@ -57,7 +57,7 @@ <h3>
{{/github}}
{{#mailing_list}}
<a href="{{mailing_list}}">
<img src="static/images/mail.png" class="chat" alt="Join their mailing list" />
<img src="images/mail.png" class="chat" alt="Join their mailing list" />
</a>
{{/mailing_list}}
{{#chat}}
Expand All @@ -67,17 +67,17 @@ <h3>
{{/chat}}
{{#twitter_url}}
<a href="{{twitter_url}}">
<img src="static/images/logos/twitter.png" class="chat" alt="Find them on Twitter" />
<img src="images/logos/twitter.png" class="chat" alt="Find them on Twitter" />
</a>
{{/twitter_url}}
{{#gplus_url}}
<a href="{{gplus_url}}">
<img src="static/images/logos/gplus.png" class="chat" alt="Find them on Google+" />
<img src="images/logos/gplus.png" class="chat" alt="Find them on Google+" />
</a>
{{/gplus_url}}
{{#website_url}}
<a href="{{website_url}}">
<img src="static/images/logos/global.png" class="chat" alt="Visit their website" />
<img src="images/logos/global.png" class="chat" alt="Visit their website" />
</a>
{{/website_url}}
{{#wikipedia_urls.en}}
Expand Down Expand Up @@ -138,7 +138,7 @@ <h3>
{{/github}}
{{#mailing_list}}
<a href="{{mailing_list}}">
<img src="static/images/mail.png" class="chat" alt="Join their mailing list" />
<img src="images/mail.png" class="chat" alt="Join their mailing list" />
</a>
{{/mailing_list}}
{{#chat}}
Expand All @@ -148,17 +148,17 @@ <h3>
{{/chat}}
{{#twitter_url}}
<a href="{{twitter_url}}">
<img src="static/images/logos/twitter.png" class="chat" alt="Find them on Twitter" />
<img src="images/logos/twitter.png" class="chat" alt="Find them on Twitter" />
</a>
{{/twitter_url}}
{{#gplus_url}}
<a href="{{gplus_url}}">
<img src="static/images/logos/gplus.png" class="chat" alt="Find them on Google+" />
<img src="images/logos/gplus.png" class="chat" alt="Find them on Google+" />
</a>
{{/gplus_url}}
{{#website_url}}
<a href="{{website_url}}">
<img src="static/images/logos/global.png" class="chat" alt="Visit their website" />
<img src="images/logos/global.png" class="chat" alt="Visit their website" />
</a>
{{/website_url}}
{{#wikipedia_urls.en}}
Expand All @@ -184,7 +184,7 @@ <h3>
<footer>
<small>Google Code-in and the Google Code-in logo are trademarks of Google Inc.</small>
</footer>
<script src="static/js/app.js"></script>
<script src="static/js/twitter.js"></script>
<script src="js/app.js"></script>
<script src="js/twitter.js"></script>
</body>
</html>

0 comments on commit 206a75c

Please sign in to comment.