├── .all-contributorsrc ├── .devcontainer └── devcontainer.json ├── .github ├── FUNDING.yml └── ISSUE_TEMPLATE │ └── feature_request.md ├── .gitignore ├── .nvmrc ├── .prettierrc.cjs ├── .vscode ├── extensions.json ├── launch.json └── settings.json ├── CODE_OF_CONDUCT.md ├── README.md ├── astro.config.ts ├── license ├── package.json ├── pnpm-lock.yaml ├── public ├── favicon.svg └── robots.txt ├── src ├── components │ ├── BlogCard.astro │ ├── BlogImage.astro │ ├── Footer.astro │ ├── Header.astro │ └── TagsLine.astro ├── env.d.ts ├── icons │ └── angular.svg ├── images │ ├── angular.jpg │ ├── minimal-angular-project.png │ └── source-map.jpg ├── layouts │ ├── BlogLayout.astro │ └── Layout.astro ├── pages │ ├── 404.astro │ ├── index.astro │ ├── models.ts │ ├── rss.xml.ts │ ├── snippets.astro │ └── snippets │ │ ├── component-store-with-global-state.mdx │ │ ├── create-minimal-angular-project-for-research-purpose.mdx │ │ ├── disable-components-using-directive.mdx │ │ ├── enable-tracing.mdx │ │ ├── guard-class-to-function.mdx │ │ ├── observables-testing.mdx │ │ ├── overriding-npm-dependencies.mdx │ │ ├── preloading-strategy.mdx │ │ ├── put-constraint-on-selector.mdx │ │ ├── server-sent-event-with-component-store.mdx │ │ ├── signal-reactivity-cheatsheet.mdx │ │ ├── source-map.mdx │ │ ├── stateful-directive-with-output.mdx │ │ ├── stateful-standalone-component.mdx │ │ ├── v15-new-image-directive.mdx │ │ └── v15-standalone.mdx └── scripts │ └── main.js ├── tailwind.config.ts └── tsconfig.json /.all-contributorsrc: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | "README.md" 4 | ], 5 | "imageSize": 100, 6 | "commit": false, 7 | "commitConvention": "angular", 8 | "contributors": [ 9 | { 10 | "login": "olierxleben", 11 | "name": "Oliver Erxleben", 12 | "avatar_url": "https://avatars.githubusercontent.com/u/1403225?v=4", 13 | "profile": "https://github.com/olierxleben", 14 | "contributions": [ 15 | "code" 16 | ] 17 | }, 18 | { 19 | "login": "9kubczas4", 20 | "name": "Paweł Kubiak", 21 | "avatar_url": "https://avatars.githubusercontent.com/u/43759569?v=4", 22 | "profile": "https://github.com/9kubczas4", 23 | "contributions": [ 24 | "code" 25 | ] 26 | }, 27 | { 28 | "login": "SantoshYadavDev", 29 | "name": "Santosh Yadav", 30 | "avatar_url": "https://avatars.githubusercontent.com/u/11923975?v=4", 31 | "profile": "https://github.com/santoshyadavdev", 32 | "contributions": [ 33 | "code" 34 | ] 35 | }, 36 | { 37 | "login": "Nicoss54", 38 | "name": "Nicolas Frizzarin", 39 | "avatar_url": "https://avatars.githubusercontent.com/u/24563545?v=4", 40 | "profile": "https://github.com/Nicoss54", 41 | "contributions": [ 42 | "doc" 43 | ] 44 | }, 45 | { 46 | "login": "yharaskrik", 47 | "name": "Jay Bell", 48 | "avatar_url": "https://avatars.githubusercontent.com/u/9469090?v=4", 49 | "profile": "http://trellis.org", 50 | "contributions": [ 51 | "doc" 52 | ] 53 | }, 54 | { 55 | "login": "wasylb", 56 | "name": "Bartosz Wasilew", 57 | "avatar_url": "https://avatars.githubusercontent.com/u/43531815?v=4", 58 | "profile": "https://github.com/wasylb", 59 | "contributions": [ 60 | "doc" 61 | ] 62 | }, 63 | { 64 | "login": "goetzrobin", 65 | "name": "Robin Goetz", 66 | "avatar_url": "https://avatars.githubusercontent.com/u/35136007?v=4", 67 | "profile": "https://goetzrobin.github.io", 68 | "contributions": [ 69 | "code" 70 | ] 71 | }, 72 | { 73 | "login": "nartc", 74 | "name": "Chau Tran", 75 | "avatar_url": "https://avatars.githubusercontent.com/u/25516557?v=4", 76 | "profile": "https://nartc.me", 77 | "contributions": [ 78 | "code", 79 | "doc" 80 | ] 81 | }, 82 | { 83 | "login": "phhien203", 84 | "name": "Pham Huu Hien", 85 | "avatar_url": "https://avatars.githubusercontent.com/u/8808535?v=4", 86 | "profile": "https://blog.hien.page", 87 | "contributions": [ 88 | "doc" 89 | ] 90 | }, 91 | { 92 | "login": "nelsongutidev", 93 | "name": "Nelson Gutierrez", 94 | "avatar_url": "https://avatars.githubusercontent.com/u/62297014?v=4", 95 | "profile": "https://nelsonguti.dev/", 96 | "contributions": [ 97 | "doc" 98 | ] 99 | }, 100 | { 101 | "login": "lucioaimar", 102 | "name": "Lucio Aimar", 103 | "avatar_url": "https://avatars.githubusercontent.com/u/64326713?v=4", 104 | "profile": "https://github.com/lucioaimar", 105 | "contributions": [ 106 | "doc" 107 | ] 108 | }, 109 | { 110 | "login": "deepakrudrapaul", 111 | "name": "Deepak Rudra Paul", 112 | "avatar_url": "https://avatars.githubusercontent.com/u/25549935?v=4", 113 | "profile": "https://github.com/deepakrudrapaul", 114 | "contributions": [ 115 | "doc" 116 | ] 117 | }, 118 | { 119 | "login": "rubenperegrina", 120 | "name": "Rubén Peregrina", 121 | "avatar_url": "https://avatars.githubusercontent.com/u/23550574?v=4", 122 | "profile": "https://github.com/rubenperegrina", 123 | "contributions": [ 124 | "doc" 125 | ] 126 | } 127 | ], 128 | "contributorsPerLine": 7, 129 | "skipCi": true, 130 | "repoType": "github", 131 | "repoHost": "https://github.com", 132 | "projectName": "angular-snippets", 133 | "projectOwner": "santoshyadavdev" 134 | } 135 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the 2 | // README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node 3 | { 4 | "name": "Node.js", 5 | "image": "mcr.microsoft.com/devcontainers/javascript-node:16-bullseye" 6 | 7 | // Features to add to the dev container. More info: https://containers.dev/features. 8 | // "features": {}, 9 | 10 | // Use 'forwardPorts' to make a list of ports inside the container available locally. 11 | // "forwardPorts": [], 12 | 13 | // Use 'postCreateCommand' to run commands after the container is created. 14 | // "postCreateCommand": "yarn install", 15 | 16 | // Configure tool-specific properties. 17 | // "customizations": {}, 18 | 19 | // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. 20 | // "remoteUser": "root" 21 | } 22 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [SantoshYadavDev] 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: "" 5 | labels: "" 6 | assignees: "" 7 | --- 8 | 9 | **Is your feature request related to a problem? Please describe.** 10 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 11 | 12 | **Describe the solution you'd like** 13 | A clear and concise description of what you want to happen. 14 | 15 | **Describe alternatives you've considered** 16 | A clear and concise description of any alternative solutions or features you've considered. 17 | 18 | **Additional context** 19 | Add any other context or screenshots about the feature request here. 20 | -------------------------------------------------------------------------------- /.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 | # environment variables 15 | .env 16 | .env.production 17 | 18 | # macOS-specific files 19 | .DS_Store 20 | 21 | # we use pnpm for package management 22 | package-lock.json 23 | yarn.lock 24 | 25 | # other folders 26 | .vercel 27 | .netlify 28 | .idea 29 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 18 -------------------------------------------------------------------------------- /.prettierrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: [require.resolve("prettier-plugin-astro")], 3 | overrides: [ 4 | { 5 | files: "*.astro", 6 | options: { 7 | parser: "astro", 8 | // ensure HTML tag breaks properly 9 | htmlWhitespaceSensitivity: "ignore", 10 | }, 11 | }, 12 | ], 13 | }; 14 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "astro-build.astro-vscode", 4 | "esbenp.prettier-vscode", 5 | "unifiedjs.vscode-mdx" 6 | ], 7 | "unwantedRecommendations": [] 8 | } 9 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "command": "./node_modules/.bin/astro dev", 6 | "name": "Development server", 7 | "request": "launch", 8 | "type": "node-terminal" 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "deno.enable": true, 3 | "deno.enablePaths": ["netlify/edge-functions"], 4 | "deno.unstable": true, 5 | "deno.importMap": ".netlify/edge-functions-import-map.json", 6 | "deno.path": "/home/codespace/.config/netlify/deno-cli/deno", 7 | "prettier.documentSelectors": ["**/*.astro"], 8 | "[astro]": { 9 | "editor.defaultFormatter": "esbenp.prettier-vscode" 10 | }, 11 | "[mdx]": { 12 | "editor.defaultFormatter": "esbenp.prettier-vscode" 13 | }, 14 | "editor.formatOnSave": true, 15 | "editor.formatOnSaveMode": "file", 16 | "editor.codeActionsOnSave": { 17 | "source.organizeImports": true 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | - Demonstrating empathy and kindness toward other people 21 | - Being respectful of differing opinions, viewpoints, and experiences 22 | - Giving and gracefully accepting constructive feedback 23 | - Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | - Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | - The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | - Trolling, insulting or derogatory comments, and personal or political attacks 33 | - Public or private harassment 34 | - Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | - Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | santosh.yadav198613@gmail.com. 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 120 | 121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 122 | enforcement ladder](https://github.com/mozilla/diversity). 123 | 124 | [homepage]: https://www.contributor-covenant.org 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | https://www.contributor-covenant.org/faq. Translations are available at 128 | https://www.contributor-covenant.org/translations. 129 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Angular Snippets 2 | 3 | 4 | [![All Contributors](https://img.shields.io/badge/all_contributors-13-orange.svg?style=flat-square)](#contributors-) 5 | 6 | 7 | A website to find and share code snippets for Angular. 8 | 9 | ## How to add snippets 10 | 11 | Follow the below steps to add a snippet to the website. 12 | 13 | - Go to pages -> snippets folder. 14 | - add a new mdx file with the name of the snippet. 15 | - add the content in the format below. 16 | 17 | ```mdx 18 | --- 19 | title: Tile of the snippet 20 | description: description of the snippet 21 | pubDate: (Dare) Feb 20, 2022 22 | contributedBy: "@TwitterHandle" 23 | --- 24 | 25 | import BlogImage from "@components/BlogImage.astro"; 26 | import SourceMap from "@images/source-map.jpg"; 27 | 28 | Content of the snippet 29 | 30 | We accept mdx syntax here. 31 | 32 | You can include code snippets like this. 33 | 34 | "sourceMap": { 35 | "hidden": true, 36 | } 37 | 38 | and images like this. 39 | 40 | 41 | ``` 42 | 43 | ## Tech Stack 🛠️ 44 | 45 | - Static Site Generator: [Astro](https://astro.build/) 46 | - CSS Framework: [Tailwind CSS](https://tailwindcss.com/) 47 | - Markdown: [MDX](https://mdxjs.com/) 48 | - Package Manager: [pnpm](https://pnpm.io/) 49 | 50 | ## Developer Notes 📝 51 | 52 | Here are some commands that you can run to get started with the project. You can also check all the commands in the [`package.json`](https://github.com/lancerossdev/basicblog/blob/main/package.json) 53 | 54 | ```bash 55 | # Install dependencies 56 | pnpm install 57 | 58 | # Run the development server 59 | pnpm dev 60 | 61 | # Build the project 62 | pnpm build 63 | 64 | # Serve the built project 65 | pnpm preview 66 | ``` 67 | 68 | ## Contributors 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 |
Oliver Erxleben
Oliver Erxleben

💻
Paweł Kubiak
Paweł Kubiak

💻
Santosh Yadav
Santosh Yadav

💻
Nicolas Frizzarin
Nicolas Frizzarin

📖
Jay Bell
Jay Bell

📖
Bartosz Wasilew
Bartosz Wasilew

📖
Robin Goetz
Robin Goetz

💻
Chau Tran
Chau Tran

💻 📖
Pham Huu Hien
Pham Huu Hien

📖
Nelson Gutierrez
Nelson Gutierrez

📖
Lucio Aimar
Lucio Aimar

📖
Deepak Rudra Paul
Deepak Rudra Paul

📖
Rubén Peregrina
Rubén Peregrina

📖
94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | ## License ⚖️ 108 | 109 | This repository has [MIT License](https://github.com/santoshyadavdev/angular-snipptes/blob/main/license). 110 | -------------------------------------------------------------------------------- /astro.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "astro/config"; 2 | import compress from "astro-compress"; 3 | import sitemap from "@astrojs/sitemap"; 4 | import tailwind from "@astrojs/tailwind"; 5 | import mdx from "@astrojs/mdx"; 6 | import image from "@astrojs/image"; 7 | import astroLayouts from "astro-layouts"; 8 | import codeTitle from "remark-code-title"; 9 | 10 | // https://astro.build/config 11 | export default defineConfig({ 12 | site: "https://angular-snippets.dev", 13 | markdown: { 14 | extendDefaultPlugins: true, 15 | shikiConfig: { 16 | theme: "dark-plus", 17 | }, 18 | remarkPlugins: [ 19 | [ 20 | astroLayouts, 21 | { 22 | default: "@layouts/Layout.astro", 23 | snippets: "@layouts/BlogLayout.astro", 24 | }, 25 | ], 26 | codeTitle, 27 | ], 28 | }, 29 | 30 | base: "/", 31 | integrations: [ 32 | compress({ 33 | css: true, 34 | html: true, 35 | js: true, 36 | img: true, 37 | svg: true, 38 | logger: 0, 39 | }), 40 | tailwind(), 41 | sitemap(), 42 | mdx(), 43 | image({ 44 | serviceEntryPoint: "@astrojs/image/sharp", 45 | }), 46 | ], 47 | }); 48 | -------------------------------------------------------------------------------- /license: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Santosh Yadav 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-snippets", 3 | "version": "1.0.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "astro dev", 7 | "build": "astro build", 8 | "preview": "astro build && astro preview", 9 | "prettier": "prettier --write --plugin-search-dir=. ." 10 | }, 11 | "devDependencies": { 12 | "@astrojs/image": "^0.17.3", 13 | "@astrojs/mdx": "~0.19.6", 14 | "@astrojs/rss": "^1.2.1", 15 | "@astrojs/sitemap": "^1.0.0", 16 | "@astrojs/tailwind": "^4.0.0", 17 | "@fontsource/fira-code": "^4.5.12", 18 | "@fontsource/inter": "^4.5.14", 19 | "@tailwindcss/typography": "^0.5.8", 20 | "astro": "^2.10.11", 21 | "astro-compress": "2.0.12", 22 | "astro-icon": "^0.8.0", 23 | "astro-layouts": "^0.0.6", 24 | "prettier": "^2.8.4", 25 | "prettier-plugin-astro": "^0.8.0", 26 | "remark-code-title": "^0.2.2", 27 | "sharp": "^0.31.2", 28 | "tailwind-scrollbar": "^2.0.1", 29 | "tailwindcss": "^3.2.4" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /public/favicon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 10 | 11 | 12 | 13 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Allow: / 3 | 4 | Sitemap: https://angular-snippets.dev/sitemap-index.xml -------------------------------------------------------------------------------- /src/components/BlogCard.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import TagsLine from "./TagsLine.astro"; 3 | 4 | export interface Props { 5 | title: string; 6 | description: string; 7 | pubDate: string; 8 | url: string | undefined; 9 | contributedBy: string; 10 | tags: string[]; 11 | } 12 | let { title, description, pubDate, url, contributedBy, tags } = Astro.props; 13 | const shortDate = new Date(pubDate).toLocaleDateString("en", { 14 | dateStyle: "short", 15 | }); 16 | url = url + "/"; 17 | --- 18 | 19 |
  • 22 | 23 | 24 | 25 |

    {title}

    26 | 27 |
    28 | 29 | 30 | 31 |
    32 |
  • 33 | -------------------------------------------------------------------------------- /src/components/BlogImage.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { Picture } from "@astrojs/image/components"; 3 | interface Props { 4 | src: string; 5 | alt: string; 6 | loading?: "lazy" | "eager"; 7 | } 8 | const { src, alt, loading = "lazy" } = Astro.props; 9 | --- 10 | 11 | 19 | -------------------------------------------------------------------------------- /src/components/Footer.astro: -------------------------------------------------------------------------------- 1 |
    4 | An open source project created by Santhosh Yadav. 5 |
    6 | -------------------------------------------------------------------------------- /src/components/Header.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { Icon } from "astro-icon"; 3 | 4 | const navItems = [ 5 | { 6 | name: "Snippets", 7 | href: "/snippets/", 8 | }, 9 | { 10 | name: "RSS", 11 | href: "/rss.xml", 12 | }, 13 | ]; 14 | --- 15 | 16 |
    17 | 21 | Angular Snippets 22 | 23 | 60 | 86 |
    87 | 88 | 106 | -------------------------------------------------------------------------------- /src/components/TagsLine.astro: -------------------------------------------------------------------------------- 1 | --- 2 | const { tags } = Astro.props; 3 | --- 4 | 5 |
    6 | { 7 | tags.map((tag) => ( 8 | 9 | {tag} 10 | 11 | )) 12 | } 13 |
    14 | -------------------------------------------------------------------------------- /src/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /src/icons/angular.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 10 | 11 | 12 | 13 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/images/angular.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/santoshyadavdev/angular-snippets/1b8d2c9509e4395e4b884060346a024250a427b1/src/images/angular.jpg -------------------------------------------------------------------------------- /src/images/minimal-angular-project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/santoshyadavdev/angular-snippets/1b8d2c9509e4395e4b884060346a024250a427b1/src/images/minimal-angular-project.png -------------------------------------------------------------------------------- /src/images/source-map.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/santoshyadavdev/angular-snippets/1b8d2c9509e4395e4b884060346a024250a427b1/src/images/source-map.jpg -------------------------------------------------------------------------------- /src/layouts/BlogLayout.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import "@fontsource/inter/variable.css"; 3 | import "@fontsource/fira-code"; 4 | import Header from "@components/Header.astro"; 5 | import Footer from "@components/Footer.astro"; 6 | import TagsLine from "@components/TagsLine.astro"; 7 | 8 | let { pubDate } = Astro.props.content; 9 | const { frontmatter } = Astro.props; 10 | export interface Props { 11 | title?: string; 12 | description?: string; 13 | image?: string; 14 | ImageAlt?: string; 15 | } 16 | 17 | const thisDate = new Date(pubDate).toLocaleDateString("en", { 18 | dateStyle: "long", 19 | }); 20 | pubDate = pubDate.split("T")[0]; 21 | 22 | const ogImageParams = "./banner.png"; 23 | 24 | const canonicalURL = new URL(Astro.url).href; 25 | --- 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | {frontmatter.title} 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 78 | 79 | 80 | 83 |
    84 |
    85 |
    86 |
    87 |

    88 | {frontmatter.title} 89 |

    90 | 100 |
    101 | 102 |
    103 |
    104 |
    107 | 108 |
    109 |
    110 | Back to snippets 111 |
    112 |
    113 |
    114 |
    115 | 116 | 117 | -------------------------------------------------------------------------------- /src/layouts/Layout.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import "@fontsource/inter/variable.css"; 3 | import Header from "@components/Header.astro"; 4 | import Footer from "@components/Footer.astro"; 5 | 6 | export interface Props { 7 | title?: string; 8 | description?: string; 9 | } 10 | 11 | const { title, description } = Astro.props as Props; 12 | const canonicalURL = new URL(Astro.url).href; 13 | --- 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | {title} 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 66 | 67 | 68 | 71 |
    72 |
    73 | 74 |
    75 |