SalaMuseoGames/local.sh

45 lines
942 B
Bash
Raw Normal View History

2023-12-21 00:35:17 +01:00
#!/bin/sh
cd "$( dirname "$( realpath "$0" )" )"
[ "$1" = "update" ] && \
2024-01-20 18:00:04 +01:00
Message="$( [ -n "$2" ] && echo "$2" || cat .CommitMessage.txt )" && \
2024-01-20 17:51:03 +01:00
git add . && git commit -m ": ${Message}" && git push
2023-12-21 00:35:17 +01:00
[ "$1" = "newpost" ] && [ -n "$2" ] && [ -n "$3" ] && \
mkdir -p "./assets/media/games/$2" && \
2024-01-20 17:51:03 +01:00
echo "Add $2 [$3]" > .CommitMessage.txt && \
2023-12-21 00:35:17 +01:00
cat << [EOF] > "./_posts/$3-$2.md"
---
layout: "post"
2024-04-02 21:11:53 +02:00
title: "$([ -n "$4" ] && curl -L "https://www.mobygames.com/game/$4/" | grep '<meta property="og:title"' | cut -b36-)"
2023-12-21 00:35:17 +01:00
subtitle: ""
description: ""
image: "/assets/media/games/$2/"
image_source: "internal"
category: "games"
tags:
- ""
author: "octobot"
2024-04-02 21:11:53 +02:00
mobygames_id: "$4"
2023-12-21 00:35:17 +01:00
software_data:
2024-04-02 21:11:53 +02:00
platform: ""
frame_url: ""
release:
region: ""
source: ""
type: ""
screen:
orientation: ""
display: ""
2023-12-21 00:35:17 +01:00
---
## About the game
<!-- [...] -->
2023-12-21 00:35:17 +01:00
## Resources
* Official page of the game; Cover image credits: <>
[EOF]