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/ .venv/
*.conf *.conf

View File

@ -1,3 +1,3 @@
clean: clean:
rm --recursive --force build rm --recursive --force export
rm --force nginx.conf 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])}" 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: def get_args() -> argparse.Namespace:
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
@ -131,7 +137,6 @@ def get_args() -> argparse.Namespace:
parser.add_argument( parser.add_argument(
"-c", "--check", action="store_true", help="Check the config without building" "-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() return parser.parse_args()
@ -139,7 +144,7 @@ def main():
args = get_args() args = get_args()
cwd = Path.cwd().resolve() cwd = Path.cwd().resolve()
output = cwd / "build" output = cwd / "export"
explore = output / "explore" explore = output / "explore"
with Path(args.config).resolve().open() as infile: with Path(args.config).resolve().open() as infile:

View File

@ -7,6 +7,33 @@ static:
- index.html - index.html
- robots.txt - robots.txt
posts: 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 - title: A 1:1 recreation of the set for Star Trek the Original Series
slug: star-trek-set-tours slug: star-trek-set-tours
location: location:
@ -17,16 +44,22 @@ posts:
links: links:
- title: Star Trek Set Tours - title: Star Trek Set Tours
link: https://www.startrektour.com/ link: https://www.startrektour.com/
media: media: []
- title: Foo Bar Baz
content: Fizz buzz, lorem ipsum dolher, siamet - title: The most successful forest conservation project in the USA
source: https://cdn.enp.one/img/backgrounds/cl-network.jpg slug: mount-greylock
- title: Foo Bar Baz location:
content: Fizz buzz, lorem ipsum dolher, siamet title: North Adams, MA
source: https://cdn.enp.one/img/backgrounds/cl-network.jpg link: https://maps.google.com
- title: Foo Bar Baz date: "2020-01-01"
content: Fizz buzz, lorem ipsum dolher, siamet banner: https://cdn.enp.one/img/backgrounds/cl-photo-denver.jpg
source: https://cdn.enp.one/img/backgrounds/cl-network.jpg media: []
- title: Foo Bar Baz
content: Fizz buzz, lorem ipsum dolher, siamet - title: Ghosts of parties past are the last inhabitants of this magnificent forest castle
source: https://cdn.enp.one/img/backgrounds/cl-network.jpg 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 { location = robots.txt {
allow all; allow all;
log_not_found off; log_not_found off;
access_log off; access_log off;
} }
location = explore/ { location = explore/ {
index index.html index index.html
} }
location ~* explore/(.*)/ { location ~* explore/(.*)/ {