Unverified Commit 9603194e authored by Jessica Schilling's avatar Jessica Schilling Committed by GitHub

Merge pull request #40 from ipfs/feat/add-build-script

feat: Build script
parents fa0f5a06 8a9c62e6
name: Build
on:
push:
jobs:
no-uncommitted-changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Run Build
uses: actions/setup-node@v1
with:
node-version: '12.x'
- run: npm run build
- name: Check working tree
id: changes
uses: UnicornGlobal/has-changes-action@v1.0.11
- name: Check for uncommited changes
if: steps.changes.outputs.changed == 1
run: git status && echo "Output does not match src/, uncommitted changes exist, follow build instructions from README" && exit 1
# dir-index-html
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](https://protocol.ai)
[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.io/)
[![Made by Protocol Labs](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](https://protocol.ai)
[![Project: IPFS](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.io/)
[![Matrix](https://img.shields.io/badge/matrix-%23ipfs%3Amatrix.org-blue.svg?style=flat-square)](https://matrix.to/#/room/#ipfs:matrix.org)
[![IRC](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
> Directory listing HTML for go-ipfs gateways
> Directory listing HTML for `go-ipfs` gateways
This repo is not be used standalone. It's used by the gateway code in go-ipfs. It'll be merged into the gateway package, once the gateway has been extracted from go-ipfs.
**NOTE:** This repo is not intended to be used as a standalone project! This code is used by the gateway code within [`go-ipfs`](https://github.com/ipfs/go-ipfs). In the long term, once the the gateway is extracted from `go-ipfs`, the code in this repo will be merged into that gateway package.
![](https://user-images.githubusercontent.com/157609/88379209-ce6f0600-cda2-11ea-9620-20b9237bb441.png)
## Updating
1. Make changes to _both_ dir-index.html and dir-index-uncat.html.
2. Follow the instructions in [go-ipfs](https://github.com/ipfs/go-ipfs/tree/master/assets#updating-dir-index-html) for updating the directory index.
When making updates to the directory listing page template, please note the following:
1. Make your changes to the (human-friendly) source documents in the `src` directory
2. Before testing or releasing, make sure to run the build script to update the minified version in the top-level directory:
```bash
> npm run build
```
3. To get your updates into `go-ipfs`, you'll need to do the following:
- Cut a new, appropriately versioned release of `dir-index-html` (don't forget to bump the version number in `package.json`)
- Make a PR against `go-ipfs` following [these instructions](https://github.com/ipfs/go-ipfs/tree/master/assets#updating-dir-index-html) for updating the directory index
## Testing
1. Install [go](https://golang.org/dl/).
2. Run the test server:
1. Make sure you have [Go](https://golang.org/dl/) installed
2. Start the test server, which lives in its own directory:
```bash
> cd test
> go run .
```
This will listen on [`localhost:3000`](http://localhost:3000/) and reload the template every time you refresh the page.
This will listen on `localhost:3000` and re-load the template every time you refresh the page.
If you get a "no such file or directory" error upon trying `go run .`, make sure you ran `npm run build` to generate the minified artifact that the test is looking for.
## Contribute
Feel free to join in. All welcome. A good place to start is [the issues](https://github.com/ipfs/dir-index-html/issues).
Feel free to join in. All are welcome! A good place to start is to check the [issues](https://github.com/ipfs/dir-index-html/issues) for anything you find interesting.
This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).
......
This diff is collapsed.
This diff is collapsed.
body{color:#34373f;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.43;margin:0;word-break:break-all;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}a{color:#117eb3;text-decoration:none}a:hover{color:#00b0e9;text-decoration:underline}a:active,a:visited{color:#00b0e9}strong{font-weight:700}table{border-collapse:collapse;border-spacing:0;max-width:100%;width:100%}table:last-child{border-bottom-left-radius:3px;border-bottom-right-radius:3px}tr:first-child td{border-top:0}tr:nth-of-type(even){background-color:#f7f8fa}td{border-top:1px solid #d9dbe2;padding:.65em;vertical-align:top}#page-header{align-items:center;background:#0b3a53;border-bottom:4px solid #69c4cd;color:#fff;display:flex;font-size:1.12em;font-weight:500;justify-content:space-between;padding:0 1em}#page-header a{color:#69c4cd}#page-header a:active{color:#9ad4db}#page-header a:hover{color:#fff}#page-header-logo{height:2.25em;margin:.7em .7em .7em 0;width:7.15em}#page-header-menu{align-items:center;display:flex;margin:.65em 0}#page-header-menu div{margin:0 .6em}#page-header-menu div:last-child{margin:0 0 0 .6em}#page-header-menu svg{fill:#69c4cd;height:1.8em;margin-top:.125em}#page-header-menu svg:hover{fill:#fff}.menu-item-narrow{display:none}#content{border:1px solid #d9dbe2;border-radius:4px;margin:1em}#content-header{background-color:#edf0f4;border-bottom:1px solid #d9dbe2;border-top-left-radius:3px;border-top-right-radius:3px;padding:.7em 1em}.type-icon,.type-icon>*{width:1.15em}.no-linebreak{white-space:nowrap}.ipfs-hash{color:#7f8491;font-family:monospace}@media only screen and (max-width:500px){.menu-item-narrow{display:inline}.menu-item-wide{display:none}}@media print{#page-header{display:none}#content-header,.ipfs-hash,body{color:#000}#content-header{border-bottom:1px solid #000}#content{border:1px solid #000}a,a:visited{color:#000;text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}tr{page-break-inside:avoid}tr:nth-of-type(even){background-color:transparent}td{border-top:1px solid #000}}@-ms-viewport{width:device-width}.d-flex{display:flex}.flex-wrap{flex-flow:wrap}.flex-shrink-1{flex-shrink:1}.ml-auto{margin-left:auto}.table-responsive{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
{
"name": "dir-index-html",
"author": "lgierth",
"description": "Directory listing HTML for go-ipfs gateways",
"version": "1.2.0",
"homepage": "https://github.com/ipfs/dir-index-html#readme",
"bugs": {
"url": "https://github.com/ipfs/dir-index-html"
},
......@@ -11,8 +15,13 @@
"gxVersion": "0.14.0",
"language": "go",
"license": "MIT",
"name": "dir-index-html",
"releaseCmd": "git commit -a -m \"gx publish $VERSION\"",
"version": "1.0.4"
"scripts": {
"build": "npm run build:clean && npm run build:remove-style-links && npm run build:minify-wrap-css && npm run build:combine-html-css && npm run build:remove-unused",
"build:clean": "rm dir-index.html",
"build:remove-style-links": "sed '/<link rel=\"stylesheet\"/d' ./src/dir-index.html > ./base-html.html",
"build:minify-wrap-css": "(echo \"<style>\" && cat ./src/icons.css ./src/style.css | tr -d \"\t\n\r\" && echo -e \"\\n</style>\") > ./minified-wrapped-style.html",
"build:combine-html-css": "sed '/<head>/ r ./minified-wrapped-style.html' ./base-html.html > ./dir-index.html",
"build:remove-unused": "rm ./base-html.html && rm ./minified-wrapped-style.html"
}
}
......@@ -2,26 +2,24 @@
{{ $root := . }}
<html>
<head>
<meta charset="utf-8" />
<meta name="description" content="A directory of files hosted on the distributed, decentralized web using IPFS">
<meta property="og:title" content="Files on IPFS">
<meta property="og:description" content="{{ .Path }}">
<meta property="og:type" content="website">
<meta property="og:image" content="https://gateway.ipfs.io/ipfs/QmSDeYAe9mga6NdTozAZuyGL3Q1XjsLtvX28XFxJH8oPjq">
<meta name="twitter:title" content="{{ .Path }}">
<meta name="twitter:description" content="A directory of files hosted on the distributed, decentralized web using IPFS">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://gateway.ipfs.io/ipfs/QmSDeYAe9mga6NdTozAZuyGL3Q1XjsLtvX28XFxJH8oPjq">
<meta name="twitter:creator" content="@ipfs">
<meta name="twitter:site" content="@ipfs">
<meta name="image" content="https://gateway.ipfs.io/ipfs/QmSDeYAe9mga6NdTozAZuyGL3Q1XjsLtvX28XFxJH8oPjq">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlo89/56ZQ/8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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nxmf/0cpq/9HKav/Rymr/0cpq/83GZ/+inkb/op5GSAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAop5G16KeRv/LxWb/y8Vm/6KeRv+inkaPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAop5G/6KeRtcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/n8AAPgfAADwDwAAwAMAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAwAMAAPAPAAD4HwAA/n8AAA==" />
<!-- TODO: seed these - maybe like the starter ex or the webui? -->
<link rel="stylesheet" href="/ipfs/QmcSfmAKkwYuLeG7kJenVVMSdtnCbtWiioGUyAUZqG7gs7/style.css"/>
<!-- Icon art is https://fileicons.org/ -->
<link rel="stylesheet" href="/ipfs/Qme2SZFZhhgzT4v3d2R87c8KwaozjyqqUrXPzzA85QbGnj/icons.css">
<title>{{ .Path }}</title>
<meta charset="utf-8" />
<meta name="description" content="A directory of files hosted on the distributed, decentralized web using IPFS">
<meta property="og:title" content="Files on IPFS">
<meta property="og:description" content="{{ .Path }}">
<meta property="og:type" content="website">
<meta property="og:image" content="https://gateway.ipfs.io/ipfs/QmSDeYAe9mga6NdTozAZuyGL3Q1XjsLtvX28XFxJH8oPjq">
<meta name="twitter:title" content="{{ .Path }}">
<meta name="twitter:description" content="A directory of files hosted on the distributed, decentralized web using IPFS">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://gateway.ipfs.io/ipfs/QmSDeYAe9mga6NdTozAZuyGL3Q1XjsLtvX28XFxJH8oPjq">
<meta name="twitter:creator" content="@ipfs">
<meta name="twitter:site" content="@ipfs">
<meta name="image" content="https://gateway.ipfs.io/ipfs/QmSDeYAe9mga6NdTozAZuyGL3Q1XjsLtvX28XFxJH8oPjq">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAE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av/Rymr/0cpq/9HKav/Rymr/0cpq/9HKav+inkb/nplD/wAAAAAAAAAAAAAAAKKeRv+3slb/0cpq/9HKav/Rymr/0cpq/9HKav/Rymr/0cpq/9HKav+1sFX/op5G/wAAAAAAAAAAAAAAAAAAAAAAAAAAop5GUKKeRv/Nxmf/0cpq/9HKav/Rymr/0cpq/83GZ/+inkb/op5GSAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAop5G16KeRv/LxWb/y8Vm/6KeRv+inkaPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAop5G/6KeRtcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/n8AAPgfAADwDwAAwAMAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAwAMAAPAPAAD4HwAA/n8AAA==" />
<link rel="stylesheet" href="style.css"/>
<link rel="stylesheet" href="icons.css">
<title>{{ .Path }}</title>
</head>
<body>
<div id="page-header">
......
This diff is collapsed.
body {
color:#34373f;
font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;
font-size:14px;
line-height:1.43;
margin:0;
word-break:break-all;
-webkit-text-size-adjust:100%;
-ms-text-size-adjust:100%;
-webkit-tap-highlight-color:transparent
}
a {
color:#117eb3;
text-decoration:none
}
a:hover {
color:#00b0e9;
text-decoration:underline
}
a:active,
a:visited {
color:#00b0e9
}
strong {
font-weight:700
}
table {
border-collapse:collapse;
border-spacing:0;
max-width:100%;
width:100%
}
table:last-child {
border-bottom-left-radius:3px;
border-bottom-right-radius:3px
}
tr:first-child td {
border-top:0
}
tr:nth-of-type(even) {
background-color:#f7f8fa
}
td {
border-top:1px solid #d9dbe2;
padding:.65em;
vertical-align:top
}
#page-header {
align-items:center;
background:#0b3a53;
border-bottom:4px solid #69c4cd;
color:#fff;
display:flex;
font-size:1.12em;
font-weight:500;
justify-content:space-between;
padding:0 1em
}
#page-header a {
color:#69c4cd
}
#page-header a:active {
color:#9ad4db
}
#page-header a:hover {
color:#fff
}
#page-header-logo {
height:2.25em;
margin:.7em .7em .7em 0;
width:7.15em
}
#page-header-menu {
align-items:center;
display:flex;
margin:.65em 0
}
#page-header-menu div {
margin:0 .6em
}
#page-header-menu div:last-child {
margin:0 0 0 .6em
}
#page-header-menu svg {
fill:#69c4cd;
height:1.8em;
margin-top:.125em
}
#page-header-menu svg:hover {
fill:#fff
}
.menu-item-narrow {
display:none
}
#content {
border:1px solid #d9dbe2;
border-radius:4px;
margin:1em
}
#content-header {
background-color:#edf0f4;
border-bottom:1px solid #d9dbe2;
border-top-left-radius:3px;
border-top-right-radius:3px;
padding:.7em 1em
}
.type-icon,
.type-icon>* {
width:1.15em
}
.no-linebreak {
white-space:nowrap
}
.ipfs-hash {
color:#7f8491;
font-family:monospace
}
@media only screen and (max-width:500px) {
.menu-item-narrow {
display:inline
}
.menu-item-wide {
display:none
}
}
@media print {
#page-header {
display:none
}
#content-header,
.ipfs-hash,
body {
color:#000
}
#content-header {
border-bottom:1px solid #000
}
#content {
border:1px solid #000
}
a,
a:visited {
color:#000;
text-decoration:underline
}
a[href]:after {
content:" (" attr(href) ")"
}
tr {
page-break-inside:avoid
}
tr:nth-of-type(even) {
background-color:transparent
}
td {
border-top:1px solid #000
}
}
@-ms-viewport {
width:device-width
}
.d-flex {
display:flex
}
.flex-wrap {
flex-flow:wrap
}
.flex-shrink-1 {
flex-shrink:1
}
.ml-auto {
margin-left:auto
}
.table-responsive {
display:block;
width:100%;
overflow-x:auto;
-webkit-overflow-scrolling:touch
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment