Skip to content

Commit

Permalink
Merge pull request #637 from hydephp/add-example-site-fixtures
Browse files Browse the repository at this point in the history
Internal: Add full site test fixtures
  • Loading branch information
caendesilva authored Nov 3, 2022
2 parents 9a33fa2 + 7beaebf commit 4e142a8
Show file tree
Hide file tree
Showing 36 changed files with 1,736 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/fixtures/example-sites/cookbook/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# If you have a domain, you should set the URL here so that permalinks can be generated.
# SITE_URL=https://example.org

# If you want to use Torchlight.dev, enter your API token here to automatically enable it
# TORCHLIGHT_TOKEN=torch_

# If you want to change the default port of the realtime compiler server, you can do so here
# SERVER_PORT=8080
16 changes: 16 additions & 0 deletions tests/fixtures/example-sites/cookbook/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
* text=auto

*.blade.php diff=html
*.css diff=css
*.html diff=html
*.md diff=markdown
*.php diff=php

/.github export-ignore
.styleci.yml export-ignore
.scrutinizer.yml export-ignore
BACKERS.md export-ignore
CONTRIBUTING.md export-ignore
CHANGELOG.md export-ignore

tests/ export-ignore
13 changes: 13 additions & 0 deletions tests/fixtures/example-sites/cookbook/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/vendor
/node_modules
/builds
/.idea
/.vscode
/.vagrant
/.cache
.phpunit.result.cache

.env

/_site
composer.lock
21 changes: 21 additions & 0 deletions tests/fixtures/example-sites/cookbook/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Caen De Silva

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
111 changes: 111 additions & 0 deletions tests/fixtures/example-sites/cookbook/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# HydePHP - Elegant and Powerful Static Site Generator


[![Latest Version on Packagist](https://img.shields.io/packagist/v/hyde/framework?include_prereleases)](https://packagist.org/packages/hyde/framework)
[![Total Downloads on Packagist](https://img.shields.io/packagist/dt/hyde/framework)](https://packagist.org/packages/hyde/framework)
[![License MIT](https://img.shields.io/github/license/hydephp/hyde) ](https://github.com/hydephp/hyde/blob/master/LICENSE.md)
[![Test Coverage](https://codecov.io/gh/hydephp/develop/branch/master/graph/badge.svg?token=G6N2161TOT)](https://codecov.io/gh/hydephp/develop)
[![Test Suite](https://github.com/hydephp/develop/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/hydephp/develop/actions/workflows/continuous-integration.yml)


## Make static websites, blogs, and documentation pages with the tools you already know and love.

### About HydePHP
HydePHP is a content-first Laravel-powered console application that allows you to create static HTML pages, blog posts, and documentation sites,
using your choice of Markdown and/or Blade.

Build sites in record-time with a full batteries-included TailwindCSS frontend that just works without any fuzz.

### Speed & simplicity first, full control when you need it.
Hyde is all about letting you get started quickly by giving you a full-featured frontend starter kit, while also giving you the power and freedom of doing things the way you want to.

Markdown purist? That's all you need. Blade artisan? Go for it.
Hyde comes with hand-crafted frontend templates so you can focus on your content.
You don't _need_ to customize anything. But you _can_ customize everything.

See the documentation and learn more at https://hydephp.com/docs/

## Features

### Content Creation
- Create blog posts using Markdown and Front Matter.
- Create documentation pages from plain Markdown, no front matter needed!
- Create simple pages using Markdown, or create advanced ones using Laravel Blade.
- You can scaffold blog posts and Markdown pages to automatically fill in the front matter.
- You can also scaffold Blade pages to automatically use the default layout.

### Built-in Frontend
- Hyde comes with a TailwindCSS starter kit so you can start making content right away.
- The starter kit is fully responsive, has a dark mode theme, and is customizable.
- The frontend is accessible to screenreaders and rich with semantic HTML and microdata.
- Hyde automatically chooses the right layout to use depending on the content being rendered.
- Hyde also fills in and creates content like navigation menus and sidebars automatically.

### Easy Asset Managing
- The Hyde starter comes with [HydeFront](https://github.com/hydephp/hydefront/) to serve the base stylesheet and JavaScript through the jsDelivr CDN.
- Hyde ships with precompiled and minified TailwindCSS styles in the app.css file, you can also load them through the CDN.
- This means that all the styles you need are already installed. However, if you want to customize the Tailwind config, or if you add new Tailwind classes through Blade files, you can simply run the `npm run dev` command to recompile the styles using Laravel Mix.

### Customization
- You don't need to configure anything as Hyde is shipped with sensible defaults.
- You can, however, customize nearly everything. Here are some examples:
- All frontend components and page layouts are created with Blade so you
can publish the vendor views, just like in Laravel.
- Override many of the dynamic content features like the menus and footer.

## Getting Started - High-level overview
> See [Installation Guide](https://hydephp.com/docs/master/installation.html) and [Getting Started](https://hydephp.com/docs/master/getting-started.html) for the full details.
It's a breeze to get started with Hyde. Create a new Hyde project using Composer:

```bash
composer create-project hyde/hyde
```

Next, place your Markdown files in one of the content directories: `_posts`, `_docs`, and `_pages` which also accepts Blade files. You can also use use the `hyde:make` command to scaffold them.

When you're ready, run the build command to compile your static site which will save your HTML files in the `_site` directory.

```bash
php hyde build
```

## ⚠ Beta Software Warning
Heads up! HydePHP is still new and currently in beta. Please report any bugs and issues in the appropriate issue tracker. Versions in the 0.x series might not be stable and may change at any time. No backwards compatibility guarantees are made and there will be breaking changes without notice.

Please wait until v1.0 for production use and remember to back up your source files before updating (use Git!).
See https://hydephp.com/docs/master/updating-hyde for the upgrade guide.

## Resources

### Changelog

Please see [CHANGELOG](https://github.com/hydephp/develop/blob/master/CHANGELOG.md) for more information on what has changed recently.

### Contributing

HydePHP is an open-source project, contributions are very welcome!

Development is made in the HydePHP Monorepo, which you can find here https://github.com/hydephp/develop.

### Security

If you discover any security-related issues, please email caen@desilva.se instead of using the issue tracker.
All vulnerabilities will be promptly addressed.

### Credits

- [Caen De Silva](https://github.com/caendesilva), feel free to buy me a coffee! https://www.buymeacoffee.com/caen
- [All Contributors](../../contributors)

### License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

### Attributions
> Please see the respective authors' repositories for their license files
- The Hyde core is built with [Laravel Zero](https://laravel-zero.com/) which is based on [Laravel](https://laravel.com/)
- The documentation frontend was originally based on [Lagrafo - Docs for Laravel apps](https://github.com/caendesilva/lagrafo)
- The dark mode switch is based on a component from [Flowbite](https://flowbite.com/docs/customize/dark-mode/).
- The frontend is built with [TailwindCSS](https://tailwindcss.com/).
28 changes: 28 additions & 0 deletions tests/fixtures/example-sites/cookbook/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Security Policy

## Supported Versions

### Hyde is currently in Beta and has no supported versions.

Versions in the 0.x series are not stable and may change at any time.
No backwards compatibility guarantees are made and there will be breaking changes without notice.

| Version | Supported | Classification |
|---------|-----------|---------------------------|
| > 0.64 | :warning: | Beta (active development) |
| < 0.64 | :x: | Beta (legacy) |
| < 0.8 | :x: | Alpha stage |


<!--
| 5.1.x | :white_check_mark: |
| 5.0.x | :x: |
| 4.0.x | :white_check_mark: |
| < 4.0 | :x: | -->


## Reporting a Vulnerability

If you discover a security vulnerability within this package, please send an e-mail to the creator, Caen De Silva, via caen@desilva.se.

All security vulnerabilities will be promptly addressed.
Empty file.
2 changes: 2 additions & 0 deletions tests/fixtures/example-sites/cookbook/_media/app.css

Large diffs are not rendered by default.

51 changes: 51 additions & 0 deletions tests/fixtures/example-sites/cookbook/_pages/404.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!doctype html>
<html lang="en">

<head>
<title>404 - Page not found</title>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

<!-- Fonts -->
<link rel="dns-prefetch" href="//fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet" type="text/css">

<!-- Styles -->
<style>html{line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}a{background-color:transparent;-webkit-text-decoration-skip:objects}svg:not(:root){overflow:hidden}button{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button{overflow:visible}button{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}[type=checkbox],[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}[hidden]{display:none}html{-webkit-box-sizing:border-box;box-sizing:border-box;font-family:sans-serif}*,::after,::before{-webkit-box-sizing:inherit;box-sizing:inherit}p{margin:0}button{background:0 0;padding:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}*,::after,::before{border-width:0;border-style:solid;border-color:#dae1e7}[type=button],[type=reset],[type=submit],button{border-radius:0}button{font-family:inherit}[role=button],button{cursor:pointer}.bg-transparent{background-color:transparent}.bg-white{background-color:#fff}.bg-purple-light{background-color:#a779e9}.bg-no-repeat{background-repeat:no-repeat}.bg-cover{background-size:cover}.border-grey-light{border-color:#dae1e7}.hover\:border-grey:hover{border-color:#b8c2cc}.rounded-lg{border-radius:.5rem}.border-2{border-width:2px}.flex{display:-webkit-box;display:-ms-flexbox;display:flex}.items-center{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.justify-center{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.font-sans{font-family:Nunito,sans-serif}.font-light{font-weight:300}.font-bold{font-weight:700}.font-black{font-weight:900}.h-1{height:.25rem}.leading-normal{line-height:1.5}.m-8{margin:2rem}.my-3{margin-top:.75rem;margin-bottom:.75rem}.mb-8{margin-bottom:2rem}.max-w-sm{max-width:30rem}.min-h-screen{min-height:100vh}.py-3{padding-top:.75rem;padding-bottom:.75rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.pb-full{padding-bottom:100%}.absolute{position:absolute}.relative{position:relative}.pin{top:0;right:0;bottom:0;left:0}.text-black{color:#22292f}.text-grey-darkest{color:#3d4852}.text-grey-darker{color:#606f7b}.text-2xl{font-size:1.5rem}.text-5xl{font-size:3rem}.uppercase{text-transform:uppercase}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.tracking-wide{letter-spacing:.05em}.w-16{width:4rem}.w-full{width:100%}@media (min-width:768px){.md\:bg-left{background-position:left}.md\:bg-right{background-position:right}.md\:flex{display:-webkit-box;display:-ms-flexbox;display:flex}.md\:my-6{margin-top:1.5rem;margin-bottom:1.5rem}.md\:min-h-screen{min-height:100vh}.md\:pb-0{padding-bottom:0}.md\:text-3xl{font-size:1.875rem}.md\:text-15xl{font-size:9rem}.md\:w-1\/2{width:50%}}@media (min-width:992px){.lg\:bg-center{background-position:center}}</style>
</head>

<!-- Error page and illustration by LaravelCollective: https://github.com/LaravelCollective/errors (License MIT) --->

<body class="antialiased font-sans">
<div class="md:flex min-h-screen">
<div class="w-full md:w-1/2 bg-white flex items-center justify-center">
<div class="max-w-sm m-8">
<div class="text-black text-5xl md:text-15xl font-black">
404
</div>

<div class="w-16 h-1 bg-purple-light my-3 md:my-6"></div>

<p class="text-grey-darker text-2xl md:text-3xl font-light mb-8 leading-normal">
Sorry, the page you are looking for could not be found.
</p>

<a href="{{ config('site.url') ?? '/' }}">
<button
class="bg-transparent text-grey-darkest font-bold uppercase tracking-wide py-3 px-6 border-2 border-grey-light hover:border-grey rounded-lg">
Go Home
</button>
</a>
</div>

</div>

<div class="relative pb-full md:flex md:pb-0 md:min-h-screen w-full md:w-1/2">
<div style="background-image: url('https://cdn.jsdelivr.net/gh/LaravelCollective/errors@1.0/src/publish/svg/404.svg');"
class="absolute pin bg-cover bg-no-repeat md:bg-left lg:bg-center">
</div>
</div>
</div>
</body>
</html>
17 changes: 17 additions & 0 deletions tests/fixtures/example-sites/cookbook/_pages/index.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@php($title = 'Latest Posts')
@extends('hyde::layouts.app')
@section('content')

<main id="content" class="mx-auto max-w-7xl py-12 px-8">
<header class="lg:mb-12 xl:mb-16">
<h1 class="text-3xl text-left leading-10 tracking-tight font-extrabold sm:leading-none mb-8 md:mb-12 md:text-4xl md:text-center lg:text-5xl text-gray-700 dark:text-gray-200">
Latest Posts
</h1>
</header>

<div id="post-feed" class="max-w-3xl mx-auto">
@include('hyde::components.blog-post-feed')
</div>
</main>

@endsection
Empty file.
37 changes: 37 additions & 0 deletions tests/fixtures/example-sites/cookbook/_posts/a-nice-cup-of-tea.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: 'A Nice Cup of Tea'
description: "A nice cup of tea is the usual answer in Britain and Ireland to any everyday problem. Nothing is so bad that a nice cup of tea with a friend or family member can't make it better."
category: Cookbook
author: 'wikibooks'
date: '27 July 2022 09:38 UTC'
image:
url: https://cdn.desilva.se/hydephp/media/demos/1024px-Nice_Cup_of_Tea.jpg
description: 'A nice cup of tea (and a sit down). A Denby teapot and cup with milk jug.'
title: 'A nice cup of tea (and a sit down). A Denby teapot and cup with milk jug.'
author: 'Wikimedia Commons'
copyright: 'Public Domain'
---

<!-- This post was created based on Wikibooks contributors, "Cookbook:A Nice Cup of Tea," Wikibooks, The Free Textbook Project. An article licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License, which this blog post is also licensed under. -->

## Introduction

A nice cup of tea is the usual answer in Britain and Ireland to any everyday problem. Nothing is so bad that a nice cup of tea with a friend or family member can't make it better.

## Procedure

A nice cup of tea, milk and no sugar

Preparing and serving the tea

1. Pour freshly drawn water into a tea kettle. Electric kettles are fast and convenient.
2. If infusing a pot of tea, pour some hot tap water into your teapot and let stand for about several seconds to a minute to pre-warm it. Alternately, you can swish some of the hotter boiling water from your kettle around in the teapot for a few seconds. Pour out this water before adding the tea to the teapot.
3. If using loose tea, prepare the tea
1. Commonly one-half to one tea measure (or rounded teaspoon if you do not have a tea measure) is added per desired cup of tea. Some people add an extra measure "for the pot" (e.g., if 4 cups of tea are desired, 5 measures of tea would be used. It really is a matter of personal preference.)
2. If you are using an infuser, be sure it is closed tightly so the tea does not spill into the pot. Rinse the tea-filled infuser briefly under cool tap water to wash away tiny flakes that would otherwise drift into the teapot.
3. If using a filter basket infuser, do not overfill the basket (refer to the instructions that came with your basket). The brief rinse is usually not necessary unless the basket's mesh is quite porous.
4. Simply dropping loose tea into the teapot is also an option, though you may want to strain the tea as you pour it into the cups.
4. Place the tea or tea bag into the teapot.
5. When the water reaches the preferred temperature, pour it from the tea kettle into the teapot or single-serving teacup. As you pour, try to avoid pouring directly onto the tea (especially important for green and white teas) to avoid scalding the leaves.
6. Allow the tea to infuse quietly (i.e., do not stir the teapot or "dunk the teabag"). Agitating the tea releases more of the bitter compounds and degrades the taste. Watch the time to avoid over-infusion, and remove the infuser or tea bag when the time is up. If you did not use an infuser or tea bag, pour the tea into cups for immediate consumption.
7. Remember that the tannins in tea stain, so it is advisable to pour the tea over a non-staining surface, wipe up any spills quickly, and do not leave tea standing in a teapot for long periods of time.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}

/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
//
}
}
Loading

0 comments on commit 4e142a8

Please sign in to comment.