on master help sign in
Add static site generation proposal (#1165)
dc5e808mikeosborne
content/grants/static-site-generation.mdnew file+102
@@ -0,0 +1,102 @@
1++++
2+title = "Static Website Generation from Graph Store"
3+date = "2021-09-28"
4+[taxonomies]
5+grant_type = ["Proposal"]
6+grant_category = ["App Dev: Other"]
7+[extra]
8+image = ""
9+description = "Publish Urbit notebooks to the clearweb"
10+reward = 5
11+assignee = "~tacryt-socryp"
12+grant_id = "P0072"
13+completed = false
14+canceled = false
15+link = ""
16++++
17+
18+## Static Website Generation from Graph Store
19+
20+### Purpose
21+
22+Publish is Urbit’s minimum viable tooling necessary for blog publishing. However, Publish lacks a critical feature: the ability to reach a clearweb audience. Many writers desire to own their data and writing experience, but shy away from writing on Urbit as the aggregate Urbit-based audience is orders of magnitude smaller than the clearweb. Building a tool to publish a Publish notebook as a static blog website is the best way to convert these writers.
23+
24+The Hoon standard library has mature HTML templating functionality in the form of Sail, which allows a user-developer to pass in some predefined noun (in this case a `%graph-store` node) into a Sail template and output it as HTML.
25+
26+Converting a Publish post to a static blog webpage upon any edit to the post can straightforwardly be accomplished via a Gall agent and a mark conversion. We propose that this well-defined and self-contained task can allow the specification of a few Sail template methods that take in a `%graph-store` node and render it as an HTML website.
27+
28+### Use Cases
29+
30+The first common use case we would like to support is to render a particular blog post as rich text, reusing many of the same JS libraries used in Landscape for the heavy-duty markdown rendering.
31+
32+The second common use case we will build is rendering the blog post with comments.
33+
34+The third common use case we will build is rendering a listing of all blog posts in particular notebook.
35+
36+### User Stories
37+
38+1. Justin Murphy has a Publish notebook. He wants to expand his audience by publishing to a regular clearweb site.
39+2. Justin installs the [~tirrel %static-blog] desk, which installs a Static Blog desk.
40+3. Justin already has a domain name set up that directs to his Urbit. He clicks the Static Blog tile. He sets a URL he wants to bind ‘/justinblog’ and picks a Publish notebook to bind it to “Justin Blog”. He picks a style he wants it to render in “Blog Article Only” (he could also select “Blog Article with Comments”)
41+4. He then clicks “Serve Page”, and his Publish Notebook is now rendered into static HTML and served at /justinblog.
42+5. He then goes to the Groups app and finds his Justin Blog. He writes a new article, and publishes it, then edits one of his existing articles and publishes it. He sees the latest state reflected on his new static site.
43+
44+## Milestones
45+
46+Milestone 1 - Gall agent developed
47+
48+Estimated completion:
49+
50+Payment: 3 stars
51+
52+Build agent that has the build pipelines specified and watches for graph-store updates.
53+
54+Milestone 2 - HTML Template Examples
55+
56+Estimated completion:
57+
58+Payment: 1 star
59+
60+Build out the two rich HTML templates for Publish notebook data specified above in “use cases”
61+
62+Milestone 3 - Grid Tile Development
63+
64+Estimated completion:
65+
66+Payment: 1 star
67+
68+Build out a tile in Grid for managing these web blogs.
69+
70+Architecture:
71+One Gall agent: %static-blog
72+
73+++on-init: On initial load, tells file-server that it wants to serve a webpage at /static-blog, and subscribes to /updates on %graph-store
74+++on-load: n/a
75+++on-poke: Receives pokes which allow one to A) associate a particular graph with a particular mark that will convert that graph to a static webpage, B) dissociate them once associated, C) serve a set of static webpages at a path to the public web, D) stop serving a set of static webpages at a path.
76+++on-watch: Subscribe to the state of the application
77+++on-peek: Read out the files of a particular static site, read out the set of associations
78+
79+Future Directions:
80+
81+- More marks can be built out that wrap the Sail generated from the graph-store -> html conversion and inject calls-to-action, payment links, and other forms of plugin content using Ford marks as a build pipeline
82+- Other graph types can and should eventually be able to converted to static sites as well.
83+
84+## Milestones
85+
86+### Milestone 1: Gall Agent Development
87+
88+Payment: 1 Star
89+
90+Complete planet-market, a simple Gall agent for keeping track of layer 2 invite codes. Write a REST API for interacting with the planet-market agent using HTTP.
91+
92+### Milestone 2: Web Interface
93+
94+Payment: 1 Star
95+
96+Make a simple web interface through which someone can get free layer 2 invite codes using the REST API if they have a password.
97+
98+### Milestone 3: Port and Tirrel Payment Processor Integration
99+
100+Payment: 4 stars
101+
102+Integrate the above example web interface with Tirrel’s processor such that rather than giving away free planets, the web interface allows for sale of planets for USD. Add the ability to purchase invite codes. Update Port to accept an invite code, generate a passport, and boot a planet using keyfile.