Skip to content
This repository was archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Start styling the npm pages
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed Oct 20, 2016
1 parent 35b5cbb commit 96d89b9
Show file tree
Hide file tree
Showing 5 changed files with 211 additions and 8 deletions.
2 changes: 2 additions & 0 deletions scss/pages/on-npm-foo.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#on-npm-foo {
}
1 change: 1 addition & 0 deletions www/assets/gratipay.css.spt
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,6 @@
@import "scss/pages/giving";
@import "scss/pages/settings";
@import "scss/pages/on-confirm";
@import "scss/pages/on-npm-foo";
@import "scss/pages/search";
@import "scss/pages/hall-of-fame";
Binary file added www/assets/npm-n.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
194 changes: 194 additions & 0 deletions www/assets/npm-wombat-typing.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 14 additions & 8 deletions www/on/npm/%package/index.html.spt
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,21 @@ package_name = request.path['package']
r = requests.get('https://registry.npmjs.com/{}'.format(package_name))
if r.status_code != 200:
raise Response(r.status_code)
readme = markdown.render(r.json()['readme'])
title = package_name
suppress_sidebar = True
package = r.json()
readme = markdown.render(package['readme'])
banner = package_name
page_id = "on-npm-foo"
[---]
{% extends "templates/base.html" %}
{% block content %}

{{ readme }}

No it's not.

{% block banner %}
<a class="elsewhere" href="https://npmjs.com/package/{{ package['name'] }}">
<div class="avatar">
<img src="{{ website.asset('npm-wombat-typing.svg') }}" class="avatar">
<img class="platform" src="{{ website.asset('npm-n.png') }}" />
</div>
{{ super () }}
</a>
{% endblock %}

{% block content %}{{ readme }}{% endblock %}

0 comments on commit 96d89b9

Please sign in to comment.