diff --git a/.gitignore b/.gitignore index e28fdd0..f0718f8 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ yarn.lock # other folders .vercel .netlify +.idea diff --git a/src/components/BlogCard.astro b/src/components/BlogCard.astro index 199c74c..acb4dab 100644 --- a/src/components/BlogCard.astro +++ b/src/components/BlogCard.astro @@ -1,23 +1,35 @@ --- +import TagsLine from "./TagsLine.astro"; + export interface Props { title: string; description: string; pubDate: string; url: string | undefined; contributedBy: string; + tags: string[]; } -let { title, description, pubDate, url, contributedBy } = Astro.props; +let { title, description, pubDate, url, contributedBy, tags } = Astro.props; const shortDate = new Date(pubDate).toLocaleDateString("en", { dateStyle: "short", }); url = url + "/"; --- -
  • - +
  • + -

    {title}

    + +

    {title}

    + +
    +
    -
  • \ No newline at end of file + diff --git a/src/components/TagsLine.astro b/src/components/TagsLine.astro new file mode 100644 index 0000000..612f748 --- /dev/null +++ b/src/components/TagsLine.astro @@ -0,0 +1,13 @@ +--- +const { tags } = Astro.props; +--- + +
    + { + tags.map((tag) => ( + + {tag} + + )) + } +
    diff --git a/src/layouts/BlogLayout.astro b/src/layouts/BlogLayout.astro index 76e3fa7..e03f77e 100644 --- a/src/layouts/BlogLayout.astro +++ b/src/layouts/BlogLayout.astro @@ -2,6 +2,7 @@ import "@fontsource/inter/variable.css"; import "@fontsource/fira-code"; import Header from "@components/Header.astro"; +import TagsLine from "@components/TagsLine.astro"; let { pubDate } = Astro.props.content; const { frontmatter } = Astro.props; @@ -97,6 +98,9 @@ const canonicalURL = new URL(Astro.url).href; {frontmatter.contributedBy} +
    + +
    diff --git a/src/pages/index.astro b/src/pages/index.astro index 7daac74..8d673c7 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -2,12 +2,7 @@ import Layout from "@layouts/Layout.astro"; import BlogCard from "@components/BlogCard.astro"; import { Icon } from "astro-icon"; -interface Frontmatter { - title: string; - pubDate: string; - description: string; - contributedBy: string; -} +import { Frontmatter } from "./models"; const metadata = { title: "Angular Snippets", @@ -25,7 +20,7 @@ blogs = blogs.sort(
    - +

    )) } diff --git a/src/pages/models.ts b/src/pages/models.ts new file mode 100644 index 0000000..b44bea9 --- /dev/null +++ b/src/pages/models.ts @@ -0,0 +1,7 @@ +export interface Frontmatter { + title: string; + pubDate: string; + description: string; + contributedBy: string; + tags?: string[]; +} diff --git a/src/pages/snippets.astro b/src/pages/snippets.astro index fbe0d55..3f847ef 100644 --- a/src/pages/snippets.astro +++ b/src/pages/snippets.astro @@ -1,13 +1,7 @@ --- import Layout from "@layouts/Layout.astro"; import BlogCard from "@components/BlogCard.astro"; - -interface Frontmatter { - title: string; - pubDate: string; - description: string; - contributedBy: string; -} +import { Frontmatter } from "./models"; let blogs = await Astro.glob("./snippets/*.mdx"); blogs = blogs.sort( @@ -28,15 +22,18 @@ blogs = blogs.sort(
      { - blogs.map((post) => ( - - )) + blogs.map((post) => { + return ( + + ); + }) }
    diff --git a/src/pages/snippets/source-map.mdx b/src/pages/snippets/source-map.mdx index 6ff7b39..2401eb9 100644 --- a/src/pages/snippets/source-map.mdx +++ b/src/pages/snippets/source-map.mdx @@ -1,18 +1,20 @@ --- title: Make source maps available for reporting tools description: "Make source maps available for reporting tools" +tags: [json, sourceMaps] pubDate: Feb 20, 2022 contributedBy: "@SantoshYadavDev" --- -import BlogImage from "@components/BlogImage.astro" -import SourceMap from "@images/source-map.jpg" -Do you want to upload source-map to an reporting tool like +import BlogImage from "@components/BlogImage.astro"; +import SourceMap from "@images/source-map.jpg"; + +Do you want to upload source-map to an reporting tool like @datadoghq , but want to make sure no one can debug the code due to sourceMap - --- + Set below property in build options, the source-map will not be mapped to the bundle, but you will get a source map. ```json @@ -21,5 +23,4 @@ Set below property in build options, the source-map will not be mapped to the bu } ``` - diff --git a/src/pages/snippets/v15-standalone.mdx b/src/pages/snippets/v15-standalone.mdx index d4a80d2..875ce3a 100644 --- a/src/pages/snippets/v15-standalone.mdx +++ b/src/pages/snippets/v15-standalone.mdx @@ -1,6 +1,7 @@ --- title: Angular 15 Standalone Components description: "Easy example of Angular 15 standalone components in existing projects" +tags: ["angular15", "standalone components"] # comma separated list which gets trimmed pubDate: Feb 22, 2022 contributedBy: "@olierxleben" --- @@ -9,22 +10,25 @@ Here is a quick example of how to use a standalone component in an existing NgMo Let`s start with the component itself. ```typescript -import {Component} from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'fancy-button', + selector: "fancy-button", standalone: true, // magic lies here template: ` - `, }) -export class ButtonComponent { -} +export class ButtonComponent {} ``` + --- + And for the integration in an NgModule, you can just do the following: ```typescript