File tree 3 files changed +123
-0
lines changed
3 files changed +123
-0
lines changed Original file line number Diff line number Diff line change
1
+ const { DateTime } = require ( "luxon" ) ;
2
+ const readingTime = require ( 'eleventy-plugin-reading-time' )
3
+ const embedEverything = require ( "eleventy-plugin-embed-everything" )
4
+
5
+ const now = new Date ( )
6
+
7
+ module . exports = ( config ) => {
8
+ config . addPlugin ( readingTime )
9
+ config . addPlugin ( embedEverything )
10
+
11
+ // Custom collections
12
+ const livePosts = post => {
13
+ if ( post . data . draft ) return false
14
+ if ( post . inputPath . includes ( 'draft' ) ) return false
15
+ if ( post . date <= now ) return true
16
+ return false
17
+ }
18
+
19
+ config . addCollection ( 'posts' , collection => {
20
+ return collection . getFilteredByGlob ( './posts/*.md' ) . filter ( livePosts ) . reverse ( )
21
+ } )
22
+ config . addCollection ( 'drafts' , collection => {
23
+ return collection . getFilteredByGlob ( './posts/*.md' ) . filter ( _ => ! livePosts ( _ ) ) . reverse ( ) ;
24
+ } )
25
+
26
+ }
Original file line number Diff line number Diff line change
1
+ # Created by https://www.gitignore.io/api/node
2
+ # Edit at https://www.gitignore.io/?templates=node
3
+
4
+ # ## Node ###
5
+ # Logs
6
+ logs
7
+ * .log
8
+ npm-debug.log *
9
+ yarn-debug.log *
10
+ yarn-error.log *
11
+ lerna-debug.log *
12
+
13
+ # Diagnostic reports (https://nodejs.org/api/report.html)
14
+ report. [0-9 ]* . [0-9 ]* . [0-9 ]* . [0-9 ]* .json
15
+
16
+ # Runtime data
17
+ pids
18
+ * .pid
19
+ * .seed
20
+ * .pid.lock
21
+
22
+ # Directory for instrumented libs generated by jscoverage/JSCover
23
+ lib-cov
24
+
25
+ # Coverage directory used by tools like istanbul
26
+ coverage
27
+ * .lcov
28
+
29
+ # nyc test coverage
30
+ .nyc_output
31
+
32
+ # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
33
+ .grunt
34
+
35
+ # Bower dependency directory (https://bower.io/)
36
+ bower_components
37
+
38
+ # node-waf configuration
39
+ .lock-wscript
40
+
41
+ # Compiled binary addons (https://nodejs.org/api/addons.html)
42
+ build /Release
43
+
44
+ # Dependency directories
45
+ node_modules /
46
+ jspm_packages /
47
+
48
+ # TypeScript v1 declaration files
49
+ typings /
50
+
51
+ # TypeScript cache
52
+ * .tsbuildinfo
53
+
54
+ # Optional npm cache directory
55
+ .npm
56
+
57
+ # Optional eslint cache
58
+ .eslintcache
59
+
60
+ # Optional REPL history
61
+ .node_repl_history
62
+
63
+ # Output of 'npm pack'
64
+ * .tgz
65
+
66
+ # Yarn Integrity file
67
+ .yarn-integrity
68
+
69
+ # dotenv environment variables file
70
+ .env
71
+ .env.test
72
+
73
+ # parcel-bundler cache (https://parceljs.org/)
74
+ .cache
75
+
76
+ # next.js build output
77
+ .next
78
+
79
+ # nuxt.js build output
80
+ .nuxt
81
+
82
+ # vuepress build output
83
+ .vuepress /dist
84
+
85
+ # Serverless directories
86
+ .serverless /
87
+
88
+ # FuseBox cache
89
+ .fusebox /
90
+
91
+ # DynamoDB Local files
92
+ .dynamodb /
93
+
94
+ # End of https://www.gitignore.io/api/node
Original file line number Diff line number Diff line change
1
+ # [ ChrisSpiegl.com] ( https://ChrisSpiegl.com )
2
+
3
+ Building a new personal website.
You can’t perform that action at this time.
0 commit comments