Commit graph

82 commits

Author SHA1 Message Date
2d4df9bae1
feat: Add PyPI publishing workflow
Introduced a Forgejo Actions workflow for automatically publishing new versions to PyPI upon pushing tags. This enhancement automates the release process for Python packages, ensuring that tagged commits trigger a build and publish sequence in a controlled, containerized environment. The workflow includes steps for setting up the environment, installing dependencies, and securely uploading the package using stored PyPI tokens.

By automating the release pipeline, this change aims to reduce manual errors, streamline version releases, and support continuous delivery practices for Python projects.
2024-05-26 08:57:14 +02:00
e88058af35
chore: bump version to 0.3.4
Incremented the project version to 0.3.4 in pyproject.toml, preparing for a new release. This version bump reflects the latest minor fixes and improvements.
2024-05-26 08:51:11 +02:00
3812d675fc
feat: enhance file download handling
Improved the file download process by appending filenames to the proxy URLs, facilitating proper naming of downloaded files. Updated the proxy function to accept an optional filename parameter, which is then used to set the 'Content-Disposition' header for file downloads. This ensures that files downloaded through the proxy are saved with their original names, improving user experience and file management. Additionally, modified the main route to pass file names to the proxy URLs for both image and non-image files, aligning with the enhanced proxy functionality.

This change addresses user feedback regarding difficulties in identifying and organizing downloaded files, by ensuring files retain their names post-download, thus making it easier for users to recognize and manage their downloads effectively.
2024-05-26 08:50:22 +02:00
ef1566d20b
feat: bump structables version to 0.3.3
Increase the version of structables to 0.3.3 in preparation for a new release. This version bump reflects recent enhancements and bug fixes. It ensures users have access to the latest features and improvements in the structables package.
2024-05-25 17:21:54 +02:00
cbf596aee7
feat: revamp footer layout and improve section separation
Redesigned the footer in `footer.html` to use a light background with dark text, adopting a more modern aesthetic and enhancing readability. The layout now utilizes a responsive grid, separating content into two columns for better organization on wider screens.

In `index.html`, added conditional rendering of horizontal rules between sections, omitting the rule after the last section. This change improves visual flow and reduces unnecessary visual clutter on the page.

These changes collectively enhance the user interface's look and feel, aligning with modern web design practices and improving overall user experience.
2024-05-25 17:21:23 +02:00
75ae8ada4f
feat: Bump structables version to 0.3.2
Increased structables project version in pyproject.toml to reflect the latest updates and improvements added. This version increment is critical for package management and distribution, ensuring users receive the most recent features, bug fixes, and performance enhancements.
2024-05-25 17:10:50 +02:00
b320099c44
feat: enhance project search for teachers
Extended the `projects_search` function and adjusted `category_page` logic to specifically cater to searches initiated by teachers. This update introduces a `teachers` flag that, when set to true, modifies the search criteria to include projects tagged for teachers, thereby streamlining the retrieval of educational content. This change aims to improve the user experience for educators by making relevant projects more accessible.

By distinguishing teacher-initiated searches with a dedicated filter, the platform can now offer more tailored content, thus enhancing its value as an educational resource.
2024-05-25 17:10:19 +02:00
70e4b9ddee
chore: bump project version to 0.3.1
Incremented the project version in pyproject.toml to release minor fixes and improvements. This version update ensures users have access to the latest enhancements and bug fixes, maintaining the smooth and efficient operation of the Structables package.
2024-05-25 17:01:18 +02:00
6c22ddac8e
feat: Refactor app initialization for clarity
Refactored app initialization in `main.py` by encapsulating the Flask server start-up configuration into a `main` function. This change improves code readability and organization, making the execution flow clearer, especially when the application starts or is debugged. Previously, the server start-up logic was directly in the global scope guarded by `if __name__ == "__main__":`, making the logic slightly less organized. Moving this into a dedicated function allows for potential expansion and easier testing. Additionally, ensured data initialization occurs after server start-up to align with best practices for initial data loading.
2024-05-25 17:00:44 +02:00
bcc31368f9
docs: clarify project lineage in README
Revised the project description for Structables in the README to streamline the explanation of its ancestry. The adjustment clarifies that Structables is a fork of snowcatridge10's Indestructables, which in turn is a fork of Cobra's Destructables, making the project's lineage easier to understand without the prior mention of removing Selenium. This change aims to provide a clearer and more concise project background to new contributors and users.
2024-05-25 16:51:15 +02:00
bc9074fc2b
feat: implement dynamic content loading and config management
Introduce dynamic loading of project data and streamlined configuration management. This update modularizes the codebase, separating routes and utilities for improved maintainability and scalability. It also adds a new configuration system to manage environment variables more efficiently, ensuring a seamless setup process for different environments. The refactor includes the addition of Typesense API key retrieval for enhanced search capabilities and the initialization of the application with environment-specific settings, providing a foundation for further feature development and optimization.

The change underscores a shift towards a more maintainable and scalable architecture, setting the stage for future enhancements and features. By organizing the route and utility functions into separate modules, the codebase becomes easier to navigate and extend. The new config management approach centralizes settings, aiding in the smooth adaptation to varying deployment conditions. Additionally, the introduction of dynamic project data loading aims to keep the content fresh and relevant, improving the user experience.

This commit marks a significant step in the project's evolution, streamlining its structure and paving the way for continuous improvement and growth.
2024-05-25 16:48:15 +02:00
a014283775
feat: humanize project titles in listing
Convert slugged project head titles to readable format in the projects listing page by applying `unslugify` to the title before rendering. This enhances UI readability, making project titles more accessible and understandable to users. The change only affects how titles are displayed, with no impact on underlying data structures or URL schemes.
2024-05-25 15:42:40 +02:00
c60da5ec3a
feat: Enhance project channel search flexibility
Introduced `unslugify` function to expand search capabilities by generating possible original titles from slugs, allowing for a broader search when matching project channels. This function is utilized in the `project_list` method to attempt queries with different variants of a channel's name, enhancing the likelihood of matching user-desired content. The update optimizes search functionality and user experience by accommodating varied naming conventions.

Version incremented to 0.2.2 in project metadata to reflect new feature addition and improvements.
2024-05-25 15:14:27 +02:00
c593904a19
feat: Enhance error handling responses with correct status codes
Updated error handlers for 404, 400, 429, and 500 HTTP error responses to explicitly return the corresponding status codes along with the error templates. This change ensures that responses not only serve the correct error pages but also reflect the appropriate HTTP status codes, improving compliance with HTTP standards and enhancing the clarity of the server's response to clients.

This adjustment aids in proper error diagnostics and handling by both the client applications and search engines, potentially influencing SEO and user experience positively by ensuring that web crawlers correctly interpret the nature of the errors.

Resolves issues related to ambiguous HTTP status codes in error responses.
2024-05-25 15:04:26 +02:00
db9f4d9207
refactor(main): optimize server startup process
Moved `update_data()` to execute before entering the main conditional logic in the server startup process. This adjustment ensures that data initialization occurs immediately upon server start, outside of the main function's scope. The change eliminates redundant print statements and streamlines the startup sequence, potentially improving the startup time and overall server responsiveness from the moment it goes live. This modification leads to a cleaner and more efficient codebase, enhancing maintainability and readability.
2024-05-25 15:03:52 +02:00
6c5faf6c19
feat(main.py): Normalize external links for sitemap
To ensure consistency within our sitemap, we've introduced logic that normalizes external channel links to relative paths. This change detects links starting with "https://" and transforms them into relative paths by stripping the protocol and domain parts. This adjustment facilitates better integration with the site's navigation structure, eliminating potential issues with external link handling and improving the user experience when accessing these channels through the sitemap.
2024-05-25 14:57:52 +02:00
ee6cc2de6d
feat(sitemap): redesign UI for improved navigation
The sitemap page has undergone a significant redesign for enhanced user navigation. The update introduces a card-based layout with updated CSS for better visuals and user interaction, focusing on accessibility and aesthetics. The redesigned sitemap now features a containerized layout with cards, improving the overall page structure and readability. Each group within the sitemap is now displayed as a card, making individual sections more distinguishable and easier to navigate. This change aims to provide a more engaging user experience by making information easier to find and the page more pleasant to interact with.
2024-05-23 17:23:04 +02:00
d10381c687
feat: Update Matrix link and add issue-reporting guide
Updated the Matrix room link to ensure users are directed to the correct communication channel. Additionally introduced a new section on opening issues to guide users in reporting problems or providing feedback through the appropriate repositories and discussion forums. This enhancement aims to improve community engagement and streamline the feedback process.
2024-05-23 17:15:13 +02:00
de11b2843d
feat: bump version to 0.2.1, update .gitignore
Incremented the project version to 0.2.1, preparing for a new release with minor improvements and bug fixes. Additionally, refined the .gitignore file to explicitly include the distribution directory, ensuring build artifacts are not accidentally committed to version control. This step aligns with best practices for Python project maintenance and distribution.
2024-05-23 09:05:26 +02:00
0b4676b720
refactor: streamline README and enhance project visibility
Updated the project documentation and .gitignore for a cleaner structure and enhanced visibility. The README now integrates dynamic badges for real-time status like support links, PyPI version, and latest commit info, offering a quick overview of the project status at a glance. These changes aim to make the project more accessible to potential contributors and users by providing essential information more efficiently. Additionally, the `.gitignore` file has been updated to include the `dist/` directory, preventing the accidental inclusion of distribution files in the repository, thus maintaining a cleaner project structure.

The restructuring of the README content, including a simplified approach to setting up development and production environments, aligns with best practices, making it easier for new contributors to get started. Furthermore, the changes enhance project documentation coherence and readability by embedding relevant badges and updating linkage paths for better navigation.
2024-05-23 08:27:21 +02:00
85d5c88294
feat: Introduce pyproject.toml for build configuration
Migrated project dependencies and metadata into a newly added `pyproject.toml`, aligning with modern Python packaging practices. Removed `requirements.txt` as dependencies are now specified in the unified project configuration. Restructured the project by moving Python code, static assets, and templates into a `src/structables` directory to encapsulate project components better and facilitate packaging. Moreover, refactor `main.py` to read environment variables earlier, streamline argument parsing, and ensure configurations are correctly applied before the Flask app initialization. This reorganization supports better project scalability, simplifies the build process, and enhances maintainability by consolidating project configurations and dependencies.

Note: The usage of `pyproject.toml` requires tools that support PEP 518 and might necessitate updates to CI/CD pipelines or developer workflows.
2024-05-23 08:06:36 +02:00
25a07d797b
feat(article layout): Improve readability and multimedia integration
Revamped the article template to enhance visual appeal and user engagement. Introduced a modern, centered layout for article headers, enriched steps display, and standardized multimedia elements with rounded corners and shadows for a cohesive look. Adjustments ensure content is more engaging and accessible, encouraging longer visitor sessions and interaction. This change aligns with the goal of providing a more immersive user experience while maintaining the site's aesthetic consistency.

Refactored CSS to support these changes, defining variables for easier future theme adjustments and promoting code reuse across similar elements. The update signifies a pivotal shift towards a refined and flexible presentation of articles, potentially increasing visitor retention and satisfaction.
2024-05-23 07:30:45 +02:00
c32144d437
refactor: improve UI consistency across templates
Updated category and projects templates to enhance readability and maintain UI consistency. Both templates now use a card layout with image headers and a relocated author, channel information, and metrics (favorites, views) to the card footer for improved layout consistency and readability. Also standardized image and anchor tag formats across both pages, removing inline styles and deprecated classes for cleaner, more maintainable code. Changes aim to provide a more uniform user experience and simplify future template adjustments.
2024-05-22 18:21:40 +02:00
9eee296c81
feat(css): enhance card design with flex layout
Introduced a flexbox layout to cards for a more adaptive and cohesive structure. This update includes styling for `.card-body` and `.card-footer`, ensuring they occupy space efficiently and maintain visual consistency across different viewport sizes. The `.card-footer` now has a distinct background and top border to clearly delineate it from the body content, enhancing readability and aesthetic appeal.

This enhancement addresses the need for more flexible layout options within cards, improving the overall user experience by ensuring content is well-organized and visually appealing across devices.
2024-05-22 18:17:37 +02:00
b0adb37ce7
feat: Overhaul UI styling and structure
Introduced a modular CSS variable system for easier theme management, enhancing the maintainability and scalability of our site's design. Reorganized the HTML structure in the index page for a more semantic layout, improving accessibility and SEO. Additionally, updated the styling of UI components, such as navigation and cards, for a more modern and cohesive look. This change not only refreshes the website's aesthetics but also improves the user experience on both desktop and mobile devices.
2024-05-22 18:10:32 +02:00
d20f1d2e1b
refactor(footer): improve HTML structure and accessibility
Optimized the footer HTML markup for better readability and web accessibility. Changes include the use of more semantic HTML, such as replacing `<center>` tags with CSS for centering content, and ensuring proper use of self-closing `<hr />` tags. This update aims to enhance maintainability and ensure a more inclusive user experience by adhering to modern web standards.
2024-05-22 18:02:20 +02:00
0f9f8b21a4
refactor(header): streamline navigation and improve form aesthetics
Redesigned the header's navigation layout and search form to enhance user interface consistency and accessibility. Migrated the logo loading to utilize Flask's url_for, ensuring dynamic path resolution which is more maintainable and compatible across different deployment environments. Simplified the navbar structure by consolidating elements under a single navbar-collapse class, aligning with Bootstrap's best practices for responsive design. Upgraded the search button to be more visually appealing and accessible by replacing visibility styles with an outline class, promoting a clearer call-to-action for users to engage with the search functionality.
2024-05-22 18:01:09 +02:00
6324579b36
refactor: improve HTML formatting in base template
Adjusted the formatting in the base.html template for better readability and consistency. This includes changes to indentation, the self-closing of meta tags, and the simplification of the main block. These adjustments make the code cleaner and more in line with modern HTML practices, potentially easing future maintenance and readability.
2024-05-22 18:00:33 +02:00
83ed63b13f
feat: enhance accessibility and SEO on the base template
Improved the base template by setting the default language to English, enhancing SEO through better ordering of meta and title tags, and including an initial-scale for the viewport meta tag. Wrapped the main content area with a `<main>` tag to improve semantic HTML structure and accessibility. These changes make the site more accessible and potentially improve search engine rankings.
2024-05-22 17:57:14 +02:00
eb85c1c7fa
refactor: streamline imports and improve null checks
This commit makes several refinements across the main.py file for better readability and performance:
- Simplified the import statements by removing unused imports, such as `ConfigParser` and `stream_with_context`, and consolidating uses of `urllib.parse`.
- Enhanced code clarity by replacing `!= None` checks with the more Pythonic `is not None` for better readability and to adhere to PEP 8 recommendations.
- Omitted redundant variable assignments in functions where the variables were declared but not meaningfully used, focusing the logic and reducing memory usage slightly.
- Corrected a logical error in an if condition by ensuring a proper membership test with `"embedType" not in "file"` making the code not only more readable but also preventing potential bugs.

Together, these changes make the codebase leaner, more maintainable, and compliant with best practices.
2024-05-22 17:56:46 +02:00
455218f7b6
feat: stream proxy content dynamically
Refactored the proxy route to stream data dynamically from URLs starting
with specific domains, rather than loading it all at once. This change
introduces a subfunction within the proxy route handler to manage
streaming, which iterates through data chunks and yields them until
completion. The new approach aims to enhance performance and resource
utilization by avoiding the download of the entire content before
sending it to the client. Additionally, error handling has been
tightened, specifically for HTTP errors and missing 'content-type'
headers, improving the robustness and reliability of the proxy feature.
2024-03-29 08:17:56 +01:00
b517139b00
feat(main): track total project count in project
listing

Introduce a new variable to hold the total number of projects when
accessing the projects listing route. This addition enables improved
tracking and potential features that require knowing the total number of
projects upfront, such as pagination controls or statistics display.
This change only affects the `project_list` function when the path
matches the projects endpoint.

By having the total number of projects readily available, future
enhancements or adjustments to the UI/UX involving the display of
project quantities can be more easily implemented, offering a better
user experience.
2024-03-28 16:25:33 +01:00
a8c4ef5827
feat: support POST for search queries
Enhanced the search functionality to support POST requests, ensuring
more versatile and secure handling of search queries. This change
involves accepting search queries through both GET and POST methods,
aligning with best practices for handling potentially sensitive user
inputs. Additionally, refactored conditionals for improved readability
and maintainability of the code. This update aims at enhancing user
experience and security, paving the way for future improvements in how
user inputs are processed and handled within the application.
2024-03-28 16:22:59 +01:00
5a6d6d403c
feat: standardize navbar logo size
Introduced a specific height for the navbar logo across the application
to ensure consistency in the navbar's visual presentation. By adjusting
the CSS to set a fixed height and applying the corresponding class to
the logo in the header, the layout becomes more predictable and
harmonious, significantly improving the user interface's appearance.
2024-03-28 14:12:20 +01:00
5e99720328
Fix image embed check in file processing
Corrected the logic for identifying image files without an embedded type
by fixing the misplaced quotation marks in the conditional. This change
ensures that the correct files are appended with proxy URLs for step
images. Additionally, removed unnecessary whitespace for cleaner code
structure.
2024-02-16 18:31:38 +01:00
dfe7882b12
Consolidated matrix rooms and source links
Removed several Matrix chat room links from the README and streamlined
the list of instances to enhance readability and maintain a focus on
primary resources. Updated footer source code references to point to a
singular, official repository for increased clarity and to reflect the
project's centralization efforts. This change should make the
documentation less cluttered and more user-friendly for new
contributors.
2024-02-15 16:27:34 +01:00
bcdbf5ec69
Enhanced search integration
Refactored the project search function to dynamically construct query parameters, improving readability and maintainability. Introduced several new parameters to refine search results and included a timeout for reliability. Added logging for better debugging and transparency about the search operations.

Updated category and search routes to use the new search function capabilities, ensuring relevant results and proper exception handling. Additionally, implemented pagination support for better user experience when browsing projects.

To improve the UI, the category and project listing templates have been refreshed with a modern layout, including the use of Bootstrap classes and better organization of content.

Resolves issues with inefficient search parameter construction and user interface inconsistencies.
2024-01-31 19:22:58 +01:00
c1f4e157a4
Optimized navigation layout in header
Streamlined the header's HTML structure by consolidating navigation elements and search form into more efficient class usage, improving maintainability and readability. Removed fixed height for the logo to enhance flexibility in different resolutions. These adjustments make future styling and responsiveness optimizations smoother.
2024-01-31 17:36:47 +01:00
b730e9c6db
Center align media elements in article template
Improved visual consistency in 'article.html' by adding 'justify-content-center' to each media row, ensuring images, videos, and iframes are centered within their containers. Additionally, applied 'wrap' class to text content for enhanced readability. These changes cater to better user engagement and a more polished layout presentation.
2024-01-31 17:09:52 +01:00
9dd8f4e2e0
Enhanced environment configuration and content fetching
Extended environment variables to allow for greater configurability and aligned debug mode detection with the new STRUCTABLES_DEBUG variable. Additionally, introduced command-line arguments for specifying Invidious instance URLs and unsafe iframe display settings.

The content fetching logic has been revised for fetching JSON data directly instead of scraping HTML, resulting in a more robust and efficient data extraction process. New templates accommodate the change and present a cleaner UI, including handling of iframes, downloads, and proper proxying of external resources.

HTML templates have been refactored to utilize better layout and styling while enhancing support for iframes and downloads, complete with the new ability to block iframe content from outside sources unless explicitly permitted. This security-focused feature protects end-users from potentially unsafe content.
2024-01-31 12:50:19 +01:00
1a4e0360a2
Update Matrix room link in README
Corrected the Matrix room URL in the README documentation to point to the new `#structables:private.coffee` room. This ensures users can find and join the correct discussion channel.
2024-01-19 08:16:41 +01:00
9f117f5ccc
Improve text overflow handling in articles
Updated CSS to include word-wrapping rules and adjusted the article template to apply these styles to content rows, ensuring better handling of long strings without space characters and improving the readability of articles with unusual text content. No layout disruption expected.
2024-01-17 19:11:43 +01:00
6762004c50
Fix article template loop rendering issue
Corrected improper nesting within for-loop structure in the article template to ensure that step content is appropriately wrapped in a div, resolving visual inconsistencies in article step display. This change maintains structured and clean output for article content.
2024-01-17 18:46:20 +01:00
0249bccd9f
Update URL for Private.coffee's hosted instance
The README documentation has been updated to reflect the change in URL for the front-end alternative provided by Private.coffee. The updated link points to the new correct domain.
2024-01-17 18:30:24 +01:00
c8cb88e3b7
Rebrand project from Indestructables to Structables
Updated the project name and references across various files, including README, template headers, and footers to reflect the rebranding from 'Indestructables' to 'Structables'. The favicon has been removed, and the main logo updated to align with the new branding. The commit modifies links to the source code repository as part of rebranding efforts. This change creates a clear distinction from the upstream project while maintaining acknowledgments to the original sources.
2024-01-17 17:01:35 +01:00
232a1504fb
Update .gitignore and enhance project structure
- Add 'privacy.txt' to .gitignore to prevent checking it in
- Refactor data storage from arrays to dictionaries for better data handling in 'main.py'
- Include 'pathlib' import for handling filesystem paths
- Introduce new CSS and Bootstrap files providing updated styles and responsive design elements
- Modify HTML templates to use updated data structures and enhance accessibility

These changes improve code readability, maintain project consistency, and enhance the front-end presentation. This work is part of ongoing efforts to better manage project data, secure sensitive information, and provide a more robust user interface.
2024-01-17 16:43:51 +01:00
f60494af6e
Removed Selenium dependency from Indestructables
Enhanced the Indestructables fork by eliminating its reliance on Selenium and Playwright's Chromium binary. This change streamlines the setup process and potentially improves performance and stability. Additionally, a new matrix room link has been added to the README for community engagement. Related project licenses reiterated for clarity.
2024-01-16 17:18:47 +01:00
29592de90a
Refactor data fetching logic using stdlib
Removed dependencies on external libraries such as `requests`, `requests-html`, and `playwright` in favor of Python's standard libraries like `urllib` for HTTP requests and parsing functionality. A more robust and efficient data update function was introduced to scrape API keys and fetch project data using Typesense. Transitioned from a manual browser-based scraping approach to an API-based one for improved stability and performance. Added logging for better monitoring and debuggability. Error-handling now leverages `HTTPError` from `urllib.error`. Shifted the configuration of debug mode to rely on an environment variable, aligning with Twelve-Factor principles. Removed unused functions and streamlined the handling of various routes within the Flask app. This change shifts the project towards a more maintainable code base by using built-in libraries, reduces external dependencies, and improves resilience and scalability of the web scraping components.
2024-01-16 17:13:59 +01:00
d269a9992e Merge branch '3-so-there-s-another-upstream' into 'main'
License/Upstream link fixes

Closes #3

See merge request PrivateCoffee/indestructables!1
2023-07-19 06:28:04 +00:00
e09497f471
Improve error handling 2023-07-19 08:26:45 +02:00