blazed-past-us 0.7.8 → 0.7.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/.github/workflows/main.yml +43 -0
  2. package/blazed-past-us-0.7.8.tgz +0 -0
  3. package/dist/runtime/render.js +1 -1
  4. package/dist/server/parse-markdown.js +1 -0
  5. package/dist/server/server-utils.d.ts +2 -1
  6. package/dist/server/server-utils.js +23 -2
  7. package/dist/template/package-lock.json +408 -442
  8. package/dist/template/package.json +1 -1
  9. package/dist/template/public/images/surfer.jpg +0 -0
  10. package/dist/template/src/config.json +2 -2
  11. package/dist/template/src/posts/registry.json +1 -1
  12. package/dist/template/src/posts/the-inspiration-and-architecture.md +49 -0
  13. package/dist/template/src/styles/fonts.css +13 -13
  14. package/dist/template/src/styles/main.css +6 -0
  15. package/dist/template/src/styles/post.css +1 -1
  16. package/dist/template/src/svgs/client-side-runtime.svg +4 -0
  17. package/dist/template/src/svgs/server-side-arch.svg +4 -0
  18. package/dist/template/src/svgs/surfer.svg +2551 -0
  19. package/package.json +2 -2
  20. package/dist/template/src/posts/this-is-a-post-title.md +0 -11
  21. /package/dist/template/{src/assets/favicon.svg → favicon.svg} +0 -0
  22. /package/dist/template/src/{assets/fonts → fonts}/Bangers-Regular.ttf +0 -0
  23. /package/dist/template/src/{assets/fonts → fonts}/Inter_28pt-Bold.ttf +0 -0
  24. /package/dist/template/src/{assets/fonts → fonts}/Inter_28pt-BoldItalic.ttf +0 -0
  25. /package/dist/template/src/{assets/fonts → fonts}/Inter_28pt-ExtraBold.ttf +0 -0
  26. /package/dist/template/src/{assets/fonts → fonts}/Inter_28pt-ExtraBoldItalic.ttf +0 -0
  27. /package/dist/template/src/{assets/fonts → fonts}/Inter_28pt-Italic.ttf +0 -0
  28. /package/dist/template/src/{assets/fonts → fonts}/Inter_28pt-Light.ttf +0 -0
  29. /package/dist/template/src/{assets/fonts → fonts}/Inter_28pt-Medium.ttf +0 -0
  30. /package/dist/template/src/{assets/fonts → fonts}/Inter_28pt-Regular.ttf +0 -0
  31. /package/dist/template/src/{assets/fonts → fonts}/MerriweatherSans-Bold.ttf +0 -0
  32. /package/dist/template/src/{assets/fonts → fonts}/MerriweatherSans-Italic.ttf +0 -0
  33. /package/dist/template/src/{assets/fonts → fonts}/MerriweatherSans-Light.ttf +0 -0
  34. /package/dist/template/src/{assets/fonts → fonts}/MerriweatherSans-Regular.ttf +0 -0
  35. /package/dist/template/src/{assets/fonts → fonts}/PTSerifCaption-Regular.ttf +0 -0
  36. /package/dist/template/src/{assets/fonts → fonts}/PermanentMarker-Regular.ttf +0 -0
  37. /package/dist/template/src/{assets/svgs → svgs}/intersection.svg +0 -0
@@ -0,0 +1,43 @@
1
+ name: deploy to Github pages
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ permissions:
9
+ contents: read
10
+ pages: write
11
+ id-token: write
12
+ deployments: write
13
+
14
+ jobs:
15
+ build-deploy:
16
+ runs-on: ubuntu-latest
17
+ defaults:
18
+ run:
19
+ working-directory: ./src/template
20
+
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+
24
+ - uses: actions/setup-node@v4
25
+ with:
26
+ node-version: 24
27
+
28
+ - run: npm i
29
+ - run: npm run build
30
+
31
+ - uses: actions/upload-pages-artifact@v3
32
+ with:
33
+ path: ./src/template/dist
34
+
35
+ - uses: actions/deploy-pages@v4
36
+
37
+ - name: Create Deployment Record
38
+ uses: chrnorm/deployment-action@v2
39
+ with:
40
+ token: ${{ secrets.GITHUB_TOKEN }}
41
+ environment: github-pages
42
+ environment-url: https://gass-git.github.io/blazed-past-us/
43
+ ref: main
Binary file
@@ -2,7 +2,7 @@ import { postExists, inject } from './utils.js';
2
2
  function render(view, root, views, postsMetadata, postsHTML, postTagsFilter, postSlug) {
3
3
  const r = root;
4
4
  const { home, post, notFound } = views;
5
- // start from the very top on each render.
5
+ // start from the very top on every render.
6
6
  window.scrollTo(0, 0);
7
7
  switch (view) {
8
8
  case 'home':
@@ -21,6 +21,7 @@ async function parseMarkdown(_path) {
21
21
  const remarkResult = await remark()
22
22
  .use(remarkParse)
23
23
  .use(remarkInlineSvg)
24
+ /* .use(remarkImages) */
24
25
  .use(remarkRehype, { allowDangerousHtml: true })
25
26
  .use(rehypePrettyCode, {
26
27
  theme: JSON.parse(readFileSync(path.join(root, 'src/code-block-theme.json'), 'utf-8')),
@@ -7,5 +7,6 @@ declare function getPostsRegistry(postsDirectoryPath: string): Promise<void | Po
7
7
  declare function copyRecursive(src: string, destination: string): void;
8
8
  declare function log(msg: string, color: MsgColor): void;
9
9
  declare const remarkInlineSvg: Plugin<[], Root, Root>;
10
+ declare const remarkImages: Plugin<[], Root, Root>;
10
11
  declare function sortPostsByNewest(postsMetadata: PostMetadata[]): PostMetadata[];
11
- export { postNotInRegistry, handlePostsRegistryUpdate, getPostsRegistry, copyRecursive, log, remarkInlineSvg, sortPostsByNewest, };
12
+ export { postNotInRegistry, handlePostsRegistryUpdate, getPostsRegistry, copyRecursive, log, remarkInlineSvg, sortPostsByNewest, remarkImages, };
@@ -80,7 +80,7 @@ const remarkInlineSvg = function () {
80
80
  if (index === undefined || !parent)
81
81
  return;
82
82
  try {
83
- const svgPath = path.resolve(baseDirectory, `./src/assets/svgs/${node.url}`);
83
+ const svgPath = path.resolve(baseDirectory, `./src/svgs/${node.url}`);
84
84
  const svgContent = fs.readFileSync(svgPath, 'utf8');
85
85
  parent.children[index] = {
86
86
  type: 'html',
@@ -93,7 +93,28 @@ const remarkInlineSvg = function () {
93
93
  });
94
94
  };
95
95
  };
96
+ const remarkImages = function () {
97
+ const baseDirectory = process.cwd();
98
+ return function transformer(tree) {
99
+ visit(tree, 'image', (node, index, parent) => {
100
+ if (node.url?.endsWith('.svg'))
101
+ return;
102
+ if (index === undefined || !parent)
103
+ return;
104
+ try {
105
+ const imagePath = path.resolve(baseDirectory, `./src/assets/images/${node.url}`);
106
+ parent.children[index] = {
107
+ type: 'html',
108
+ value: `<div align="center"><img src="${imagePath}"></div>`,
109
+ };
110
+ }
111
+ catch (error) {
112
+ console.warn(error);
113
+ }
114
+ });
115
+ };
116
+ };
96
117
  function sortPostsByNewest(postsMetadata) {
97
118
  return postsMetadata.sort((a, b) => b.created.localeCompare(a.created));
98
119
  }
99
- export { postNotInRegistry, handlePostsRegistryUpdate, getPostsRegistry, copyRecursive, log, remarkInlineSvg, sortPostsByNewest, };
120
+ export { postNotInRegistry, handlePostsRegistryUpdate, getPostsRegistry, copyRecursive, log, remarkInlineSvg, sortPostsByNewest, remarkImages, };