Skip to content

Commit

Permalink
Merge pull request #18 from caendesilva/import-docs
Browse files Browse the repository at this point in the history
Import hydephp/docs
  • Loading branch information
caendesilva authored Jun 8, 2022
2 parents aa118db + e4b0b0d commit 0a0c256
Show file tree
Hide file tree
Showing 19 changed files with 1,882 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This is a basic workflow to help you get started with Actions
name: CI Deploy

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions:
contents: read

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "deploy"
deploy:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

# Copy over the root Markdown files into a new directory
- name: Copy Markdown files
run: mkdir files && cp *.md files

- name: Push Markdown files
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source-directory: 'files'
target-directory: '_docs'
destination-github-username: 'hydephp'
destination-repository-name: 'DocsCI'
target-branch: master
5 changes: 5 additions & 0 deletions docs/README.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Hyde Documentation
[![CI Deploy](https://github.com/hydephp/docs/actions/workflows/deploy.yml/badge.svg)](https://github.com/hydephp/docs/actions/workflows/deploy.yml)

This is the source for the HydePHP Documentation. Updates to this repo are automatically propagated to the [DocsCI pipeline](https://github.com/hydephp/DocsCI) which uses Hyde to build the static site hosted at
https://hydephp.com/docs
53 changes: 53 additions & 0 deletions docs/advanced-markdown.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
label: "Advanced Markdown"
priority: 26
category: "Digging Deeper"
---

# Advanced Markdown

## Introduction

Since HydePHP makes heavy use of Markdown there are some extra features and helpers
created just for Hyde to make using Markdown even easier!

## Blade Support

Since Hyde v0.30.x you can use Laravel Blade in Markdown files!

### Using Blade in Markdown

To use Blade in your Markdown files, simply use the Blade shortcode directive,
followed by your desired Blade string.

#### Standard syntax

```markdown
[Blade]: {{ "Hello World!" }} // Will render: 'Hello World!'
```

#### Blade includes

Only single-line shortcode directives are supported. If you need to use multi-line Blade code,
use an `@include` directive to render a more complex Blade template.
You can pass data to includes by specifying an array to the second argument.

```markdown
[Blade]: @include("hello-world")
[Blade]: @include("hello", ["name" => "World"])
```

### Enabling Blade-supported Markdown
It's disabled by default since it allows arbitrary PHP to run, which could be a security risk,
depending on your setup. However, if your Markdown is trusted, and you know it's safe,
you can enable it in the `config/markdown.php` file.

```php
// torchlight! {"lineNumbers": false}
'enable_blade' => true,
```

#### Limitations

All shortcodes must be the first word on a new line.
For example, using a space before the `[Blade]:` will intentionally cause it to not render.
94 changes: 94 additions & 0 deletions docs/architecture-concepts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---
priority: 10
category: "Getting Started"
---

# Some key concepts in Hyde

## The HydeCLI

When you are not writing Markdown and Blade, most of your interactions with Hyde will be through the
Hyde Command Line Interface (CLI).
Since the CLI is based on the Laravel Artisan Console, so you may actually already be familiar with it.

You should take a look at [the Console Commands page](console-commands.html)
to learn more and see the available commands and their usage.

```bash
php hyde <command> [--help]
```

## Directory structure

To take full advantage of the framework, it may first be good to familiarize ourselves with the directory structure.

```
// torchlight! {"lineNumbers": false}
├── _docs // For documentation pages
├── _posts // For blog posts
├── _pages // For static Markdown and Blade pages
├── _media // Store static assets to be copied to the build directory
├── _site // The build directory where your compiled site will be stored
├── config // Configuration files for Hyde and integrations
├── resources/assets // Location for Laravel Mix source files (optional)
└── resources/views/components // Location for Blade components (optional)
```

> Note that the `_site` directory is emptied every time you run the `hyde build` command.
> It's intended that you keep the directory out of your VCS, for example by adding it to your .gitignore file.

## File Autodiscovery

Content files, meaning source Markdown and Blade files, are automatically
discovered by Hyde and compiled to HTML when building the site.
This means that you don't need to worry about routing and controllers!

The directory a source file is in will determine the Blade template that is used to render it.

Here is an overview of the content source directories, the output directory of the compiled files,
and the file extensions supported by each. Files starting with an `_underscore` are ignored.

| Page/File Type | Source Directory | Output Directory | File Extensions |
|----------------|------------------|------------------|---------------------|
| Static Pages | `_pages/` | `_site/` | `.md`, `.blade.php` |
| Blog Posts | `_posts/` | `_site/posts/` | `.md` |
| Documentation | `_docs/` | `_site/docs/` | `.md` |
| Media Assets | `_media/` | `_site/media/` | See full list below |

<small>
<blockquote>
Media file types supported: `.png`, `.svg`, `.jpg`, `.jpeg`, `.gif`, `.ico`, `.css`, `.js`
</blockquote>
</small>

## Convention over Configuration

Hyde favours the "Convention over Configuration" paradigm and thus comes preconfigured with sensible defaults.
However, Hyde also strives to be modular and endlessly customizable hackable if you need it.
Take a look at the [customization and configuration guide](customization.html) to see the endless options available!

## Front Matter

All Markdown content files support Front Matter. Blog posts for example make heavy use of it.

The specific usage and schemas used for pages are documented in their respective documentation,
however, here is a primer on the fundamentals.

- Front matter is stored in a block of YAML that starts and ends with a `---` line.
- The front matter should be the very first thing in the Markdown file.
- Each key-pair value should be on its own line.

**Example:**
```markdown
---
title: "My New Post"
author:
name: "John Doe"
website: https://mrhyde.example.com
---

## Markdown comes here

Lorem ipsum dolor sit amet, etc.
```
Loading

0 comments on commit 0a0c256

Please sign in to comment.