···20Then build and copy over the big 'ol `bundle.web.js` file:
2122 # in the top level of this repo
23- yarn webpack build --config ./web/webpack.config.js -d inline-source-map --color
24- cp dist/bundle.web.js bskyweb/static/
2526### Golang Daemon
27
···20Then build and copy over the big 'ol `bundle.web.js` file:
2122 # in the top level of this repo
23+ yarn build-web
02425### Golang Daemon
26
+6-3
bskyweb/cmd/bskyweb/server.go
···94 // configure routes
95 e.File("/robots.txt", "static/robots.txt")
96 e.Static("/static", "static")
09798 e.GET("/", server.WebHome)
99100 // generic routes
101- e.GET("/contacts", server.WebGeneric)
102 e.GET("/search", server.WebGeneric)
103 e.GET("/notifications", server.WebGeneric)
104 e.GET("/settings", server.WebGeneric)
105- e.GET("/settings", server.WebGeneric)
000106107 // profile endpoints; only first populates info
108 e.GET("/profile/:handle", server.WebProfile)
109 e.GET("/profile/:handle/follows", server.WebGeneric)
110- e.GET("/profile/:handle/following", server.WebGeneric)
111112 // post endpoints; only first populates info
113 e.GET("/profile/:handle/post/:rkey", server.WebPost)
···94 // configure routes
95 e.File("/robots.txt", "static/robots.txt")
96 e.Static("/static", "static")
97+ e.Static("/static/js", "../web-build/static/js")
9899 e.GET("/", server.WebHome)
100101 // generic routes
0102 e.GET("/search", server.WebGeneric)
103 e.GET("/notifications", server.WebGeneric)
104 e.GET("/settings", server.WebGeneric)
105+ e.GET("/sys/debug", server.WebGeneric)
106+ e.GET("/sys/log", server.WebGeneric)
107+ e.GET("/support", server.WebGeneric)
108+ e.GET("/support/privacy", server.WebGeneric)
109110 // profile endpoints; only first populates info
111 e.GET("/profile/:handle", server.WebProfile)
112 e.GET("/profile/:handle/follows", server.WebGeneric)
113+ e.GET("/profile/:handle/followers", server.WebGeneric)
114115 // post endpoints; only first populates info
116 e.GET("/profile/:handle/post/:rkey", server.WebPost)
+109-11
bskyweb/templates/base.html
···2<html lang="en">
3<head>
4 <meta charset="UTF-8" />
5- <meta name="viewport" content="width=device-width, initial-scale=1.0">
06 <meta name="referrer" content="origin-when-cross-origin">
7 <title>{%- block head_title -%}Bluesky{%- endblock -%}</title>
08 <!-- Hello Humans! API docs at https://atproto.com -->
09 <style>
10- /* These styles make the body full-height */
11- html, body { height: 100%; }
12- /* These styles disable body scrolling if you are using <ScrollView> */
13- body { overflow: hidden; }
14- /* These styles make the root element full-height */
15- #app-root { display:flex; height:100%; }
0000000000000000000000000000000000000000016 /* Remove focus state on inputs */
17- *:focus { outline: 0; }
000000000000000000000000000000000000000000000000000000018 </style>
19- {% block head_bundle -%}<script defer src="/static/bundle.web.js"></script>{%- endblock %}
20 <link rel="apple-touch-icon" sizes="180x180" href="/static/apple-touch-icon.png"/>
21 <link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png"/>
22 <link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png"/>
···38</head>
39<body>
40{%- block body_all %}
41- <div id="app-root">
42 <noscript>
43 {%- block noscript_extra %}{% endblock -%}
44 <h1>Javascript Required</h1>
45 <p>This is a heavily interactive web application, and Javascript is required. Simple HTML interfaces are possible, but that is not what this is.
46 <p>Learn more about Bluesky at <a href="https://blueskyweb.xyz">blueskyweb.xyz</a> and <a href="https://atproto.com">atproto.com</a>.
47 </noscript>
48- </div>
49{% endblock -%}
50</body>
51</html>
···2<html lang="en">
3<head>
4 <meta charset="UTF-8" />
5+ <meta httpEquiv="X-UA-Compatible" content="IE=edge" />
6+ <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1.00001, viewport-fit=cover">
7 <meta name="referrer" content="origin-when-cross-origin">
8 <title>{%- block head_title -%}Bluesky{%- endblock -%}</title>
9+10 <!-- Hello Humans! API docs at https://atproto.com -->
11+12 <style>
13+ /**
14+ * Extend the react-native-web reset:
15+ * https://github.com/necolas/react-native-web/blob/master/packages/react-native-web/src/exports/StyleSheet/initialRules.js
16+ */
17+ html,
18+ body,
19+ #root {
20+ width: 100%;
21+ /* To smooth any scrolling behavior */
22+ -webkit-overflow-scrolling: touch;
23+ margin: 0px;
24+ padding: 0px;
25+ /* Allows content to fill the viewport and go beyond the bottom */
26+ min-height: 100%;
27+ }
28+ #root {
29+ flex-shrink: 0;
30+ flex-basis: auto;
31+ flex-grow: 1;
32+ display: flex;
33+ flex: 1;
34+ }
35+36+ html {
37+ scroll-behavior: smooth;
38+ /* Prevent text size change on orientation change https://gist.github.com/tfausak/2222823#file-ios-8-web-app-html-L138 */
39+ -webkit-text-size-adjust: 100%;
40+ height: calc(100% + env(safe-area-inset-top));
41+ }
42+43+ body {
44+ display: flex;
45+ /* Allows you to scroll below the viewport; default value is visible */
46+ overflow-y: auto;
47+ overscroll-behavior-y: none;
48+ text-rendering: optimizeLegibility;
49+ -webkit-font-smoothing: antialiased;
50+ -moz-osx-font-smoothing: grayscale;
51+ -ms-overflow-style: scrollbar;
52+ }
53+ /* Enable for apps that support dark-theme */
54+ /*@media (prefers-color-scheme: dark) {
55+ body {
56+ background-color: black;
57+ }
58+ }*/
59+60 /* Remove focus state on inputs */
61+ *:focus {
62+ outline: 0;
63+ }
64+ /* Remove default link styling */
65+ a {
66+ color: inherit;
67+ }
68+ a[role="link"]:hover {
69+ text-decoration: underline;
70+ }
71+72+ /* ProseMirror */
73+ .ProseMirror {
74+ font: 18px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
75+ min-height: 140px;
76+ }
77+ .ProseMirror p {
78+ margin: 0;
79+ }
80+ .ProseMirror p.is-editor-empty:first-child::before {
81+ color: #8d8e96;
82+ content: attr(data-placeholder);
83+ float: left;
84+ height: 0;
85+ pointer-events: none;
86+ }
87+ .ProseMirror .mention {
88+ color: #0085ff;
89+ }
90+ .ProseMirror a {
91+ color: #0085ff;
92+ cursor: pointer;
93+ }
94+ .tippy-content .items {
95+ border-radius: 6px;
96+ background: #F3F3F8;
97+ border: 1px solid #e0d9d9;
98+ padding: 3px 3px;
99+ }
100+ .tippy-content .items .item {
101+ display: block;
102+ background: transparent;
103+ color: #8a8c9a;
104+ border: 0;
105+ font: 17px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
106+ padding: 7px 10px 8px;
107+ width: 100%;
108+ text-align: left;
109+ box-sizing: border-box;
110+ letter-spacing: 0.2px;
111+ }
112+ .tippy-content .items .item.is-selected {
113+ background: #fff;
114+ border-radius: 4px;
115+ color: #333;
116+ }
117 </style>
118+ {% include "scripts.html" %}
119 <link rel="apple-touch-icon" sizes="180x180" href="/static/apple-touch-icon.png"/>
120 <link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png"/>
121 <link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png"/>
···137</head>
138<body>
139{%- block body_all %}
140+ <div id="root"></div>
141 <noscript>
142 {%- block noscript_extra %}{% endblock -%}
143 <h1>Javascript Required</h1>
144 <p>This is a heavily interactive web application, and Javascript is required. Simple HTML interfaces are possible, but that is not what this is.
145 <p>Learn more about Bluesky at <a href="https://blueskyweb.xyz">blueskyweb.xyz</a> and <a href="https://atproto.com">atproto.com</a>.
146 </noscript>
0147{% endblock -%}
148</body>
149</html>
+18-6
bskyweb/templates/error.html
···23{% block head_title %}Error {{ statusCode }} - Bluesky{% endblock %}
45-{# don't include the bundle on error pages #}
6-{% block head_bundle %}{% endblock %}
000078-{% block body_all %}
09 {% if statusCode == 404 %}
10- <h1>404: Not Found</h1>
11 {% else %}
12- <h1>{{ statusCode }}: Server Error</h1>
13- <p>Sorry about that! Our <a href="https://bluesky.statuspage.io/">Status Page</a> might have more context.
14 {% endif %}
15{% endblock %}
000000000