diff --git a/src/components/HomeButton.astro b/src/components/HomeButton.astro new file mode 100644 index 0000000..552d33e --- /dev/null +++ b/src/components/HomeButton.astro @@ -0,0 +1,15 @@ +--- +--- + + + + + + Home + + + \ No newline at end of file diff --git a/src/content/posts/code-examples.md b/src/content/posts/code-examples.md new file mode 100644 index 0000000..a410175 --- /dev/null +++ b/src/content/posts/code-examples.md @@ -0,0 +1,110 @@ +--- +title: Code Examples +description: Aurghhhhhh +pubDate: 2022-07-08 +image: + url: https://docs.astro.build/assets/arc.webp + alt: Tennis balls +tags: + - Gaybo +--- + +Penitc + +```astro +--- +import { getPosts } from "../../utils"; +import Layout from "../../layouts/Layout.astro"; +import Markdown from "../../layouts/Markdown.astro"; + +export async function getStaticPaths() { + const collection = await getPosts("projects"); + + return collection.map((post, i) => ({ + params: { slug: post.slug }, + props: { + post: post, + prev: i > 0 ? collection[i - 1] : undefined, + next: i < collection.length - 1 ? collection[i + 1] : undefined + } + })); +} + +const { post, prev, next } = Astro.props; +--- + + + + +``` + +```scss +.astro-code { + padding: 36px 8px 8px; + + position: relative; + + display: block; + + font-size: 13px; + + border-radius: $radius; + + &::before { + content: "lang: " attr(data-language); + + padding: 4px 8px; + + width: 100%; + height: 28px; + + position: absolute; + top: 0; + left: 0; + + font-size: 13px; + + background-color: $gray; + color: $light; + } +} +``` + +```go +func (p *penTool) Render() raylib.Texture2D { + offset := raylib.Vector2Scale(canvas.Offset, -1) + texture := raylib.LoadRenderTexture(int32(canvas.Size.X), int32(canvas.Size.Y)) + + raylib.BeginTextureMode(texture) + raylib.ClearBackground(raylib.Fade(raylib.Black, 0)) + for i := 0; i < len(p.Points)-1; i++ { + startPointOffset := raylib.Vector2Add(p.Points[i], offset) + endPointOffset := raylib.Vector2Add(p.Points[i+1], offset) + raylib.DrawLineEx(startPointOffset, endPointOffset, p.Size, p.Color) + raylib.DrawCircle(int32(startPointOffset.X), int32(startPointOffset.Y), p.Size/2, p.Color) + } + if len(p.Points) > 0 { + endPointOffset := raylib.Vector2Add(p.Points[len(p.Points)-1], offset) + raylib.DrawCircle(int32(endPointOffset.X), int32(endPointOffset.Y), p.Size/2, p.Color) + } + raylib.EndTextureMode() + + return texture.Texture +} +``` + +```python +from django.db import models + + +class Article(models.Model): + title = models.CharField(max_length=255) + slug = models.SlugField() + body = models.TextField() + date = models.DateTimeField(auto_now_add=True) + thumb = models.ImageField(default="default.png", blank=True) + published = models.BooleanField(default=False) + + def __str__(self): + return self.title +``` \ No newline at end of file diff --git a/src/layouts/Markdown.astro b/src/layouts/Markdown.astro index 53f8c89..38b88d3 100644 --- a/src/layouts/Markdown.astro +++ b/src/layouts/Markdown.astro @@ -1,4 +1,6 @@ --- +import HomeButton from "../components/HomeButton.astro"; + interface Props { post: any, } @@ -8,36 +10,44 @@ const { post, prev, next, base } = Astro.props; const { Content } = await post.render(); --- -Home +

{post.data.title}

{post.data.description}

-

- +
+ +

-
    +
    • {prev && ( )}
    • {next && ( )}
    • @@ -46,35 +56,44 @@ const { Content } = await post.render(); diff --git a/src/pages/posts/index.astro b/src/pages/posts/index.astro index f435bad..c3db1d5 100644 --- a/src/pages/posts/index.astro +++ b/src/pages/posts/index.astro @@ -1,6 +1,7 @@ --- import { getPosts } from "../../utils"; import Layout from "../../layouts/Layout.astro"; +import HomeButton from "../../components/HomeButton.astro"; import Card from "../../components/Card.astro"; import BannerImg from "../../../public/banner-alt.webp"; @@ -8,7 +9,7 @@ const posts = await getPosts("posts"); --- - Home +

      All Posts

      @@ -27,7 +28,3 @@ const posts = await getPosts("posts"); ))}
    - - diff --git a/src/pages/projects/index.astro b/src/pages/projects/index.astro index 432932d..35d94ca 100644 --- a/src/pages/projects/index.astro +++ b/src/pages/projects/index.astro @@ -3,12 +3,13 @@ import { getPosts } from "../../utils"; import Layout from "../../layouts/Layout.astro"; import Card from "../../components/Card.astro"; import BannerImg from "../../../public/banner-alt.webp"; +import HomeButton from "../../components/HomeButton.astro"; const projects = await getPosts("projects"); --- - Home +

    All Projects

    @@ -27,7 +28,3 @@ const projects = await getPosts("projects"); ))}
- - diff --git a/src/styles/_button.scss b/src/styles/_button.scss index 9bf494f..7213a73 100644 --- a/src/styles/_button.scss +++ b/src/styles/_button.scss @@ -1,5 +1,5 @@ .button { - padding: 0 32px; + padding: 0 20px; width: max-content; height: 35px; @@ -12,6 +12,7 @@ align-items: center; gap: 8px; + font-size: 14px; text-decoration: none; border-radius: 9999px; diff --git a/src/styles/_pill_list.scss b/src/styles/_pill_list.scss index 664afa5..f05ddbe 100644 --- a/src/styles/_pill_list.scss +++ b/src/styles/_pill_list.scss @@ -1,11 +1,9 @@ .pill-list { + padding: 0; + display: flex; flex-direction: row; flex-wrap: wrap; - gap: 8px; - // if the anchor tag has the pill class - > li { - list-style: none; - } + gap: 8px; } diff --git a/src/styles/_project_list.scss b/src/styles/_project_list.scss index 59d34eb..499d617 100644 --- a/src/styles/_project_list.scss +++ b/src/styles/_project_list.scss @@ -5,8 +5,4 @@ flex-direction: column; gap: 16px; - - > li { - list-style: none; - } } diff --git a/src/styles/_reset.scss b/src/styles/_reset.scss index 8aa9ca4..66dccd7 100644 --- a/src/styles/_reset.scss +++ b/src/styles/_reset.scss @@ -10,6 +10,9 @@ html { min-height: 100vh; font-size: 100%; + text-size-adjust: none; + -webkit-text-size-adjust: none; + -moz-text-size-adjust: none; } body { @@ -23,3 +26,13 @@ body { background-color: #261f1b; color: $light; } + +ul[role='list'], +ol[role='list'] { + list-style: none; +} + +img, picture { + max-width: 100%; + display: block; +}