Skip to content

Commit 0c3a064

Browse files
committed
Initial commit
0 parents  commit 0c3a064

File tree

170 files changed

+13632
-0
lines changed

Some content is hidden

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

170 files changed

+13632
-0
lines changed

.eleventy.js

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
const syntaxHighlight = require('@11ty/eleventy-plugin-syntaxhighlight')
2+
const markdownIt = require('markdown-it')
3+
const markdownItAnchor = require('markdown-it-anchor')
4+
const markdownItImageSize = require('@jochenlinnemann/markdown-it-imsize')
5+
const eleventyNavigationPlugin = require('@11ty/eleventy-navigation')
6+
7+
module.exports = function(eleventyConfig) {
8+
// Don't use .gitignore otherwise the CSS won't copy over on compile
9+
eleventyConfig.setUseGitIgnore(false)
10+
11+
// add navigation plugin
12+
eleventyConfig.addPlugin(eleventyNavigationPlugin)
13+
14+
// pass through images in section
15+
eleventyConfig.addPassthroughCopy("src/pages/**/*.jpg");
16+
eleventyConfig.addPassthroughCopy("src/pages/**/*.png");
17+
eleventyConfig.addPassthroughCopy("src/pages/**/*.gif");
18+
19+
// add `data-copy` to all code highlights for copy button
20+
eleventyConfig.addPlugin(syntaxHighlight, {
21+
preAttributes: {
22+
'data-copy': '',
23+
},
24+
alwaysWrapLineHighlights: true,
25+
})
26+
27+
// pass img assets through
28+
eleventyConfig.addPassthroughCopy({ "src/_eleventy/assets/img": "assets/img" })
29+
30+
// pass favicons etc through
31+
eleventyConfig.addPassthroughCopy({ "src/_eleventy/assets/favicons": "./" })
32+
33+
// only the minified css and js is needed
34+
eleventyConfig.addPassthroughCopy({ "src/_eleventy/assets/css/dist.min.css": "assets/css/dist.min.css" })
35+
eleventyConfig.addPassthroughCopy({ "src/_eleventy/assets/js/dist.min.js": "assets/js/dist.min.js" })
36+
37+
// Add markdown plugins
38+
eleventyConfig.setLibrary("md", markdownIt({
39+
html: true,
40+
breaks: true,
41+
linkify: true,
42+
}).use(markdownItAnchor, { // Add anchors to headings
43+
permalink: true,
44+
permalinkClass: 'heading-anchor',
45+
permalinkSymbol: '#',
46+
level: 2,
47+
}).use(markdownItImageSize)) // support image sizes ![image](image.jpg =100x100))
48+
49+
// Custom renderers for navigation, breadcrumbs, and TOC
50+
eleventyConfig.addFilter("renderNavigation", require('./src/_eleventy/_filters/renderers/renderNavigation.js'))
51+
eleventyConfig.addFilter("renderToc", require('./src/_eleventy/_filters/renderers/renderTOC/BuildTOC'))
52+
53+
// ordered list of pages with index to get order and title from a url
54+
eleventyConfig.addCollection("pages", require('./src/_eleventy/_filters/collections/pages.js'));
55+
56+
// extracts all links (web only, ignores images) from pages
57+
eleventyConfig.addCollection("linkData", require('./src/_eleventy/_filters/collections/links.js'));
58+
59+
// Stringify an object
60+
// usage {{ myObject | objectDebug | safe }}
61+
eleventyConfig.addFilter('objectDebug', function(value) {
62+
return `<pre>${JSON.stringify(value, '', 2)}</pre>`
63+
})
64+
65+
return {
66+
passthroughFileCopy: true,
67+
dir: {
68+
input: "src/pages",
69+
output: "public",
70+
includes: "../_eleventy/_includes",
71+
data: "../_eleventy/_data"
72+
}
73+
}
74+
}

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FATHOM_API_KEY='your-key-here'

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules
2+
public
3+
src/_eleventy/assets/css/dist.min.css
4+
src/_eleventy/assets/js/dist.min.js
5+
fathom_cache.json
6+
.env
7+
.cache
8+
src/_eleventy/_data/config.json

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
14.7

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Intersect
2+
3+
<img src="src/_eleventy/assets/img/logos/logo.svg" style="width:150px;height:150px" alt="Intersect Logo">
4+
5+
A personal wiki built with [Eleventy](https://11ty.dev).
6+
7+
Demo: [http://intersect.rknight.me](http://intersect.rknight.me)
8+
9+
To paraphrase [Andy Bell](https://github.com/andy-piccalilli/11ty-base):
10+
11+
> Please don’t submit issues or PRs. I’m just sharing this for other people to make thier own wikis. This isn’t open source: just free.
12+
13+
If there's some huge breaking issue, then by all means file an issue and let me know but I'll only be building features I want which is unlikely to be the same features any one else wants.
14+
15+
## Basic Usage
16+
17+
All pages are stored in `src/pages` so put your pages in here. These must be markdown for the headings ID links to work but they can, in theory, be `njk` or anything else Eleventy supports.
18+
19+
For more information on installation and customisation [visit the expanded readme page](https://intersect.rknight.me/meta/readme).

gulpfile.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
const gulp = require('gulp'),
2+
{ watch, parallel } = require('gulp'),
3+
minifyCSS = require('gulp-minify-css'),
4+
concat = require('gulp-concat'),
5+
prefix = require('gulp-autoprefixer'),
6+
uglify = require('gulp-uglify')
7+
8+
const CSS_FILES = [
9+
'./src/_eleventy/assets/css/*.css',
10+
'!./src/_eleventy/assets/css/dist.min.css'
11+
]
12+
13+
const JS_FILES = [
14+
'./src/_eleventy/assets/js/*.js',
15+
'!./src/_eleventy/assets/js/dist.min.js'
16+
]
17+
18+
function styles(cb) {
19+
return gulp.src(CSS_FILES)
20+
.pipe(concat('dist.min.css'))
21+
.pipe(minifyCSS())
22+
.pipe(prefix('last 2 versions'))
23+
.pipe(gulp.dest('./src/_eleventy/assets/css'))
24+
}
25+
26+
function scripts(cb)
27+
{
28+
return gulp.src(JS_FILES)
29+
.pipe(concat('dist.min.js'))
30+
.pipe(uglify())
31+
.pipe(gulp.dest('./src/_eleventy/assets/js'));
32+
}
33+
34+
const watcher = () => {
35+
watch(CSS_FILES, { ignoreInitial: true }, styles)
36+
watch(JS_FILES, { ignoreInitial: true }, scripts)
37+
}
38+
39+
exports.default = parallel(styles, scripts)
40+
exports.watch = watcher;

0 commit comments

Comments
 (0)