Skip to content

Commit

Permalink
Merge pull request #1 from hoast/develop
Browse files Browse the repository at this point in the history
Merge develop and upgrade to version 2!
  • Loading branch information
RedKenrok committed Oct 6, 2020
2 parents 5497038 + b1b9b3c commit 426e7d3
Show file tree
Hide file tree
Showing 156 changed files with 9,071 additions and 6,680 deletions.
13 changes: 13 additions & 0 deletions .docs/README.md
@@ -0,0 +1,13 @@
# Docs

## Develop

```
% yarn workspace @hoast/docs run develop
```

## Build

```
% yarn workspace @hoast/docs run build
```
95 changes: 95 additions & 0 deletions .docs/hoast.js
@@ -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
31 changes: 31 additions & 0 deletions .docs/package.json
@@ -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/"
}
}
Binary file added .docs/src/assets/icon-round-128.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .docs/src/assets/icon-round-256.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .docs/src/assets/icon-round-512.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions .docs/src/assets/manifest.json
@@ -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"
}
]
}
78 changes: 78 additions & 0 deletions .docs/src/components/html.js
@@ -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)),
]),
]),
])
},
}
25 changes: 25 additions & 0 deletions .docs/src/pages/index.md
@@ -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)
61 changes: 61 additions & 0 deletions .docs/src/styles/global.css
@@ -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;
}
10 changes: 3 additions & 7 deletions .editorconfig
Expand Up @@ -3,11 +3,7 @@ root = true
[*]
charset = utf-8
end_of_line = lf
indent_style = tab
indent_size = 4
insert_final_newline = false
trim_trailing_whitespace = false

[{*.md,*.json,*.yml}]
indent_style = space
indent_size = 2
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

0 comments on commit 426e7d3

Please sign in to comment.