Skip to content

Commit 562466d

Browse files
authored
Merge pull request #9 from milan-codes/dev
Content collections
2 parents f5d4030 + b6f31fa commit 562466d

46 files changed

Lines changed: 481 additions & 201 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bunx --no -- commitlint --edit $1

.prettierrc.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// .prettierrc.mjs
2+
/** @type {import("prettier").Config} */
3+
export default {
4+
plugins: ["prettier-plugin-astro"],
5+
overrides: [
6+
{
7+
files: "*.astro",
8+
options: {
9+
parser: "astro",
10+
},
11+
},
12+
],
13+
};

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# milan-codes.github.io
22

3-
My personal portfolio and blog, built using Astro, Svelte, and Tailwind. 👨‍💻
3+
My personal portfolio and blog, built using Astro, and Tailwind. 👨‍💻
44

55
This is my personal portfolio and blog template. It allows you to create blog posts using Markdown, display math expressions using [KaTeX](https://katex.org/), and includes analytics integration with [Plausible](https://plausible.io/), as well as a dark theme.
66

@@ -27,7 +27,7 @@ This is my personal portfolio and blog template. It allows you to create blog po
2727
### Displaying Math Expressions
2828

2929
- To display math expressions using KaTeX, wrap the LaTeX code within `$$` symbols in your Markdown files.
30-
Example: `$$E = mc^2$$`
30+
Example: `$$E = mc^2$$`
3131
- Note that the displayed formulas might be too large for their containers. This might make the blog post's page unresponsive on certain devices. To avoid this, wrap the given formula in a `<div class="overflow-x-scroll"> ... </div>` container. You can see examples of this in the blog posts in this repository.
3232

3333
### Analytics Integration with Plausible

astro.config.mjs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
import { defineConfig } from 'astro/config';
1+
import { defineConfig } from "astro/config";
22

33
// https://astro.build/config
4-
import tailwind from '@astrojs/tailwind';
4+
import tailwind from "@astrojs/tailwind";
55

66
// https://astro.build/config
7-
import partytown from '@astrojs/partytown';
8-
import { remarkReadingTime } from './remark-reading-time.mjs';
7+
import partytown from "@astrojs/partytown";
8+
import { remarkReadingTime } from "./remark-reading-time.mjs";
99

1010
// https://astro.build/config
1111
export default defineConfig({
1212
integrations: [
1313
tailwind(),
1414
partytown({
1515
config: {
16-
forward: ['dataLayer.push'],
16+
forward: ["dataLayer.push"],
1717
},
1818
}),
1919
],
2020
markdown: {
21-
remarkPlugins: ['remark-math', remarkReadingTime],
22-
rehypePlugins: ['rehype-katex'],
21+
remarkPlugins: ["remark-math", remarkReadingTime],
22+
rehypePlugins: ["rehype-katex"],
2323
},
2424
});

bun.lockb

70.9 KB
Binary file not shown.

commitlint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default { extends: ['@commitlint/config-conventional'] };

eslint.config.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import eslintPluginAstro from "eslint-plugin-astro";
2+
import tseslint from "typescript-eslint";
3+
import astroEslintParser from "astro-eslint-parser";
4+
import globals from "globals";
5+
import js from "@eslint/js";
6+
import typescriptParser from "@typescript-eslint/parser";
7+
export default [
8+
js.configs.recommended,
9+
...eslintPluginAstro.configs.recommended,
10+
...tseslint.configs.recommended,
11+
{
12+
languageOptions: {
13+
globals: {
14+
...globals.browser,
15+
...globals.node,
16+
},
17+
},
18+
},
19+
{
20+
files: ["**/*.astro"],
21+
languageOptions: {
22+
parser: astroEslintParser,
23+
parserOptions: {
24+
parser: "@typescript-eslint/parser",
25+
extraFileExtensions: [".astro"],
26+
},
27+
},
28+
},
29+
{
30+
files: ["**/*.{js,jsx,astro}"],
31+
rules: {
32+
"no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
33+
},
34+
},
35+
{
36+
files: ["**/*.{ts,tsx}", "**/*.astro/*.js"],
37+
languageOptions: {
38+
parser: typescriptParser,
39+
},
40+
},
41+
{
42+
ignores: [".astro/**"],
43+
},
44+
];

package.json

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,40 @@
11
{
2-
"name": "@example/basics",
2+
"name": "milan-codes.github.io",
33
"type": "module",
4-
"version": "0.0.1",
4+
"version": "1.0.0",
55
"private": true,
66
"scripts": {
77
"dev": "astro dev",
88
"start": "astro dev",
99
"build": "astro build",
1010
"preview": "astro preview",
11-
"astro": "astro"
11+
"astro": "astro",
12+
"lint": "eslint .",
13+
"prepare": "husky"
1214
},
1315
"dependencies": {
14-
"@astrojs/partytown": "^1.2.3",
15-
"@astrojs/tailwind": "^3.0.1",
16-
"astro": "^3.0.10",
16+
"@astrojs/partytown": "^2.1.2",
17+
"@astrojs/tailwind": "^5.1.2",
18+
"astro": "^4.16.8",
1719
"mdast-util-to-string": "^4.0.0",
1820
"reading-time": "^1.5.0",
19-
"tailwindcss": "^3.0.24"
21+
"tailwindcss": "^3.4.14"
2022
},
2123
"devDependencies": {
22-
"@tailwindcss/typography": "^0.5.9",
23-
"rehype-katex": "^6.0.3",
24-
"rehype-mathjax": "^4.0.2",
25-
"remark-math": "^5.1.1"
24+
"@commitlint/cli": "^19.5.0",
25+
"@commitlint/config-conventional": "^19.5.0",
26+
"@eslint/js": "^9.13.0",
27+
"@tailwindcss/typography": "^0.5.15",
28+
"@typescript-eslint/parser": "^8.12.2",
29+
"astro-eslint-parser": "^1.0.3",
30+
"eslint": "^9.13.0",
31+
"eslint-plugin-astro": "^1.3.0",
32+
"husky": "^9.1.6",
33+
"prettier": "^3.3.3",
34+
"prettier-plugin-astro": "^0.14.1",
35+
"rehype-katex": "^7.0.1",
36+
"rehype-mathjax": "^6.0.0",
37+
"remark-math": "^6.0.0",
38+
"typescript-eslint": "^8.12.2"
2639
}
2740
}

remark-reading-time.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ export function remarkReadingTime() {
55
return function (tree, { data }) {
66
const textOnPage = toString(tree);
77
const readingTime = getReadingTime(textOnPage);
8-
data.astro.frontmatter.minutesRead = readingTime.text;
8+
data.astro.frontmatter.readingTime = readingTime.text;
99
};
1010
}
File renamed without changes.

0 commit comments

Comments
 (0)