diff --git a/gawa/blog/data/articles/en-bash-arrays.md b/gawa/blog/data/articles/en-bash-arrays.md index 297584d..c2556f0 100644 --- a/gawa/blog/data/articles/en-bash-arrays.md +++ b/gawa/blog/data/articles/en-bash-arrays.md @@ -3,7 +3,6 @@ Title: Bash Arrays Subtitle: sub Desc: Brief intro to Bash Arrays Date: 2023-09-29 -Thumbnail: media/thumbnails/wayland.png Keywords: bash technology Category: Test diff --git a/gawa/blog/data/articles/en-test.md b/gawa/blog/data/articles/en-test.md index c2556f0..b580c5e 100644 --- a/gawa/blog/data/articles/en-test.md +++ b/gawa/blog/data/articles/en-test.md @@ -3,6 +3,7 @@ Title: Bash Arrays Subtitle: sub Desc: Brief intro to Bash Arrays Date: 2023-09-29 +Thumbnail: img/thumbnails/bash.png Keywords: bash technology Category: Test diff --git a/gawa/blog/models.py b/gawa/blog/models.py index c5e9041..58cd154 100644 --- a/gawa/blog/models.py +++ b/gawa/blog/models.py @@ -54,7 +54,10 @@ class BlogPost(Searchable): body_de = models.TextField(blank=True, default="") category = models.ForeignKey( Category, on_delete=models.SET_NULL, null=True) - thumbnail = models.ImageField(blank=True, upload_to="img/thumbnails") + thumbnail = models.ImageField( + blank=True, + upload_to="img/thumbnails", + default="img/thumbnails/default.jpg") featured = models.BooleanField(default=False) langs = models.CharField( default="['en': False, 'de': False]", max_length=64) @@ -107,9 +110,9 @@ class BlogPost(Searchable): self.date = meta_en["date"][0] self.featured = meta_en["featured"][0] == "True" self.public = meta_en["public"][0] == "True" - # self.thumbnail = meta_en["thumbnail"] + if "thumbnail" in meta_en: + self.thumbnail = meta_en["thumbnail"][0] # TODO: parse keywords from markdown - # TODO: parse category from markdown try: category: Category = Category.objects.get( @@ -120,8 +123,6 @@ class BlogPost(Searchable): logger.debug(f"category of {self}: {category}") self.category = category - # if keyword or category do not exist, create them - # I suppose except Exception as e: logger.warning( f"could not generate metadata {self.slug} from markdown: {e}") diff --git a/gawa/media/img/thumbnails/AlbumCover.png b/gawa/media/img/thumbnails/AlbumCover.png deleted file mode 100644 index 51a81fa..0000000 Binary files a/gawa/media/img/thumbnails/AlbumCover.png and /dev/null differ diff --git a/gawa/media/img/thumbnails/bash.png b/gawa/media/img/thumbnails/bash.png new file mode 100644 index 0000000..2ede2ad Binary files /dev/null and b/gawa/media/img/thumbnails/bash.png differ diff --git a/gawa/media/img/thumbnails/default.jpg b/gawa/media/img/thumbnails/default.jpg new file mode 100644 index 0000000..c808d08 Binary files /dev/null and b/gawa/media/img/thumbnails/default.jpg differ diff --git a/gawa/media/img/thumbnails/wayland_logo.png b/gawa/media/img/thumbnails/wayland_logo.png deleted file mode 100644 index 06c7038..0000000 Binary files a/gawa/media/img/thumbnails/wayland_logo.png and /dev/null differ