mirror of
https://github.com/Fluffy-Bean/website.git
synced 2024-12-26 17:36:12 +00:00
Import old blogpost
Add more tags Fix some styling issues I found
This commit is contained in:
parent
3592650efc
commit
c39c794892
51
src/content/posts/2023_06_19-Hello-Django.mdx
Normal file
51
src/content/posts/2023_06_19-Hello-Django.mdx
Normal file
|
@ -0,0 +1,51 @@
|
|||
---
|
||||
title: Hello, Django!
|
||||
description: Imported blog from old website
|
||||
pubDate: 2023-06-19
|
||||
tags:
|
||||
- python
|
||||
- django
|
||||
- caddy
|
||||
- networking
|
||||
---
|
||||
import Note from "../../components/Note.astro";
|
||||
|
||||
<Note text="This is an older blog post imported from my old Django website" />
|
||||
|
||||
Wow, first ever blog! It's kind of ridiculous that somebody would think to start that only in 2023, since the cool thing to do now is to post on social media. Then again, the entire internet feels like it's falling apart now—fun!
|
||||
|
||||
Welp, where to start? Maybe how this page was made and the suffering I went through to get it running? sound good to me!
|
||||
|
||||
## Why Django????
|
||||
|
||||
This website runs on [Django](https://www.djangoproject.com/), a Python framework that I went with for a few reasons.
|
||||
|
||||
Firstly, I love Python and how fast and easy it is to make things in it. If you need to make something using it, most likely there is a package for it out there or a guide to making it yourself.
|
||||
|
||||
Secondly, I wanted to try something other than Flask. While Flask is great and all, I wanted to try something else, as Flask is terribly slow at serving static files, something that'll come to bite me later.
|
||||
|
||||
Lastly, I don't like JavaScript, why is this important? Someone out there will tell me to have used something like Vue to make this page. My answer is no. Not every single page out there needs to be made using an entire framework, you can get the exact same results with a static HTML file and a little bit of vanilla JS.
|
||||
|
||||
## On I love networking.
|
||||
|
||||
During the writing of this post, I actually experienced a lot of issues, none that Django itself caused but rather the terrible way I got everything setup. As I was setting this page up with Docker, Caddy was my proxy for my network, and it did its job for the most part. But it was very different from what I was used to with Nginx and lacked many features I wanted, such as RTMP, which it was not made for but Nginx comes with by default.
|
||||
|
||||
My network is also setup in a way that I have my websites running on a different container than my proxy, this is how I always had it, Nginx never complained, but oh boy, did Caddy give me a lot of issues that I'll get into in just a moment.
|
||||
|
||||
So, why is this an issue?
|
||||
|
||||
Django doesn't serve static files, the main reason being that the developers aren't interested in making a web server but a web framework. This means that Caddy had to handle the serving of static files. This is cool and all, but I've never done this before, so down a rabbit hole I went.
|
||||
|
||||
First I tried the obvious, getting Caddy to `root` the files on `webserver.ip/website/static` and `webserver.ip/website/media`. Nope! Apparently, Caddy can only serve static files from local files, not from a subdomain on a local IP. This would mean I have three options:
|
||||
|
||||
1. Move Caddy onto my web server.
|
||||
2. SSH mount the files from my web server to my proxy server.
|
||||
3. Use a different proxy server.
|
||||
|
||||
In the end, I went with the third option, I went back to `Nginx Proxy Manager` (amazing tool, by the way), and setup everything from scratch again. If you are reading this, then I got everything working, yey!
|
||||
|
||||
## Final thoughts
|
||||
|
||||
After all of that, switching proxies, dropping Docker, and a lot of suffering, I got this page working. Overall, would I go with Django again? Most likely! It was fast and easy to learn, and it has some really nice features. Though I wish Python was faster so I could use this for larger projects :c
|
||||
|
||||
While I continue to work out bugs on this page and my terrible server management, enjoy reading the slop in the blog 😋
|
|
@ -1,18 +1,28 @@
|
|||
---
|
||||
title: Astro is hard....
|
||||
description: Arugh
|
||||
description: Writing blogs is even harder
|
||||
pubDate: 2024-05-28
|
||||
tags:
|
||||
- astro
|
||||
- typescript
|
||||
---
|
||||
|
||||
import Note from "../../components/Note.astro";
|
||||
Hello! Welcome to my new website, or at least as of writing this blog.
|
||||
It's been written from scratch with Astro, Typescript and a lot of suffering, mostly due to bugs and random annoyances...
|
||||
|
||||
<Note text="I have no clue what I'm doing :3" />
|
||||
So where do I start, maybe _why_ I have chosen Astro over other existing options.
|
||||
|
||||
- I've been trying to learn typescript through trying astro
|
||||
- Astro is hard, due to all the issues I've encountered
|
||||
## Why Astro
|
||||
TLDR: I don't know :3
|
||||
|
||||
- I've been trying to learn typescript through trying astro
|
||||
- Astro is hard, due to all the issues I've encountered
|
||||
|
||||
## The problems
|
||||
- Issue with Astros `getEntries()` not working, thus having to implement my own method
|
||||
- Fighting with Astro to display banner images, it won
|
||||
- Using external plugins for images/slides
|
||||
- Specifically passing variables into scripts
|
||||
|
||||
```typescript
|
||||
export async function getTagsBySlug(
|
||||
|
@ -34,3 +44,8 @@ export async function getTagsBySlug(
|
|||
return tags;
|
||||
}
|
||||
```
|
||||
|
||||
## What I've learned
|
||||
- More experience writing in Typescript
|
||||
- Learning about MDX accidentally
|
||||
- Reading Documentation, ironically
|
||||
|
|
3
src/content/tags/caddy.md
Normal file
3
src/content/tags/caddy.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
name: Caddy
|
||||
---
|
3
src/content/tags/django.md
Normal file
3
src/content/tags/django.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
name: Django
|
||||
---
|
3
src/content/tags/networking.md
Normal file
3
src/content/tags/networking.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
name: Networking
|
||||
---
|
3
src/content/tags/python.md
Normal file
3
src/content/tags/python.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
name: Python
|
||||
---
|
|
@ -205,7 +205,8 @@ const tags = await getTagsBySlug(post.data.tags);
|
|||
border-top: 2px solid $gray;
|
||||
}
|
||||
|
||||
p code {
|
||||
// Style code only if it's not a child of .astro-code
|
||||
:not(.astro-code) > code {
|
||||
padding: 2px 4px;
|
||||
|
||||
font-size: 13px;
|
||||
|
|
|
@ -27,8 +27,9 @@ tags.forEach((tag) => {
|
|||
<ul role="list" class="pill-list">
|
||||
{tags.map(tag => (
|
||||
<li>
|
||||
<a class="button" href=`/search/${tag.slug}`>
|
||||
{tag.data.name} {tag.data.postCount}
|
||||
<a class="pill large" href=`/search/${tag.slug}`>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor" viewBox="0 0 256 256"><path d="M216,152H168V104h48a8,8,0,0,0,0-16H168V40a8,8,0,0,0-16,0V88H104V40a8,8,0,0,0-16,0V88H40a8,8,0,0,0,0,16H88v48H40a8,8,0,0,0,0,16H88v48a8,8,0,0,0,16,0V168h48v48a8,8,0,0,0,16,0V168h48a8,8,0,0,0,0-16Zm-112,0V104h48v48Z"></path></svg>
|
||||
{tag.data.name} - {tag.data.postCount}
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
|
|
Loading…
Reference in a new issue