Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
30fa35d
Move html to content
olizilla Jun 12, 2017
93bb728
Fix head.html partial
olizilla Jun 12, 2017
f539b31
Browserify the JS.
olizilla Jun 12, 2017
5fc4750
Pull src JS to top level. Fix html script links
olizilla Jun 13, 2017
ad38972
Modularise the JS
olizilla Jun 13, 2017
4e59cc8
Add generated js to .gitignore
olizilla Jun 13, 2017
d962edf
Pull the topbar into a partial
olizilla Jun 13, 2017
5d21980
Merge pull request #1 from tableflip/browserify
olizilla Jun 13, 2017
5f95647
Merge pull request #3 from tableflip/topbar-partial
olizilla Jun 13, 2017
56ff92f
Pulls implementation table into partial
olizilla Jun 13, 2017
48f5635
WIP Builds impls html from data
olizilla Jun 14, 2017
d83b79f
Impls page works as before, with content created at build time.
olizilla Jun 14, 2017
df5ee56
Fix homepage animation
olizilla Jun 14, 2017
2e2e4c2
Remove debug code
olizilla Jun 14, 2017
963d50c
Merge pull request #4 from tableflip/data-driven-impls
olizilla Jun 14, 2017
fe26e56
Refactor bundles.json
olizilla Jun 14, 2017
8f4bc30
Data driven bundles page
olizilla Jun 15, 2017
1d07ffb
Merge pull request #5 from tableflip/data-driven-bundles
olizilla Jun 15, 2017
f940f09
Fix line endings in .less files
olizilla Jun 15, 2017
305b59f
Remove generated css
olizilla Jun 15, 2017
6af1ff4
Fix less imports. Add `build:css` target
olizilla Jun 15, 2017
4f9645f
Merge pull request #6 from tableflip/css-build-process
olizilla Jun 15, 2017
ed3f95d
Port impls section on homepage to hugo
olizilla Jun 15, 2017
bc7a76d
Merge pull request #7 from tableflip/fix-impls-on-homepage
olizilla Jun 15, 2017
990e505
WIP on converting splash to css
olizilla Jun 15, 2017
f890e34
WIP
olizilla Jun 15, 2017
3c5e2a7
WIP on splash... it lives!
olizilla Jun 16, 2017
11df3d1
Staggared fadez
olizilla Jun 16, 2017
02d90ea
WIP on headline animation
olizilla Jun 19, 2017
a278814
Use new css only splash animation.
olizilla Jun 19, 2017
09af244
Remove splash impl research notes
olizilla Jun 19, 2017
c490005
Merge pull request #8 from tableflip/splash
olizilla Jun 19, 2017
c186a77
Pull in contributors data at build time
olizilla Jun 20, 2017
dca419e
Fix pause on hover. Remove unused less.
olizilla Jun 20, 2017
8e3bb00
WIP on build process
olizilla Jun 20, 2017
3b9e9a0
Remove unused css, add onerror handler for missing images
olizilla Jun 20, 2017
fdaa741
Merge pull request #9 from tableflip/contributors
olizilla Jun 20, 2017
992a86f
Add minify steps
olizilla Jun 21, 2017
9d2aec9
build step to create prod site
olizilla Jun 21, 2017
e653237
Merge remote-tracking branch 'origin/move-content' into build-process
olizilla Jun 21, 2017
5fffc3b
Fix peer-routing.svg casing
olizilla Jun 21, 2017
8f097ec
Makefile based dev is GO!
olizilla Jun 21, 2017
cbd9c1c
Merge remote-tracking branch 'origin/move-content' into build-process
olizilla Jun 21, 2017
7d1a31a
make dev-stop sounds better
olizilla Jun 21, 2017
1b116e0
Pull README up to spec
olizilla Jun 21, 2017
1c2a6de
Add versions dir
olizilla Jun 21, 2017
eec7cf9
Merge pull request #10 from tableflip/build-process
olizilla Jun 21, 2017
33daf62
Fix publish-to-domain to use dnslink script
olizilla Jun 22, 2017
a35b96b
Require DOMAIN as explicit arg
olizilla Jun 22, 2017
d9ca2a4
Merge pull request #11 from tableflip/dnslink
olizilla Jun 22, 2017
68b36ad
Speed up contributor image loading
olizilla Jun 22, 2017
d7a5894
Decrease contributor loading delay to 50ms
olizilla Jun 22, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# EditorConfig - http://EditorConfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2

[Makefile]
indent_style = tab
33 changes: 6 additions & 27 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,28 +1,7 @@
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
npm-debug.log
node_modules
public/
public
static/js/*.js
static/css/*.css
dev.pid
auth.token
91 changes: 91 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
DOMAIN="libp2p.io"
IPFSLOCAL="http://localhost:8080/ipfs/"
IPFSGATEWAY="https://ipfs.io/ipfs/"
NPMBIN=./node_modules/.bin
NPM=npm
OUTPUTDIR=public
PIDFILE=dev.pid

build: clean install lint js css minify
@hugo && \
echo "" && \
echo "Site built out to ./public dir"

help:
@echo 'Makefile for a libp2p, a hugo built static site. '
@echo ' '
@echo 'Usage: '
@echo ' make Build the optimised site to ./$(OUTPUTDIR) '
@echo ' make serve Preview the production ready site at http://localhost:1313 '
@echo ' make lint Check your JS and CSS are ok '
@echo ' make js Browserify the *.js to ./static/js '
@echo ' make css Compile the *.less to ./static/css '
@echo ' make minify Optimise all the things! '
@echo ' make dev Start a hot-reloding dev server on http://localhost:1313 '
@echo ' make dev-stop Stop the dev server '
@echo ' make deploy Add the website to your local IPFS node '
@echo ' make publish-to-domain Update $(DOMAIN) DNS record to the ipfs hash from the last deploy '
@echo ' make clean remove the generated files '
@echo ' '

serve: install lint js css minify
hugo server

node_modules:
$(NPM) i

install: node_modules

lint: install
$(NPMBIN)/standard && $(NPMBIN)/lessc --lint less/*.less

js: install
$(NPMBIN)/browserify --noparse=jquery js/{index,implementations,bundles,media}.js -p [ factor-bundle -o static/js/index.js -o static/js/implementations.js -o static/js/bundles.js -o static/js/media.js ] -o static/js/common.js

css: install
for f in less/*.less; do $(NPMBIN)/lessc $$f --autoprefix='> 1%, last 2 versions' --clean-css static/css/$$(basename $$f .less).css; done

minify: install minify-js minify-img

minify-js: install
find static/js -name '*.js' -exec $(NPMBIN)/uglifyjs {} --compress --output {} \;

minify-img: install
find static/img -type d -exec $(NPMBIN)/imagemin {}/* --out-dir={} \;

dev: install js css
[ ! -f $(PIDFILE) ] || rm $(PIDFILE) ; \
touch $(PIDFILE) ; \
($(NPMBIN)/watchify --noparse=jquery js/{index,implementations,bundles,media}.js -p [ factor-bundle -o static/js/index.js -o static/js/implementations.js -o static/js/bundles.js -o static/js/media.js ] -o static/js/common.js & echo $$! >> $(PIDFILE) ; \
$(NPMBIN)/nodemon --quiet --watch less --ext less --exec "make css" & echo $$! >> $(PIDFILE) ; \
hugo server & echo $$! >> $(PIDFILE))

dev-stop:
touch $(PIDFILE) ; \
[ -z "`(cat $(PIDFILE))`" ] || kill `(cat $(PIDFILE))` ; \
rm $(PIDFILE)

deploy:
ipfs swarm peers >/dev/null || (echo "ipfs daemon must be online to publish" && exit 1)
ipfs add -r -q $(OUTPUTDIR) | tail -n1 >versions/current
cat versions/current >>versions/history
@export hash=`cat versions/current`; \
echo ""; \
echo "published website:"; \
echo "- $(IPFSLOCAL)$$hash"; \
echo "- $(IPFSGATEWAY)$$hash"; \
echo ""; \
echo "next steps:"; \
echo "- ipfs pin add -r /ipfs/$$hash"; \
echo "- make publish-to-domain"; \

publish-to-domain: auth.token versions/current
DNSIMPLE_TOKEN=$(shell cat auth.token) \
./dnslink.sh $(DOMAIN) $(shell cat versions/current)

clean:
[ ! -d $(OUTPUTDIR) ] || rm -rf $(OUTPUTDIR) && \
[ ! -d static/js ] || rm -rf static/js/*.js && \
[ ! -d static/css ] || rm -rf static/css/*.css

.PHONY: build help install lint js css minify minify-js minify-img dev stopdev deploy publish-to-domain clean
115 changes: 93 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,93 @@
# [libp2p-website](libp2p.io)

## Implementations & Bundles

JSON arrays to update implementation & bundle status can be found in `/static/js/data`

## Development

```sh
> hugo serve
# ...
Web Server is available at //localhost:1313/
```

## Publish

```sh
> hugo
# ..

> ipfs add -r public
```
# [libp2p-website](libp2p.io)

[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
[![](https://img.shields.io/badge/project-libp2p-blue.svg?style=flat-square)](http://github.com/libp2p/libp2p)
[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)

> Official website for libp2p http://libp2p.io

This repository contains the source code for the libp2p website available at http://libp2p.io

This project builds out a static site to explain libp2p, ready for deployment on ipfs. It uses `hugo` to glue the html together. It provides an informative, public-facing website. The most important things are the words, concepts and links it presents.

Much of the site content is data-driven, take a look at the `data` dir where find the data behind the implementations and bundles information as json.

## Install

```sh
git clone https://github.com/libp2p/website
```

## Usage

To deploy the site libp2p.io, run:

```sh
# Build out the optimised site to ./public, where you can check it locally.
make

# Add the site to your local ipfs, you can check it via /ipfs/<hash>
make deploy

# Save your dnsimple api token as auth.token
cat "<api token here>" > auth.token

# Update the dns record for libp2p to point to the new ipfs hash.
make publish-to-domain
```

The following commands are available:

### `make`

Build the optimised site to the `./public` dir

### `make serve`

Preview the production ready site at http://localhost:1313 _(requires `hugo` on your `PATH`)_

### `make dev`

Start a hot-reloading dev server on http://localhost:1313 _(requires `hugo` on your `PATH`)_

### `make dev-stop`

Stop that server (and take a break!)

### `make minfy`

Optimise all the things!

### `make deploy`

Build the site in the `public` dir and add to `ipfs` _(requires `hugo` & `ipfs` on your `PATH`)_

### `make publish-to-domain` :rocket:

Update the DNS record for `libp2p.io`. _(requires an `auto.token` file to be saved in the project root.)_

If you'd like to update the dnslink TXT record for another domain, pass `DOMAIN=<your domain here>` like so:

```sh
make publish-to-domain DOMAIN=tableflip.io
```

---

See the `Makefile` for the full list or run `make help` in the project root.

## Dependencies

* `hugo` to build website
* `ipfs` to deploy changes
* `jq`, `curl` and an `auth.token` file in the project root containing your dnsimple api token to update the dns.

All other dependencies are pulled from `npm` and the Makefile will run `npm install` for you because it's nice like that.

## Contribute

Please do! Check out [the issues](https://github.com/libp2p/website/issues), or open a PR!

Check out our [notes on contributing ](https://github.com/libp2p/js-libp2p#contribute) for more information on how we work, and about contributing in general. Please be aware that all interactions related to libp2p are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).

Small note: If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.
1 change: 1 addition & 0 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ copyright = "libp2p - All rights reserved."
canonifyurls = true
relativeURLs = true
baseURL = ""
googleAnalytics = "UA-96910779-2"
79 changes: 79 additions & 0 deletions content/bundles.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<!DOCTYPE html>
<html lang="en">
<head>
{{ partial "head.html" . }}
<link rel="stylesheet" type="text/css" href="/css/bundles.css">
<title>Bundles - libp2p</title>
</head>
<body>

{{ partial "topbar.html" . }}

<main>
<article class="center bundles">
<header>
<h2>Bundles.</h2>
</header>
<div class="wrap">
<p> libp2p provides ready-to-use bundles for different use cases and different languages. You can use these
to get all the functionality in one package, instead of including and bundling the different modules
yourself. See it as a quickstart.</p>
<div class="links">
<div class="active-link">
<div class="copy-block"></div>
<i class="fa fa-angle-down" aria-hidden="true"></i>
</div>
<div class="columns">
<div class="column col1"></div>
<div class="column col2"></div>
<div class="column col3"></div>
<div class="column col4"></div>
</div>
</div>
</div>
<div class="triangle white"></div>
</article>

<article class="center bundles-info">
<div class="wrap">

{{ range where $.Site.Data.bundles "status" "live" }}
{{ partial "bundle.html" . }}
{{ end }}

<section class="coming-soon">
{{ range where $.Site.Data.bundles "status" "coming-soon" }}
<div class="card">
<div class="rectangle coming-soon" title="{{ .name }} bundle coming soon">
<div class="img">
<img src="{{ .image }}" alt="{{ .name }}">
</div>
<div class="text">In progress...</div>
</div>
</div>
{{ end }}
<div class="card empty">
<div class="rectangle empty">
<img src="../img/img4.png" alt="A 3 cube tetris block in a minimal L shape, pointing upwards."/>
</div>
</div>
<div class="card empty">
<div class="rectangle empty">
<img src="../img/img5.png" alt="A single cube, corner pointing upwards; The isomorphic perspective revealing an hexangonal outline." />
</div>
</div>
</section>

</div>
<div class="triangle grey"></div>
</article>

</main>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only the main should be in body. Anything that is template/design should go into a partials/template folder.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will be pulling much more into partials.

When building pages I find it most useful to be able to compose the page out of templates, rather than override things from a layout. A layout either ends up encoding some assumptions, that some pages may not want, or is so thin that it's hardly worth making the dev fit 2 files in there head to guess what the resulting page will be.


{{ partial "footer.html" . }}

<script type="text/javascript" src="/js/common.js"></script>
<script type="text/javascript" src="/js/bundles.js"></script>

</body>
</html>
8 changes: 0 additions & 8 deletions content/bundles.md

This file was deleted.

Loading