Skip to content

Commit

Permalink
Fix: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
C2Coder committed Jan 30, 2025
1 parent e577377 commit 66d5d75
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 11 deletions.
3 changes: 1 addition & 2 deletions projectIndexer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
from os import path, chdir
import click
from src.fetch_data import FetchData
from src.generate_web import GenerateWeb
Expand Down Expand Up @@ -110,7 +109,7 @@ def generate(github_token: str, fetch_directly: bool, input_repos: str, input_re
@click.option('--build-dir', default='build', help='build directory (default is build)')
@click.option('--no-livereload', default=False, is_flag=True, help='Disable live reload and serve only once')
def serve(port: int, host: str, build_dir: str, no_livereload: bool):
chdir(build_dir)
os.chdir(build_dir)
if no_livereload:
import http.server
import socketserver
Expand Down
7 changes: 1 addition & 6 deletions src/generate_web.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import os
import random
import re
import requests
from datetime import datetime
from os import path, makedirs
from pprint import pprint
from typing import Union

from github import Repository
Expand All @@ -13,8 +10,6 @@
import subprocess
import logging

from markdown import markdown

from src.jinja_extensions.color_extension import ColorExtension
from src.web_helpers import load_projects, fix_readme_relative_images, conv_markdown

Expand Down Expand Up @@ -252,7 +247,7 @@ def render_page(self, template_name: Union[str, "Template"], path_render: str, *
with open(full_path, 'w') as f:
if self.verbose:
logger.info(f"Generating {path}")
f.write(template.render(**kwargs))
f.write(template.render(**kwargs, now=datetime.now().year))
except Exception as e:
logger.error(f"Error while generating {path_render}")
logger.error(e)
Expand Down
1 change: 0 additions & 1 deletion src/web_helpers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
from typing import IO
import markdown
import yaml

Expand Down
2 changes: 1 addition & 1 deletion templates/repos.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ <h2 class="dark:text-white text-xl font-bold text-zinc-800 mb-1">{{ repo.name }}
</div>
</div>
<div class="flex-grow"></div>
<div class="mt-auto bg-zinc-100 border-t rounded-b-xl dark:bg-zinc-900 dark:border-zinc-700">
<div class="mt-auto border-t rounded-b-xl dark:border-zinc-700">
{# dont know what to use #}
{# <p class="mt-1 text-sm text-zinc-500 dark:text-zinc-500">
Last updated: {{ repo.updated_at.strftime("%d-%m-%Y") }}
Expand Down
2 changes: 1 addition & 1 deletion templates/repos_cs.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ <h2 class="dark:text-white text-xl font-bold text-zinc-800 mb-1">{{ repo.name }}
</div>
</div>
<div class="flex-grow"></div>
<div class="mt-auto bg-zinc-100 border-t rounded-b-xl dark:bg-zinc-900 dark:border-zinc-700">
<div class="mt-auto border-t rounded-b-xl dark:border-zinc-700">
{# dont know what to use #}
{# <p class="mt-1 text-sm text-zinc-500 dark:text-zinc-500">
Last updated: {{ repo.updated_at.strftime("%d-%m-%Y") }}
Expand Down

0 comments on commit 66d5d75

Please sign in to comment.