Skip to content

Commit 035a946

Browse files
project init, SHELL of the project
1 parent 00a926e commit 035a946

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+10400
-0
lines changed

.eleventy.js

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
'use strict'
2+
3+
const glob = require('fast-glob')
4+
const path = require('path')
5+
6+
/**
7+
* The @11ty/eleventy configuration.
8+
*
9+
* For a full list of options, see: https://www.11ty.io/docs/config/
10+
*/
11+
module.exports = (eleventyConfig) => {
12+
const paths = {
13+
filters: path.join(process.cwd(), 'lib/filters/*.js'),
14+
shortcodes: path.join(process.cwd(), 'lib/shortcodes/*.js'),
15+
transforms: path.join(process.cwd(), 'lib/transforms/*.js'),
16+
}
17+
const dirs = {
18+
input: 'src',
19+
data: `./_data/`,
20+
includes: `./_includes/`,
21+
layouts: `./_layouts/`,
22+
}
23+
const files = glob.sync(path.join(process.cwd(), dirs.input, '**/*'))
24+
const exts = files
25+
.map((file) => path.extname(file).replace('.', ''))
26+
.filter((value, index, self) => self.indexOf(value) === index) // Removes duplicates, Makes array unique
27+
.filter((it) => !['purs', 'css'].includes(it))
28+
const filters = glob.sync(paths.filters)
29+
const shortcodes = glob.sync(paths.shortcodes)
30+
const transforms = glob.sync(paths.transforms)
31+
32+
// Add all found filters
33+
filters.forEach((filter) =>
34+
eleventyConfig.addFilter(resolveNameFromPath(filter), require(filter))
35+
)
36+
37+
// Add all found shortcodes
38+
shortcodes.forEach((shortcode) => {
39+
const name = resolveNameFromPath(shortcode)
40+
if (name.endsWith('_ctx'))
41+
return eleventyConfig.addPairedShortcode(name, require(shortcode))
42+
else return eleventyConfig.addShortcode(name, require(shortcode))
43+
})
44+
45+
// Add all found transforms
46+
transforms.forEach((transform) =>
47+
eleventyConfig.addTransform(
48+
resolveNameFromPath(transform),
49+
require(transform)
50+
)
51+
)
52+
53+
// Make all files pass through to cache
54+
eleventyConfig.setTemplateFormats(exts)
55+
eleventyConfig.setWatchJavaScriptDependencies(false)
56+
57+
// eleventyConfig.addPassthroughCopy(`${dirs.input}/assets`)
58+
59+
// Because of Purescript pure/ folder we need to ignore it for git but pass it through the 11ty
60+
// .eleventyignore Only source of ignoring files for 11ty
61+
eleventyConfig.setUseGitIgnore(false)
62+
63+
// eleventyConfig.setBrowserSyncConfig({
64+
// notify: true
65+
// });
66+
67+
return {
68+
// Set the path from the root of the deploy domain
69+
// i.e, example.com + "/"
70+
pathPrefix: '/',
71+
72+
// Set the src and output directories
73+
dir: dirs,
74+
75+
// Set the default template engine from `liquid` to `njk`
76+
htmlTemplateEngine: 'njk',
77+
markdownTemplateEngine: 'njk',
78+
dataTemplateEngine: 'njk',
79+
80+
// Set up eleventy to pass-through files to be compiled by Parcel
81+
passthroughFileCopy: true,
82+
}
83+
}
84+
85+
function resolveNameFromPath(pth) {
86+
return path.basename(pth, '.js')
87+
}

.gitignore

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
# Runtime data
9+
pids
10+
*.pid
11+
*.seed
12+
*.pid.lock
13+
14+
# Directory for instrumented libs generated by jscoverage/JSCover
15+
lib-cov
16+
17+
# Coverage directory used by tools like istanbul
18+
coverage
19+
20+
# nyc test coverage
21+
.nyc_output
22+
23+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24+
.grunt
25+
26+
# Bower dependency directory (https://bower.io/)
27+
bower_components
28+
29+
# node-waf configuration
30+
.lock-wscript
31+
32+
# Compiled binary addons (https://nodejs.org/api/addons.html)
33+
build/
34+
35+
# Dependency directories
36+
node_modules/
37+
jspm_packages/
38+
39+
# TypeScript v1 declaration files
40+
typings/
41+
42+
# Optional npm cache directory
43+
.npm
44+
45+
# Optional eslint cache
46+
.eslintcache
47+
48+
# Optional REPL history
49+
.node_repl_history
50+
51+
# Output of 'npm pack'
52+
*.tgz
53+
54+
# Yarn Integrity file
55+
.yarn-integrity
56+
57+
# dotenv environment variables file
58+
.env
59+
60+
# next.js build output
61+
.next
62+
63+
# ignore tern-port anywhere in project
64+
.tern-port
65+
**/.tern-port
66+
67+
# purescript
68+
.pulp-cache/
69+
generated-docs/
70+
.psc-package/
71+
.psc*
72+
.psa*
73+
.spago/
74+
75+
output/
76+
dist/
77+
_site/
78+
.tmp/
79+
util/tailwind-cheatsheet.org
80+
81+
.direnv/

.jsbeautifyrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"indent_size": 2,
3+
"indent_inner_html": true,
4+
"wrap_line_length": 80,
5+
"max_preserve_newlines": 1
6+
}

.postcssrc.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
plugins: [
3+
require('postcss-easy-import'),
4+
require('tailwindcss')('./src/_css/tailwind.config.js'),
5+
require('autoprefixer'),
6+
],
7+
}

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Web
2+
3+
```bash
4+
npm i
5+
```
6+
```bash
7+
npm run dev
8+
```
9+
10+
## If you want to build just run
11+
```bash
12+
npm run build
13+
```

lib/filters/example.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict'
2+
3+
module.exports = (value) => {
4+
// Do something with value
5+
6+
return value
7+
}

lib/filters/json.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
'use strict'
2+
3+
module.exports = (anything) => {
4+
return JSON.stringify(anything)
5+
}

lib/filters/keys.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
'use strict'
2+
3+
module.exports = (ob) => {
4+
return Object.keys(ob)
5+
}

lib/filters/newline.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict'
2+
3+
module.exports = (text) => {
4+
return JSON.parse(
5+
JSON.stringify(text)
6+
.replace(/\\n/gm, '</br>')
7+
.replace(/\\t/gm, '&nbsp;&nbsp;&nbsp;&nbsp;')
8+
)
9+
}

lib/linters/example.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict'
2+
3+
module.exports = (content, inputPath, outputPath) => {
4+
// Review content and log console output if necessary...
5+
// console.warn(`warning message`);
6+
//
7+
// Or throw an error to stop builds!
8+
// throw new Error(`error message`);
9+
}

lib/shortcodes/example.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'use strict'
2+
3+
module.exports = (slot, value) => {
4+
// Do something with value
5+
// Slot is the contents between the shortcode tags when using tag pairs
6+
if (slot) {
7+
return value + slot
8+
}
9+
10+
return value
11+
}

lib/transforms/example.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict'
2+
3+
module.exports = (content, outputPath) => {
4+
// Do something to content...
5+
6+
return content
7+
}

0 commit comments

Comments
 (0)