1;1|fig:MemLink;5;2;c|h2:In-memory micro web pages;5;3;c|p:MemLinks are self-contained, micro websites that are fully generated at the edge.|p:Use a MemLink to easily share lists of links, contact details, project overviews, and so much more.|h3:The link is the web page.;1;3|p:Memlink pages are composed of blocks that can be added, removed, and rearranged to make unique and creative content.|p:Create your own Memlink now by clicking Edit this page below.
is this a bespoke markup format or just something i don't recognize?You have:
<doc_config> | <block_data>
Where doc config is:
<palette_index> ; <background_index>
And block data is a list of blocks separated by | that have the following structure:
<block_type> : <block_value> ; <block_config>
And block_config is an additional set of characters separated by semicolon. Right now each block reads its metadata differently, so the order of the metadata options depends on the block they’re used for. I’d like to standardize them eventually. Most start with:
<background_color_index> ; <text_color_index>
The color indexes map to the index position of the given document palette selected. Every palette’s first two colors are white, and black.
If the content is encoded in the URL then that's all going to the server (unless the # idea someone mentions below gets implemented) and thus everything being shared is visible to the site owners. For savvy people that's probably understood but others might not get it, and either way it helps to understand the site's policy regarding this.
For the record, I am completely ignoring the path server-side, and just proxying the request via nginx to a single page Next.js client that is completely client-side rendered. The server doesn’t need the path at all, so yes I do hope to avoid sending it altogether. Going to try to implement that update this weekend without breaking backwards compatibility with already live links.
I’d imagine the length issue would become much more of a problem sooner, and any interactivity via JS will add to the size of the link considerably. The benefit of the block mapping is you can house relatively complex components behind a simple string map without adding that bloat to the url itself.
The idea is that once you have the renderer - whether it’s the hosted site, a native app packaging similar to a “browser” of sorts - you could load and view any Memlink page entirely clientside. The current app is a static html/JS SPA sitting on a small VPS and only handles serving the initial renderer code if not cached locally already.
I found there were a lot of edge cases with data URIs that made sharing them kinda annoying. Like email providers stripping the data URI when you email it (not getting spam-binned. The link would get deleted. Even if you left it as a plain text email.)
Firefox doesn't appear to have a URL length limit. Unfortunately, the world is standardising on Chrome, and that absolutely does (about 2,097,152 characters for the entire URI). Chrome also _sometimes_, but not always, opens a data:text/html link in Quirks Mode.
example link here https://meml.ink/MTs1fGgxOkp1c3RpbiUyNTIwR2Fycmlzb24ncyUyNTI...
I need to add some syntax docs, but ideally I want to abstract out the syntax for an easier-to-use form based block config so you know how to use the block.
For the image tag, it currently takes three options:
<img-style> ; <img-size> ; <justify-content>
img-style can be: "r" for rounded, or "s" for square (for some reason square isn't working right now, need to check on that...)
img-size can be: "xs" for x-small, "s" for small, "m" for medium, "l" for large and "f" for full-width
and justify-content can be : 's' for flex-start, 'c' for center, and 'e' for flex-end. The image is wrapped in a flex box that uses this setting to justify the image.
In writing this comment I just realized I missed the bg-color config for the image block! :D Going to add that.
Here's your updated page: https://meml.ink/MTs1fGgxOkp1c3RpbiUyNTIwR2Fycmlzb24ncyUyNTI...
Hope this helps!
My two favorite are:
- the Tweet block, you can just pass it a tweet ID and it's options are <bg-color>;<alignment> where alignment is 'l', 'r', or 'c' for left, right and center respectively
- the ASCII text block which uses figlet under the hood. Right now it only takes <bg-color> ; <text-color> but I want to also expose different figlet fonts you could set.
I hard refreshed and started getting a client side error in Chrome but was able to load it in Firefox still.
I seemed to have lost the ability to re-order the blocks.
Do you have plans to make redirects possible so I don't have to update the URL everywhere I would want to use it? eg meml.ink/justin could always go to the latest version of a profile page? Page stats would also be interesting to see (similar to adding + to the end of a bit.ly url)
It seems like with those features you'd be re-creating linkstree, about.me, or a million other generic profile pages. I guess I'm interested what your plans are.
Edit: I wasn't able to replicate the stripping issue on my end when I updated the link, so maybe there was a cached version that you got from before I pushed the fix - if you don't mind please trying a hard refresh on your end and giving the link another go, if you choose to use it again! Thank you.
Please give it a go and let me know if it works for you, if you get the chance. Thanks!
I love this concept
Then again, with that long param at the end of the url, it looks like it should be unique anyway unless the message is the same.
It’s only for “legacy”[1] links that aren’t using the hashbang for privacy, the page will redirect to the hashbang. This causes the back button loop. If you create a new page or link to a new link, this shouldn’t occur anymore. Since the link has the page, and I posted this before I added the hashbangs, it will always have this issue unfortunately. C’est la vie - thanks for the feedback there.
[1] The project is less than a week old and there are already legacy concepts that need maintaining, that’s a first for me.
I think biggest difference is the drag and drop block-based authoring experience of Memlink. Looks like that author has an additional cool project called link-lock to provide protected links - going to look more into it.
cool project btw
I managed to add emoji support last night, which ended up increasing my encoded payload size by about 30%.
I need to add some debouncing to the block updates as it’s real time right now but with all of the encoding seems to overwhelm the page if you type too fast.
Works best for text files, my links end up looking like this: https://podje.li/?m=data%3Atext%2Fplain%3Bbase64&n=macbeth.t...
data:text/html, <details style="padding-left: 1.5rem;" open> <summary><button onclick="fetch(location.href) .then(resp => resp.text()) .then(text => this.parentNode.insertAdjacentHTML('afterend', text))">+</button></summary> </details>