Skip to content

Commit

Permalink
refactor(#304): move files into src folder
Browse files Browse the repository at this point in the history
  • Loading branch information
carbontwelve committed Dec 13, 2023
1 parent d4d0748 commit 8e4eb79
Show file tree
Hide file tree
Showing 628 changed files with 76 additions and 17 deletions.
12 changes: 10 additions & 2 deletions .eleventy.js
Expand Up @@ -25,7 +25,7 @@ module.exports = function (eleventyConfig) {
`./public/fonts/iosevka-etoile-bold.woff2`,
`./public/fonts/iosevka-etoile-bolditalic.woff2`,
],
dist: './fonts',
dist: './src/fonts',
enabled: process.env.ELEVENTY_ENV !== 'production',
cache: new ObjectCache('font-subsetting'),
});
Expand All @@ -35,7 +35,8 @@ module.exports = function (eleventyConfig) {
similar: {
'Game Development': ['GameDev'],
'Retro Computing': ['RetroComputing'],
'Node JS': ['Node']
'Node JS': ['Node'],
'365 Day Project': ['365DayProject']
},
slugify,
});
Expand Down Expand Up @@ -124,4 +125,11 @@ module.exports = function (eleventyConfig) {

eleventyConfig.setLibrary('md', require('./lib/helpers/markdown'));

return {
dir: {
input: "src",
output: "_site"
}
};

};
8 changes: 4 additions & 4 deletions lib/collections.js
@@ -1,7 +1,7 @@
const {setupMarkdownIt, parseCollectionHashtags} = require ('./helpers/hashtags');
const {chunk} = require('./helpers')
const {slugify, padStart, specialTagMeta} = require("./filters");
const listData = require('../_data/lists-meta');
const listData = require('../src/_data/lists-meta');

// This function returns a reducer function for paginating custom taxonomy such as
// the content types used in this digital garden.
Expand Down Expand Up @@ -45,8 +45,8 @@ const md = setupMarkdownIt(require('markdown-it')());
module.exports = function loadCollection(eleventyConfig) {
// Filter draft posts when deployed into production
const post = (collection) => ((process.env.ELEVENTY_ENV !== 'production')
? [...collection.getFilteredByGlob('./content/**/*.md')]
: [...collection.getFilteredByGlob('./content/**/*.md')].filter((post) => !post.data.draft)
? [...collection.getFilteredByGlob('./src/content/**/*.md')]
: [...collection.getFilteredByGlob('./src/content/**/*.md')].filter((post) => !post.data.draft)
).map(parseCollectionHashtags(md, eleventyConfig.globalData.tagAtlas));

// Written for #20, this creates a collection of all tags
Expand Down Expand Up @@ -176,7 +176,7 @@ module.exports = function loadCollection(eleventyConfig) {
return carry;
}, new Map()).values());

const nowUpdates = (collection) => [...collection.getFilteredByGlob('./now/*.md')
const nowUpdates = (collection) => [...collection.getFilteredByGlob('./src/now/*.md')
.filter((post) => !post.data.draft)];

const collectSpecialTaggedContent = (prefix, collection) => Array.from(
Expand Down
4 changes: 2 additions & 2 deletions lib/filters.js
@@ -1,6 +1,6 @@
const {toTitleCase, strToSlug} = require('./helpers');
const metadata = require('../_data/metadata');
const listData = require('../_data/lists-meta');
const metadata = require('../src/_data/metadata');
const listData = require('../src/_data/lists-meta');
const readingTime = require('reading-time');
const {DateTime} = require('luxon');
const path = require('path');
Expand Down
2 changes: 1 addition & 1 deletion lib/helpers/hashtags.js
Expand Up @@ -9,7 +9,7 @@ module.exports = {
});

md.renderer.rules.hashtag_open = (tokens, idx) =>
`<a href="/topic/${atlas().find(tokens[idx].content).slug}" class="tag">`;
`<a href="/topic/${atlas().findOrCreateByTitle(tokens[idx].content).slug}" class="tag">`;

return md;
},
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion _data/bookwyrm.js → src/_data/bookwyrm.js
@@ -1,4 +1,4 @@
const ObjectCache = require("../lib/helpers/cache");
const ObjectCache = require("../../lib/helpers/cache");
const fetch = require("node-fetch");
const chalk = require("chalk");

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,4 +1,4 @@
<aside>
<aside class="citation">
{% block content %}{% endblock %}
{% if cite.href %}
<small>&mdash; <a href="{{ cite.href }}">{{ cite.name }}</a> | <a href="{{ page.url }}">notes</a></small>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,4 +1,4 @@
const {slugify, ogImageFromSlug} = require('../lib/filters');
const {slugify, ogImageFromSlug} = require('../../lib/filters');

module.exports = {
featured: false,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 8e4eb79

Please sign in to comment.