Skip to content

Commit

Permalink
Merge branch 'main' into fixedfooter
Browse files Browse the repository at this point in the history
  • Loading branch information
AsifQamar authored Oct 20, 2024
2 parents 9cd376c + 2382ef8 commit e371767
Show file tree
Hide file tree
Showing 9 changed files with 1,004 additions and 28 deletions.
101 changes: 101 additions & 0 deletions .github/scripts/update_structure.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import os
import github
from github import Github

# Helper function to recursively build the repo structure and include file extensions
def get_repo_structure(path='.', prefix=''):
structure = []
try:
items = sorted(os.listdir(path))
except FileNotFoundError:
print(f"Path not found: {path}")
return structure

for i, item in enumerate(items):
if item.startswith('.'):
continue # Skip hidden files and directories
item_path = os.path.join(path, item)
is_last = i == len(items) - 1
current_prefix = '└── ' if is_last else '├── '

if os.path.isdir(item_path):
# Directory case
structure.append(f"{prefix}{current_prefix}{item}/")
next_prefix = prefix + (' ' if is_last else '│ ')
structure.extend(get_repo_structure(item_path, next_prefix))
else:
# File case with extension
file_name, file_extension = os.path.splitext(item)
structure.append(f"{prefix}{current_prefix}{file_name}{file_extension}")

return structure

# Function to update the repo_structure.txt file
def update_structure_file(structure):
try:
with open('repo_structure.txt', 'w') as f:
f.write('\n'.join(structure))
print("repo_structure.txt updated successfully.")
except IOError as e:
print(f"Error writing to repo_structure.txt: {e}")

# Function to update the README.md with the new structure
def update_README(structure):
try:
with open('README.md', 'r') as f:
content = f.read()
except FileNotFoundError:
print("README.md not found.")
return

start_marker = '<!-- START_STRUCTURE -->'
end_marker = '<!-- END_STRUCTURE -->'

start_index = content.find(start_marker)
end_index = content.find(end_marker)

if start_index != -1 and end_index != -1:
new_content = (
content[:start_index + len(start_marker)] +
'\n```\n' + '\n'.join(structure) + '\n```\n' +
content[end_index:]
)
try:
with open('README.md', 'w') as f:
f.write(new_content)
print("README.md updated with new structure.")
except IOError as e:
print(f"Error writing to README.md: {e}")
else:
print("Markers not found in README.md. Structure not updated.")

# Main function to compare and update repository structure
def main():
gh_token = os.getenv('GH_TOKEN')
gh_repo = os.getenv('GITHUB_REPOSITORY')

if not gh_token or not gh_repo:
print("Environment variables GH_TOKEN and GITHUB_REPOSITORY must be set.")
return

g = Github(gh_token)
repo = g.get_repo(gh_repo)

current_structure = get_repo_structure()

try:
# Fetch the contents of repo_structure.txt from GitHub
contents = repo.get_contents("repo_structure.txt")
existing_structure = contents.decoded_content.decode().split('\n')
except github.GithubException:
existing_structure = None

if current_structure != existing_structure:
update_structure_file(current_structure)
update_README(current_structure)
print("Repository structure updated.")
else:
print("No changes in repository structure.")

if __name__ == "__main__":
main()
38 changes: 38 additions & 0 deletions .github/workflows/update-readme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Update Repository structure

on:
schedule:
- cron: '0 * * * *' # Run every hour
workflow_dispatch: # Allow manual triggering
push:
branches:
- main

jobs:
detect-and-update-structure:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.12

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install PyGithub
- name: Run update script
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python .github/scripts/update_structure.py

- name: Commit and push if changed
run: |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add .
git diff --quiet && git diff --staged --quiet || (git commit -m "Update repo structure" && git push)
108 changes: 108 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,103 @@
</ul>

## Project Structure

<!-- START_STRUCTURE -->
```
├── Blog_page.html
├── Contributing.md
├── Faq.html
├── LICENSE
├── README.md
├── about-us.html
├── about.html
├── blog.html
├── community.html
├── contributors.html
├── download (1).png
├── edition.html
├── feature.png
├── gssocextd.jpg
├── hacktoberfest.png
├── index.html
├── login.html
├── privacy.html
├── resources/
│ ├── favicon.ico
│ └── painting_image.jpg
├── review.html
├── signup.html
├── src/
│ ├── Scripts/
│ │ ├── BacktoTop.js
│ │ ├── Canvas.js
│ │ ├── Save.js
│ │ ├── contributor.js
│ │ └── preloader.js
│ ├── Styles/
│ │ ├── Responsive.css
│ │ ├── Style.css
│ │ ├── Style_Blog_page.css
│ │ ├── contact_us_style.css
│ │ ├── contributor.css
│ │ ├── scroll.css
│ │ └── signup.css
│ ├── bootstrap/
│ │ └── css/
│ │ ├── bootstrap-grid.css
│ │ ├── bootstrap-grid.css.map
│ │ ├── bootstrap-grid.min.css
│ │ ├── bootstrap-grid.min.css.map
│ │ ├── bootstrap-grid.rtl.css
│ │ ├── bootstrap-grid.rtl.css.map
│ │ ├── bootstrap-grid.rtl.min.css
│ │ ├── bootstrap-grid.rtl.min.css.map
│ │ ├── bootstrap-reboot.css
│ │ ├── bootstrap-reboot.css.map
│ │ ├── bootstrap-reboot.min.css
│ │ ├── bootstrap-reboot.min.css.map
│ │ ├── bootstrap-reboot.rtl.css
│ │ ├── bootstrap-reboot.rtl.css.map
│ │ ├── bootstrap-reboot.rtl.min.css
│ │ ├── bootstrap-reboot.rtl.min.css.map
│ │ ├── bootstrap-utilities.css
│ │ ├── bootstrap-utilities.css.map
│ │ ├── bootstrap-utilities.min.css
│ │ ├── bootstrap-utilities.min.css.map
│ │ ├── bootstrap-utilities.rtl.css
│ │ ├── bootstrap-utilities.rtl.css.map
│ │ ├── bootstrap-utilities.rtl.min.css
│ │ ├── bootstrap-utilities.rtl.min.css.map
│ │ ├── bootstrap.css
│ │ ├── bootstrap.css.map
│ │ ├── bootstrap.min.css
│ │ ├── bootstrap.min.css.map
│ │ ├── bootstrap.rtl.css
│ │ ├── bootstrap.rtl.css.map
│ │ ├── bootstrap.rtl.min.css
│ │ └── bootstrap.rtl.min.css.map
│ └── images/
│ ├── about-bg.jpg
│ ├── art-design-1.jpg
│ ├── art-design-2.jpg
│ ├── art-design-3.jpg
│ ├── art-design-4.jpg
│ ├── art-design-5.jpg
│ ├── art-design-6.jpg
│ ├── banner-bg.jpg
│ ├── blog-p-1.jpg
│ ├── blog-p-2.jpg
│ ├── blog-p-3.jpg
│ ├── blog-p-4.jpg
│ ├── blog-p-5.jpg
│ └── blog-p-6.jpg
├── testimonial.html
├── tutorial.html
└── welcome.html
```
<!-- END_STRUCTURE -->

### New Features ✨
<li> Background Image: Easily set an image as the background of your canvas to create more visually appealing designs</li>
<li> Background Color: You can now add a custom background color to the canvas with ease!</li>
Expand Down Expand Up @@ -214,6 +311,17 @@ git push origin YourBranchName
</tr>
</table>

# Project Mentor⚡🧑‍💻

<table>
<tr>
<td align="center"><a href="https://github.com/somyadipghosh"><img src="https://avatars.githubusercontent.com/u/77097996?v=4" width=150px height=150px /></a></br> <h4 style="color:red;">Somyadip Ghosh</h4>
<a href="https://www.linkedin.com/in/somyadipghosh/"><img src="https://img.icons8.com/fluency/2x/linkedin.png" width="32px" height="32px"></img></a>
</td>
</tr>
</table>


<!--Line-->
<img src="https://user-images.githubusercontent.com/74038190/212284100-561aa473-3905-4a80-b561-0d28506553ee.gif" width="900">

Expand Down
13 changes: 3 additions & 10 deletions about-us.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,18 +243,11 @@ <h4>Anurag</h4>
</div>
</div>
<div class="col-md-4">
<div class="team-member">
<h4>John Smith</h4>
<p>Creative Director</p>
</div>
</div>
<div class="col-md-4">
<div class="team-member">
<h4>Emily Chen</h4>
<p>UX Designer</p>
<div class="team-member">
<h4>Somyadip Ghosh</h4>
<p>Project Mentor</p>
</div>
</div>
</div>
</div>
</section>

Expand Down
2 changes: 1 addition & 1 deletion blog.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ <h4>Add Comments</h4>
href="#!"
role="button"
data-mdb-ripple-color="dark"
><i class="fab fa-twitter"></i
><i class="fa-brands fa-x-twitter"></i
></a>

<!-- Google -->
Expand Down
8 changes: 8 additions & 0 deletions community.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
width: 300px;
height: 400px;
perspective: 1000px;
border-radius: 15px;
border: none;
transition: transform 0.6s;
}
Expand Down Expand Up @@ -112,6 +113,13 @@
.card-back a:hover {
color: #0056b3;
}

.community-section .container {
padding: 30px 15px;
max-width: 1200px;
margin: 0 auto;
text-align: center;
}

/* Footer styles */
.footer .share a {
Expand Down
Loading

0 comments on commit e371767

Please sign in to comment.