Skip to content

Commit

Permalink
flatten lib and update imports
Browse files Browse the repository at this point in the history
  • Loading branch information
sransara committed Jul 13, 2024
1 parent 627c679 commit 1646c46
Show file tree
Hide file tree
Showing 22 changed files with 18 additions and 21 deletions.
2 changes: 1 addition & 1 deletion adocx/nodeConverters/inline_quoted.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { type AdocNodeConverter } from '#adocx/nodeConvertingConverter';
export const convert: AdocNodeConverter<Inline> = (node: Inline, _opts?: any) => {
const nodeType = node.getType();
if (['asciimath', 'latexmath'].includes(nodeType)) {
addOnceToAstroFence(node, "import Mathtex from '@/src/lib/astro/mathtex/Mathtex.astro';");
addOnceToAstroFence(node, "import Mathtex from '@/src/astro/mathtex/Mathtex.astro';");
return `<Mathtex block={false} lang="${nodeType}" is:raw={true}>${node.getText()}</Mathtex>`;
}
return null;
Expand Down
5 changes: 1 addition & 4 deletions adocx/nodeConverters/listing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ export const convert: AdocNodeConverter<Block> = (node: Block, _opts?: any) => {
const content = node.getContent();
const lang = node.getAttribute('language');

addOnceToAstroFence(
node,
"import CodeListing from '@/src/lib/astro/codeListing/CodeListing.astro';",
);
addOnceToAstroFence(node, "import CodeListing from '@/src/astro/codeListing/CodeListing.astro';");
return atag('div', {
id,
class: ['listingblock', ...roles].join(' '),
Expand Down
2 changes: 1 addition & 1 deletion adocx/nodeConverters/stem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const convert: AdocNodeConverter<Block> = (node: Block, _opts?: any) => {
const roles = node.getRoles().join(' ');
const content = node.getContent();
const style = node.getStyle();
addOnceToAstroFence(node, "import Mathtex from '@/src/lib/astro/mathtex/Mathtex.astro';");
addOnceToAstroFence(node, "import Mathtex from '@/src/astro/mathtex/Mathtex.astro';");
return atag('div', {
id,
class: `mathblock ${roles}`,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/layouts/adocNoteLayout/AdocNoteLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import type { ImageMetadata } from 'astro';
import type { Outline } from '@sransara/astro-adocx/utils/outline';
import type { Metadata } from '@/src/lib/types/notes';
import type { Metadata } from '@/src/types/notes';
import NoteLayout from '@/src/layouts/noteLayout/NoteLayout.astro';
import Asciidoc from '@/src/lib/astro/asciidoc/Asciidoc.astro';
import Asciidoc from '@/src/astro/asciidoc/Asciidoc.astro';
interface Props {
metadata: Metadata;
Expand Down
4 changes: 2 additions & 2 deletions src/layouts/noteLayout/NoteLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import type { ImageMetadata } from 'astro';
import type { Outline } from '@sransara/astro-adocx/utils/outline';
import siteValues from '@/site.values.js';
import type { Metadata } from '@/src/lib/types/notes';
import type { Metadata } from '@/src/types/notes';
import BaseLayout from '@/src/layouts/baseLayout/BaseLayout.astro';
import NavBar from '@/src/lib/astro/navBar/NavBar.astro';
import NavBar from '@/src/astro/navBar/NavBar.astro';
interface Props {
metadata: Metadata;
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/pages/_metas.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Metadata } from '@/src/lib/types/notes';
import type { Metadata } from '@/src/types/notes';

type Metas = Record<string, { metadata: Metadata }>;
const metas = import.meta.glob('./**/_meta/metadata.ts', { eager: true }) as Metas;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/about/index.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import BaseLayout from '@/src/layouts/baseLayout/BaseLayout.astro';
import NavBar from '@/src/lib/astro/navBar/NavBar.astro';
import NavBar from '@/src/astro/navBar/NavBar.astro';
---

<style>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import BaseLayout from '@/src/layouts/baseLayout/BaseLayout.astro';
import NavBar from '@/src/lib/astro/navBar/NavBar.astro';
import NavBar from '@/src/astro/navBar/NavBar.astro';
---

<BaseLayout>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Metadata } from '@/src/lib/types/notes';
import type { Metadata } from '@/src/types/notes';

export const metadata: Metadata = {
title: 'Build yourself a Git',
Expand Down
2 changes: 1 addition & 1 deletion src/pages/notes/2019/hello-world/_meta/metadata.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Metadata } from '@/src/lib/types/notes';
import type { Metadata } from '@/src/types/notes';

export const metadata: Metadata = {
title: 'Hello world',
Expand Down
2 changes: 1 addition & 1 deletion src/pages/notes/2023/bazel-python-venv/_meta/metadata.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Metadata } from '@/src/lib/types/notes';
import type { Metadata } from '@/src/types/notes';

export const metadata: Metadata = {
title: 'Quick guide: Bazel Python virtual environment',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Metadata } from '@/src/lib/types/notes';
import type { Metadata } from '@/src/types/notes';

export const metadata: Metadata = {
title: 'Power to tail recursion',
Expand Down
2 changes: 1 addition & 1 deletion src/pages/notes/[year]/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { format, parseISO } from 'date-fns';
import BaseLayout from '@/src/layouts/baseLayout/BaseLayout.astro';
import NavBar from '@/src/lib/astro/navBar/NavBar.astro';
import NavBar from '@/src/astro/navBar/NavBar.astro';
import { routes } from '@/src/pages/_metas.ts';
export function getStaticPaths() {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/notes/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import { format, parseISO } from 'date-fns';
import BaseLayout from '@/src/layouts/baseLayout/BaseLayout.astro';
import NavBar from '@/src/lib/astro/navBar/NavBar.astro';
import NavBar from '@/src/astro/navBar/NavBar.astro';
import { routes } from '@/src/pages/_metas.ts';
import { groupBy } from '@/src/lib/utils.ts';
import { groupBy } from '@/src/lib/array';
const notesGroupedByYear = groupBy(
routes('/notes'),
Expand Down
2 changes: 1 addition & 1 deletion src/pages/projects/index.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import BaseLayout from '@/src/layouts/baseLayout/BaseLayout.astro';
import NavBar from '@/src/lib/astro/navBar/NavBar.astro';
import NavBar from '@/src/astro/navBar/NavBar.astro';
---

<BaseLayout title="Projects">
Expand Down
File renamed without changes.

0 comments on commit 1646c46

Please sign in to comment.