Add some content to the index page and cleanup the css a bit

main
James Mills 6 days ago
parent e01466f641
commit 0aef42600d
Signed by: prologic
GPG Key ID: AC4C014F1440EBD6

@ -0,0 +1,9 @@
*~
*.bak
/.pub
/.git
/README.md
/.drone.yml
/.gitignore
/.dockerignore

@ -0,0 +1,35 @@
---
kind: pipeline
name: 🐳 Docker
steps:
- name: 📦 Image
image: plugins/kaniko
settings:
repo: r.mills.io/prologic/docs.yarn.social
tags: latest
when:
branch:
- main
event:
- push
---
kind: pipeline
name: 🥳 Done
steps:
- name: 🔔 Notify
image: plugins/webhook
settings:
urls:
- https://msgbus.mills.io/ci.mills.io
depends_on:
- 🐳 Docker
trigger:
branch:
- main
event:
- push

@ -1,68 +1,82 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="/css/style.min.css">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<title>Yarn.social :: {{ title }}</title>
</head>
<body>
<main class="container-flex">
<input id="responsive-sidebar" type="checkbox" name="responsive-sidebar" />
<label id="responsive-sidebar-label-1" for="responsive-sidebar"></label>
<label id="responsive-sidebar-label-2" for="responsive-sidebar">×</label>
<aside class="sidebar-left">
<a id="site-logo" href="#">
<svg width="210px" height="70px" aria-hidden="true" viewBox="0 0 210 70" xmlns="http://www.w3.org/2000/svg">
<g>
<circle fill-opacity="0.0" cx="35.997" cy="36.087" r="31.699"/>
<path fill="currentColor" d="M 23.787 55.282 C 18.211 55.282 14.55 54.611 14.278 54.56 C 13.205 54.354 12.5 53.32 12.703 52.248 C 12.905 51.172 13.941 50.465 15.013 50.666 C 15.13 50.691 26.62 52.771 39.939 49.28 C 53.236 45.792 61.041 38.43 61.12 38.357 C 61.905 37.601 63.161 37.628 63.921 38.419 C 64.676 39.21 64.649 40.463 63.858 41.22 C 63.512 41.551 55.227 49.366 40.945 53.114 C 34.462 54.81 28.453 55.282 23.787 55.282 Z"/>
<path fill="currentColor" d="M 20.414 48.389 C 13.616 48.389 8.639 47.636 8.274 47.58 C 7.194 47.411 6.456 46.399 6.624 45.317 C 6.791 44.237 7.798 43.503 8.885 43.663 C 9.035 43.689 24.126 45.958 37.5 42.449 C 50.819 38.957 61.962 28.788 62.075 28.687 C 62.88 27.947 64.132 27.999 64.873 28.801 C 65.614 29.607 65.564 30.861 64.758 31.602 C 64.277 32.047 52.77 42.543 38.505 46.284 C 32.255 47.924 25.771 48.389 20.414 48.389 Z"/>
<path fill="currentColor" d="M 18.555 40.487 C 12.404 40.487 8.117 39.798 7.798 39.747 C 6.72 39.569 5.991 38.55 6.168 37.471 C 6.344 36.392 7.354 35.644 8.444 35.839 C 8.577 35.86 22.041 38.005 35.395 34.503 C 48.694 31.015 58.505 21.738 58.599 21.644 C 59.386 20.888 60.644 20.913 61.4 21.707 C 62.157 22.497 62.129 23.749 61.34 24.506 C 60.911 24.919 50.682 34.592 36.398 38.338 C 29.979 40.016 23.632 40.487 18.555 40.487 Z"/>
<path fill="currentColor" d="M 19.045 33.246 C 18.096 33.246 17.255 32.561 17.093 31.595 C 14.752 17.663 19.969 11.016 20.192 10.742 C 20.881 9.891 22.129 9.76 22.977 10.447 C 23.825 11.132 23.96 12.37 23.283 13.22 C 23.199 13.331 18.991 18.977 21 30.936 C 21.18 32.014 20.453 33.036 19.373 33.219 C 19.265 33.238 19.153 33.246 19.045 33.246 Z M 27.422 32.766 C 26.429 32.766 25.572 32.019 25.458 31.009 C 23.615 14.757 28.488 7.879 28.698 7.595 C 29.347 6.711 30.583 6.519 31.467 7.167 C 32.344 7.81 32.539 9.04 31.905 9.922 C 31.826 10.036 27.755 16.104 29.394 30.56 C 29.517 31.647 28.736 32.629 27.649 32.75 C 27.573 32.763 27.497 32.766 27.422 32.766 Z M 36.117 30.56 C 35.132 30.56 34.278 29.824 34.154 28.824 C 32.488 15.409 36.318 8.128 36.482 7.826 C 37.005 6.864 38.206 6.505 39.167 7.026 C 40.126 7.545 40.485 8.743 39.972 9.704 C 39.901 9.838 36.597 16.356 38.082 28.336 C 38.217 29.422 37.447 30.414 36.362 30.547 C 36.281 30.556 36.199 30.56 36.117 30.56 Z M 45.322 26.213 C 44.36 26.213 43.515 25.512 43.366 24.531 C 41.858 14.646 43.836 9.902 43.92 9.705 C 44.349 8.698 45.524 8.235 46.52 8.669 C 47.52 9.098 47.986 10.256 47.564 11.256 C 47.52 11.363 45.979 15.4 47.28 23.934 C 47.447 25.014 46.705 26.025 45.621 26.191 C 45.524 26.207 45.422 26.213 45.322 26.213 Z M 30.296 64.815 C 30.048 64.815 29.796 64.768 29.553 64.671 C 27.109 63.678 24.862 61.457 24.614 61.207 C 23.847 60.43 23.852 59.18 24.625 58.407 C 25.4 57.635 26.654 57.639 27.426 58.414 C 27.948 58.938 29.608 60.419 31.043 61 C 32.057 61.411 32.545 62.565 32.133 63.58 C 31.822 64.35 31.078 64.815 30.296 64.815 Z M 41.594 65.123 C 41.247 65.123 40.895 65.033 40.576 64.842 C 37.872 63.215 34.493 59.901 34.352 59.763 C 33.569 58.995 33.561 57.74 34.329 56.961 C 35.098 56.179 36.352 56.173 37.132 56.938 C 37.164 56.969 40.317 60.062 42.617 61.442 C 43.556 62.007 43.858 63.222 43.297 64.16 C 42.923 64.78 42.267 65.123 41.594 65.123 Z M 50.173 61.793 C 49.855 61.793 49.535 61.718 49.234 61.555 C 46.969 60.335 44.549 57.732 44.278 57.438 C 43.538 56.634 43.593 55.382 44.397 54.641 C 45.204 53.907 46.454 53.956 47.198 54.76 C 47.805 55.421 49.692 57.304 51.115 58.071 C 52.079 58.59 52.44 59.792 51.918 60.754 C 51.558 61.415 50.879 61.793 50.173 61.793 Z M 56.998 56.261 C 56.693 56.261 56.385 56.193 56.099 56.045 C 54.901 55.433 53.546 54.377 53.396 54.261 C 52.535 53.585 52.388 52.34 53.064 51.481 C 53.738 50.624 54.985 50.471 55.843 51.145 C 56.17 51.401 57.178 52.148 57.9 52.518 C 58.877 53.015 59.261 54.21 58.764 55.185 C 58.413 55.866 57.719 56.261 56.998 56.261 Z M 10.653 33.583 C 9.676 33.583 8.828 32.862 8.693 31.868 C 7.985 26.652 9.374 21.707 10.479 19.651 C 10.998 18.689 12.2 18.329 13.164 18.848 C 14.126 19.366 14.487 20.569 13.968 21.532 C 13.269 22.828 12.02 26.928 12.618 31.335 C 12.766 32.419 12.008 33.416 10.922 33.563 C 10.829 33.578 10.741 33.583 10.653 33.583 Z M 53.508 22.574 C 52.575 22.574 51.744 21.91 51.564 20.962 C 51.014 18.051 51.343 14.725 51.955 12.944 C 52.309 11.912 53.435 11.356 54.473 11.714 C 55.507 12.071 56.059 13.198 55.702 14.232 C 55.332 15.307 55.013 17.876 55.458 20.221 C 55.662 21.295 54.957 22.333 53.881 22.538 C 53.754 22.563 53.63 22.574 53.508 22.574 Z"/>
</g>
</svg>
</a>
<nav class="nav-item"><a class="nav-item-link" href="#">Home</a>
<a class="nav-item-link" href="#">Glossary</a>
<hr>
<input class="dropdown-button" id="dropdown-button-1" type="checkbox" name="dropdown-button" />
<label class="dropdown" id="dropdown-1" for="dropdown-button-1"><p class="dropdown-title">Features</p>
<div class="dropdown-item"><a href="#">Feature Flagging</a></div>
</label>
<hr>
<input class="dropdown-button" id="dropdown-button-2" type="checkbox" name="dropdown-button" />
<label class="dropdown" id="dropdown-2" for="dropdown-button-2"><p class="dropdown-title">Running in Docker</p>
<div class="dropdown-item"><a href="#">Setting Up Apache2</a></div>
<div class="dropdown-item"><a href="#">Setting Up Traefik</a></div>
</label>
<hr>
<input class="dropdown-button" id="dropdown-button-3" type="checkbox" name="dropdown-button" />
<label class="dropdown" id="dropdown-3" for="dropdown-button-3"><p class="dropdown-title">Templates & Themes</p>
<div class="dropdown-item"><a href="#">Template Authors</a></div>
<div class="dropdown-item"><a href="#">Using Custom Themes</a></div>
</label>
</nav>
</aside>
<div class="container-flex main-content">
<h1 id="site-header">{{ title }}</h1>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
{{ styles }}
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<title>{{ title }}</title>
<meta name="title" content="{{ title }}" />
<meta name="description" content="{{ description }}" />
<meta name="keywords" content="{{ keywords }}" />
</head>
<body>
<main class="container-flex">
<input id="responsive-sidebar" type="checkbox" name="responsive-sidebar" />
<label id="responsive-sidebar-label-1" for="responsive-sidebar"></label>
<label id="responsive-sidebar-label-2" for="responsive-sidebar">×</label>
<aside class="sidebar-left">
<a id="site-logo" href="#">
<svg width="210px" height="70px" aria-hidden="true" viewBox="0 0 210 70" xmlns="http://www.w3.org/2000/svg">
<g>
<circle fill-opacity="0.0" cx="35.997" cy="36.087" r="31.699" />
<path fill="currentColor"
d="M 23.787 55.282 C 18.211 55.282 14.55 54.611 14.278 54.56 C 13.205 54.354 12.5 53.32 12.703 52.248 C 12.905 51.172 13.941 50.465 15.013 50.666 C 15.13 50.691 26.62 52.771 39.939 49.28 C 53.236 45.792 61.041 38.43 61.12 38.357 C 61.905 37.601 63.161 37.628 63.921 38.419 C 64.676 39.21 64.649 40.463 63.858 41.22 C 63.512 41.551 55.227 49.366 40.945 53.114 C 34.462 54.81 28.453 55.282 23.787 55.282 Z" />
<path fill="currentColor"
d="M 20.414 48.389 C 13.616 48.389 8.639 47.636 8.274 47.58 C 7.194 47.411 6.456 46.399 6.624 45.317 C 6.791 44.237 7.798 43.503 8.885 43.663 C 9.035 43.689 24.126 45.958 37.5 42.449 C 50.819 38.957 61.962 28.788 62.075 28.687 C 62.88 27.947 64.132 27.999 64.873 28.801 C 65.614 29.607 65.564 30.861 64.758 31.602 C 64.277 32.047 52.77 42.543 38.505 46.284 C 32.255 47.924 25.771 48.389 20.414 48.389 Z" />
<path fill="currentColor"
d="M 18.555 40.487 C 12.404 40.487 8.117 39.798 7.798 39.747 C 6.72 39.569 5.991 38.55 6.168 37.471 C 6.344 36.392 7.354 35.644 8.444 35.839 C 8.577 35.86 22.041 38.005 35.395 34.503 C 48.694 31.015 58.505 21.738 58.599 21.644 C 59.386 20.888 60.644 20.913 61.4 21.707 C 62.157 22.497 62.129 23.749 61.34 24.506 C 60.911 24.919 50.682 34.592 36.398 38.338 C 29.979 40.016 23.632 40.487 18.555 40.487 Z" />
<path fill="currentColor"
d="M 19.045 33.246 C 18.096 33.246 17.255 32.561 17.093 31.595 C 14.752 17.663 19.969 11.016 20.192 10.742 C 20.881 9.891 22.129 9.76 22.977 10.447 C 23.825 11.132 23.96 12.37 23.283 13.22 C 23.199 13.331 18.991 18.977 21 30.936 C 21.18 32.014 20.453 33.036 19.373 33.219 C 19.265 33.238 19.153 33.246 19.045 33.246 Z M 27.422 32.766 C 26.429 32.766 25.572 32.019 25.458 31.009 C 23.615 14.757 28.488 7.879 28.698 7.595 C 29.347 6.711 30.583 6.519 31.467 7.167 C 32.344 7.81 32.539 9.04 31.905 9.922 C 31.826 10.036 27.755 16.104 29.394 30.56 C 29.517 31.647 28.736 32.629 27.649 32.75 C 27.573 32.763 27.497 32.766 27.422 32.766 Z M 36.117 30.56 C 35.132 30.56 34.278 29.824 34.154 28.824 C 32.488 15.409 36.318 8.128 36.482 7.826 C 37.005 6.864 38.206 6.505 39.167 7.026 C 40.126 7.545 40.485 8.743 39.972 9.704 C 39.901 9.838 36.597 16.356 38.082 28.336 C 38.217 29.422 37.447 30.414 36.362 30.547 C 36.281 30.556 36.199 30.56 36.117 30.56 Z M 45.322 26.213 C 44.36 26.213 43.515 25.512 43.366 24.531 C 41.858 14.646 43.836 9.902 43.92 9.705 C 44.349 8.698 45.524 8.235 46.52 8.669 C 47.52 9.098 47.986 10.256 47.564 11.256 C 47.52 11.363 45.979 15.4 47.28 23.934 C 47.447 25.014 46.705 26.025 45.621 26.191 C 45.524 26.207 45.422 26.213 45.322 26.213 Z M 30.296 64.815 C 30.048 64.815 29.796 64.768 29.553 64.671 C 27.109 63.678 24.862 61.457 24.614 61.207 C 23.847 60.43 23.852 59.18 24.625 58.407 C 25.4 57.635 26.654 57.639 27.426 58.414 C 27.948 58.938 29.608 60.419 31.043 61 C 32.057 61.411 32.545 62.565 32.133 63.58 C 31.822 64.35 31.078 64.815 30.296 64.815 Z M 41.594 65.123 C 41.247 65.123 40.895 65.033 40.576 64.842 C 37.872 63.215 34.493 59.901 34.352 59.763 C 33.569 58.995 33.561 57.74 34.329 56.961 C 35.098 56.179 36.352 56.173 37.132 56.938 C 37.164 56.969 40.317 60.062 42.617 61.442 C 43.556 62.007 43.858 63.222 43.297 64.16 C 42.923 64.78 42.267 65.123 41.594 65.123 Z M 50.173 61.793 C 49.855 61.793 49.535 61.718 49.234 61.555 C 46.969 60.335 44.549 57.732 44.278 57.438 C 43.538 56.634 43.593 55.382 44.397 54.641 C 45.204 53.907 46.454 53.956 47.198 54.76 C 47.805 55.421 49.692 57.304 51.115 58.071 C 52.079 58.59 52.44 59.792 51.918 60.754 C 51.558 61.415 50.879 61.793 50.173 61.793 Z M 56.998 56.261 C 56.693 56.261 56.385 56.193 56.099 56.045 C 54.901 55.433 53.546 54.377 53.396 54.261 C 52.535 53.585 52.388 52.34 53.064 51.481 C 53.738 50.624 54.985 50.471 55.843 51.145 C 56.17 51.401 57.178 52.148 57.9 52.518 C 58.877 53.015 59.261 54.21 58.764 55.185 C 58.413 55.866 57.719 56.261 56.998 56.261 Z M 10.653 33.583 C 9.676 33.583 8.828 32.862 8.693 31.868 C 7.985 26.652 9.374 21.707 10.479 19.651 C 10.998 18.689 12.2 18.329 13.164 18.848 C 14.126 19.366 14.487 20.569 13.968 21.532 C 13.269 22.828 12.02 26.928 12.618 31.335 C 12.766 32.419 12.008 33.416 10.922 33.563 C 10.829 33.578 10.741 33.583 10.653 33.583 Z M 53.508 22.574 C 52.575 22.574 51.744 21.91 51.564 20.962 C 51.014 18.051 51.343 14.725 51.955 12.944 C 52.309 11.912 53.435 11.356 54.473 11.714 C 55.507 12.071 56.059 13.198 55.702 14.232 C 55.332 15.307 55.013 17.876 55.458 20.221 C 55.662 21.295 54.957 22.333 53.881 22.538 C 53.754 22.563 53.63 22.574 53.508 22.574 Z" />
</g>
</svg>
</a>
<nav class="nav-item"><a class="nav-item-link" href="#">Home</a>
<a class="nav-item-link" href="#">Glossary</a>
<hr>
<input class="dropdown-button" id="dropdown-button-1" type="checkbox" name="dropdown-button" />
<label class="dropdown" id="dropdown-1" for="dropdown-button-1">
<p class="dropdown-title">Features</p>
<div class="dropdown-item"><a href="#">Feature Flagging</a></div>
</label>
<hr>
<input class="dropdown-button" id="dropdown-button-2" type="checkbox" name="dropdown-button" />
<label class="dropdown" id="dropdown-2" for="dropdown-button-2">
<p class="dropdown-title">Running in Docker</p>
<div class="dropdown-item"><a href="#">Setting Up Apache2</a></div>
<div class="dropdown-item"><a href="#">Setting Up Traefik</a></div>
</label>
<hr>
<div class="content">
{{ content }}
</div>
<footer>
<hr>
<p class="muted">
Last modified <time datetime="{{ date +%Y-%m-%dT%H:%M:%SZ%:z }}">{{ date }}</time> ·
© <a href="https://yarn.social">Yarn.social</a> 2022 ·
Built with <a href="https://git.mills.io/prologic/zs">zs</a>
</p>
</footer>
<input class="dropdown-button" id="dropdown-button-3" type="checkbox" name="dropdown-button" />
<label class="dropdown" id="dropdown-3" for="dropdown-button-3">
<p class="dropdown-title">Templates & Themes</p>
<div class="dropdown-item"><a href="#">Template Authors</a></div>
<div class="dropdown-item"><a href="#">Using Custom Themes</a></div>
</label>
</nav>
</aside>
<div class="container-flex main-content">
<h1 id="site-header">{{ title }}</h1>
<hr>
<div class="content">
{{ content }}
</div>
</main>
<footer>
<hr>
<p class="muted">
Last modified <time datetime="{{ date +%Y-%m-%dT%H:%M:%SZ%:z }}">{{ date }}</time> ·
© <a href="https://yarn.social">Yarn.social</a> 2022 ·
Built with <a href="https://git.mills.io/prologic/zs">zs</a>
</p>
</footer>
</div>
</main>
</body>
</html>
{{ scripts }}
</html>

@ -2,5 +2,13 @@
set -e
minify -o "$ZS_OUTDIR/css/style.min.css" "$ZS_OUTDIR/css/style.css"
rm -rf "$ZS_OUTDIR/css/style.css"
CSS="style"
JS="live"
for css in $CSS; do
minify -o "$ZS_OUTDIR/css/$css.min.css" "$ZS_OUTDIR/css/$css.css"
done
for js in $JS; do
minify -o "$ZS_OUTDIR/js/$js.min.js" "$ZS_OUTDIR/js/$js.js"
done

@ -0,0 +1,14 @@
#!/bin/sh
set -e
JS="live"
ext="js"
if [ -n "$ZS_PRODUCTION" ]; then
ext="min.js"
fi
for js in $JS; do
printf "<script type=\"application/javascript\" src=\"/js/%s.%s\"></script>\n" "$js" "$ext"
done

@ -0,0 +1,14 @@
#!/bin/sh
set -e
CSS="style"
ext="css"
if [ -n "$ZS_PRODUCTION" ]; then
ext="min.css"
fi
for css in $CSS; do
printf "<link rel=\"stylesheet\" href=\"/css/%s.%s\">\n" "$css" "$ext"
done

@ -0,0 +1,8 @@
*~
*.bak
COPYING
Dockerfile
LICENSE
Makefile
README.md

@ -0,0 +1,17 @@
# Build
FROM prologic/zs AS build
RUN mkdir -p /src
WORKDIR /src
# Copy content
COPY . .
# Build the site
RUN zs build
# Runtime
FROM prologic/zs AS runtime
COPY --from=build /src/.pub /data

@ -0,0 +1,29 @@
.PHONY: deps dev build image clean
GOCMD=go
IMAGE := r.mills.io/prologic/docs.yarn.social
TAG := latest
all: build
deps:
@$(GOCMD) install go.mills.io/zs@latest
@$(GOCMD) install github.com/tdewolff/minify/v2/cmd/minify@latest
dev : DEBUG=1
dev : build
@zs serve
build:
@zs build
ifeq ($(PUBLISH), 1)
image:
@docker buildx build --platform linux/amd64,linux/arm64 --push -t $(IMAGE):$(TAG) .
else
image:
@docker build -t $(IMAGE):$(TAG) .
endif
clean:
@git clean -f -d -X

@ -1,271 +1,260 @@
:root {
--primary-color: #11191f;
--secondary-color: #141e26;
--primary-text-color: #1095c1;
--hovered-text-color: #1ab3e6;
--text-color: #bbc6ce;
--primary-border-color: #233543;
--default-margin: 1rem;
--primary-color: #11191f;
--secondary-color: #141e26;
--primary-text-color: #1095c1;
--hovered-text-color: #1ab3e6;
--text-color: #bbc6ce;
--primary-border-color: #233543;
--default-margin: 1rem;
}
body {
background-color: var(--primary-color);
color: var(--text-color);
margin: 0;
list-style: none;
text-decoration: none;
font-family: -apple-system, BlinkMacSystemFont, 'egoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
}
h1, p {
margin:0;
background-color: var(--primary-color);
color: var(--text-color);
margin: 0;
list-style: none;
text-decoration: none;
font-family: -apple-system, BlinkMacSystemFont, 'egoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
}
a {
text-decoration: inherit;
color: var(--primary-text-color);
transition: all 0.2s ease-in-out;
text-decoration: inherit;
color: var(--primary-text-color);
transition: all 0.2s ease-in-out;
}
a:hover {
color: var(--hovered-text-color);
text-decoration: underline;
color: var(--hovered-text-color);
text-decoration: underline;
}
hr {
border: none;
border-top: 1px solid var(--primary-border-color);
border: none;
border-top: 1px solid var(--primary-border-color);
}
ul, li {
padding:0;
list-style: none;
margin: 0;
ul,
li {
padding: 0;
list-style: disc;
margin: 1em;
}
.container-flex {
width: 100vw;
height: 100vh;
width: 100vw;
height: 100vh;
}
.dropdown-title {
padding: 0.5rem 0 0.5rem 0;
font-weight: bold;
padding: 0.5rem 0 0.5rem 0;
font-weight: bold;
}
#responsive-sidebar {
position: absolute;
left: -9999px;
display: none;
position: absolute;
left: -9999px;
display: none;
}
#responsive-sidebar-label-1 {
position: absolute;
cursor: pointer;
display: none;
margin: -0.2rem 0 0 0.5rem;
font-size: 2.5rem;
position: absolute;
cursor: pointer;
display: none;
margin: -0.2rem 0 0 0.5rem;
font-size: 2.5rem;
}
#responsive-sidebar-label-2 {
position: absolute;
cursor: pointer;
display: none;
margin: -0.9rem 0 0 0.5rem;
font-size: 4.5rem;
position: absolute;
cursor: pointer;
display: none;
margin: -0.9rem 0 0 0.5rem;
font-size: 4.5rem;
}
.sidebar-left {
background-color: var(--secondary-color);
height: 100vh;
width: 15vw;
float: left;
border-right: 1px solid var(--primary-border-color);
padding-left: var(--default-margin);
position: fixed;
background-color: var(--secondary-color);
height: 100vh;
width: 15vw;
float: left;
border-right: 1px solid var(--primary-border-color);
padding-left: var(--default-margin);
position: fixed;
}
.sidebar-left > #site-logo {
display: block;
color: var(--primary-text-color);
width: 75px;
margin: auto;
.sidebar-left>#site-logo {
display: block;
color: var(--primary-text-color);
width: 75px;
margin: auto;
}
.sidebar-left hr {
width: 100vw;
border: none;
border-top: 1px solid var(--primary-border-color);
border: none;
border-top: 1px solid var(--primary-border-color);
}
.sidebar-left > nav, .sidebar-left > nav > .dropdown, .sidebar-left > nav > .dropdown > .dropdown-item, .sidebar-left > nav > .dropdown > li > a {
width: 100vw;
}
.sidebar-left > nav > .dropdown-button {
display: none;
.sidebar-left>nav>.dropdown-button {
display: none;
}
.sidebar-left a {
display: block;
padding: 0.5rem 0 0.5rem 0;
display: block;
padding: 0.5rem 0 0.5rem 0;
}
.sidebar-left a:hover {
background-color: var(--primary-color);
background-color: var(--primary-color);
}
#search-bar {
width: 100vw;
width: 100vw;
}
.main-content {
margin-left: 17vw;
width: 65vw;
margin-left: 17vw;
width: 65vw;
}
.main-content #site-header {
text-align: center;
padding: 0.5rem 0 0.5rem 0;
text-align: center;
padding: 0.5rem 0 0.5rem 0;
}
.content {
margin: 0 1rem 0 1rem;
}
.content h1, .content h2, .content h3, .content h4, .content h5, .content h6 {
text-align: center;
margin: 0 1rem 0 1rem;
}
.content > table {
width: 100%;
border-radius: var(--default-margin);
background-color: var(--secondary-color);
border: 1px solid var(--primary-border-color);
padding: var(--default-margin);
.content>table {
width: 100%;
border-radius: var(--default-margin);
background-color: var(--secondary-color);
border: 1px solid var(--primary-border-color);
padding: var(--default-margin);
}
.content > table > thead > tr > th {
border-bottom: 1px solid var(--primary-border-color);
.content>table>thead>tr>th {
border-bottom: 1px solid var(--primary-border-color);
}
.content > table > tbody > tr > td {
padding: var(--default-margin);
.content>table>tbody>tr>td {
padding: var(--default-margin);
}
.content > table > tbody > tr:nth-child(even) {
background-color: var(--primary-color);
.content>table>tbody>tr:nth-child(even) {
background-color: var(--primary-color);
}
.content > table > tbody > tr > td:nth-child(1) {
text-align: center;
.content>table>tbody>tr>td:nth-child(1) {
text-align: center;
}
.content > table > tbody > tr:last-child > td {
padding-bottom: 0;
.content>table>tbody>tr:last-child>td {
padding-bottom: 0;
}
footer {
width: 100vw;
bottom: 0;
text-align: center;
width: 100%;
bottom: 0;
text-align: center;
}
footer p {
padding: 0.5rem 0 1rem 0;
padding: 0.5rem 0 1rem 0;
}
/*1200px (no extra white space on the right) -> 800px (responsive menu)*/
/* 1200px (no extra white space on the right) -> 800px (responsive menu) */
@media only screen and (min-width: 801px) and (max-width: 1200px) {
.main-content {
margin-left: 18vw;
width: 80vw;
}
.main-content {
margin-left: 18vw;
width: 80vw;
}
}
@media only screen and (max-width: 800px) {
#responsive-sidebar {
display: block;
}
#responsive-sidebar-label-1 {
display: block;
}
#responsive-sidebar-label-2 {
display: block;
left: -103vw;
transition: left 0.25s ease-out;
z-index: 1000;
}
#responsive-sidebar:checked ~ .sidebar-left {
left: 0;
position: fixed;
transition: left 0.25s ease-in;
}
#responsive-sidebar:checked ~ #responsive-sidebar-label-2 {
left: 0;
transition: left 0.25s ease-in;
}
.sidebar-left {
left: -103vw;
width: 100vw;
transition: left 0.25s ease-out;
text-align: center;
padding-left: 0;
font-size: larger;
}
.sidebar-left > #site-logo {
display: none;
}
.sidebar-left > nav {
margin-top: 3rem;
}
.sidebar-left > nav > .dropdown-button {
display: block;
}
.sidebar-left > nav > .dropdown-button {
left: -9999px;
position: absolute;
}
.sidebar-left > nav > .dropdown {
width: 100vw;
display: block;
padding: 1rem 0 1rem 0;
}
.sidebar-left > nav > .dropdown > .dropdown-item {
display: none;
}
.sidebar-left > nav > #dropdown-button-1:checked ~ #dropdown-1 > .dropdown-item {
display: block;
}
.sidebar-left > nav > #dropdown-button-2:checked ~ #dropdown-2 > .dropdown-item {
display: block;
}
.sidebar-left > nav > #dropdown-button-3:checked ~ #dropdown-3 > .dropdown-item {
display: block;
}
.main-content {
width: 100vw;
margin-left: 0;
}
#content-title, #content-main {
margin-left: var(--default-margin);
margin-right: var(--default-margin);
}
#responsive-sidebar {
display: block;
}
#responsive-sidebar-label-1 {
display: block;
}
#responsive-sidebar-label-2 {
display: block;
left: -103vw;
transition: left 0.25s ease-out;
z-index: 1000;
}
#responsive-sidebar:checked~.sidebar-left {
left: 0;
position: fixed;
transition: left 0.25s ease-in;
}
#responsive-sidebar:checked~#responsive-sidebar-label-2 {
left: 0;
transition: left 0.25s ease-in;
}
.sidebar-left {
left: -103vw;
width: 100vw;
transition: left 0.25s ease-out;
text-align: center;
padding-left: 0;
font-size: larger;
}
.sidebar-left>#site-logo {
display: none;
}
.sidebar-left>nav {
margin-top: 3rem;
}
.sidebar-left>nav>.dropdown-button {
display: block;
}
.sidebar-left>nav>.dropdown-button {
left: -9999px;
position: absolute;
}
.sidebar-left>nav>.dropdown {
width: 100vw;
display: block;
padding: 1rem 0 1rem 0;
}
.sidebar-left>nav>.dropdown>.dropdown-item {
display: none;
}
.sidebar-left>nav>#dropdown-button-1:checked~#dropdown-1>.dropdown-item {
display: block;
}
.sidebar-left>nav>#dropdown-button-2:checked~#dropdown-2>.dropdown-item {
display: block;
}
.sidebar-left>nav>#dropdown-button-3:checked~#dropdown-3>.dropdown-item {
display: block;
}
.main-content {
width: 100vw;
margin-left: 0;
}
#content-title,
#content-main {
margin-left: var(--default-margin);
margin-right: var(--default-margin);
}
}

@ -1,8 +1,59 @@
---
title: Documentation
layout: layout.html
title: Yarn.social Documentation
description: Documentation for Yarn.social's Pod backend, API, Mobile App, Tools and Services.
---
## Overview
# Welcome to Yarn.social
Blah blah blah...
Hey there 👋 Welcome to Yarn.social 🤗
## What is Yarn.social? {#what}
[Yarn.social](https://yarn.social/) is a non-social social media 🤣 At least that's what some in the community call it.
Seriously though Yarn.social is a privacy first micro-blogging social media ecosystem. Why do we call it an ecosystem? Well because unlike many traditional "big-tech" social media platforms, Yarn.social is not a "single place" you can go. It is fully decentralised and joining Yarn.social can be as simple as joining an existing Pod to running your own to building your own client and hosting your own feed however you wish!
Also unlike other social media solutions such as [Mastodon](https://mastodon.social/explore) that uses the [ActivityPub](https://en.wikipedia.org/wiki/ActivityPub) protocol (*often referred to as the "Fediverse")* Yarn.social is also not a protocol, but a set of specifications for how to build clients and publish feeds that clients can consume. Yarn.social is thereby strictly decentralised in the strictest sense where most ActivityPub-based social media software really forms a "distributed network" of nodes.
Probably the most important thing to remember of all is that Yarn.social is first and foremost privacy first and 100% decentralised and has no interest in any advertising business models and so therefore will never have any ads.
If you are curious about the history of Yarn.social and how it was formed please have a read of [About Yarn.social](https://yarn.social/about.html)
## Why Yarn.social? {#why}
## Technical Stuff {#technical}
For the technical minded folks that are curious and want to know every little detail of how things work (*and we don't blame you!*) [Yarn.social](https://yarn.social/) is actually just a "brand" name we've given to a project that originally started out as a simple [Twtxt](https://twtxt.readthedocs.org/) Web Client/App. It was then later rebranded (*pretty quickly*) into Twt.social (now gone) and finally what you see here now today.
As stated before, Yarn.social is an ecosystem
- Clients such as the ones found on [https://yarn.social#clients](https://yarn.social/#clients)
- A set of [specifications](https://dev.twtxt.net/) for how to build clients and publish feeds and interact with others
- A collection of supporting tools and [services](https://yarn.social/#services) that support the greater ecosystem.
And of course Yarn.social has its own client and backend called [yarnd](https://git.mills.io/yarnsocial/yarn) which provides:
- A (by default) multi-user Web Application that primarily uses Server-side-rendering (SSR) technology with minimal Javascript (*only to enhance the experience*).
- Is based on the and uses the [Twtxt](https://twtxt.readthedocs.org/) spec/format itself.
- Has a JSON API for interacting with a Pod programatically
- And a [Mobile App](https://yarn.social/#mobile-app)!
### The Stack {#stack}
For the extra curious and developer in you, here's the tech stack that powers all Yarn.social pods (*instances of yarnd*):
#### Backend {#backend}
- Written in [Go](https://golang.org/)
- No framework(s).
#### Frontend {#frontend}
- Is a Server-side Render Web App (SSR)
- Using Go's [html/template](https://pkg.go.dev/html/template)(s)
- Very minimal use of Javascript (*only to enhance the User eXperience slightly with graceful degradation*)
#### Mobile App {#app}
- Written in [Dart](https://dart.dev/) using the [Flutter](https://flutter.dev/) framework
- Talks to `yarnd`'s Backend via its JSON API.

@ -0,0 +1,233 @@
/*
Live.js - One script closer to Designing in the Browser
Written for Handcraft.com by Martin Kool (@mrtnkl).
Version 4.
Recent change: Made stylesheet and mimetype checks case insensitive.
http://livejs.com
http://livejs.com/license (MIT)
@livejs
Include live.js#css to monitor css changes only.
Include live.js#js to monitor js changes only.
Include live.js#html to monitor html changes only.
Mix and match to monitor a preferred combination such as live.js#html,css
By default, just include live.js to monitor all css, js and html changes.
Live.js can also be loaded as a bookmarklet. It is best to only use it for CSS then,
as a page reload due to a change in html or css would not re-include the bookmarklet.
To monitor CSS and be notified that it has loaded, include it as: live.js#css,notify
*/
(function () {
var headers = { "Etag": 1, "Last-Modified": 1, "Content-Length": 1, "Content-Type": 1 },
resources = {},
pendingRequests = {},
currentLinkElements = {},
oldLinkElements = {},
interval = 1000,
loaded = false,
active = { "html": 1, "css": 1, "js": 1 };
var Live = {
// performs a cycle per interval
heartbeat: function () {
if (document.body) {
// make sure all resources are loaded on first activation
if (!loaded) Live.loadresources();
Live.checkForChanges();
}
setTimeout(Live.heartbeat, interval);
},
// loads all local css and js resources upon first activation
loadresources: function () {
// helper method to assert if a given url is local
function isLocal(url) {
var loc = document.location,
reg = new RegExp("^\\.|^\/(?!\/)|^[\\w]((?!://).)*$|" + loc.protocol + "//" + loc.host);
return url.match(reg);
}
// gather all resources
var scripts = document.getElementsByTagName("script"),
links = document.getElementsByTagName("link"),
uris = [];
// track local js urls
for (var i = 0; i < scripts.length; i++) {
var script = scripts[i], src = script.getAttribute("src");
if (src && isLocal(src))
uris.push(src);
if (src && src.match(/\blive.js#/)) {
for (var type in active)
active[type] = src.match("[#,|]" + type) != null
if (src.match("notify"))
alert("Live.js is loaded.");
}
}
if (!active.js) uris = [];
if (active.html) uris.push(document.location.href);
// track local css urls
for (var i = 0; i < links.length && active.css; i++) {
var link = links[i], rel = link.getAttribute("rel"), href = link.getAttribute("href", 2);
if (href && rel && rel.match(new RegExp("stylesheet", "i")) && isLocal(href)) {
uris.push(href);
currentLinkElements[href] = link;
}
}
// initialize the resources info
for (var i = 0; i < uris.length; i++) {
var url = uris[i];
Live.getHead(url, function (url, info) {
resources[url] = info;
});
}
// add rule for morphing between old and new css files
var head = document.getElementsByTagName("head")[0],
style = document.createElement("style"),
rule = "transition: all .3s ease-out;"
css = [".livejs-loading * { ", rule, " -webkit-", rule, "-moz-", rule, "-o-", rule, "}"].join('');
style.setAttribute("type", "text/css");
head.appendChild(style);
style.styleSheet ? style.styleSheet.cssText = css : style.appendChild(document.createTextNode(css));
// yep
loaded = true;
},
// check all tracking resources for changes
checkForChanges: function () {
for (var url in resources) {
if (pendingRequests[url])
continue;
Live.getHead(url, function (url, newInfo) {
var oldInfo = resources[url],
hasChanged = false;
resources[url] = newInfo;
for (var header in oldInfo) {
// do verification based on the header type
var oldValue = oldInfo[header],
newValue = newInfo[header],
contentType = newInfo["Content-Type"];
switch (header.toLowerCase()) {
case "etag":
if (!newValue) break;
// fall through to default
default:
hasChanged = oldValue != newValue;
break;
}
// if changed, act
if (hasChanged) {
Live.refreshResource(url, contentType);
break;
}
}
});
}
},
// act upon a changed url of certain content type
refreshResource: function (url, type) {
switch (type.toLowerCase()) {
// css files can be reloaded dynamically by replacing the link element
case "text/css":
var link = currentLinkElements[url],
html = document.body.parentNode,
head = link.parentNode,
next = link.nextSibling,
newLink = document.createElement("link");
html.className = html.className.replace(/\s*livejs\-loading/gi, '') + ' livejs-loading';
newLink.setAttribute("type", "text/css");
newLink.setAttribute("rel", "stylesheet");
newLink.setAttribute("href", url + "?now=" + new Date() * 1);
next ? head.insertBefore(newLink, next) : head.appendChild(newLink);
currentLinkElements[url] = newLink;
oldLinkElements[url] = link;
// schedule removal of the old link
Live.removeoldLinkElements();
break;
// check if an html resource is our current url, then reload
case "text/html":
if (url != document.location.href)
return;
// local javascript changes cause a reload as well
case "text/javascript":
case "application/javascript":
case "application/x-javascript":
document.location.reload();
}
},
// removes the old stylesheet rules only once the new one has finished loading
removeoldLinkElements: function () {
var pending = 0;
for (var url in oldLinkElements) {
// if this sheet has any cssRules, delete the old link
try {
var link = currentLinkElements[url],
oldLink = oldLinkElements[url],
html = document.body.parentNode,
sheet = link.sheet || link.styleSheet,
rules = sheet.rules || sheet.cssRules;
if (rules.length >= 0) {
oldLink.parentNode.removeChild(oldLink);
delete oldLinkElements[url];
setTimeout(function () {
html.className = html.className.replace(/\s*livejs\-loading/gi, '');
}, 100);
}
} catch (e) {
pending++;
}
if (pending) setTimeout(Live.removeoldLinkElements, 50);
}
},
// performs a HEAD request and passes the header info to the given callback
getHead: function (url, callback) {
pendingRequests[url] = true;
var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XmlHttp");
xhr.open("HEAD", url, true);
xhr.onreadystatechange = function () {
delete pendingRequests[url];
if (xhr.readyState == 4 && xhr.status != 304) {
xhr.getAllResponseHeaders();
var info = {};
for (var h in headers) {
var value = xhr.getResponseHeader(h);
// adjust the simple Etag variant to match on its significant part
if (h.toLowerCase() == "etag" && value) value = value.replace(/^W\//, '');
if (h.toLowerCase() == "content-type" && value) value = value.replace(/^(.*?);.*?$/i, "$1");
info[h] = value;
}
callback(url, info);
}
}
xhr.send();
}
};
// start listening
if (document.location.protocol != "file:") {
if (!window.liveJsLoaded)
Live.heartbeat();
window.liveJsLoaded = true;
}
else if (window.console)
console.log("Live.js doesn't support the file protocol. It needs http.");
})();
Loading…
Cancel
Save