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

Fix issues with the sitemap and RSS feed generator commands #1654

Merged
merged 7 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ This serves two purposes:
- for now removed features.

### Fixed
- Fixed a bug where the sitemap and RSS feed generator commands did not work when the `_site/` directory was not present in https://github.com/hydephp/develop/pull/1654
- Realtime Compiler: Fixed responsive dashboard table issue in https://github.com/hydephp/develop/pull/1595

### Security
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,30 @@

use Hyde\Hyde;
use Hyde\Framework\Features\BuildTasks\PostBuildTask;
use Hyde\Framework\Concerns\InteractsWithDirectories;
use Hyde\Framework\Features\XmlGenerators\RssFeedGenerator;

use function file_put_contents;

class GenerateRssFeed extends PostBuildTask
{
use InteractsWithDirectories;

public static string $message = 'Generating RSS feed';

protected string $path;

public function handle(): void
{
file_put_contents(
Hyde::sitePath(RssFeedGenerator::getFilename()),
RssFeedGenerator::make()
);
$this->path = Hyde::sitePath(RssFeedGenerator::getFilename());

$this->needsParentDirectory($this->path);

file_put_contents($this->path, RssFeedGenerator::make());
}

public function printFinishMessage(): void
{
$this->createdSiteFile('_site/'.RssFeedGenerator::getFilename())->withExecutionTime();
$this->createdSiteFile($this->path)->withExecutionTime();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,30 @@

use Hyde\Hyde;
use Hyde\Framework\Features\BuildTasks\PostBuildTask;
use Hyde\Framework\Concerns\InteractsWithDirectories;
use Hyde\Framework\Features\XmlGenerators\SitemapGenerator;

use function file_put_contents;

class GenerateSitemap extends PostBuildTask
{
use InteractsWithDirectories;

public static string $message = 'Generating sitemap';

protected string $path;

public function handle(): void
{
file_put_contents(
Hyde::sitePath('sitemap.xml'),
SitemapGenerator::make()
);
$this->path = Hyde::sitePath('sitemap.xml');

$this->needsParentDirectory($this->path);

file_put_contents($this->path, SitemapGenerator::make());
}

public function printFinishMessage(): void
{
$this->createdSiteFile('_site/sitemap.xml')->withExecutionTime();
$this->createdSiteFile($this->path)->withExecutionTime();
}
}
Loading