Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from hoast/develop
Merge develop and upgrade to version 2!
- Loading branch information
Showing
156 changed files
with
9,071 additions
and
6,680 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Docs | ||
|
||
## Develop | ||
|
||
``` | ||
% yarn workspace @hoast/docs run develop | ||
``` | ||
|
||
## Build | ||
|
||
``` | ||
% yarn workspace @hoast/docs run build | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
import Hoast from '@hoast/hoast' | ||
import ProcessFrontmatter from '@hoast/process-frontmatter' | ||
import ProcessMarkdown from '@hoast/process-markdown' | ||
import ProcessMithril from '@hoast/process-mithril' | ||
import ProcessPostprocess from '@hoast/process-postprocess' | ||
import ProcessWritefiles from '@hoast/process-writefiles' | ||
import SourceReadfiles from '@hoast/source-readfiles' | ||
|
||
const hoast = new Hoast() | ||
.addCollections([ | ||
// Add pages collection. | ||
{ | ||
// Read files from pages directory. | ||
source: new SourceReadfiles({ | ||
directory: 'src/pages', | ||
}), | ||
processes: [ | ||
// Extract frontmatter. | ||
new ProcessFrontmatter(), | ||
// Convert markdown to HTML. | ||
new ProcessMarkdown({ | ||
highlightOptions: {}, | ||
|
||
remarkPlugins: [ | ||
'remark-external-links', | ||
], | ||
}), | ||
// Template using mithril. | ||
new ProcessMithril({ | ||
componentDirectory: 'src/components', | ||
componentPath: 'html.js', | ||
|
||
prefix: '<!DOCTYPE html>', | ||
}), | ||
// Bundle and minify. | ||
new ProcessPostprocess({ | ||
minify: process.env.NODE_ENV === 'production', | ||
|
||
cssPlugins: [ | ||
'postcss-import', | ||
'autoprefixer', | ||
'postcss-preset-env', | ||
], | ||
}), | ||
// Write to filesystem. | ||
new ProcessWritefiles({ | ||
directory: '../docs', | ||
}), | ||
], | ||
}, | ||
|
||
// Add style sheets collection. | ||
{ | ||
source: new SourceReadfiles({ | ||
directory: 'src/styles', | ||
}), | ||
processes: [ | ||
new ProcessPostprocess({ | ||
mode: 'css', | ||
minify: process.env.NODE_ENV === 'production', | ||
|
||
cssPlugins: [ | ||
'postcss-import', | ||
'autoprefixer', | ||
'postcss-preset-env', | ||
], | ||
}), | ||
new ProcessWritefiles({ | ||
directory: '../docs/styles', | ||
}), | ||
], | ||
}, | ||
|
||
// Transfer files from .assets directory over. | ||
{ | ||
source: new SourceReadfiles({ | ||
directory: 'src/assets', | ||
|
||
readOptions: { | ||
encoding: null, | ||
}, | ||
}), | ||
processes: [ | ||
new ProcessWritefiles({ | ||
directory: '../docs/assets', | ||
|
||
writeOptions: { | ||
encoding: null, | ||
}, | ||
}), | ||
], | ||
}, | ||
]) | ||
|
||
export default hoast |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"private": true, | ||
"name": "@hoast/docs", | ||
"version": "0.0.0", | ||
"dependencies": { | ||
"normalize.css": "8.0.1" | ||
}, | ||
"devDependencies": { | ||
"@hoast/hoast": "x", | ||
"@hoast/process-frontmatter": "x", | ||
"@hoast/process-markdown": "x", | ||
"@hoast/process-mithril": "x", | ||
"@hoast/process-postprocess": "x", | ||
"@hoast/process-writefiles": "x", | ||
"@hoast/source-readfiles": "x", | ||
"autoprefixer": "10.0.1", | ||
"mithril": "^2.0.4", | ||
"onchange": "7.0.2", | ||
"postcss-import": "12.0.1", | ||
"postcss-preset-env": "6.7.0", | ||
"remark-external-links": "^7.0.0", | ||
"serve": "11.3.2" | ||
}, | ||
"type": "module", | ||
"scripts": { | ||
"build": "NODE_ENV=production hoast", | ||
"develop": "NODE_ENV=development onchange -i 'hoast.js' 'src/**' -- hoast", | ||
"lint": "eslint --fix --cache *.js src/components/*.js", | ||
"serve": "serve ../docs/" | ||
} | ||
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"start_url": "index.html?utm_source=homescreen", | ||
"name": "Hoast", | ||
"short_name": "Hoast", | ||
"description": "A modular data processor!", | ||
"dir": "ltr", | ||
"lang": "en-GB", | ||
"background_color": "#ffffff", | ||
"theme_color": "#ffffff", | ||
"display": "standalone", | ||
"orientation": "portrait", | ||
"icons": [ | ||
{ | ||
"src": "assets/128.png", | ||
"type": "image/png", | ||
"sizes": "128x128" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import m from 'mithril' | ||
|
||
export default { | ||
view: function ({ attrs }) { | ||
// Get file contents. | ||
const frontmatter = attrs.data.frontmatter | ||
const contents = attrs.data.contents | ||
|
||
// Render component. | ||
return m('html', { | ||
lang: 'en', | ||
}, [ | ||
m('head', [ | ||
// File meta data. | ||
m('meta', { | ||
charset: 'UTF-8', | ||
}), | ||
m('meta', { | ||
name: 'viewport', | ||
content: 'width=device-width, initial-scale=1.0', | ||
}), | ||
|
||
// Page meta data. | ||
m('title', frontmatter.title), | ||
m('meta', { | ||
name: 'description', | ||
content: frontmatter.description, | ||
}), | ||
m('meta', { | ||
name: 'keywords', | ||
content: frontmatter.keywords, | ||
}), | ||
|
||
// Icons. | ||
m('link', { | ||
rel: 'icon', | ||
href: '/assets/icon-round-128.png', | ||
type: 'image/png', | ||
sizes: '128x128', | ||
}), | ||
m('link', { | ||
rel: 'icon', | ||
href: '/assets/icon-round-256.png', | ||
type: 'image/png', | ||
sizes: '256x256', | ||
}), | ||
m('link', { | ||
rel: 'icon', | ||
href: '/assets/icon-round-512.png', | ||
type: 'image/png', | ||
sizes: '512x512', | ||
}), | ||
|
||
// Style sheets. | ||
m('link', { | ||
rel: 'stylesheet', | ||
href: '/styles/global.css', | ||
}), | ||
|
||
m('meta', { | ||
name: 'theme-color', | ||
content: '#ffffff', | ||
}), | ||
]), | ||
|
||
m('body', [ | ||
m('div', { | ||
class: 'container', | ||
}, [ | ||
// Markdown content. | ||
m('div', { | ||
class: 'content', | ||
}, m.trust(contents)), | ||
]), | ||
]), | ||
]) | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
{ | ||
"title": "Hoast, a modular data processor!", | ||
"description": "A simple and modular ecosystem for build automation.", | ||
"keywords": "hoast, modular, data, processor, javascript, static, page, generator" | ||
} | ||
--- | ||
|
||
ʕ ˵•ᴥ•ʔ | ||
|
||
# Hoast | ||
|
||
A simple and modular ecosystem for build automation. | ||
|
||
[Repository](https://www.github.com/hoast/hoast#readme) | ||
|
||
[Examples](https://github.com/hoast/hoast/tree/master/examples#readme) | ||
|
||
[Packages](https://github.com/hoast/hoast/tree/master/packages#readme) | ||
|
||
[Guides](https://github.com/hoast/hoast/tree/master/guides#readme) | ||
|
||
[Contribute](https://github.com/hoast/hoast/blob/master/CONTRIBUTING.md) | ||
|
||
[MIT licensed](https://github.com/hoast/hoast/blob/master/LICENSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
@import 'normalize.css'; | ||
|
||
body { | ||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; | ||
font-weight: 300; | ||
line-height: 2; | ||
} | ||
|
||
a { | ||
font-weight: 600; | ||
} | ||
|
||
h1, h2, h3, h4, h5, h6 { | ||
font-weight: 600; | ||
} | ||
|
||
.container { | ||
position: relative; | ||
display: table; | ||
height: 100vh; | ||
width: 100%; | ||
max-width: 16em; | ||
margin-left: auto; | ||
margin-right: auto; | ||
} | ||
|
||
.container > .content { | ||
display: table-cell; | ||
vertical-align: middle; | ||
padding-top: 0.5em; | ||
padding-bottom: 0.75em; | ||
} | ||
|
||
.content { | ||
padding-left: 2em; | ||
padding-right: 2em; | ||
} | ||
|
||
.content > *:first-child { | ||
margin-top: 0.25em; | ||
margin-bottom: 0.25em; | ||
|
||
font-size: 4em; | ||
font-weight: 400; | ||
text-align: center; | ||
white-space: nowrap; | ||
} | ||
|
||
.content img { | ||
display: block; | ||
margin-left: auto; | ||
margin-right: auto; | ||
} | ||
|
||
.content ul { | ||
padding-left: 1em; | ||
} | ||
|
||
.content ul li { | ||
margin-bottom: 1em; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.