Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

feat: Add treefmt #4

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
40 changes: 20 additions & 20 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import { defineConfig } from 'astro/config';
import { defineConfig } from "astro/config";

import rehypeSanitize from 'rehype-sanitize';
import rehypeStringify from 'rehype-stringify';
import rehypeRaw from 'rehype-raw';
import remarkParse from 'remark-parse';
import remarkRehype from 'remark-rehype';
import rehypeSanitize from "rehype-sanitize";
import rehypeStringify from "rehype-stringify";
import rehypeRaw from "rehype-raw";
import remarkParse from "remark-parse";
import remarkRehype from "remark-rehype";

// https://astro.build/config
export default defineConfig({
markdown: {
remarkRehype: {
allowDangerousHtml: true
// This is fine because we are using rehypeSanitize to sanitize XSS.
// See https://github.com/remarkjs/remark-rehype?tab=readme-ov-file#example-supporting-html-in-markdown-properly
},
remarkPlugins: [
remarkParse,
remarkRehype,
rehypeRaw,
rehypeSanitize,
rehypeStringify,
]
}
markdown: {
remarkRehype: {
allowDangerousHtml: true,
// This is fine because we are using rehypeSanitize to sanitize XSS.
// See https://github.com/remarkjs/remark-rehype?tab=readme-ov-file#example-supporting-html-in-markdown-properly
},
remarkPlugins: [
remarkParse,
remarkRehype,
rehypeRaw,
rehypeSanitize,
rehypeStringify,
],
},
});
35 changes: 35 additions & 0 deletions flake.lock

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

12 changes: 11 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
flake = false;
};

inputs.treefmt-nix.url = "github:numtide/treefmt-nix";

outputs =
inputs:
inputs.snowfall-lib.mkFlake {
Expand All @@ -26,6 +28,14 @@
namespace = "auxolotl--docs-site";
};

outputs-builder = channels: { formatter = channels.nixpkgs.nixfmt-rfc-style; };
outputs-builder =
channels:
let
treefmt = inputs.treefmt-nix.lib.evalModule channels.nixpkgs ./treefmt.nix;
in
{
formatter = treefmt.config.build.wrapper;
checks.formatting = treefmt.config.build.check inputs.self;
};
};
}
2 changes: 1 addition & 1 deletion src/components/Renderer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ const { Content } = await post.render();

<div class="contents">
<Content />
</div>
</div>s
Loading