9 |
10 | Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem
11 | Ipsum has been the industry's standard dummy text ever since the 1500s, when an
12 | unknown printer took a galley of type and scrambled it to make a type specimen
13 | book. It has survived not only five centuries, but also the leap into electronic
14 | typesetting, remaining essentially unchanged. It was popularised in the 1960s
15 | with the release of Letraset sheets containing Lorem Ipsum passages, and more
16 | recently with desktop publishing software like Aldus PageMaker including
17 | versions of Lorem Ipsum.
18 |
--------------------------------------------------------------------------------
/testdata/posts/fifth.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Fifth post
3 | author: CUSTOM AUTHOR NAME
4 | publish_date: 2023-02-17
5 | abstract: This is the fifth post showcasing math rendering
6 | render_math: true
7 | ---
8 |
9 | # Math rendering
10 |
11 | This post showcases math rendering using [KaTeX](https://katex.org/) in
12 | [deno-gfm](https://github.com/denoland/deno-gfm)
13 |
14 | ## Inline math
15 |
16 | Inline math is rendered using `$` delimiters, e.g. `$\sqrt{3x-1}+(1+x)^2$`
17 | renders as $\sqrt{3x-1}+(1+x)^2$ .
18 |
19 | And the letter `i` is rendered as $i$.
20 |
21 | ## Block math
22 |
23 | Block math is rendered using `$$` delimiters, e.g. `$$\sqrt{3x-1}+(1+x)^2$$`
24 | renders as
25 |
26 | $$ \sqrt{3x-1}+(1+x)^2 $$
27 |
28 | ## Math in code blocks
29 |
30 | Math can be rendered in code blocks by using the `math` language tag, e.g.
31 | `math \sqrt{3x-1}+(1+x)^2` renders as
32 |
33 | ```math
34 | \sqrt{3x-1}+(1+x)^2
35 | ```
36 |
37 |
38 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright 2018-2022 the Deno authors
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6 |
7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8 |
9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10 |
--------------------------------------------------------------------------------
/deps.ts:
--------------------------------------------------------------------------------
1 | // Copyright 2022 the Deno authors. All rights reserved. MIT license.
2 |
3 | export { serveDir } from "https://deno.land/std@0.193.0/http/file_server.ts";
4 | export { walk } from "https://deno.land/std@0.193.0/fs/walk.ts";
5 | export {
6 | dirname,
7 | fromFileUrl,
8 | join,
9 | relative,
10 | } from "https://deno.land/std@0.193.0/path/mod.ts";
11 | export {
12 | type ConnInfo,
13 | serve,
14 | } from "https://deno.land/std@0.193.0/http/mod.ts";
15 | export { extract as frontMatter } from "https://deno.land/std@0.193.0/front_matter/any.ts";
16 |
17 | export * as gfm from "jsr:@deno/gfm@0.10.0";
18 | export { Fragment, h } from "https://deno.land/x/htm@0.1.3/mod.ts";
19 | export {
20 | default as html,
21 | type HtmlOptions,
22 | type VNode,
23 | } from "https://deno.land/x/htm@0.1.3/html.tsx";
24 | import UnoCSS from "https://deno.land/x/htm@0.1.3/plugins/unocss.ts";
25 | import ColorScheme from "https://deno.land/x/htm@0.1.3/plugins/color-scheme.ts";
26 |
27 | export {
28 | createReporter,
29 | type Reporter as GaReporter,
30 | } from "https://deno.land/x/g_a@0.1.2/mod.ts";
31 | export { default as callsites } from "https://raw.githubusercontent.com/kt3k/callsites/v1.0.0/mod.ts";
32 | export { Feed, type Item as FeedItem } from "https://esm.sh/feed@4.2.2";
33 | export { default as removeMarkdown } from "https://esm.sh/remove-markdown@0.5.0";
34 |
35 | // Add syntax highlighting support for C by default
36 | import "https://esm.sh/prismjs@1.29.0/components/prism-c?no-check";
37 |
38 | export { ColorScheme, UnoCSS };
39 | export type UnoConfig = typeof UnoCSS extends (
40 | arg: infer P | undefined,
41 | ) => unknown ? P
42 | : never;
43 |
--------------------------------------------------------------------------------
/testdata/posts/first.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: First post
3 | publish_date: 2022-03-20
4 | abstract: This is the first post.
5 | cover_html:
6 | ---
7 |
8 | It was popularised in the 1960s with the release of Letraset sheets containing
9 | Lorem Ipsum passages, and more recently with desktop publishing software like
10 | Aldus PageMaker including versions of Lorem Ipsum.
11 |
12 |
13 |
14 | Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem
15 | Ipsum has been the industry's standard dummy text ever since the 1500s, when an
16 | unknown printer took a galley of type and scrambled it to make a type specimen
17 | book. It has survived not only five centuries, but also the leap into electronic
18 | typesetting, remaining essentially unchanged. It was popularised in the 1960s
19 | with the release of Letraset sheets containing Lorem Ipsum passages, and more
20 | recently with desktop publishing software like Aldus PageMaker including
21 | versions of Lorem Ipsum.
22 |
23 | ## Usage
24 |
25 | ```js
26 | import blog from "https://deno.land/x/blog/blog.tsx";
27 |
28 | blog({
29 | author: "Dino",
30 | title: "My Blog",
31 | description: "The blog description.",
32 | avatar: "https://deno-avatar.deno.dev/avatar/blog.svg",
33 | avatarClass: "rounded-full",
34 | links: [
35 | { title: "Email", url: "mailto:bot@deno.com" },
36 | { title: "GitHub", url: "https://github.com/denobot" },
37 | { title: "Twitter", url: "https://twitter.com/denobot" },
38 | ],
39 | });
40 | ```
41 |
42 | $100, $200, $300, $400, $500
43 |
--------------------------------------------------------------------------------
/testdata/posts/third.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Third post
3 | author: CUSTOM AUTHOR NAME
4 | publish_date: 2022-08-19
5 | abstract: This is the third post.
6 | allow_iframes: true
7 | ---
8 |
9 |
10 |
11 | Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem
12 | Ipsum has been the industry's standard dummy text ever since the 1500s, when an
13 | unknown printer took a galley of type and scrambled it to make a type specimen
14 | book. It has survived not only five centuries, but also the leap into electronic
15 | typesetting, remaining essentially unchanged. It was popularised in the 1960s
16 | with the release of Letraset sheets containing Lorem Ipsum passages, and more
17 | recently with desktop publishing software like Aldus PageMaker including
18 | versions of Lorem Ipsum.
19 |
20 | Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem
21 | Ipsum has been the industry's standard dummy text ever since the 1500s, when an
22 | unknown printer took a galley of type and scrambled it to make a type specimen
23 | book. It has survived not only five centuries, but also the leap into electronic
24 | typesetting, remaining essentially unchanged. It was popularised in the 1960s
25 | with the release of Letraset sheets containing Lorem Ipsum passages, and more
26 | recently with desktop publishing software like Aldus PageMaker including
27 | versions of Lorem Ipsum.
28 |
29 | Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem
30 | Ipsum has been the industry's standard dummy text ever since the 1500s, when an
31 | unknown printer took a galley of type and scrambled it to make a type specimen
32 | book. It has survived not only five centuries, but also the leap into electronic
33 | typesetting, remaining essentially unchanged. It was popularised in the 1960s
34 | with the release of Letraset sheets containing Lorem Ipsum passages, and more
35 | recently with desktop publishing software like Aldus PageMaker including
36 | versions of Lorem Ipsum.
37 |
38 | Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem
39 | Ipsum has been the industry's standard dummy text ever since the 1500s, when an
40 | unknown printer took a galley of type and scrambled it to make a type specimen
41 | book. It has survived not only five centuries, but also the leap into electronic
42 | typesetting, remaining essentially unchanged. It was popularised in the 1960s
43 | with the release of Letraset sheets containing Lorem Ipsum passages, and more
44 | recently with desktop publishing software like Aldus PageMaker including
45 | versions of Lorem Ipsum.
46 |
--------------------------------------------------------------------------------
/types.d.ts:
--------------------------------------------------------------------------------
1 | // Copyright 2022 the Deno authors. All rights reserved. MIT license.
2 |
3 | import type { ConnInfo, UnoConfig, VNode } from "./deps.ts";
4 |
5 | export interface BlogContext {
6 | state: BlogState;
7 | connInfo: ConnInfo;
8 | next: () => Promise