Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions lib/ppt.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Pptxgen from 'pptxgenjs';
import slugify from '@sindresorhus/slugify';

function toPlainText(blocks = []) {
return (
Expand All @@ -18,17 +19,6 @@ function toPlainText(blocks = []) {
);
}

function slugify(text) {
return text
.toString()
.toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^w-]+/g, '') // Remove all non-word chars
.replace(/--+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}

const backgroundImages = {
pca: [
{path: '/static/ppts/bgimg.jpg'},
Expand Down
37 changes: 37 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"@sanity/block-content-to-react": "^2.0.7",
"@sanity/client": "^1.150.7",
"@sanity/image-url": "^0.140.22",
"@sindresorhus/slugify": "^1.1.0",
"@stripe/react-stripe-js": "^1.2.2",
"@stripe/stripe-js": "^1.12.1",
"@theme-ui/color": "^0.3.5",
Expand Down