Skip to content
Merged
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
62 changes: 13 additions & 49 deletions _config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
import Lua from "@tree-sitter-grammars/tree-sitter-lua"
import Markdown from "@tree-sitter-grammars/tree-sitter-markdown"
import YAML from "@tree-sitter-grammars/tree-sitter-yaml"
import cssnano from "cssnano"
import advancedPreset from "cssnano-preset-advanced"
import escapeHtml from "escape-html"
import lume from "lume/mod.ts"
import googleFonts from "lume/plugins/google_fonts.ts"
import jsx from "lume/plugins/jsx.ts"
Expand All @@ -9,25 +15,18 @@ import postcss from "lume/plugins/postcss.ts"
import redirects from "lume/plugins/redirects.ts"
import robots from "lume/plugins/robots.ts"
import sitemap from "lume/plugins/sitemap.ts"
import tailwindcss from "lume/plugins/tailwindcss.ts"
import transformImages from "lume/plugins/transform_images.ts"
import cssnano from "cssnano"
import advancedPreset from "cssnano-preset-advanced"
import escapeHtml from "escape-html"
import variableCompress from "postcss-variable-compress"
import rehypeExternalLinks from "rehype-external-links"
import rehypeRaw from "rehype-raw"
import typography from "@tailwindcss/typography"
import Parser, { type Language } from "tree-sitter"
import Bash from "tree-sitter-bash"
import JSON from "tree-sitter-json"
import Go from "tree-sitter-go"
import Lua from "@tree-sitter-grammars/tree-sitter-lua"
import Markdown from "@tree-sitter-grammars/tree-sitter-markdown"
import YAML from "@tree-sitter-grammars/tree-sitter-yaml"
import HTML from "tree-sitter-html"
import JavaScript from "tree-sitter-javascript"
import JSON from "tree-sitter-json"
import TypeScript from "tree-sitter-typescript"
import tailwindcss from "./src/_plugins/tailwindcss.ts"

const site = lume({
dest: "./public",
Expand Down Expand Up @@ -142,45 +141,9 @@ site.use(mdx({
],
],
}))
site.use(metas())
site.use(minifyHTML())
site.use(redirects())

site.use(tailwindcss({
options: {
plugins: [typography],
theme: {
fontFamily: {
sans: ["Atkinson Hyperlegible", "sans-serif"],
mono: ["monospace"],
},
extend: {
colors: {
"vsc-back": "#1f1f1f",
"vsc-front": "#d4d4d4",
},
content: {
"open-in-new": "url('/icon/open_in_new_16dp_2563EB.svg')",
"open-in-new-dark": "url('/icon/open_in_new_16dp_60A5FA.svg')",
"open-in-new-gray": "url('/icon/open_in_new_16dp_6B7280.svg')",
"open-in-new-gray-dark": "url('/icon/open_in_new_16dp_9CA3AF.svg')",
},
typography: (theme: (s: string) => string) => ({
DEFAULT: {
css: {
"code:not(pre > code)": {
backgroundColor: theme("colors.gray.100"),
borderRadius: "0.25rem",
margin: "0.125rem",
padding: "0.125rem 0.25rem",
},
},
},
}),
},
},
},
}))
site.use(tailwindcss())
site.use(postcss({
plugins: [
cssnano({
Expand All @@ -201,9 +164,8 @@ site.use(robots({
},
],
}))
site.use(transformImages({
extensions: [".jpg", ".jpeg", ".png", ".webp", ".gif"],
}))
site.use(transformImages())
site.add("/img")

site.use(multilanguage({
defaultLanguage: "ja",
Expand All @@ -212,5 +174,7 @@ site.use(multilanguage({
site.use(sitemap({
query: "externalUrl=undefined",
}))
site.use(metas())
site.use(minifyHTML())

export default site
70 changes: 61 additions & 9 deletions deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
{
"tasks": {
"lume": "echo \"import 'lume/cli.ts'\" | deno run -A -",
"build": "deno task lume",
"serve": "deno task lume -s --port 4000",
"lume": {
"description": "Run Lume command",
"command": "deno run -P=lume lume/cli.ts"
},
"build": {
"description": "Build the site for production",
"command": "deno task lume"
},
"serve": {
"description": "Run and serve the site for development",
"command": "deno task lume -s --port 4000"
}
},
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "npm:react@18.3.1",
"jsxImportSourceTypes": "npm:@types/react@18.3.18",
"jsxImportSource": "lume",
"types": [
"lume/types.ts",
"lume/types.ts"
],
"verbatimModuleSyntax": true
},
Expand All @@ -21,7 +29,8 @@
"cssnano": "npm:cssnano@7.1.2",
"cssnano-preset-advanced": "npm:cssnano-preset-advanced@7.0.10",
"escape-html": "npm:escape-html@1.0.3",
"lume/": "https://deno.land/x/lume@v2.5.4/",
"lume/": "https://cdn.jsdelivr.net/gh/lumeland/lume@3.1.3/",
"lume/jsx-runtime": "https://cdn.jsdelivr.net/gh/oscarotero/ssx@0.1.14/jsx-runtime.ts",
"postcss-variable-compress": "npm:postcss-variable-compress@3.0.0",
"rehype-external-links": "npm:rehype-external-links@3.0.0",
"rehype-raw": "npm:rehype-raw@7.0.0",
Expand All @@ -31,9 +40,52 @@
"tree-sitter-html": "npm:tree-sitter-html@0.23.2",
"tree-sitter-javascript": "npm:tree-sitter-javascript@0.23.1",
"tree-sitter-json": "npm:tree-sitter-json@0.24.8",
"tree-sitter-typescript": "npm:tree-sitter-typescript@0.23.2",
"tree-sitter-typescript": "npm:tree-sitter-typescript@0.23.2"
},
"fmt": {
"semiColons": false,
"semiColons": false
},
"permissions": {
"lume": {
"read": true,
"write": [
"./"
],
"import": [
"cdn.jsdelivr.net:443",
"jsr.io:443",
"deno.land:443",
"esm.sh:443"
],
"net": [
"0.0.0.0",
"cdn.jsdelivr.net:443",
"data.jsdelivr.com:443",
"jsr.io:443",
"deno.land:443",
"esm.sh:443",
"registry.npmjs.org:443",
"fonts.googleapis.com:443",
"fonts.gstatic.com:443"
],
"env": true,
"run": true,
"ffi": true,
"sys": true
}
},
"unstable": [
"temporal",
"fmt-component"
],
"lint": {
"plugins": [
"https://cdn.jsdelivr.net/gh/lumeland/lume@3.1.3/lint.ts"
],
"rules": {
"exclude": [
"no-import-prefix"
]
}
}
}
Loading
Loading