64 | ${t.title||"..."} 65 | 66 | ${(t.hostname||"").replace(/^www\./,"")} 67 | 68 | 69 |
70 |71 | ${t.score} points by 72 | ${t.by} 73 | ${l(t.time)} ago | 74 | ${t.descendants||0} comments 75 |
76 |├── client ├── robots.txt ├── favicon-128.png ├── favicon-16.png ├── favicon-180.png ├── favicon-192.png ├── favicon-32.png ├── index.html ├── manifest.json ├── sw.js └── @ │ ├── js │ ├── hn.js │ ├── about.js │ ├── view.js │ └── app.js │ ├── css │ └── app.css │ └── 3rd │ └── uhtml.js ├── docs ├── robots.txt ├── favicon-128.png ├── favicon-16.png ├── favicon-180.png ├── favicon-192.png ├── favicon-32.png ├── manifest.json ├── index.html ├── @ │ ├── js │ │ ├── hn.js │ │ ├── app.js │ │ ├── about.js │ │ └── view.js │ ├── css │ │ └── app.css │ └── 3rd │ │ └── uhtml.js ├── sw.js ├── about │ └── index.html ├── ask │ └── index.html ├── item │ └── index.html ├── job │ └── index.html ├── new │ └── index.html ├── show │ └── index.html ├── top │ └── index.html └── user │ └── index.html ├── .gitignore ├── server ├── args.js └── app.js ├── LICENSE ├── package.json ├── template └── index.html └── README.md /client/robots.txt: -------------------------------------------------------------------------------- 1 | # 👋 lighthouse 2 | -------------------------------------------------------------------------------- /docs/robots.txt: -------------------------------------------------------------------------------- 1 | # 👋 lighthouse 2 | -------------------------------------------------------------------------------- /docs/favicon-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebReflection/hn/HEAD/docs/favicon-128.png -------------------------------------------------------------------------------- /docs/favicon-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebReflection/hn/HEAD/docs/favicon-16.png -------------------------------------------------------------------------------- /docs/favicon-180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebReflection/hn/HEAD/docs/favicon-180.png -------------------------------------------------------------------------------- /docs/favicon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebReflection/hn/HEAD/docs/favicon-192.png -------------------------------------------------------------------------------- /docs/favicon-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebReflection/hn/HEAD/docs/favicon-32.png -------------------------------------------------------------------------------- /client/favicon-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebReflection/hn/HEAD/client/favicon-128.png -------------------------------------------------------------------------------- /client/favicon-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebReflection/hn/HEAD/client/favicon-16.png -------------------------------------------------------------------------------- /client/favicon-180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebReflection/hn/HEAD/client/favicon-180.png -------------------------------------------------------------------------------- /client/favicon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebReflection/hn/HEAD/client/favicon-192.png -------------------------------------------------------------------------------- /client/favicon-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebReflection/hn/HEAD/client/favicon-32.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | client/about 3 | client/ask 4 | client/item 5 | client/job 6 | client/new 7 | client/show 8 | client/top 9 | client/user 10 | node_modules/ 11 | !docs/node_modules/ 12 | package-lock.json 13 | -------------------------------------------------------------------------------- /docs/manifest.json: -------------------------------------------------------------------------------- 1 | {"background_color":"#123","description":"Isomorphic Hacker News","display":"standalone","name":"iHN","orientation":"portrait-primary","short_name":"iHN","start_url":"./top/?1","theme_color":"#123","icons":[{"src":"./favicon-128.png","sizes":"128x128","type":"image/png"},{"src":"./favicon-192.png","sizes":"192x192","type":"image/png"}]} -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 |11 | Hello there, I am Andrea Giammarchi, aka @webreflection, and I am the developer behind this project. 12 |
13 |14 | Thank you for visiting ♥ and now please let me introduce what is this about ... 15 |
16 |17 | The goal of this project is to showcase a 100% isomorphic version of the famous 18 | Hacker News PWA, through my tiny 19 | µhtml and 20 | µcontent libraries, able to produce a fully static, yet SSR ready, Hacker News reader. 21 |
22 |36 | All sources are available on GitHub, and all you need to do, in order to test this project locally, is the following: 37 |
38 |39 | git clone https://github.com/WebReflection/hn.git 40 | cd hn 41 | npm i 42 | npm test 43 | # npm run test:ssr # for SSR 44 |45 |
46 | The client side part is within the client/@/ folder, while the server side part is within the server folder.
47 |
49 | The reason to choose a @ as folder prefix, is to have a portable pattern that would never interfere with the name of any other possible folder.
50 |
52 | As example, the SSR part uses those folders indexes to render each page, but the structure is fully compatible with a static host too. 53 |
54 |
55 | The client side is served either through µcdn, or pre-built via µcompress, after a npm run build command.
56 |
58 | To keep it simple, I have also targeted the docs folder, instead of public, simply to be able to tell GitHub to publish this Web App via such folder.
59 |
61 | I hope this project will inspire new, as well as old, Web developers, as it's definitively something anyone could do without needing to move away from plain Web standards 🎉 62 |
63 |11 | Hello there, I am Andrea Giammarchi, aka @webreflection, 12 | and I am the developer behind this project. 13 |
14 |15 | Thank you for visiting ♥ and now please let me introduce what is this about ... 16 |
17 |18 | The goal of this project is to showcase a 100% isomorphic version of the famous 19 | Hacker News PWA, through my tiny 20 | µhtml and 21 | µcontent libraries, 22 | able to produce a fully static, yet SSR ready, Hacker News reader. 23 |
24 |38 | All sources are available on GitHub, 39 | and all you need to do, in order to test this project locally, is the following: 40 |
41 |42 | git clone https://github.com/WebReflection/hn.git 43 | cd hn 44 | npm i 45 | npm test 46 | # npm run test:ssr # for SSR 47 |48 |
49 | The client side part is within the client/@/ folder,
50 | while the server side part is within the server folder.
51 |
53 | The reason to choose a @ as folder prefix, is to have a portable pattern
54 | that would never interfere with the name of any other possible folder.
55 |
57 | As example, the SSR part uses those folders indexes to render each page, 58 | but the structure is fully compatible with a static host too. 59 |
60 |
61 | The client side is served either through µcdn,
62 | or pre-built via µcompress,
63 | after a npm run build command.
64 |
66 | To keep it simple, I have also targeted the docs folder, instead of public,
67 | simply to be able to tell GitHub to publish this Web App via such folder.
68 |
70 | I hope this project will inspire new, as well as old, Web developers, as it's definitively something 71 | anyone could do without needing to move away from plain Web standards 🎉 72 |
73 |71 | ${t.score} points by 72 | ${t.by} 73 | ${l(t.time)} ago | 74 | ${t.descendants||0} comments 75 |
76 |110 | ... joined ${(e=>{const a=new Date,t=(new Date(a.getFullYear(),a.getMonth(),a.getDate())-new Date(1e3*e))/864e5;return t<0?"today":t<1?"yesterday":Math.ceil(t)+" days ago"})(t||0)}, and has ${s} karma 111 |
112 |113 | submissions / 114 | comments / 115 | favourites 116 |
117 |The page you are looking for is not here.
129 |172 | ${model.score} points by 173 | ${model.by} 177 | ${timeBetween(model.time)} ago | 178 | ${model.descendants || 0} comments 182 |
183 |227 | ... joined ${ago(created || 0)}, 228 | and has ${karma} karma 229 |
230 |231 | submissions / 233 | comments / 235 | favourites 237 |
238 |The page you are looking for is not here.
254 |