Skip to content
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

Refactor publications to integrate better with Hyde #675

Merged
merged 133 commits into from
Nov 20, 2022

Conversation

caendesilva
Copy link
Member

@caendesilva caendesilva commented Nov 18, 2022

Refactors the great work @rgasch has done so the changes better integrate within the Hyde core.

Notably, the data has been refactored into a few classes: both the PublicationType class for a stronger OOP experience, and the pages into "real" Hyde page classes that get auto-discovered and fully integrated into Hyde and its build process.

This also means that the build:publications command has been removed as the standard build command now compiles publications as well. The rendering logic in the removed command has been merged into the new individual page classes.

In addition, this change means that the publications can show up in navigation menus, and be linked to using routes. Try running route list command!

$ php hyde route:list

+---------------------+------------------------+-----------------------+------------+
| Page Type           | Source File            | Output File           | Route Key  |
+---------------------+------------------------+-----------------------+------------+
| BladePage           | _pages/404.blade.php   | _site/404.html        | 404        |
| BladePage           | _pages/index.blade.php | _site/index.html      | index      |
| PublicationPage     | blah/abc.md            | _site/blah/abc.html   | blah/abc   |
| PublicationPage     | blah/123.md            | _site/blah/123.html   | blah/123   |
| PublicationPage     | blah/aaa.md            | _site/blah/aaa.html   | blah/aaa   |
| PublicationListPage | blah/schema.json       | _site/blah/index.html | blah/index |
+---------------------+------------------------+-----------------------+------------+

@caendesilva caendesilva changed the title Refactor publications Refactor publications to integrate better with Hyde Nov 19, 2022
@caendesilva
Copy link
Member Author

I think we should update the schema to not include .blade.php as Laravel doesn't recognize view keys that includes those. Right now I'm stripping out the file extension so it still works, but if we remove the suffix from the schema we can also ship stock views like hyde::layouts.post for example.

@caendesilva caendesilva force-pushed the refactor-publications branch from 287634e to 7687016 Compare November 19, 2022 19:04
@caendesilva caendesilva force-pushed the refactor-publications branch from 862c8ad to 275299b Compare November 19, 2022 19:08
@caendesilva caendesilva force-pushed the refactor-publications branch from 7647c6b to 64f1ad6 Compare November 19, 2022 19:23
@caendesilva caendesilva marked this pull request as ready for review November 20, 2022 15:13
@caendesilva caendesilva merged commit 8d0eb88 into publications-feature Nov 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants