mirror of
https://github.com/Fluffy-Bean/website.git
synced 2025-05-29 14:53:16 +00:00
Markdown reset
Move home button to its own component thang CSS reset stufffffff Leg
This commit is contained in:
parent
b491b07bea
commit
8c02e380d0
11 changed files with 213 additions and 56 deletions
110
src/content/posts/code-examples.md
Normal file
110
src/content/posts/code-examples.md
Normal file
|
@ -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;
|
||||
---
|
||||
|
||||
<Layout title=`Leggy Land - ${post.data.title}` src={post.data.image.url} alt={post.data.image.alt}>
|
||||
<Markdown {post} {prev} {next} base="/projects" />
|
||||
</Layout>
|
||||
```
|
||||
|
||||
```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
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue