git ssb

0+

gb / gwenbell.com



Commit f5479b48a6784b7e3a1896e3c0eb81b7a66ef865

strip sbot, localize anchors

Gwen committed on 9/29/2016, 10:26:34 PM
Parent: bbf61587f52edfa5763a748e96a3e564068931f0

Files changed

index.jschanged
layouts/index.jadechanged
layouts/navbar.jadechanged
src/index.mdadded
index.jsView
@@ -1,10 +1,5 @@
11 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');
72 var nm = require('nodemailer');
83 var bodyParser = require('body-parser');
94
105 var app = express();
@@ -13,73 +8,8 @@
138
149 app.use(bodyParser.json());
1510 app.use(bodyParser.urlencoded({extended: true}));
1611
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-
8212 app.post('/send', function (req, res) {
8313 var name = req.body.nombre;
8414 var email = req.body.elmail;
8515 var website = req.body.siteurl;
layouts/index.jadeView
@@ -1,36 +1,8 @@
11 extends layout
22
33 block content
44
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 />
335 <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>
346 <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>
357 <br />
368 <h2><a href="#details">Technical Details</a></h2>
layouts/navbar.jadeView
@@ -2,7 +2,7 @@
22 .contain
33 .twelve.col
44 ul
55 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>
src/index.mdView
@@ -1,0 +1,5 @@
1 +---
2 +title: Gwen Bell
3 +layout: index.jade
4 +---
5 +

Built with git-ssb-web