Commit f5479b48a6784b7e3a1896e3c0eb81b7a66ef865
strip sbot, localize anchors
Gwen committed on 9/29/2016, 10:26:34 PMParent: bbf61587f52edfa5763a748e96a3e564068931f0
Files changed
index.js | changed |
layouts/index.jade | changed |
layouts/navbar.jade | changed |
src/index.md | added |
index.js | ||
---|---|---|
@@ -1,10 +1,5 @@ | ||
1 | 1 … | var express = require('express'); |
2 | -var avatar = require('ssb-avatar'); | |
3 | -var client = require('ssb-client'); | |
4 | -var pull = require('pull-stream'); | |
5 | -var moment = require('moment'); | |
6 | -var markdown = require('marked'); | |
7 | 2 … | var nm = require('nodemailer'); |
8 | 3 … | var bodyParser = require('body-parser'); |
9 | 4 … | |
10 | 5 … | var app = express(); |
@@ -13,73 +8,8 @@ | ||
13 | 8 … | |
14 | 9 … | app.use(bodyParser.json()); |
15 | 10 … | app.use(bodyParser.urlencoded({extended: true})); |
16 | 11 … | |
17 | -const me = '@ya/sq19NPxRza5xtoqi9BilwLZ7HgQjG3QpcTRnGgWs=.ed25519' | |
18 | -const site = 'Gwen Bell'; | |
19 | - | |
20 | -app.get('/', function (req, res) { | |
21 | - client(function (err, sbot) { | |
22 | - if (err) { | |
23 | - throw err; | |
24 | - } | |
25 | - avatar(sbot, me, me, function (err, avatar){ | |
26 | - if (err) { | |
27 | - throw err; | |
28 | - } | |
29 | - name = avatar.name; | |
30 | - image = avatar.image; | |
31 | - }) | |
32 | - | |
33 | - pull( | |
34 | - sbot.query.read({query: [{$filter: { value: { author: me, content: {type: 'pin'}}}}], limit: 1, reverse: true}), | |
35 | - pull.drain(function (data) { | |
36 | - getpin = data; | |
37 | - pull( | |
38 | - sbot.query.read({query: [{$filter: { key: getpin.value.content.link}}]}), | |
39 | - pull.drain(function (data){ | |
40 | - pinned = data; | |
41 | - }) | |
42 | - ) | |
43 | - }) | |
44 | - ) | |
45 | - pull( | |
46 | - sbot.query.read({query: [{$filter: { value: { author: me, content: {type: 'post'}}}}], limit: 1, reverse: true}), | |
47 | - pull.drain(function (data) { | |
48 | - post = data; | |
49 | - }) | |
50 | - ) | |
51 | - pull( | |
52 | - sbot.query.read({query: [{$filter: { value: { author: me, content: {type: 'vote'}}}}], limit: 1, reverse: true}), | |
53 | - pull.drain(function (data) { | |
54 | - vote = data; | |
55 | - pull( | |
56 | - sbot.query.read({query: [{$filter: { key: data.value.content.vote.link}}]}), | |
57 | - pull.drain(function (reblog) { | |
58 | - avatar(sbot, me, reblog.value.author, function (err, avatar){ | |
59 | - if (err) { | |
60 | - throw err; | |
61 | - } | |
62 | - reauthor = avatar; | |
63 | - gotPost(); | |
64 | - }) | |
65 | - redo = reblog; | |
66 | - }) | |
67 | - ) | |
68 | - }) | |
69 | - ) | |
70 | - pull( | |
71 | - sbot.query.read({query: [{$filter: { value: { author: me, content: {type: 'git-update'}}}}], limit: 1, reverse: true}), | |
72 | - pull.drain(function (data) { | |
73 | - gits = data; | |
74 | - }) | |
75 | - ) | |
76 | - }); | |
77 | - function gotPost() { | |
78 | - res.render('index', { title: site, markdown, moment}); | |
79 | - } | |
80 | -}); | |
81 | - | |
82 | 12 … | app.post('/send', function (req, res) { |
83 | 13 … | var name = req.body.nombre; |
84 | 14 … | var email = req.body.elmail; |
85 | 15 … | var website = req.body.siteurl; |
layouts/index.jade | ||
---|---|---|
@@ -1,36 +1,8 @@ | ||
1 | 1 … | extends layout |
2 | 2 … | |
3 | 3 … | block content |
4 | 4 … | |
5 | - a(href="/"): h1= title | |
6 | - h2 Hi & welcome. This site reflects a living, breathing application built on a <a href="/dt-interview">distributed database called scuttlebot</a>. You might think of what you see on this site as a healthy response to what I view as unhealthy centralized social networking: | |
7 | - div(class='message') | |
8 | - p.small.ri pinned | |
9 | - img(src='https://evbogue.com/ws/blobs/get/#{image}' class='avatar') | |
10 | - p <a href='/' target='_parent'>@#{name}</a> | |
11 | - != markdown(pinned.value.content.text) | |
12 | - span.date #{moment(pinned.value.timestamp).fromNow()} | |
13 | - div(class='message') | |
14 | - img(src='https://evbogue.com/ws/blobs/get/#{image}' class='avatar') | |
15 | - p <a href='/' target='_parent'>@#{name}</a> | |
16 | - != markdown(post.value.content.text) | |
17 | - span.date #{moment(post.value.timestamp).fromNow()} | |
18 | - div(class='message') | |
19 | - img(src='https://evbogue.com/ws/blobs/get/#{image}' class='avatar') | |
20 | - p <a href='/' target='_parent'>@#{name}</a> dug #{vote.value.content.vote.link} | |
21 | - span.date #{moment(vote.value.timestamp).fromNow()} | |
22 | - div.message | |
23 | - if (redo.value.content.type === post) | |
24 | - img(src='https://evbogue.com/ws/blobs/get/#{reauthor.image}' class='avatar') | |
25 | - p @<a href='#{redo.value.author}'>#{reauthor.name}</a> said | |
26 | - != markdown(redo.value.content.text) | |
27 | - span.date #{moment(redo.value.timestamp).fromNow()} | |
28 | - div(class='message') | |
29 | - img(src='https://evbogue.com/ws/blobs/get/#{image}' class='avatar') | |
30 | - p <a href='/' target='_parent'>@#{name}</a> pushed a git commit to #{gits.value.content.repo}<br /> | |
31 | - span.date #{moment(gits.value.timestamp).fromNow()} | |
32 | - <br /> | |
33 | 5 … | <img src="/g.jpg" class="profile" style="width:150px; float:left;" /><h2 id="about"><a href="#about">About</a></h2> <p>Gwen(dolyn) Bell is a Mexico City, Mexico based web developer and technical writer. She's lived in Mexico on and off since her <a href="firstmxtrip">first trip to Mexico in 2006</a>. When she first arrived in the country she told everyone she knew she intended to stay. The commitment took root.</p> |
34 | 6 … | <p>Gwen practices Stoicism and yoga, takes long walks around Mexico City and builds for the future where the web is decentralized, distributed, cryptographically secure and more home-grown than corporate. She intends to one day build the <a href="/grh">GRH</a>, speak fluent Spanish and drink...in Oaxaca where it was born... the <i>pura mezcal</i>, <i>madre cuixhe</i>.</p> |
35 | 7 … | <br /> |
36 | 8 … | <h2><a href="#details">Technical Details</a></h2> |
layouts/navbar.jade | |||
---|---|---|---|
@@ -2,7 +2,7 @@ | |||
2 | 2 … | .contain | |
3 | 3 … | .twelve.col | |
4 | 4 … | ul | |
5 | 5 … | li <a href="/"><b>gb</b></a> | |
6 | - li <a href="http://gwenbell.com/#about">About</a> | ||
7 | - li <a href="http://gwenbell.com/blog">Blog</a> | ||
8 | - li <a href="http://gwenbell.com/#contact">Contact</a> | ||
6 … | + li <a href="#about">About</a> | ||
7 … | + li <a href="/blog">Blog</a> | ||
8 … | + li <a href="/#contact">Contact</a> |
Built with git-ssb-web