From 36855fe7fb05ab328849eba9b21448b8ff309226 Mon Sep 17 00:00:00 2001 From: SG Date: Thu, 5 Jun 2025 16:36:16 +0300 Subject: [PATCH] Updates --- .gitignore | 3 ++- hydrogen.py | 5 ++++- robots.txt => static/robots.txt | 0 templates/index.html | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) rename robots.txt => static/robots.txt (100%) diff --git a/.gitignore b/.gitignore index 67eba04..eb078e8 100644 --- a/.gitignore +++ b/.gitignore @@ -168,4 +168,5 @@ cython_debug/ # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ -public \ No newline at end of file +public +content/* \ No newline at end of file diff --git a/hydrogen.py b/hydrogen.py index 5f89215..82324c4 100644 --- a/hydrogen.py +++ b/hydrogen.py @@ -30,7 +30,7 @@ class ContentItemPrototype: self.slug = md_file.stem self.data = frontmatter.load(md_file) self.html = markdown.markdown(self.data.content) - self.preview = self.html[:300] + " ...read more" + self.preview = self.html[:300] + "... read more" self.title = self.data.get("title", self.slug) self.omit_second_title = self.data.get("omit_second_title", False) self.date = self.data.get("data", "2000-01-01T00:00:00+03:00") @@ -85,3 +85,6 @@ with (output_dir / "index.html").open("w", encoding="utf-8") as f: # Render the about file about_content = ContentItemPrototype(Path('static/about.md')) about_content.render_content() + +# Move 'robots.txt' into output_dir +shutil.copyfile(static_dir / 'robots.txt', output_dir / 'robots.txt') \ No newline at end of file diff --git a/robots.txt b/static/robots.txt similarity index 100% rename from robots.txt rename to static/robots.txt diff --git a/templates/index.html b/templates/index.html index 2c8fe7f..ea39c43 100644 --- a/templates/index.html +++ b/templates/index.html @@ -7,7 +7,7 @@
{{ content_item.title }}
-
{{ content_item.title }}
+
{{ content_item.title }}

{{ content_item.preview | safe}}