-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Added github JSON loader and Fixed JS Search #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dpswirld
merged 7 commits into
main
from
44-chore-load-github-json-and-updated-js-search
May 1, 2025
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
06d4816
Added github JSON loader
dpswirld 2d62d13
Update src/static_site_generator.py
dpswirld 9cf8ff8
feat: Refactor to include as a version2query class (#46)
rbarker-dev 92f197b
feat: MVP complete -- Update filters to include teams and generate th…
rbarker-dev 919dea4
Restructure and linked proj organization
dpswirld 8541cbb
Merge branch 'main' into 44-chore-load-github-json-and-updated-js-search
dpswirld cc41280
Apply suggestions from code review
dpswirld File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,34 @@ | ||
from jinja2 import Environment, FileSystemLoader | ||
import logging | ||
|
||
# Example data | ||
GENERATOR_DATA = { | ||
'title': 'Version Two', | ||
'github_user': 'octocat', | ||
'team': 'Platform Engineering', | ||
'tasks': [] | ||
} | ||
|
||
def generate_site(data=None, output_file='./_site/index.html'): | ||
env = Environment(loader=FileSystemLoader('templates')) | ||
template = env.get_template('kaban_board.html') | ||
class StaticSiteGenerator(): | ||
|
||
GENERATOR_DATA["tasks"] = data if data is not None else [] | ||
def __init__(self): | ||
self.GENERATOR_DATA = { | ||
'title': 'Version Two', | ||
'github_user': 'octocat', | ||
'team': 'Platform Engineering', | ||
'tasks': [] | ||
} | ||
|
||
# Extract unique statuses from the tasks list | ||
unique_statuses = sorted({task["status"] for task in GENERATOR_DATA["tasks"]}) | ||
|
||
# Add statuses to the data dictionary | ||
data_with_statuses = {**GENERATOR_DATA, "statuses": unique_statuses} | ||
|
||
# Render template with updated data | ||
output = template.render(data_with_statuses) | ||
|
||
with open(output_file, 'w') as f: | ||
f.write(output) | ||
def generate_site(self, data=None, output_file='./_site/index.html'): | ||
logging.info("Generating Static Site") | ||
env = Environment(loader=FileSystemLoader('templates')) | ||
template = env.get_template('kaban_board.html') | ||
|
||
self.GENERATOR_DATA["tasks"] = data if data is not None else [] | ||
|
||
# Extract unique statuses from the tasks list | ||
unique_statuses = sorted({task["status"] for task in self.GENERATOR_DATA["tasks"]}) | ||
|
||
# Add statuses to the data dictionary | ||
data_with_statuses = {**self.GENERATOR_DATA, "statuses": unique_statuses} | ||
|
||
# Render template with updated data | ||
output = template.render(data_with_statuses) | ||
|
||
with open(output_file, 'w') as f: | ||
f.write(output) | ||
|
||
logging.info("Static Site Generated @ ./_site/index.html") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.