diff --git a/apps/docs/src/components/BlogHeader.astro b/apps/docs/src/components/BlogHeader.astro index a976cf39..38e4f1ca 100644 --- a/apps/docs/src/components/BlogHeader.astro +++ b/apps/docs/src/components/BlogHeader.astro @@ -1,8 +1,5 @@ --- -import { buttonVariants } from "@/components/ui/Button"; import { getCategories } from "@/lib/fetchers"; -import { cn } from "@/lib/utils"; -import { Icon } from "astro-icon/components"; const categories = await getCategories(); @@ -11,56 +8,8 @@ type Props = { }; const { title } = Astro.props; -const { category } = Astro.params; ---

{title}

-
-
- - -
- - { - categories?.length ? ( - - ) : ( -
- ) - } -
-
diff --git a/apps/docs/src/components/cards/BlogCard.astro b/apps/docs/src/components/cards/BlogCard.astro index 8b7c0ee1..819e08b0 100644 --- a/apps/docs/src/components/cards/BlogCard.astro +++ b/apps/docs/src/components/cards/BlogCard.astro @@ -26,14 +26,6 @@ const post = Astro.props;
- - - {post.data.category} - - `—`
` elements represent six levels of section headings. `

` is the highest section level while `

` is the lowest. - -# H1 - -## H2 - -### H3 - -#### H4 - -##### H5 - -###### H6 - -## Paragraph - -Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores editium rerore eost, temped molorro ratiae volorro te reribus dolorer sperchicium faceata tiustia prat. - -Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat. - -## Images - -#### Syntax - -```markdown -![Alt text](./full/or/relative/path/of/image) -``` - -#### Output - -![blog placeholder](/images/blog/placeholder-about.jpg) - -## Blockquotes - -The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a `footer` or `cite` element, and optionally with in-line changes such as annotations and abbreviations. - -### Blockquote without attribution - -#### Syntax - -```markdown -> Tiam, ad mint andaepu dandae nostion secatur sequo quae. -> **Note** that you can use _Markdown syntax_ within a blockquote. -``` - -#### Output - -> Tiam, ad mint andaepu dandae nostion secatur sequo quae. -> **Note** that you can use _Markdown syntax_ within a blockquote. - -### Blockquote with attribution - -#### Syntax - -```markdown -> Don't communicate by sharing memory, share memory by communicating.
-> — Rob Pike[^1] -``` - -#### Output - -> Don't communicate by sharing memory, share memory by communicating.
-> — Rob Pike[^1] - -[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015. - -## Tables - -#### Syntax - -```markdown -| Italics | Bold | Code | -| --------- | -------- | ------ | -| _italics_ | **bold** | `code` | -``` - -#### Output - -| Italics | Bold | Code | -| --------- | -------- | ------ | -| _italics_ | **bold** | `code` | - -## Code Blocks - -#### Syntax - -we can use 3 backticks ``` in new line and write snippet and close with 3 backticks on new line and to highlight language specific syntac, write one word of language name after first 3 backticks, for eg. html, javascript, css, markdown, typescript, txt, bash - -````markdown -```html - - - - - Example HTML5 Document - - -

Test

- - -``` -```` - -Output - -```html - - - - - Example HTML5 Document - - -

Test

- - -``` - -## List Types - -### Ordered List - -#### Syntax - -```markdown -1. First item -2. Second item -3. Third item -``` - -#### Output - -1. First item -2. Second item -3. Third item - -### Unordered List - -#### Syntax - -```markdown -- List item -- Another item -- And another item -``` - -#### Output - -- List item -- Another item -- And another item - -### Nested list - -#### Syntax - -```markdown -- Fruit - - Apple - - Orange - - Banana -- Dairy - - Milk - - Cheese -``` - -#### Output - -- Fruit - - Apple - - Orange - - Banana -- Dairy - - Milk - - Cheese - -## Other Elements — abbr, sub, sup, kbd, mark - -#### Syntax - -```markdown -GIF is a bitmap image format. - -H2O - -Xn + Yn = Zn - -Press CTRL+ALT+Delete to end the session. - -Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures. -``` - -#### Output - -GIF is a bitmap image format. - -H2O - -Xn + Yn = Zn - -Press CTRL+ALT+Delete to end the session. - -Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures. diff --git a/apps/docs/src/content/blog/pale-blue-dot.md b/apps/docs/src/content/blog/pale-blue-dot.md deleted file mode 100644 index 07964176..00000000 --- a/apps/docs/src/content/blog/pale-blue-dot.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: "Pale Blue Dot" -description: "Carl Sagan's reflection on our planet Earth" -pubDate: "Sep 10 2023" -cover: "/images/blog/placeholder-4.jpg" -category: "space" ---- - -Look again at that dot. That’s here. That’s home. That’s us. On it everyone you love, everyone you know, everyone you ever heard of, every human being who ever was, lived out their lives. The aggregate of our joy and suffering, thousands of confident religions, ideologies, and economic doctrines, every hunter and forager, every hero and coward, every creator and destroyer of civilization, every king and peasant, every young couple in love, every mother and father, hopeful child, inventor and explorer, every teacher of morals, every corrupt politician, every “superstar,” every “supreme leader,” every saint and sinner in the history of our species lived there—on a mote of dust suspended in a sunbeam. - -The Earth is a very small stage in a vast cosmic arena. Think of the rivers of blood spilled by all those generals and emperors so that, in glory and triumph, they could become the momentary masters of a fraction of a dot. Think of the endless cruelties visited by the inhabitants of one corner of this pixel on the scarcely distinguishable inhabitants of some other corner, how frequent their misunderstandings, how eager they are to kill one another, how fervent their hatreds. - -Our posturings, our imagined self-importance, the delusion that we have some privileged position in the Universe, are challenged by this point of pale light. Our planet is a lonely speck in the great enveloping cosmic dark. In our obscurity, in all this vastness, there is no hint that help will come from elsewhere to save us from ourselves. -The Earth is the only world known so far to harbor life. There is nowhere else, at least in the near future, to which our species could migrate. Visit, yes. Settle, not yet. Like it or not, for the moment the Earth is where we make our stand. diff --git a/apps/docs/src/content/blog/preview-markdown.md b/apps/docs/src/content/blog/preview-markdown.md deleted file mode 100644 index 8b9a3c8b..00000000 --- a/apps/docs/src/content/blog/preview-markdown.md +++ /dev/null @@ -1,212 +0,0 @@ ---- -title: "Preview Markdown" -description: "Lorem ipsum dolor sit amet" -pubDate: "Jul 11 2022" -cover: "/images/blog/placeholder-about.jpg" -category: "markdown" ---- - -Until now, trying to style an article, document, or blog post with Tailwind has been a tedious task that required a keen eye for typography and a lot of complex custom CSS. - -By default, Tailwind removes all of the default browser styling from paragraphs, headings, lists and more. This ends up being really useful for building application UIs because you spend less time undoing user-agent styles, but when you _really are_ just trying to style some content that came from a rich-text editor in a CMS or a markdown file, it can be surprising and unintuitive. - -We get lots of complaints about it actually, with people regularly asking us things like: - -> Why is Tailwind removing the default styles on my `h1` elements? How do I disable this? What do you mean I lose all the other base styles too? -> We hear you, but we're not convinced that simply disabling our base styles is what you really want. You don't want to have to remove annoying margins every time you use a `p` element in a piece of your dashboard UI. And I doubt you really want your blog posts to use the user-agent styles either — you want them to look _awesome_, not awful. - -The `@tailwindcss/typography` plugin is our attempt to give you what you _actually_ want, without any of the downsides of doing something stupid like disabling our base styles. - -It adds a new `prose` class that you can slap on any block of vanilla HTML content and turn it into a beautiful, well-formatted document: - -```html -
-

Garlic bread with cheese: What the science tells us

-

- For years parents have espoused the health benefits of eating garlic bread - with cheese to their children, with the food earning such an iconic status - in our culture that kids will often dress up as warm, cheesy loaf for - Halloween. -

-

- But a recent study shows that the celebrated appetizer may be linked to a - series of rabies cases springing up around the country. -

-
-``` - -For more information about how to use the plugin and the features it includes, [read the documentation](https://github.com/tailwindcss/typography/blob/master/README.md). - ---- - -## What to expect from here on out - -What follows from here is just a bunch of absolute nonsense I've written to dogfood the plugin itself. It includes every sensible typographic element I could think of, like **bold text**, unordered lists, ordered lists, code blocks, block quotes, _and even italics_. - -It's important to cover all of these use cases for a few reasons: - -1. We want everything to look good out of the box. -2. Really just the first reason, that's the whole point of the plugin. -3. Here's a third pretend reason though a list with three items looks more realistic than a list with two items. - -Now we're going to try out another header style. - -### Typography should be easy - -So that's a header for you — with any luck if we've done our job correctly that will look pretty reasonable. - -Something a wise person once told me about typography is: - -> Typography is pretty important if you don't want your stuff to look like trash. Make it good then it won't be bad. - -It's probably important that images look okay here by default as well: - -Image - -Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. - -Now I'm going to show you an example of an unordered list to make sure that looks good, too: - -- So here is the first item in this list. -- In this example we're keeping the items short. -- Later, we'll use longer, more complex list items. - -And that's the end of this section. - -## What if we stack headings? - -### We should make sure that looks good, too. - -Sometimes you have headings directly underneath each other. In those cases you often have to undo the top margin on the second heading because it usually looks better for the headings to be closer together than a paragraph followed by a heading should be. - -### When a heading comes after a paragraph … - -When a heading comes after a paragraph, we need a bit more space, like I already mentioned above. Now let's see what a more complex list would look like. - -- **I often do this thing where list items have headings.** - - For some reason I think this looks cool which is unfortunate because it's pretty annoying to get the styles right. - - I often have two or three paragraphs in these list items, too, so the hard part is getting the spacing between the paragraphs, list item heading, and separate list items to all make sense. Pretty tough honestly, you could make a strong argument that you just shouldn't write this way. - -- **Since this is a list, I need at least two items.** - - I explained what I'm doing already in the previous list item, but a list wouldn't be a list if it only had one item, and we really want this to look realistic. That's why I've added this second list item so I actually have something to look at when writing the styles. - -- **It's not a bad idea to add a third item either.** - - I think it probably would've been fine to just use two items but three is definitely not worse, and since I seem to be having no trouble making up arbitrary things to type, I might as well include it. - -After this sort of list I usually have a closing statement or paragraph, because it kinda looks weird jumping right to a heading. - -## Code should look okay by default. - -I think most people are going to use [highlight.js](https://highlightjs.org/) or [Prism](https://prismjs.com/) or something if they want to style their code blocks but it wouldn't hurt to make them look _okay_ out of the box, even with no syntax highlighting. - -Here's what a default `tailwind.config.js` file looks like at the time of writing: - -```js -module.exports = { - purge: [], - theme: { - extend: {}, - }, - variants: {}, - plugins: [], -}; -``` - -Hopefully that looks good enough to you. - -### What about nested lists? - -Nested lists basically always look bad which is why editors like Medium don't even let you do it, but I guess since some of you goofballs are going to do it we have to carry the burden of at least making it work. - -1. **Nested lists are rarely a good idea.** - - You might feel like you are being really "organized" or something but you are just creating a gross shape on the screen that is hard to read. - - Nested navigation in UIs is a bad idea too, keep things as flat as possible. - - Nesting tons of folders in your source code is also not helpful. -2. **Since we need to have more items, here's another one.** - - I'm not sure if we'll bother styling more than two levels deep. - - Two is already too much, three is guaranteed to be a bad idea. - - If you nest four levels deep you belong in prison. -3. **Two items isn't really a list, three is good though.** - - Again please don't nest lists if you want people to actually read your content. - - Nobody wants to look at this. - - I'm upset that we even have to bother styling this. - -The most annoying thing about lists in Markdown is that `
  • ` elements aren't given a child `

    ` tag unless there are multiple paragraphs in the list item. That means I have to worry about styling that annoying situation too. - -- **For example, here's another nested list.** - - But this time with a second paragraph. - - - These list items won't have `

    ` tags - - Because they are only one line each - -- **But in this second top-level list item, they will.** - - This is especially annoying because of the spacing on this paragraph. - - - As you can see here, because I've added a second line, this list item now has a `

    ` tag. - - This is the second line I'm talking about by the way. - - - Finally here's another list item so it's more like a list. - -- A closing list item, but with no nested list, because why not? - -And finally a sentence to close off this section. - -## There are other elements we need to style - -I almost forgot to mention links, like [this link to the Tailwind CSS website](https://tailwindcss.com). We almost made them blue but that's so yesterday, so we went with dark gray, feels edgier. - -We even included table styles, check it out: - -| Wrestler | Origin | Finisher | -| ----------------------- | ------------ | ------------------ | -| Bret "The Hitman" Hart | Calgary, AB | Sharpshooter | -| Stone Cold Steve Austin | Austin, TX | Stone Cold Stunner | -| Randy Savage | Sarasota, FL | Elbow Drop | -| Vader | Boulder, CO | Vader Bomb | -| Razor Ramon | Chuluota, FL | Razor's Edge | - -We also need to make sure inline code looks good, like if I wanted to talk about `` elements or tell you the good news about `@tailwindcss/typography`. - -### Sometimes I even use `code` in headings - -Even though it's probably a bad idea, and historically I've had a hard time making it look good. This _"wrap the code blocks in backticks"_ trick works pretty well though really. - -Another thing I've done in the past is put a `code` tag inside of a link, like if I wanted to tell you about the [`tailwindcss/docs`](https://github.com/tailwindcss/docs) repository. I don't love that there is an underline below the backticks but it is absolutely not worth the madness it would require to avoid it. - -#### We haven't used an `h4` yet - -But now we have. Please don't use `h5` or `h6` in your content, Medium only supports two heading levels for a reason, you animals. I honestly considered using a `before` pseudo-element to scream at you if you use an `h5` or `h6`. - -We don't style them at all out of the box because `h4` elements are already so small that they are the same size as the body copy. What are we supposed to do with an `h5`, make it _smaller_ than the body copy? No thanks. - -### We still need to think about stacked headings though. - -#### Let's make sure we don't screw that up with `h4` elements, either. - -Phew, with any luck we have styled the headings above this text and they look pretty good. - -Let's add a closing paragraph here so things end with a decently sized block of text. I can't explain why I want things to end that way but I have to assume it's because I think things will look weird or unbalanced if there is a heading too close to the end of the document. - -What I've written here is probably long enough, but adding this final sentence can't hurt. - -## GitHub Flavored Markdown - -I've also added support for GitHub Flavored Mardown using `remark-gfm`. - -With `remark-gfm`, we get a few extra features in our markdown. Example: autolink literals. - -A link like www.example.com or https://example.com would automatically be converted into an `a` tag. - -This works for email links too: contact@example.com. diff --git a/apps/docs/src/content/blog/third-post.md b/apps/docs/src/content/blog/third-post.md deleted file mode 100644 index e4ccc3fe..00000000 --- a/apps/docs/src/content/blog/third-post.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: "Third post" -description: "Lorem ipsum dolor sit amet" -pubDate: "Jul 15 2022" -cover: "/images/blog/placeholder-2.jpg" -category: "design" ---- - -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo viverra. Adipiscing enim eu turpis egestas pretium. Euismod elementum nisi quis eleifend quam adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus et malesuada fames ac turpis egestas. Eget magna fermentum iaculis eu non diam phasellus vestibulum lorem. Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet. - -Morbi tristique senectus et netus. Id semper risus in hendrerit gravida rutrum quisque non tellus. Habitasse platea dictumst quisque sagittis purus sit amet. Tellus molestie nunc non blandit massa. Cursus vitae congue mauris rhoncus. Accumsan tortor posuere ac ut. Fringilla urna porttitor rhoncus dolor. Elit ullamcorper dignissim cras tincidunt lobortis. In cursus turpis massa tincidunt dui ut ornare lectus. Integer feugiat scelerisque varius morbi enim nunc. Bibendum neque egestas congue quisque egestas diam. Cras ornare arcu dui vivamus arcu felis bibendum. Dignissim suspendisse in est ante in nibh mauris. Sed tempus urna et pharetra pharetra massa massa ultricies mi. - -Mollis nunc sed id semper risus in. Convallis a cras semper auctor neque. Diam sit amet nisl suscipit. Lacus viverra vitae congue eu consequat ac felis donec. Egestas integer eget aliquet nibh praesent tristique magna sit amet. Eget magna fermentum iaculis eu non diam. In vitae turpis massa sed elementum. Tristique et egestas quis ipsum suspendisse ultrices. Eget lorem dolor sed viverra ipsum. Vel turpis nunc eget lorem dolor sed viverra. Posuere ac ut consequat semper viverra nam. Laoreet suspendisse interdum consectetur libero id faucibus. Diam phasellus vestibulum lorem sed risus ultricies tristique. Rhoncus dolor purus non enim praesent elementum facilisis. Ultrices tincidunt arcu non sodales neque. Tempus egestas sed sed risus pretium quam vulputate. Viverra suspendisse potenti nullam ac tortor vitae purus faucibus ornare. Fringilla urna porttitor rhoncus dolor purus non. Amet dictum sit amet justo donec enim. - -Mattis ullamcorper velit sed ullamcorper morbi tincidunt. Tortor posuere ac ut consequat semper viverra. Tellus mauris a diam maecenas sed enim ut sem viverra. Venenatis urna cursus eget nunc scelerisque viverra mauris in. Arcu ac tortor dignissim convallis aenean et tortor at. Curabitur gravida arcu ac tortor dignissim convallis aenean et tortor. Egestas tellus rutrum tellus pellentesque eu. Fusce ut placerat orci nulla pellentesque dignissim enim sit amet. Ut enim blandit volutpat maecenas volutpat blandit aliquam etiam. Id donec ultrices tincidunt arcu. Id cursus metus aliquam eleifend mi. - -Tempus quam pellentesque nec nam aliquam sem. Risus at ultrices mi tempus imperdiet. Id porta nibh venenatis cras sed felis eget velit. Ipsum a arcu cursus vitae. Facilisis magna etiam tempor orci eu lobortis elementum. Tincidunt dui ut ornare lectus sit. Quisque non tellus orci ac. Blandit libero volutpat sed cras. Nec tincidunt praesent semper feugiat nibh sed pulvinar proin gravida. Egestas integer eget aliquet nibh praesent tristique magna. diff --git a/apps/docs/src/content/blog/using-mdx.mdx b/apps/docs/src/content/blog/using-mdx.mdx deleted file mode 100644 index ec5b49d8..00000000 --- a/apps/docs/src/content/blog/using-mdx.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: "Using MDX" -description: "Lorem ipsum dolor sit amet" -pubDate: "Jul 02 2022" -cover: "/images/blog/placeholder-5.jpg" -category: "code" ---- - -This theme comes with the [@astrojs/mdx](https://docs.astro.build/en/guides/integrations-guide/mdx/) integration installed and configured in your `astro.config.mjs` config file. If you prefer not to use MDX, you can disable support by removing the integration from your config file. - -## Why MDX? - -MDX is a special flavor of Markdown that supports embedded JavaScript & JSX syntax. This unlocks the ability to [mix JavaScript and UI Components into your Markdown content](https://docs.astro.build/en/guides/markdown-content/#mdx-features) for things like interactive charts or alerts. - -If you have existing content authored in MDX, this integration will hopefully make migrating to Astro a breeze. - -## Example - -Here is how you import and use a UI component inside of MDX. -When you open this page in the browser, you should see the clickable button below. - -## More Links - -- [MDX Syntax Documentation](https://mdxjs.com/docs/what-is-mdx) -- [Astro Usage Documentation](https://docs.astro.build/en/guides/markdown-content/#markdown-and-mdx-pages) -- **Note:** [Client Directives](https://docs.astro.build/en/reference/directives-reference/#client-directives) are still required to create interactive components. Otherwise, all components in your MDX will render as static HTML (no JavaScript) by default. diff --git a/apps/docs/src/content/config.ts b/apps/docs/src/content/config.ts index 239897e2..cf08e1b7 100644 --- a/apps/docs/src/content/config.ts +++ b/apps/docs/src/content/config.ts @@ -8,7 +8,7 @@ const blog = defineCollection({ title: z.string(), description: z.string(), cover: z.string(), - category: z.string(), + category: z.string().optional(), // Transform string to Date object pubDate: z .string() diff --git a/apps/docs/src/layouts/BlogPost.astro b/apps/docs/src/layouts/BlogPost.astro index d7148b90..f90fb0fe 100644 --- a/apps/docs/src/layouts/BlogPost.astro +++ b/apps/docs/src/layouts/BlogPost.astro @@ -29,14 +29,6 @@ const { title, description, pubDate, updatedDate, cover, category } =

    - - - {category} - - post.data.category).flat()), - ]; - - return uniqueCategories.map((category) => { - const filteredPosts = allPosts - .filter((post) => post.data.category.includes(category)) - .sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf()); - return { - params: { category }, - props: { posts: filteredPosts }, - }; - }); -} - -const { category } = Astro.params; -const { posts } = Astro.props; ---- - - -
    - - -
    - {posts.map((post) => )} -
    -
    -