From b228af52a9b91c2cf7a46f1c8125a7938a1625c1 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Fri, 17 Mar 2023 09:30:03 +0100 Subject: [PATCH] chore: set-up generator, styles, indexes Co-authored-by: Robin Berjon --- .config.json | 6 ++ .gitignore | 1 + Makefile | 13 ++- src/_includes/footer.html | 16 ++++ src/_includes/head.html | 11 +++ src/_includes/header.html | 15 ++++ src/css/index.css | 166 +++++++++++++++++++++++++++++++++++ src/css/specs.css | 131 +++++++++++++++++++++++++++ src/http-gateways/index.html | 55 ++++++++++++ src/index.html | 156 ++++++++++++++++++++++++++++++++ src/ipns/index.html | 23 +++++ src/ipns/ipns-record.md | 2 +- src/meta/index.html | 25 ++++++ template.html | 18 ++++ 14 files changed, 636 insertions(+), 2 deletions(-) create mode 100644 .config.json create mode 100644 .gitignore create mode 100644 src/_includes/footer.html create mode 100644 src/_includes/head.html create mode 100644 src/_includes/header.html create mode 100644 src/css/index.css create mode 100644 src/css/specs.css create mode 100644 src/http-gateways/index.html create mode 100644 src/index.html create mode 100644 src/ipns/index.html create mode 100644 src/meta/index.html create mode 100644 template.html diff --git a/.config.json b/.config.json new file mode 100644 index 000000000..e3a0b4f76 --- /dev/null +++ b/.config.json @@ -0,0 +1,6 @@ +{ + "input": "src", + "output": "out", + "template": "template.html", + "baseURL": "https://specs.ipfs.tech" +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..466e24805 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +out/ \ No newline at end of file diff --git a/Makefile b/Makefile index 8ed9b4f43..34e1f3133 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,15 @@ -all: superlinter +SPEC_GENERATOR_VER=v1.1.2 + +all: website + +clean: + rm -rf ./out + +website: clean + npx spec-generator@$(SPEC_GENERATOR_VER) -c .config.json + +watch: clean + npx spec-generator@$(SPEC_GENERATOR_VER) -c .config.json -w superlinter: docker run --rm -e VALIDATE_ALL_CODEBASE=false -e RUN_LOCAL=true -e VALIDATE_MARKDOWN=true -e MARKDOWN_CONFIG_FILE=".markdownlint.json" -e LINTER_RULES_PATH="." -v $(shell pwd):/tmp/lint github/super-linter:v4 diff --git a/src/_includes/footer.html b/src/_includes/footer.html new file mode 100644 index 000000000..26e5351e9 --- /dev/null +++ b/src/_includes/footer.html @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff --git a/src/_includes/head.html b/src/_includes/head.html new file mode 100644 index 000000000..dfa3a3ff6 --- /dev/null +++ b/src/_includes/head.html @@ -0,0 +1,11 @@ + + + + + + {% if title != 'Home' %}{{ title }} | {% endif %}IPFS Standards + + + + + \ No newline at end of file diff --git a/src/_includes/header.html b/src/_includes/header.html new file mode 100644 index 000000000..234d9dcbc --- /dev/null +++ b/src/_includes/header.html @@ -0,0 +1,15 @@ +{% include 'head.html' %} + + + +
+
+

{{ title }}

+

{{ description }}

+
+
diff --git a/src/css/index.css b/src/css/index.css new file mode 100644 index 000000000..8ee142d61 --- /dev/null +++ b/src/css/index.css @@ -0,0 +1,166 @@ + +body { + margin: 0; + padding: 0; + font-size: 1rem; + line-height: 1.5; + font-family: var(--body-family); + font-weight: 300; +} + +nav { + background: var(--ipfs-gradient-0-background-image); +} +nav > div { + max-width: var(--max-page-width); + margin: 0 auto; + padding: 1rem 1rem; +} +nav img, +nav a { + vertical-align: middle; +} +nav a { + color: var(--ipfs-off-white); + text-decoration: none; + /* font-size: var(--size-h5); */ + font-weight: var(--weight-semi-bold); +} + +header { + background: var(--ipfs-brand-gradient); +} +header > div { + max-width: var(--max-page-width); + margin: 0 auto; + padding: 3rem 1rem; +} +header h1 { + font-size: var(--size-h2); + font-weight: var(--weight-semi-bold); + margin-top: 0; + line-height: 1; + color: var(--ipfs-off-white); +} +header img.logo { + margin-bottom: 2rem; +} +header p { + color: var(--ipfs-off-white); + max-width: var(--max-readable-width); +} + +main { + max-width: var(--max-page-width); + margin: 4rem auto 0; + padding: 0 1rem; +} + +.basic-grid { + display: grid; + column-gap: 4rem; + row-gap: 4rem; + grid-template-columns: repeat(1, minmax(0,1fr)); +} +@media (min-width: 640px) { + .basic-grid { + grid-template-columns: repeat(2, minmax(0,1fr)); + } +} + +h2.pitch-title { + color: var(--fg); + text-align: center; + margin-top: 9rem; + font-weight: var(--weight-regular); + font-size: var(--size-h2); + margin-bottom: 1rem; + line-height: 1; +} +.pitch-subtitle { + text-align: center; + font-size: var(--size-h5); + font-weight: var(--weight-light); + margin-bottom: 4rem; + line-height: 1.2; +} +.pitch { + background: var(--stark-bg); + color: var(--stark-fg); + padding: 0 1rem; +} +.pitch h3 { + text-align: center; + margin-bottom: 1rem; +} +.pitch h3::after { + width: 3rem; + height: 0.5rem; + background: var(--ipfs-teal); + display: block; + content: " "; + margin: 0.5rem auto; +} + +main > section { + margin-top: 9rem; +} +h2 { + font-size: var(--size-h2); + font-weight: var(--weight-semi-bold); + margin-bottom: 1rem; +} +main > section section { + background: var(--stark-bg); + color: var(--stark-fg); + padding: 0 1rem; +} +h3 { + font-size: var(--size-h3); + font-weight: var(--weight-semi-bold); + margin-bottom: 1rem; +} +h3 a { + color: inherit; +} + +a { + color: var(--highlight-colour); + transition: color 0.2s; +} +a:hover { + color: var(--ipfs-yellow); +} +dt { + font-style: normal; + font-weight: bold; +} +dt a { + text-decoration-color: var(--ipfs-stone-grey); + display: block; +} +dd { + font-style: normal; + margin-left: 1rem; + margin-bottom: .6rem; +} + + +footer { + margin-top: 4rem; + text-align: center; + color: var(--ipfs-ash-grey); + background: var(--stark-bg); + border-top: 1px solid var(--ipfs-jade); +} +footer > div { + max-width: var(--max-page-width); + margin: 0 auto; + padding: 1rem 1rem 3rem 1rem; +} +footer a { + text-decoration: none; +} +footer img { + vertical-align: text-bottom; +} diff --git a/src/css/specs.css b/src/css/specs.css new file mode 100644 index 000000000..d509482b1 --- /dev/null +++ b/src/css/specs.css @@ -0,0 +1,131 @@ + + +:root { + --size-mono: 0.9em; +} + +body { + max-width: var(--max-readable-width); + margin: 0 auto; + padding: 0 0 0 0; + line-height: 1.5; +} + +#ipseity-back-to-root { + margin-bottom: 2rem; + background: var(--standard-gradient); + padding-left: 1rem; + font-weight: 600; + font-size: 0.9rem; +} + +#ipseity-back-to-root a { + color: var(--ipfs-off-white); + text-decoration: none; + transition: color 0.2s; +} + +#ipseity-back-to-root a:hover { + color: var(--ipfs-yellow); +} + +header { + background-image: url(/img/ipfs-standards.svg); + background-repeat: no-repeat; + background-size: 100px; + background-position-x: right; + margin-bottom: 3rem; + border-bottom: 0.25rem solid var(--ipfs-turquoise); + padding-bottom: 2rem; +} + +header dt { + font-weight: var(--weight-regular); + text-decoration: underline; +} + +header dd img { + opacity: 0.5; + transition: opacity .5s; + background: var(--contrast-bg); + border-radius: 2px; + vertical-align: sub; +} + +header dd img:hover { + opacity: 1; +} + +header dd a { + text-decoration: none; +} + +h1 { + max-width: calc(100% - (100px + 1rem)); + font-weight: var(--weight-semi-bold); + line-height: 1; + margin: 0.15rem 0 0 0; +} + +h2, h3, h4, h5, h6 { + margin: 3rem 0 0 0; + font-weight: var(--weight-semi-bold); +} + +:is(h2, h3, h4, h5, h6) bdi.secno { + color: var(--ipfs-ash-grey); +} + +p#last-modified { + color: var(--ipfs-ash-grey); + margin-top: 0rem; + font-size: 1.6rem; +} + +p { + margin: 1rem 0; +} + +.header-wrapper { + display: flex; + align-items: baseline; +} + +.header-wrapper + section > .header-wrapper > :is(h3, h4, h5, h6) { + margin-top: 1rem; +} + +.self-link::after { + color: var(--ipfs-ash-grey); +} + +.self-link:hover::after { + color: var(--ipfs-yellow); +} + +@media only screen and (max-width: 816px) { + body { + margin-left: 1rem; + margin-right: 1rem; + font-size: 1rem; + } + + #ipseity-back-to-root { + margin: 0 -1rem 2rem -1rem; + } + + header { + background-size: 50px; + } + + p#last-modified { + margin-top: -0.8rem; + font-size: 1.2rem; + } +} + +@media print { + body { + font-size: 1rem; + } +} diff --git a/src/http-gateways/index.html b/src/http-gateways/index.html new file mode 100644 index 000000000..842cfe063 --- /dev/null +++ b/src/http-gateways/index.html @@ -0,0 +1,55 @@ +--- +title: HTTP Gateways +description: | + IPFS Gateway acts as a bridge between traditional HTTP clients and IPFS. Through the gateway, users can download files, + directories and other IPLD data stored in IPFS as if they were stored in a traditional web server. +--- + +{% include 'header.html' %} + +
+

HTTP

+

+ Low-level gateways that expose IPFS resources over HTTP protocol. +

+
+
Path Gateways
+
+ The most versatile form of IPFS Gateway is a Path Gateway. It exposes namespaces like /ipfs/ and + /ipns/ under an HTTP server root and provides basic primitives for integrating IPFS resources + within the existing HTTP stack. +
+
Trustless Gateways
+
+ Trustless Gateways are a minimal subset of Path Gateways + that allow light IPFS clients to retrieve data behind a CID and verify its integrity without delegating any + trust to the gateway itself. +
+
+

Web

+

+ Designed for website hosting and improved interoperability with web browsers and + origin-based security model. +

+
+
DNSLink Gateways
+
+ DNSLink Gateways are an extension of Path Gateways that enable hosting a + specific content path under a specific DNS name. +
+
Subdomain Gateways
+
+ Subdomain Gateways are an extension of Path Gateways that + enable website hosting isolated per CID/name, while remaining compatible with web browsers relative pathing and + the security model of the web. +
+
Redirects File
+
+ The Redirects File specification is an extension of the Subdomain Gateway and DNSLink Gateway specifications that + enables URL redirects or rewrites by adding redirect rules to a0 file stored underneath the root CID of a web + site. +
+
+
+ +{% include 'footer.html' %} diff --git a/src/index.html b/src/index.html new file mode 100644 index 000000000..b3fe0d367 --- /dev/null +++ b/src/index.html @@ -0,0 +1,156 @@ +--- +title: Home +--- + +{% include 'head.html' %} + +
+
+ +

IPFS Standards

+

+ The purpose of IPFS Standards is to foster interoperability between independent implementations of + the IPFS stack by producing Internet-grade specifications and test suites. +

+
+
+ +
+

Specifying IPFS and the Interplanetary stack.

+

+ The technology that powers the content-addressable web is being standardized here. +

+ + +
+

Specifications

+

+ The specifications are broken up into multiple areas that cover the stack. +

+
+
+

HTTP Gateways

+

+ IPFS Gateway acts as a bridge between traditional HTTP clients and IPFS. Through the gateway, users can download files, + directories and other IPLD data stored in IPFS as if they were stored in a traditional web server. +

+
+
Path Gateways
+
+ The most versatile form of IPFS Gateway is a Path Gateway. It exposes namespaces like /ipfs/ and + /ipns/ under an HTTP server root and provides basic primitives for integrating IPFS resources + within the existing HTTP stack. +
+
Trustless Gateways
+
+ Trustless Gateways are a minimal subset of Path Gateways + that allow light IPFS clients to retrieve data behind a CID and verify its integrity without delegating any + trust to the gateway itself. +
+
DNSLink Gateways
+
+ DNSLink Gateways are an extension of Path Gateways that enable hosting a + specific content path under a specific DNS name. +
+
Subdomain Gateways
+
+ Subdomain Gateways are an extension of Path Gateways that + enable website hosting isolated per CID/name, while remaining compatible with web browsers relative pathing and + the security model of the web. +
+
Redirects File
+
+ The Redirects File specification is an extension of the Subdomain Gateway and DNSLink Gateway specifications that + enables URL redirects or rewrites by adding redirect rules to a0 file stored underneath the root CID of a web + site. +
+
+
+
+

InterPlanetary Naming System

+

+ The InterPlanetary Naming System (IPNS) is a naming system responsible for creating, reading and updating mutable pointers to data. +

+ +
+
IPNS Record and Protocol
+
+ Specifies the IPNS protocol in a language-agnostic manner, allowing everyone to create a compatible IPNS Record Publisher + or Resolver. +
+
IPNS PubSub Router
+
+ Specifies how to publish and retrieve IPNS records using libp2p PubSub router. +
+
+ +
+
+

Meta

+

+ Meta contains all the non-technical documents that conspire to make the standards + project work: what the core values are, what the governance model is, how to produce documents, + etc. +

+
+
Code of Conduct
+
+ The code of conduct that all community participants are held to. +
+
Spec for Specs
+
+ Specifies the format and system used to create and maintain specifications for + the interplanetary stack. +
+ +
+
+
+
+
+ +{% include 'footer.html' %} diff --git a/src/ipns/index.html b/src/ipns/index.html new file mode 100644 index 000000000..a5e977a7b --- /dev/null +++ b/src/ipns/index.html @@ -0,0 +1,23 @@ +--- +title: InterPlanetary Naming System +description: | + The InterPlanetary Naming System (IPNS) is a naming system responsible for creating, reading and updating mutable pointers to data. +--- + +{% include 'header.html' %} + +
+
+
IPNS Record and Protocol
+
+ Specifies the IPNS protocol in a language-agnostic manner, allowing everyone to create a compatible IPNS Record Publisher + or Resolver. +
+
IPNS PubSub Router
+
+ Specifies how to publish and retrieve IPNS records using libp2p PubSub router. +
+
+
+ +{% include 'footer.html' %} diff --git a/src/ipns/ipns-record.md b/src/ipns/ipns-record.md index c1d858426..dc439945f 100644 --- a/src/ipns/ipns-record.md +++ b/src/ipns/ipns-record.md @@ -14,7 +14,7 @@ editors: github: guseggert --- -# InterPlanetary Naming System +# IPNS Record and Protocol The InterPlanetary File System (IPFS) is powered by content-addressed data, which by nature is immutable: changing an object would change its hash, and consequently its address, making it a different object altogether. However, there are several use cases where we benefit from having mutable data. This is where the InterPlanetary Naming System (IPNS) gets into the equation. IPNS records provide cryptographically verifiable, mutable pointers to objects. diff --git a/src/meta/index.html b/src/meta/index.html new file mode 100644 index 000000000..7ffa96f37 --- /dev/null +++ b/src/meta/index.html @@ -0,0 +1,25 @@ +--- +title: Meta +description: | + Meta contains all the non-technical documents that conspire to make the standards + project work: what the core values are, what the governance model is, how to produce documents, + etc. +--- + +{% include 'header.html' %} + +
+
+
Code of Conduct
+
+ The code of conduct that all community participants are held to. +
+
Spec for Specs
+
+ Specifies the format and system used to create and maintain specifications for + the interplanetary stack. +
+
+
+ +{% include 'footer.html' %} diff --git a/template.html b/template.html new file mode 100644 index 000000000..e8f3f9410 --- /dev/null +++ b/template.html @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + ${body} + +