Skip to content
This repository has been archived by the owner on Oct 23, 2021. It is now read-only.

Blog: All about jotai #7

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
9c82918
Stuff
PuruVJ Jun 18, 2021
936e6cf
Merge branch 'main' of https://github.com/PuruVJ/puruvjdev3-svelte in…
PuruVJ Jun 19, 2021
f53779e
Day 1
PuruVJ Jun 19, 2021
e410296
Merge branch 'main' of https://github.com/PuruVJ/puruvjdev3-svelte in…
PuruVJ Jun 20, 2021
bf817ac
Stuff
PuruVJ Jun 20, 2021
ee3d416
Merge branch 'main' of https://github.com/PuruVJ/puruvjdev3-svelte in…
PuruVJ Jun 21, 2021
7f79278
Day 2
PuruVJ Jun 21, 2021
df860ea
Add small text
PuruVJ Jun 21, 2021
e02d49d
Day 3
PuruVJ Jun 22, 2021
c012b53
Merge branch 'main' of https://github.com/PuruVJ/puruvjdev3-svelte in…
PuruVJ Jun 25, 2021
0d98b1b
Day 4?
PuruVJ Jul 2, 2021
fae51c2
Rename file
PuruVJ Jul 3, 2021
9d92a06
Day 6
PuruVJ Jul 6, 2021
54c3437
Day 8
PuruVJ Jul 9, 2021
d193a9a
stuff
PuruVJ Jul 10, 2021
8fa72fc
Merge branch 'main' of https://github.com/PuruVJ/puruvjdev3-svelte in…
PuruVJ Jul 10, 2021
de273ca
Update with new scripts
PuruVJ Jul 10, 2021
d0c7f26
Day 9
PuruVJ Jul 11, 2021
5d67bb9
Merge branch 'main' of https://github.com/PuruVJ/puruvjdev3-svelte in…
PuruVJ Jul 12, 2021
f4505d4
Build
PuruVJ Jul 12, 2021
b234cf8
Day 10 IG?
PuruVJ Jul 13, 2021
180e9e9
Day 11
PuruVJ Jul 14, 2021
59c819b
Conclude
PuruVJ Jul 14, 2021
a174c2c
New ToC
PuruVJ Jul 15, 2021
fc828fa
Fix contrast of ToC
PuruVJ Jul 15, 2021
9e3f897
Fix path of fonts
PuruVJ Jul 15, 2021
fd9da68
Merge branch 'feat/streamline-image-opt' of https://github.com/PuruVJ…
PuruVJ Jul 15, 2021
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
1,980 changes: 1,979 additions & 1 deletion package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "puruvjdev3",
"version": "0.0.1",
"scripts": {
"start": "svelte-kit dev",
"start": "svelte-kit dev --port 1211",
"prebuild": "cd scripts && esmo prebuild.ts",
"build": "svelte-kit build",
"postbuild": "cd scripts && node postbuild.js & npm run notify:sitemap",
Expand Down
4 changes: 2 additions & 2 deletions scripts/blog-md-html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ export async function blogMDHtml({
document = seriesLinksPlugin(document, seriesPostsList, series, id);
}

document = twemojiPlugin(document);

const toc = generateTOC(document);

document = twemojiPlugin(document);

// Finally
html = document.body.innerHTML;

Expand Down
15 changes: 13 additions & 2 deletions scripts/blog-plugins/generate-toc.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { htmlToText } from 'html-to-text';
import twemoji from 'twemoji';

type TOC = {
indent: number;
Expand All @@ -19,10 +20,20 @@ export function generateTOC(document: Document) {
for (let heading of headingEls) {
const indent = heading.tagName === 'H1' ? 0 : heading.tagName === 'H2' ? 1 : 2;
const id = heading.id;
const title = htmlToText(heading.innerHTML);
const title = htmlToText(heading.innerHTML).replace('#', '');
const length = title.length;

TOCdata.push({ indent, id, title, length });
console.log({ title });

TOCdata.push({
indent,
id,
title: twemoji.parse(title, {
ext: '.svg',
folder: 'svg',
}),
length,
});
}

return TOCdata;
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion scripts/optimize-images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import fetch from 'node-fetch';
import { cloudinary } from './cloudinary.js';
import { ASSETS_ROOT_PATH, RELATIVE_ASSETS_PATH } from './constants';
import { optimizeGif } from './gif-module';
import { imageMarkup, gifMarkup } from './markup';
import { imageMarkup, gifMarkup } from './img-markup';
import { ExportedImagesMetaData } from './types';

/**
Expand Down
Loading