├── .changeset ├── README.md └── config.json ├── .devcontainer ├── .gitignore ├── Dockerfile ├── _gitconfig.local └── devcontainer.json ├── .editorconfig ├── .eslintignore ├── .eslintrc.cjs ├── .github └── workflows │ └── release.yml ├── .gitignore ├── .markdownlint.json ├── .npmrc ├── .prettierignore ├── .prettierrc ├── .vscode ├── extensions.json ├── launch.json └── settings.json ├── README.md ├── apps └── astro-m2dx │ ├── .eslintrc.cjs │ ├── .gitignore │ ├── .markdownlint.yml │ ├── .npmrc │ ├── README.md │ ├── astro.config.mjs │ ├── netlify.toml │ ├── package.json │ ├── postcss.config.cjs │ ├── public │ ├── astro.svg │ ├── favicon.png │ └── favicon.svg │ ├── src │ ├── @content │ │ ├── _components.ts │ │ ├── _frontmatter.yaml │ │ ├── blog │ │ │ ├── include-directives │ │ │ │ ├── index.mdx │ │ │ │ └── partial.mdx │ │ │ ├── index.mdx │ │ │ └── working-with-images │ │ │ │ ├── index.mdx │ │ │ │ └── snapshot.webp │ │ ├── gallery │ │ │ ├── _components.ts │ │ │ ├── adam-miller-dBaz0xhCkPY-unsplash.jpg │ │ │ ├── bradley-dunn-amF7lbfzLj0-unsplash.jpg │ │ │ ├── bradley-dunn-i8qs7bfTB0M-unsplash.jpg │ │ │ ├── edgar-moran-LboRnt38jpA-unsplash.jpg │ │ │ ├── elia-pellegrini-C54fuJ5E8YU-unsplash.jpg │ │ │ ├── elia-pellegrini-ZFnCkbhFvhw-unsplash.jpg │ │ │ ├── elia-pellegrini-gasB30pgsg0-unsplash.jpg │ │ │ ├── elia-pellegrini-onwHGWNbPD0-unsplash.jpg │ │ │ ├── history-in-hd-e5eDHbmHprg-unsplash.jpg │ │ │ ├── index.mdx │ │ │ ├── jonas-verstuyft-flsFQ3UTuKw-unsplash.jpg │ │ │ ├── levi-stute-mFF39sOZSgM-unsplash.jpg │ │ │ ├── linus-sandvide-bhSNKT5aaMc-unsplash.jpg │ │ │ ├── mike-kiev-Opzk_hvwO9Q-unsplash.jpg │ │ │ ├── nasa-5e9CmF-Ge9Y-unsplash.jpg │ │ │ ├── nick-brunner-LXspKUjsgH0-unsplash.jpg │ │ │ └── nicolas-lobos-NR_tXTuyTak-unsplash.jpg │ │ ├── home │ │ │ ├── astronaut.jpg │ │ │ ├── christian.png │ │ │ └── index.mdx │ │ └── old-docs │ │ │ └── index.mdx │ ├── components │ │ ├── BlogList │ │ │ ├── index.astro │ │ │ └── index.ts │ │ ├── CTA │ │ │ ├── CTA.astro │ │ │ └── index.ts │ │ ├── Card │ │ │ ├── Card.astro │ │ │ └── index.ts │ │ ├── FancyCard │ │ │ └── FancyCard.astro │ │ ├── GalleryImage │ │ │ ├── index.astro │ │ │ └── index.ts │ │ ├── Heading │ │ │ ├── Heading2.astro │ │ │ ├── Heading3.astro │ │ │ └── index.ts │ │ ├── Quote │ │ │ ├── Quote.astro │ │ │ ├── index.ts │ │ │ └── style.css │ │ ├── Signature │ │ │ ├── Signature.svg │ │ │ ├── index.astro │ │ │ └── index.ts │ │ └── Wrap │ │ │ ├── Wrap.astro │ │ │ └── index.ts │ ├── config.ts │ ├── env.d.ts │ ├── icons │ │ ├── m2dx-ondark.svg │ │ └── m2dx.svg │ ├── layouts │ │ ├── BaseLayout │ │ │ ├── BaseLayout.astro │ │ │ ├── Head.astro │ │ │ ├── OpenGraph.astro │ │ │ ├── TwitterCard.astro │ │ │ └── index.ts │ │ ├── MarkdownLayout │ │ │ ├── MarkdownLayout.astro │ │ │ └── index.ts │ │ └── PageLayout │ │ │ ├── Footer.astro │ │ │ ├── Header.astro │ │ │ ├── PageLayout.astro │ │ │ └── index.ts │ ├── pages │ │ ├── blog │ │ │ ├── [...slug].astro │ │ │ └── index.astro │ │ ├── gallery.astro │ │ ├── index.astro │ │ └── old-docs.astro │ ├── styles │ │ ├── base │ │ │ └── sections.css │ │ ├── components │ │ │ ├── aside.css │ │ │ ├── card.css │ │ │ ├── footer.css │ │ │ ├── header.css │ │ │ ├── image-gallery.css │ │ │ ├── page-layout.css │ │ │ └── wrap.css │ │ ├── tailwind.css │ │ └── utilities │ │ │ └── text.css │ └── utils │ │ └── slugs.ts │ ├── tailwind.config.cjs │ └── tsconfig.json ├── config ├── eslint-config-base │ ├── index.cjs │ └── package.json └── tsconfig │ ├── README.md │ ├── package.json │ ├── tsconfig.base.json │ ├── tsconfig.strictest.json │ └── tsconfig.utils.json ├── internal ├── utils-mdast │ ├── package.json │ ├── src │ │ ├── createJsxElement.ts │ │ ├── createProgram.ts │ │ ├── index.ts │ │ ├── loadVFile.ts │ │ └── parseEsm.ts │ └── tsconfig.json ├── utils-test │ ├── .gitignore │ ├── package.json │ ├── src │ │ ├── cases.spec.ts │ │ ├── deepMerge.spec.ts │ │ ├── isObjectLike.spec.ts │ │ ├── path.spec.ts │ │ ├── shortHash.spec.ts │ │ └── splitting.spec.ts │ └── tsconfig.json └── utils │ ├── package.json │ ├── src │ ├── ObjectLike.ts │ ├── deepMerge.ts │ ├── fill.ts │ ├── fillDigits.ts │ ├── filters.ts │ ├── fs │ │ └── index.ts │ ├── getCallerLocation.ts │ ├── getLocation.ts │ ├── index.ts │ ├── path.ts │ ├── print.ts │ ├── shortHash.ts │ ├── text │ │ ├── cases.ts │ │ ├── index.ts │ │ └── splitting.ts │ └── truncate.ts │ └── tsconfig.json ├── package.json ├── packages ├── astro-art-direction │ ├── CHANGELOG.md │ ├── README.md │ ├── lib │ │ ├── ArtDirection.ts │ │ ├── Picture.astro │ │ ├── PictureProps.ts │ │ ├── applyArtDirection.ts │ │ ├── aspectRatio.ts │ │ ├── classList.ts │ │ ├── defaultArtDirection.ts │ │ ├── getPicture.ts │ │ ├── index.ts │ │ ├── limitAspectRatio.ts │ │ ├── limitWidths.ts │ │ ├── reexport.ts │ │ └── resolveSrc.ts │ ├── package.json │ └── tsconfig.json ├── astro-m2dx-image │ ├── CHANGELOG.md │ ├── README.md │ ├── architecture.md │ ├── lib │ │ ├── Image.astro │ │ ├── Picture.astro │ │ ├── index.ts │ │ ├── internal.ts │ │ └── types.ts │ ├── package.json │ └── tsconfig.json ├── astro-m2dx │ ├── .gitignore │ ├── .mintest │ │ └── .gitignore │ ├── CHANGELOG.md │ ├── README.md │ ├── fixtures │ │ ├── componentDirectives │ │ │ └── _directives.ts │ │ ├── includeDirective │ │ │ └── hello-world.mdx │ │ ├── mergeFrontmatter │ │ │ ├── d1 │ │ │ │ ├── _frontmatter.yaml │ │ │ │ └── d11 │ │ │ │ │ ├── _frontmatter.yaml │ │ │ │ │ └── d111 │ │ │ │ │ └── _frontmatter.yaml │ │ │ └── relativePaths │ │ │ │ ├── _frontmatter.yaml │ │ │ │ ├── logo.png │ │ │ │ └── sub │ │ │ │ └── _frontmatter.yaml │ │ └── relativeImages │ │ │ ├── _components-2.ts │ │ │ ├── _components-3.ts │ │ │ └── test.png │ ├── package.json │ ├── relative-images.png │ ├── src │ │ ├── Exports │ │ │ ├── Exports.spec.ts │ │ │ ├── Exports.ts │ │ │ └── index.ts │ │ ├── autoImports │ │ │ ├── findUnresolved.spec.ts │ │ │ ├── findUnresolved.ts │ │ │ └── index.ts │ │ ├── componentDirectives │ │ │ ├── index.spec.ts │ │ │ └── index.ts │ │ ├── env.d.ts │ │ ├── exportComponents │ │ │ ├── findExportInMdx.ts │ │ │ ├── index.spec.ts │ │ │ └── index.ts │ │ ├── identifyImages │ │ │ └── index.ts │ │ ├── includeDirective │ │ │ ├── index.spec.ts │ │ │ └── index.ts │ │ ├── index.ts │ │ ├── mergeFrontmatter │ │ │ ├── index.spec.ts │ │ │ └── index.ts │ │ ├── normalizePaths │ │ │ ├── index.spec.ts │ │ │ └── index.ts │ │ ├── relativeImages │ │ │ ├── index.spec.ts │ │ │ └── index.ts │ │ ├── scanTitleAndAbstract │ │ │ ├── index.spec.ts │ │ │ └── index.ts │ │ ├── styleDirectives │ │ │ ├── index.spec.ts │ │ │ └── index.ts │ │ ├── types │ │ │ └── VFile.ts │ │ └── unwrapImages │ │ │ └── index.ts │ └── tsconfig.json ├── estree-typeguards │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ ├── src │ │ ├── exports.ts │ │ ├── index.ts │ │ └── typeguards.ts │ └── tsconfig.json ├── m2dx-utils │ ├── .gitignore │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ ├── src │ │ ├── createJsxElement.ts │ │ ├── createProgram.spec.ts │ │ ├── createProgram.ts │ │ ├── embeddedHast.spec.ts │ │ ├── embeddedHast.ts │ │ ├── env.d.ts │ │ ├── estree.spec.ts │ │ ├── estree.ts │ │ ├── find.ts │ │ ├── findAllImages.spec.ts │ │ ├── findAllImages.ts │ │ ├── findAllImportSpecifiers.spec.ts │ │ ├── findAllImportSpecifiers.ts │ │ ├── findAllJsxElements.spec.ts │ │ ├── findAllJsxElements.ts │ │ ├── index.ts │ │ ├── mdast.spec.ts │ │ ├── mdast.ts │ │ ├── parseEsm.spec.ts │ │ ├── parseEsm.ts │ │ ├── parseMdx.spec.ts │ │ ├── parseMdx.ts │ │ ├── rehype.ts │ │ ├── toText.spec.ts │ │ ├── toText.ts │ │ ├── visit.spec.ts │ │ └── visit.ts │ └── tsconfig.json ├── mdast-typeguards │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ ├── src │ │ ├── abstract-typeguards.ts │ │ ├── basic-typeguards.ts │ │ ├── content-typeguards.ts │ │ ├── directives.ts │ │ ├── exports.ts │ │ ├── index.ts │ │ ├── mdx-exports.ts │ │ ├── mdx-typeguards.ts │ │ ├── mixins.ts │ │ └── node.ts │ └── tsconfig.json ├── mdast-util-hast │ ├── .gitignore │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ ├── src │ │ └── index.ts │ └── tsconfig.json ├── mintest-green │ ├── .gitignore │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ ├── src │ │ ├── assert │ │ │ ├── arrayContaining.ts │ │ │ ├── index.ts │ │ │ ├── objectContaining.spec.ts │ │ │ ├── objectContaining.ts │ │ │ ├── snapshot.spec.ts │ │ │ └── snapshot.ts │ │ ├── bin.ts │ │ ├── describe │ │ │ ├── Fn.ts │ │ │ ├── Result.ts │ │ │ ├── Suite.ts │ │ │ ├── createSuite.ts │ │ │ └── index.ts │ │ ├── index.ts │ │ ├── mintest.spec.ts │ │ ├── run │ │ │ └── index.ts │ │ └── samples │ │ │ └── sample1.ts │ └── tsconfig.json ├── pre-visit │ ├── .gitignore │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ ├── src │ │ ├── index.spec.ts │ │ └── index.ts │ └── tsconfig.json ├── remark-class-directive │ ├── .gitignore │ ├── .mintest │ │ └── .gitignore │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ ├── src │ │ ├── index.spec.ts │ │ └── index.ts │ └── tsconfig.json ├── remark-enhance-frontmatter │ ├── .gitignore │ ├── .mintest │ │ └── .gitignore │ ├── CHANGELOG.md │ ├── README.md │ ├── fixtures │ │ ├── d1 │ │ │ ├── _frontmatter.yaml │ │ │ ├── d11 │ │ │ │ ├── _frontmatter.yaml │ │ │ │ └── d111 │ │ │ │ │ ├── _frontmatter.yaml │ │ │ │ │ └── test.md │ │ │ └── test.md │ │ ├── d2 │ │ │ └── test.md │ │ └── relativePaths │ │ │ ├── _frontmatter.yaml │ │ │ ├── logo.png │ │ │ └── sub │ │ │ ├── _frontmatter.yaml │ │ │ └── test.md │ ├── package.json │ ├── src │ │ ├── index.spec.ts │ │ └── index.ts │ └── tsconfig.json ├── remark-mdx-imports │ ├── .gitignore │ ├── .mintest │ │ └── .gitignore │ ├── CHANGELOG.md │ ├── README.md │ ├── fixtures │ │ ├── _components.ts │ │ └── sub │ │ │ ├── _components.ts │ │ │ └── test.mdx │ ├── package.json │ ├── src │ │ ├── findExports.ts │ │ ├── index.spec.ts │ │ └── index.ts │ └── tsconfig.json ├── remark-mdx-includes │ ├── .gitignore │ ├── CHANGELOG.md │ ├── README.md │ ├── fixtures │ │ ├── partial.mdx │ │ └── sub │ │ │ ├── section.mdx │ │ │ └── test.mdx │ ├── package.json │ ├── src │ │ ├── index.spec.ts │ │ └── index.ts │ └── tsconfig.json ├── remark-mdx-mappings │ ├── .gitignore │ ├── .mintest │ │ └── .gitignore │ ├── CHANGELOG.md │ ├── README.md │ ├── fixtures │ │ ├── _components.ts │ │ └── sub │ │ │ ├── _components.ts │ │ │ └── test.mdx │ ├── package.json │ ├── src │ │ ├── index.spec.ts │ │ └── index.ts │ └── tsconfig.json ├── remark-normalize-paths │ ├── .gitignore │ ├── .mintest │ │ └── .gitignore │ ├── CHANGELOG.md │ ├── README.md │ ├── fixtures │ │ ├── foo │ │ │ ├── bar.md │ │ │ └── test-image.jpg │ │ └── test-link.md │ ├── package.json │ ├── src │ │ ├── index.spec.ts │ │ └── index.ts │ └── tsconfig.json └── remark-sectionize-headings │ ├── .gitignore │ ├── .mintest │ └── .gitignore │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ ├── src │ ├── index.spec.ts │ └── index.ts │ └── tsconfig.json ├── pnpm-lock.yaml ├── pnpm-workspace.yaml └── turbo.json /.changeset/README.md: -------------------------------------------------------------------------------- 1 | # Changesets 2 | 3 | Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works 4 | with multi-package repos, or single-package repos to help you version and publish your code. You can 5 | find the full documentation for it [in our repository](https://github.com/changesets/changesets) 6 | 7 | We have a quick list of common questions to get you started engaging with this project in 8 | [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) 9 | -------------------------------------------------------------------------------- /.changeset/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://unpkg.com/@changesets/config@2.1.1/schema.json", 3 | "changelog": ["@changesets/changelog-github", {"repo": "christian-hackyourshack/npm"}], 4 | "commit": false, 5 | "fixed": [], 6 | "linked": [], 7 | "access": "public", 8 | "baseBranch": "main", 9 | "updateInternalDependencies": "patch", 10 | "ignore": ["@app/*"] 11 | } 12 | -------------------------------------------------------------------------------- /.devcontainer/.gitignore: -------------------------------------------------------------------------------- 1 | .gitconfig.local 2 | -------------------------------------------------------------------------------- /.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gitpod/workspace-node 2 | 3 | USER root 4 | 5 | # [Optional] Uncomment this section to install additional OS packages. 6 | RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ 7 | && apt-get -y install --no-install-recommends \ 8 | ruby-full 9 | 10 | USER gitpod 11 | 12 | # [Optional] Uncomment if you want to install an additional version of node using nvm 13 | # ARG EXTRA_NODE_VERSION=10 14 | # RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}" 15 | 16 | # [Optional] Uncomment if you want to install more global node packages 17 | ARG NODE_MODULES="" 18 | RUN umask 0002 \ 19 | && npm cache clean --force > /dev/null 2>&1 \ 20 | && npm install -g npm@latest ${NODE_MODULES} \ 21 | && npm cache clean --force > /dev/null 2>&1 22 | # RUN su node -c "npm install -g " 23 | 24 | # Setup gitconfig to be installed from dotfiles 25 | RUN find /home/gitpod/.gitconfig -delete 26 | ADD .gitconfig.local /home/gitpod/.gitconfig.local 27 | -------------------------------------------------------------------------------- /.devcontainer/_gitconfig.local: -------------------------------------------------------------------------------- 1 | # Fill in your credentials and rename to .gitconfig.local 2 | [user] 3 | name = AUTHORNAME 4 | email = AUTHOREMAIL 5 | [credential] 6 | helper = GIT_CREDENTIAL_HELPER 7 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: 2 | // https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/typescript-node 3 | { 4 | "name": "Astro", 5 | 6 | "build": { 7 | "dockerfile": "Dockerfile", 8 | "args": { 9 | "NODE_MODULES": "typescript pnpm@latest" 10 | } 11 | }, 12 | 13 | "customizations": { 14 | "vscode": { 15 | "extensions": [ 16 | "astro-build.astro-vscode", 17 | "brunnerh.insert-unicode", 18 | "davidanson.vscode-markdownlint", 19 | "dbaeumer.vscode-eslint", 20 | "editorconfig.editorconfig", 21 | "esbenp.prettier-vscode", 22 | "jock.svg", 23 | "yzhang.markdown-all-in-one" 24 | ] 25 | } 26 | }, 27 | 28 | "settings": { 29 | "dotfiles.repository": "christian-hackyourshack/dotfiles", 30 | "dotfiles.targetPath": "~/.dotfiles", 31 | "dotfiles.installCommand": "~/.dotfiles/script/bootstrap", 32 | "emmet.includeLanguages": { 33 | "postcss": "css" 34 | }, 35 | "terminal.integrated.defaultProfile.linux": "zsh", 36 | "terminal.integrated.profiles.linux": { 37 | "zsh": { 38 | "path": "zsh", 39 | "args": ["-l"] 40 | } 41 | } 42 | } 43 | 44 | // Use 'forwardPorts' to make a list of ports inside the container available locally. 45 | // "forwardPorts": [], 46 | 47 | // Use 'postCreateCommand' to run commands after the container is created. 48 | // "postCreateCommand": "pnpm setup && pnpm install -g pnpm@latest && pnpm install" 49 | 50 | // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. 51 | // "remoteUser": "gitpod" 52 | } 53 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # https://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | [*] 7 | charset = utf-8 8 | end_of_line = lf 9 | indent_size = 2 10 | indent_style = space 11 | insert_final_newline = true 12 | max_line_length = 100 13 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | CHANGELOG.md 2 | -------------------------------------------------------------------------------- /.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | // This tells ESLint to load the config from the package `eslint-config-base` 4 | extends: ['base'], 5 | settings: {}, 6 | }; 7 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | defaults: 9 | run: 10 | shell: bash 11 | 12 | env: 13 | CI: true 14 | 15 | concurrency: ${{ github.workflow }}-${{ github.ref }} 16 | 17 | jobs: 18 | release: 19 | name: Create PR or release to NPM 20 | runs-on: ubuntu-latest 21 | steps: 22 | - name: Checkout sources 23 | uses: actions/checkout@v3 24 | 25 | - name: Setup pnpm 26 | uses: pnpm/action-setup@v2.2.4 27 | with: 28 | version: 8 29 | 30 | - name: Setup node.js 31 | uses: actions/setup-node@v3 32 | with: 33 | node-version: 16 34 | cache: 'pnpm' 35 | 36 | - name: Install dependencies 37 | run: pnpm install --frozen-lockfile 38 | 39 | - name: Build packages 40 | run: pnpm run release:build 41 | 42 | - name: Check packages 43 | run: pnpm run release:check 44 | 45 | - name: Prepare .npmrc for publishing on npm 46 | run: | 47 | cat << EOF > "$HOME/.npmrc" 48 | //registry.npmjs.org/:_authToken=$NPM_TOKEN 49 | EOF 50 | env: 51 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }} 52 | 53 | - name: Update versions or publish 54 | id: changesets 55 | uses: changesets/action@v1 56 | with: 57 | version: pnpm run release:version 58 | publish: pnpm run release:publish 59 | commit: '[ci] release' 60 | title: '[ci] release' 61 | env: 62 | GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} 63 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }} 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | node_modules 5 | .pnp 6 | .pnp.js 7 | .pnpm-store 8 | 9 | # testing 10 | coverage 11 | 12 | # next.js 13 | .next/ 14 | out/ 15 | dist/ 16 | build 17 | 18 | # misc 19 | .DS_Store 20 | *.pem 21 | 22 | # debug 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | .pnpm-debug.log* 27 | 28 | # local env files 29 | .env.local 30 | .env.development.local 31 | .env.test.local 32 | .env.production.local 33 | 34 | # turbo 35 | .turbo 36 | -------------------------------------------------------------------------------- /.markdownlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "MD013": false, 3 | "MD024": false 4 | } 5 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | auto-install-peers=true 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | **/dist 2 | **/node_modules 3 | 4 | /.pnpm-store 5 | /pnpm-lock.yaml 6 | 7 | /.changeset 8 | CHANGELOG.md 9 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "plugins": ["./node_modules/prettier-plugin-astro"], 4 | "overrides": [ 5 | { 6 | "files": "CHANGELOG.md", 7 | "options": { "plugins": [] } 8 | }, 9 | { 10 | "files": "**/*.astro", 11 | "options": { "parser": "astro" } 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["csstools.postcss", "formulahendry.auto-rename-tag", "unifiedjs.vscode-mdx"] 3 | } 4 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "[astro]": { 3 | "editor.defaultFormatter": "astro-build.astro-vscode" 4 | }, 5 | "editor.defaultFormatter": "esbenp.prettier-vscode", 6 | "editor.formatOnSave": true, 7 | "editor.minimap.maxColumn": 100, 8 | "editor.tabSize": 2, 9 | "markdown.extension.toc.levels": "2..6", 10 | "prettier.printWidth": 100, 11 | "svg.preview.background": "dark-transparent", 12 | "terminal.integrated.cursorWidth": 3, 13 | "[typescript]": { 14 | "editor.defaultFormatter": "vscode.typescript-language-features" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Shackhacker Christian's Public Packages 2 | 3 | This is the monorepo, that I use to maintain my public NPM packages. 4 | 5 | Find the packages in [./packages](./packages/). 6 | Internal configuration packages can be found at [./config](./config/). 7 | 8 | Some packages have dedicated websites for their documentation, find their sources at [./apps](./apps/). 9 | 10 | ## Development 11 | 12 | For development I use a VS Code [.devcontainer](./.devcontainer/) 13 | 14 | Happy Hacking, 15 | Christian 16 | -------------------------------------------------------------------------------- /apps/astro-m2dx/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: ['base'], 4 | }; 5 | -------------------------------------------------------------------------------- /apps/astro-m2dx/.gitignore: -------------------------------------------------------------------------------- 1 | # build output 2 | dist/ 3 | .output/ 4 | 5 | # dependencies 6 | node_modules/ 7 | 8 | # logs 9 | npm-debug.log* 10 | yarn-debug.log* 11 | yarn-error.log* 12 | pnpm-debug.log* 13 | 14 | 15 | # environment variables 16 | .env 17 | .env.production 18 | 19 | # macOS-specific files 20 | .DS_Store 21 | -------------------------------------------------------------------------------- /apps/astro-m2dx/.markdownlint.yml: -------------------------------------------------------------------------------- 1 | default: true 2 | MD013: false 3 | MD025: false 4 | MD026: false 5 | MD033: false 6 | MD034: false 7 | MD041: false 8 | MD045: false 9 | -------------------------------------------------------------------------------- /apps/astro-m2dx/.npmrc: -------------------------------------------------------------------------------- 1 | # Expose Astro dependencies for `pnpm` users 2 | shamefully-hoist=true 3 | -------------------------------------------------------------------------------- /apps/astro-m2dx/README.md: -------------------------------------------------------------------------------- 1 | # Welcome to astro-m2dx 2 | 3 | These are the sources for the site https://astro-m2dx.netlify.app, documenting the remark plugin for clean Markdown in the context of Astro site-generation. 4 | -------------------------------------------------------------------------------- /apps/astro-m2dx/astro.config.mjs: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'astro/config'; 2 | 3 | import image from '@astrojs/image'; 4 | import mdx from '@astrojs/mdx'; 5 | import tailwind from '@astrojs/tailwind'; 6 | import remarkClassDirective from 'remark-class-directive'; 7 | import remarkDirective from 'remark-directive'; 8 | import remarkEnhanceFrontmatter from 'remark-enhance-frontmatter'; 9 | import remarkMdxImports from 'remark-mdx-imports'; 10 | import remarkMdxIncludes from 'remark-mdx-includes'; 11 | import remarkMdxMappings from 'remark-mdx-mappings'; 12 | import remarkNormalizePaths from 'remark-normalize-paths'; 13 | import remarkSectionizeHeadings from 'remark-sectionize-headings'; 14 | import remarkUnwrapImages from 'remark-unwrap-images'; 15 | 16 | /** @type {import('remark-enhance-frontmatter').Options} */ 17 | const frontmatterOptions = { 18 | resolvePaths: true, 19 | title: true, 20 | transform: [ 21 | (frontmatter, vfile) => { 22 | frontmatter.rawmdx = vfile.value; 23 | }, 24 | ], 25 | }; 26 | 27 | /** @type {import('remark-sectionize-headings').Options} */ 28 | const sectionizeOptions = { 29 | addClass: 'section', 30 | levels: [2], 31 | }; 32 | 33 | /** @type {import('@astrojs/image').IntegrationOptions} */ 34 | const imageOptions = { 35 | serviceEntryPoint: '@astrojs/image/sharp', 36 | }; 37 | 38 | /** @type {import('@astrojs/mdx').MdxOptions} */ 39 | const mdxOptions = { 40 | remarkPlugins: [ 41 | [remarkEnhanceFrontmatter, frontmatterOptions], 42 | [remarkSectionizeHeadings, sectionizeOptions], 43 | remarkUnwrapImages, 44 | remarkDirective, 45 | remarkClassDirective, 46 | remarkMdxIncludes, 47 | remarkNormalizePaths, 48 | remarkMdxImports, 49 | remarkMdxMappings, 50 | ], 51 | }; 52 | 53 | // https://astro.build/config 54 | export default defineConfig({ 55 | integrations: [image(imageOptions), mdx(mdxOptions), tailwind()], 56 | }); 57 | -------------------------------------------------------------------------------- /apps/astro-m2dx/netlify.toml: -------------------------------------------------------------------------------- 1 | [build.environment] 2 | NODE_VERSION = "16" 3 | NPM_FLAGS = "--version" 4 | [build] 5 | base = "apps/astro-m2dx/" 6 | publish = "./dist" 7 | command = "npx pnpm i --store=node_modules/.pnpm-store --frozen-lockfile && npx pnpm run build:ci" 8 | -------------------------------------------------------------------------------- /apps/astro-m2dx/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@app/astro-m2dx", 3 | "type": "module", 4 | "version": "0.0.0", 5 | "private": true, 6 | "scripts": { 7 | "astro": "astro", 8 | "build:ci": "pnpm run -w build", 9 | "build": "astro build", 10 | "clean": "rimraf -rf ./dist/", 11 | "dev": "astro dev", 12 | "preview": "astro preview" 13 | }, 14 | "dependencies": { 15 | "@astrojs/image": "^0.17.1", 16 | "@astrojs/mdx": "^0.19.7", 17 | "@astrojs/tailwind": "^4.0.0", 18 | "@tailwindcss/typography": "^0.5.9", 19 | "astro-art-direction": "workspace:*", 20 | "astro-icon": "^0.8.1", 21 | "astro": "^2.7.0", 22 | "hastscript": "^7.2.0", 23 | "postcss-import": "^15.1.0", 24 | "remark-class-directive": "workspace:*", 25 | "remark-directive": "^2.0.1", 26 | "remark-enhance-frontmatter": "workspace:*", 27 | "remark-mdx-imports": "workspace:*", 28 | "remark-mdx-includes": "workspace:*", 29 | "remark-mdx-mappings": "workspace:*", 30 | "remark-normalize-paths": "workspace:*", 31 | "remark-sectionize-headings": "workspace:*", 32 | "remark-unwrap-images": "^3.0.1", 33 | "sharp": "^0.32.1", 34 | "tailwind-merge": "^1.13.2", 35 | "tailwindcss": "^3.3.2", 36 | "unist-util-visit": "^4.1.2" 37 | }, 38 | "devDependencies": { 39 | "eslint-config-base": "workspace:*", 40 | "rimraf": "^5.0.1", 41 | "shiki": "^0.14.2" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /apps/astro-m2dx/postcss.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | 'postcss-import': {}, 4 | tailwindcss: {}, 5 | autoprefixer: {}, 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /apps/astro-m2dx/public/astro.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | -------------------------------------------------------------------------------- /apps/astro-m2dx/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christian-hackyourshack/npm/eb9ad2f5ae6ae60b961c2fa4387d9006f1a33b9d/apps/astro-m2dx/public/favicon.png -------------------------------------------------------------------------------- /apps/astro-m2dx/src/@content/_components.ts: -------------------------------------------------------------------------------- 1 | export { BlogList } from '@components/BlogList'; 2 | export { Card } from '@components/Card'; 3 | export { Code } from 'astro/components'; 4 | export { CTA } from '@components/CTA'; 5 | export { Quote } from '@components/Quote'; 6 | export { Signature } from '@components/Signature'; 7 | export { Wrap } from '@components/Wrap'; 8 | 9 | import { Picture } from 'astro-art-direction'; 10 | 11 | export const components = { 12 | img: Picture, 13 | }; 14 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/@content/_frontmatter.yaml: -------------------------------------------------------------------------------- 1 | layout: '@layouts/MarkdownLayout' 2 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/@content/blog/include-directives/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | lastUpdate: 2022-12-02 3 | --- 4 | 5 | # Include directives `::include` 6 | 7 | ::include[./partial.mdx]{.foobar} 8 | 9 | ## Applying style to included partials 10 | 11 | The `::include` directive now allows to apply CSS classes to included partials 12 | 13 | ```mdx 14 | ::include[./partial.mdx]{.my-class} 15 | ``` 16 | 17 | The included partial will now be wrapped in a div with the specified class `my-class`. 18 | 19 | Of course, it would be nicer to apply the class to the imported root element, but that is currently not possible in Astro. 20 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/@content/blog/include-directives/partial.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | layout: 3 | --- 4 | 5 | ## Basics 6 | 7 | I distinguish between normal MDX files, and the ones that I plan to include and call the latter `partials`. 8 | 9 | I do that, because the `:include`-directive cannot simply copy the file content, but it has to work in the MDX-world and imports the included file and renders it. Hence, it is rendered as it is imported, and as such, usually it should not have a layout. 10 | 11 | That is, why you'll find this kind of frontmatter in my included files 12 | 13 | ```mdx 14 | --- 15 | layout: 16 | --- 17 | 18 | ## My Partial 19 | 20 | ... 21 | ``` 22 | 23 | Of course, you could do that globally, if you put all your partials in a common directory, add a file `_frontmatter.yaml` to that directory and activate the ['Default Frontmatter' feature](/docs/#default-frontmatter). 24 | 25 | ```yaml 26 | layout: 27 | ``` 28 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/@content/blog/index.mdx: -------------------------------------------------------------------------------- 1 | # Blog 2 | 3 | Read the **first article** from astro-m2dx... 4 | 5 | ::BlogList{sort='byDate'} 6 | 7 | There will be more in the future. I would also love to hear stories from you. If you have success stories with astro-m2dx to share, let me know by creating a [Github issue](https://github.com/christian-hackyourshack/npm/issues/new) or filing a [pull request](https://github.com/christian-hackyourshack/npm/pulls). 8 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/@content/blog/working-with-images/snapshot.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christian-hackyourshack/npm/eb9ad2f5ae6ae60b961c2fa4387d9006f1a33b9d/apps/astro-m2dx/src/@content/blog/working-with-images/snapshot.webp -------------------------------------------------------------------------------- /apps/astro-m2dx/src/@content/gallery/_components.ts: -------------------------------------------------------------------------------- 1 | import { GalleryImage } from '@components/GalleryImage'; 2 | 3 | export const components = { 4 | img: GalleryImage, 5 | }; 6 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/@content/gallery/adam-miller-dBaz0xhCkPY-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christian-hackyourshack/npm/eb9ad2f5ae6ae60b961c2fa4387d9006f1a33b9d/apps/astro-m2dx/src/@content/gallery/adam-miller-dBaz0xhCkPY-unsplash.jpg -------------------------------------------------------------------------------- /apps/astro-m2dx/src/@content/gallery/bradley-dunn-amF7lbfzLj0-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christian-hackyourshack/npm/eb9ad2f5ae6ae60b961c2fa4387d9006f1a33b9d/apps/astro-m2dx/src/@content/gallery/bradley-dunn-amF7lbfzLj0-unsplash.jpg -------------------------------------------------------------------------------- /apps/astro-m2dx/src/@content/gallery/bradley-dunn-i8qs7bfTB0M-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christian-hackyourshack/npm/eb9ad2f5ae6ae60b961c2fa4387d9006f1a33b9d/apps/astro-m2dx/src/@content/gallery/bradley-dunn-i8qs7bfTB0M-unsplash.jpg -------------------------------------------------------------------------------- /apps/astro-m2dx/src/@content/gallery/edgar-moran-LboRnt38jpA-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christian-hackyourshack/npm/eb9ad2f5ae6ae60b961c2fa4387d9006f1a33b9d/apps/astro-m2dx/src/@content/gallery/edgar-moran-LboRnt38jpA-unsplash.jpg -------------------------------------------------------------------------------- /apps/astro-m2dx/src/@content/gallery/elia-pellegrini-C54fuJ5E8YU-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christian-hackyourshack/npm/eb9ad2f5ae6ae60b961c2fa4387d9006f1a33b9d/apps/astro-m2dx/src/@content/gallery/elia-pellegrini-C54fuJ5E8YU-unsplash.jpg -------------------------------------------------------------------------------- /apps/astro-m2dx/src/@content/gallery/elia-pellegrini-ZFnCkbhFvhw-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christian-hackyourshack/npm/eb9ad2f5ae6ae60b961c2fa4387d9006f1a33b9d/apps/astro-m2dx/src/@content/gallery/elia-pellegrini-ZFnCkbhFvhw-unsplash.jpg -------------------------------------------------------------------------------- /apps/astro-m2dx/src/@content/gallery/elia-pellegrini-gasB30pgsg0-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christian-hackyourshack/npm/eb9ad2f5ae6ae60b961c2fa4387d9006f1a33b9d/apps/astro-m2dx/src/@content/gallery/elia-pellegrini-gasB30pgsg0-unsplash.jpg -------------------------------------------------------------------------------- /apps/astro-m2dx/src/@content/gallery/elia-pellegrini-onwHGWNbPD0-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christian-hackyourshack/npm/eb9ad2f5ae6ae60b961c2fa4387d9006f1a33b9d/apps/astro-m2dx/src/@content/gallery/elia-pellegrini-onwHGWNbPD0-unsplash.jpg -------------------------------------------------------------------------------- /apps/astro-m2dx/src/@content/gallery/history-in-hd-e5eDHbmHprg-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christian-hackyourshack/npm/eb9ad2f5ae6ae60b961c2fa4387d9006f1a33b9d/apps/astro-m2dx/src/@content/gallery/history-in-hd-e5eDHbmHprg-unsplash.jpg -------------------------------------------------------------------------------- /apps/astro-m2dx/src/@content/gallery/index.mdx: -------------------------------------------------------------------------------- 1 | # Image Gallery 2 | 3 | Find some nice images that I have pulled from unsplash for demonstration purposes. 4 | 5 | ::list-class{.image-gallery} 6 | 7 | - ![](./adam-miller-dBaz0xhCkPY-unsplash.jpg) 8 | - ![](./edgar-moran-LboRnt38jpA-unsplash.jpg) 9 | - ![](./elia-pellegrini-C54fuJ5E8YU-unsplash.jpg) 10 | - ![](./bradley-dunn-i8qs7bfTB0M-unsplash.jpg) 11 | - ![](./elia-pellegrini-gasB30pgsg0-unsplash.jpg) 12 | - ![](./bradley-dunn-amF7lbfzLj0-unsplash.jpg) 13 | - ![](./elia-pellegrini-onwHGWNbPD0-unsplash.jpg) 14 | - ![](./elia-pellegrini-ZFnCkbhFvhw-unsplash.jpg) 15 | - ![](./nasa-5e9CmF-Ge9Y-unsplash.jpg) 16 | - ![](./nicolas-lobos-NR_tXTuyTak-unsplash.jpg) 17 | - ![](./history-in-hd-e5eDHbmHprg-unsplash.jpg) 18 | - ![](./levi-stute-mFF39sOZSgM-unsplash.jpg) 19 | - ![](./jonas-verstuyft-flsFQ3UTuKw-unsplash.jpg) 20 | - ![](./linus-sandvide-bhSNKT5aaMc-unsplash.jpg) 21 | - ![](./nick-brunner-LXspKUjsgH0-unsplash.jpg) 22 | - ![](./mike-kiev-Opzk_hvwO9Q-unsplash.jpg) 23 | 24 | ## How to make it... 25 | 26 | This image gallery was generated with a tiny snippet of CSS 27 | 28 | ```css 29 | .image-gallery { 30 | list-class: none; 31 | column-width: 150px; 32 | column-gap: 2rem; 33 | } 34 | 35 | .image-gallery img, 36 | .image-gallery li { 37 | margin: 0; 38 | padding: 0; 39 | } 40 | .image-gallery img { 41 | margin-bottom: 2rem; 42 | } 43 | ``` 44 | 45 | and a list of images in MDX (this is the raw MDX of this page, taken from the frontmatter, where it was injected using the feature [`rawMdx`](/docs#inject-raw-mdx)) 46 | 47 | 48 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/@content/gallery/jonas-verstuyft-flsFQ3UTuKw-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christian-hackyourshack/npm/eb9ad2f5ae6ae60b961c2fa4387d9006f1a33b9d/apps/astro-m2dx/src/@content/gallery/jonas-verstuyft-flsFQ3UTuKw-unsplash.jpg -------------------------------------------------------------------------------- /apps/astro-m2dx/src/@content/gallery/levi-stute-mFF39sOZSgM-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christian-hackyourshack/npm/eb9ad2f5ae6ae60b961c2fa4387d9006f1a33b9d/apps/astro-m2dx/src/@content/gallery/levi-stute-mFF39sOZSgM-unsplash.jpg -------------------------------------------------------------------------------- /apps/astro-m2dx/src/@content/gallery/linus-sandvide-bhSNKT5aaMc-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christian-hackyourshack/npm/eb9ad2f5ae6ae60b961c2fa4387d9006f1a33b9d/apps/astro-m2dx/src/@content/gallery/linus-sandvide-bhSNKT5aaMc-unsplash.jpg -------------------------------------------------------------------------------- /apps/astro-m2dx/src/@content/gallery/mike-kiev-Opzk_hvwO9Q-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christian-hackyourshack/npm/eb9ad2f5ae6ae60b961c2fa4387d9006f1a33b9d/apps/astro-m2dx/src/@content/gallery/mike-kiev-Opzk_hvwO9Q-unsplash.jpg -------------------------------------------------------------------------------- /apps/astro-m2dx/src/@content/gallery/nasa-5e9CmF-Ge9Y-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christian-hackyourshack/npm/eb9ad2f5ae6ae60b961c2fa4387d9006f1a33b9d/apps/astro-m2dx/src/@content/gallery/nasa-5e9CmF-Ge9Y-unsplash.jpg -------------------------------------------------------------------------------- /apps/astro-m2dx/src/@content/gallery/nick-brunner-LXspKUjsgH0-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christian-hackyourshack/npm/eb9ad2f5ae6ae60b961c2fa4387d9006f1a33b9d/apps/astro-m2dx/src/@content/gallery/nick-brunner-LXspKUjsgH0-unsplash.jpg -------------------------------------------------------------------------------- /apps/astro-m2dx/src/@content/gallery/nicolas-lobos-NR_tXTuyTak-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christian-hackyourshack/npm/eb9ad2f5ae6ae60b961c2fa4387d9006f1a33b9d/apps/astro-m2dx/src/@content/gallery/nicolas-lobos-NR_tXTuyTak-unsplash.jpg -------------------------------------------------------------------------------- /apps/astro-m2dx/src/@content/home/astronaut.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christian-hackyourshack/npm/eb9ad2f5ae6ae60b961c2fa4387d9006f1a33b9d/apps/astro-m2dx/src/@content/home/astronaut.jpg -------------------------------------------------------------------------------- /apps/astro-m2dx/src/@content/home/christian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christian-hackyourshack/npm/eb9ad2f5ae6ae60b961c2fa4387d9006f1a33b9d/apps/astro-m2dx/src/@content/home/christian.png -------------------------------------------------------------------------------- /apps/astro-m2dx/src/components/BlogList/index.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import type { MDXInstance } from 'astro'; 3 | import { blogSlug } from 'utils/slugs'; 4 | 5 | export interface Props { 6 | sort?: 'byDate'; 7 | } 8 | const { sort } = Astro.props; 9 | 10 | const entries = await Astro.glob('../../@content/blog/*/index.mdx'); 11 | if (sort === 'byDate') { 12 | // console.log('TODO: Sort blog entries by date'); 13 | } 14 | 15 | function href(mdx: MDXInstance>) { 16 | return `/blog/${blogSlug(mdx.file)}`; 17 | } 18 | --- 19 | 20 | 29 | 30 | 35 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/components/BlogList/index.ts: -------------------------------------------------------------------------------- 1 | export { default as BlogList, type Props as BlogListProps } from './index.astro'; 2 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/components/CTA/CTA.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { twMerge } from 'tailwind-merge'; 3 | 4 | export interface Props { 5 | class?: string; 6 | href: string; 7 | } 8 | const { class: className = '', href } = Astro.props; 9 | --- 10 | 11 | 12 |

13 | 14 |

15 |
16 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/components/CTA/index.ts: -------------------------------------------------------------------------------- 1 | export { default as CTA, type Props as CTAProps } from './CTA.astro'; 2 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/components/Card/Card.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { twMerge } from 'tailwind-merge'; 3 | 4 | export interface Props { 5 | class?: string; 6 | title: string; 7 | href: string; 8 | img?: string; 9 | } 10 | const { class: className = '', title, href, img } = Astro.props; 11 | --- 12 | 13 |
14 | {!!img && } 15 | {!!title &&
{title}
} 16 |

17 | 18 |

19 | { 20 | href && ( 21 | 22 | Read the docs 23 | 24 | ) 25 | } 26 |
27 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/components/Card/index.ts: -------------------------------------------------------------------------------- 1 | export { default as Card, type Props as CardProps } from './Card.astro'; 2 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/components/FancyCard/FancyCard.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { twMerge } from 'tailwind-merge'; 3 | import { Card, CardProps } from '@components/Card'; 4 | 5 | const { class: className, ...props } = Astro.props as CardProps; 6 | const fancyClass = twMerge('bg-orange-200', className); 7 | --- 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/components/GalleryImage/index.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { limitAspectRatio, Picture, PictureProps } from 'astro-art-direction'; 3 | 4 | export interface Props extends PictureProps {} 5 | const props = Astro.props as Props; 6 | 7 | const customProps: Props = { 8 | artDirection: { 9 | getAspectRatio: limitAspectRatio(5 / 4), 10 | }, 11 | widths: [240, 480], 12 | position: 'attention', 13 | sizes: '(min-width: 360px) 240px, 100vw', 14 | ...props, 15 | }; 16 | --- 17 | 18 | 19 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/components/GalleryImage/index.ts: -------------------------------------------------------------------------------- 1 | export { default as GalleryImage, type Props as GalleryImageProps } from './index.astro'; 2 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/components/Heading/Heading2.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { twMerge } from 'tailwind-merge'; 3 | export type Props = astroHTML.JSX.HTMLAttributes; 4 | const { class: className = '', ...props } = Astro.props; 5 | --- 6 | 7 |

8 | 9 |

10 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/components/Heading/Heading3.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { twMerge } from 'tailwind-merge'; 3 | export type Props = astroHTML.JSX.HTMLAttributes; 4 | const { class: className = '', ...props } = Astro.props; 5 | --- 6 | 7 |

8 | 9 |

10 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/components/Heading/index.ts: -------------------------------------------------------------------------------- 1 | export { default as Heading2, type Props as Heading2Props } from './Heading2.astro'; 2 | export { default as Heading3, type Props as Heading3Props } from './Heading3.astro'; 3 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/components/Quote/Quote.astro: -------------------------------------------------------------------------------- 1 | --- 2 | // Copyright 2022, Hack Your Shack [https://hackyourshack.org] 3 | import { Picture } from 'astro-art-direction'; 4 | import './style.css'; 5 | 6 | export interface Props { 7 | class?: string; 8 | author: string; 9 | from?: string; 10 | country?: string; 11 | avatar?: string; 12 | } 13 | 14 | const { 15 | class: className, 16 | author, 17 | from, 18 | country, 19 | avatar, 20 | } = Astro.props as Props; 21 | --- 22 | 23 |
24 | { 25 | !!avatar && ( 26 | 33 | ) 34 | } 35 |

36 | {author} 37 | {!!from && from {from}} 38 | {!!country && , {country}} 39 |

40 |
41 | 42 |
43 |
44 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/components/Quote/index.ts: -------------------------------------------------------------------------------- 1 | export { default as Quote, type Props as QuoteProps } from './Quote.astro'; 2 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/components/Quote/style.css: -------------------------------------------------------------------------------- 1 | .quote { 2 | display: grid; 3 | grid-template-columns: 8ch auto; 4 | grid-template-rows: 1.5rem auto; 5 | grid-gap: 0.5rem 1.5rem; 6 | grid-template-areas: 'avatar person' 'avatar text'; 7 | } 8 | 9 | .quote__avatar { 10 | grid-area: avatar; 11 | width: 100%; 12 | border-radius: 100%; 13 | margin: auto 0 !important; 14 | } 15 | 16 | .quote__person { 17 | margin: auto 0 !important; 18 | /* padding: 0; */ 19 | grid-area: person; 20 | @apply text-slate-400 text-lg; 21 | } 22 | 23 | .quote__text { 24 | margin: 0; 25 | grid-area: text; 26 | @apply text-2xl italic; 27 | } 28 | 29 | .quote__text > p { 30 | margin: 0; 31 | } 32 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/components/Signature/index.ts: -------------------------------------------------------------------------------- 1 | export { default as Signature } from './index.astro'; 2 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/components/Wrap/Wrap.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { twMerge } from 'tailwind-merge'; 3 | 4 | export interface Props { 5 | class?: string; 6 | } 7 | const { class: className = '' } = Astro.props; 8 | --- 9 | 10 |
11 | 12 |
13 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/components/Wrap/index.ts: -------------------------------------------------------------------------------- 1 | export { default as Wrap, type Props as WrapProps } from './Wrap.astro'; 2 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/config.ts: -------------------------------------------------------------------------------- 1 | export const site = { 2 | name: 'Astro-M²DX', 3 | canonicalURL: 'https://astro-m2dx.netlify.app/', 4 | twitter: '@astro-m2dx', 5 | }; 6 | 7 | const config = { 8 | site, 9 | }; 10 | 11 | export default config; 12 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | // 4 | 5 | declare module '*.mdx' { 6 | export const title: string; 7 | // eslint-disable-next-line @typescript-eslint/no-explicit-any 8 | export const components: Record; 9 | } 10 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/layouts/BaseLayout/BaseLayout.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import Head, { type Props as HeadProps } from './Head.astro'; 3 | 4 | export interface Props extends HeadProps { 5 | class?: string; 6 | dir?: 'ltr' | 'rtl'; 7 | lang?: string; 8 | } 9 | 10 | const { 11 | class: className = '', 12 | dir = 'ltr', 13 | lang = 'en', 14 | ...headProps 15 | } = (Astro.props.frontmatter || Astro.props) as Props; 16 | --- 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/layouts/BaseLayout/OpenGraph.astro: -------------------------------------------------------------------------------- 1 | --- 2 | export interface Props { 3 | title?: string; 4 | description?: string; 5 | image?: string; 6 | canonicalURL?: string; 7 | } 8 | 9 | const { title, description, image, canonicalURL } = Astro.props as Props; 10 | --- 11 | 12 | 13 | 14 | {canonicalURL && } 15 | {title && } 16 | {description && } 17 | {image && } 18 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/layouts/BaseLayout/TwitterCard.astro: -------------------------------------------------------------------------------- 1 | --- 2 | export interface Props { 3 | title?: string; 4 | description?: string; 5 | image?: string; 6 | account: string; 7 | } 8 | 9 | const { title, description, image, account } = Astro.props as Props; 10 | --- 11 | 12 | 13 | 14 | 15 | {title && } 16 | {description && } 17 | {image && } 18 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/layouts/BaseLayout/index.ts: -------------------------------------------------------------------------------- 1 | export { default as BaseLayout, type Props as BaseProps } from './BaseLayout.astro'; 2 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/layouts/MarkdownLayout/MarkdownLayout.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { PageLayout } from '@layouts/PageLayout'; 3 | 4 | const { title } = Astro.props.frontmatter; 5 | --- 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/layouts/MarkdownLayout/index.ts: -------------------------------------------------------------------------------- 1 | export { default as MarkdownLayout } from './MarkdownLayout.astro'; 2 | export { default } from './MarkdownLayout.astro'; 3 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/layouts/PageLayout/Footer.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { site } from 'config'; 3 | 4 | export interface Props { 5 | class?: string; 6 | } 7 | 8 | const { class: className = '' } = Astro.props as Props; 9 | --- 10 | 11 | 16 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/layouts/PageLayout/Header.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { Icon } from 'astro-icon'; 3 | 4 | export interface Props { 5 | class?: string; 6 | } 7 | 8 | const { class: className = '' } = Astro.props as Props; 9 | --- 10 | 11 |
12 | 13 | 14 | Home 15 | 16 | 27 |
28 | -------------------------------------------------------------------------------- /apps/astro-m2dx/src/layouts/PageLayout/PageLayout.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import Header from './Header.astro'; 3 | import { BaseLayout, type BaseProps } from '@layouts/BaseLayout'; 4 | import Footer from './Footer.astro'; 5 | 6 | export interface Props extends BaseProps { 7 | bodyClass?: string; 8 | back?: { 9 | alt?: string; 10 | href: string; 11 | }; 12 | } 13 | 14 | const { 15 | class: className = '', 16 | bodyClass = '', 17 | back, 18 | ...baseProps 19 | } = (Astro.props.frontmatter || Astro.props) as Props; 20 | --- 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 |
29 | 30 |
31 | 32 |