Compare commits

...

5 Commits

5 changed files with 64 additions and 21 deletions

2
.gitignore vendored
View File

@ -1,3 +1,3 @@
build/
export/
.venv/
*.conf

View File

@ -1,3 +1,3 @@
clean:
rm --recursive --force build
rm --recursive --force export
rm --force nginx.conf

View File

@ -122,6 +122,12 @@ class ConfigSerializer(msh.Schema):
f"Post slugs used multiple times: {set([item for item in slugs if slugs.count(item) > 1])}"
)
@msh.post_load
def _remove_future(self, data: Dict[str, Any], *args, **kwargs) -> PostContainer:
posts = [item for item in data["posts"] if item.date >= datetime.date.today()]
data["posts"] = posts
return data
def get_args() -> argparse.Namespace:
parser = argparse.ArgumentParser()
@ -131,7 +137,6 @@ def get_args() -> argparse.Namespace:
parser.add_argument(
"-c", "--check", action="store_true", help="Check the config without building"
)
parser.add_argument("-p", "--publish", action="store_true", help="Publish the site")
return parser.parse_args()
@ -139,7 +144,7 @@ def main():
args = get_args()
cwd = Path.cwd().resolve()
output = cwd / "build"
output = cwd / "export"
explore = output / "explore"
with Path(args.config).resolve().open() as infile:

View File

@ -7,6 +7,33 @@ static:
- index.html
- robots.txt
posts:
- title: Talcott's "Castle on the Mountain" does not dissapoint
slug: heubline-tower
location:
title: Simsbury, CT
link: https://maps.google.com
date: "2020-01-01"
banner: https://cdn.enp.one/img/backgrounds/cl-photo-denver.jpg
media: []
- title: The three hundred year old fort with delusions of grandeur
slug: fort-revere
location:
title: Hull, MA
link: https://maps.google.com
date: "2020-01-01"
banner: https://cdn.enp.one/img/backgrounds/cl-photo-denver.jpg
media: []
- title: Supervillian lair or air traffic control station?
slug: jss-north-truro
location:
title: North Truro, MA
link: https://maps.google.com
date: "2020-01-01"
banner: https://cdn.enp.one/img/backgrounds/cl-photo-denver.jpg
media: []
- title: A 1:1 recreation of the set for Star Trek the Original Series
slug: star-trek-set-tours
location:
@ -17,16 +44,22 @@ posts:
links:
- title: Star Trek Set Tours
link: https://www.startrektour.com/
media:
- title: Foo Bar Baz
content: Fizz buzz, lorem ipsum dolher, siamet
source: https://cdn.enp.one/img/backgrounds/cl-network.jpg
- title: Foo Bar Baz
content: Fizz buzz, lorem ipsum dolher, siamet
source: https://cdn.enp.one/img/backgrounds/cl-network.jpg
- title: Foo Bar Baz
content: Fizz buzz, lorem ipsum dolher, siamet
source: https://cdn.enp.one/img/backgrounds/cl-network.jpg
- title: Foo Bar Baz
content: Fizz buzz, lorem ipsum dolher, siamet
source: https://cdn.enp.one/img/backgrounds/cl-network.jpg
media: []
- title: The most successful forest conservation project in the USA
slug: mount-greylock
location:
title: North Adams, MA
link: https://maps.google.com
date: "2020-01-01"
banner: https://cdn.enp.one/img/backgrounds/cl-photo-denver.jpg
media: []
- title: Ghosts of parties past are the last inhabitants of this magnificent forest castle
slug: castle-of-madame-sherri
location:
title: Chesterfield, NH
link: https://maps.google.com
date: "2020-01-01"
banner: https://cdn.enp.one/img/backgrounds/cl-photo-denver.jpg
media: []

View File

@ -1,11 +1,16 @@
error_page 404 error/404.html;
location = error/404.html {
internal;
}
location = robots.txt {
allow all;
log_not_found off;
access_log off;
allow all;
log_not_found off;
access_log off;
}
location = explore/ {
index index.html
index index.html
}
location ~* explore/(.*)/ {