!wip Add initial configuration structure

This commit is contained in:
Ethan Paul 2021-02-18 21:14:22 -05:00
parent 4a4bb10ca4
commit 6fff0c7d69
No known key found for this signature in database
GPG Key ID: D0E2CBF1245E92BF
3 changed files with 72 additions and 0 deletions

View File

View File

@ -0,0 +1,72 @@
import datetime
import enum
from dataclasses import dataclass
from pathlib import Path
from typing import List
from typing import Optional
from typing import Union
class OrderBy(enum.Enum):
TITLE = enum.auto()
DATE = enum.auto()
DATE_INVERTED = enum.auto()
NATIVE = enum.auto()
@dataclass
class MetroPostMedia:
title: Optional[str]
description: Optional[str]
image: Union[str, Path]
embed: str
datetime: Union[datetime.date, datetime.datetime]
@dataclass
class MetroPost:
slug: str
title: Optional[str]
subtitle: Optional[str]
unlist: bool
media: List[MetroPostMedia]
@dataclass
class MetroMediaLicense:
name: str
link: str
badge: str
@dataclass
class MetroMediaImagesSizes:
desktop: int
mobile: int
preview: int
@dataclass
class MetroMediaImage:
sizes: MetroMediaImagesSizes
link_original: bool
force_download: bool
@dataclass
class MetroMedia:
license: MetroMediaLicense
image: MetroMediaImage
@dataclass
class MetroSettings:
title: str
base_url: str
source: Path
output: Path
theme: str
orderby: OrderBy
media: MetroMedia
posts: List[MetroPost]