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

Build website with HydePHP #41

Merged
merged 50 commits into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
6231e28
chore: Move all Ansible code into subfolder
geoffreyvanwyk Nov 25, 2023
8ceeaeb
chore: Specify Python packages
geoffreyvanwyk Nov 25, 2023
c135cd6
chore: Create HydePHP skeleton
geoffreyvanwyk Nov 25, 2023
1548f6c
style: Start with blank page using basic layout
geoffreyvanwyk Nov 25, 2023
6e36c62
chore(ui): Install Daisy UI
geoffreyvanwyk Dec 7, 2023
6bcea5c
style: Copy Hero from DaisyUI
geoffreyvanwyk Dec 8, 2023
ae16f07
feat: Add Hero component to landing page
geoffreyvanwyk Dec 11, 2023
dd4b44b
style: Colorize primary hero button
geoffreyvanwyk Dec 11, 2023
9aec23a
chore: Publish the app Blade layout
geoffreyvanwyk Dec 13, 2023
35980d3
style: Change theme to match Moodle color
geoffreyvanwyk Dec 13, 2023
d688fe0
style: Change other versions button group to dropdown
geoffreyvanwyk Dec 13, 2023
19ef932
chore: Publish navigation Blade layout
geoffreyvanwyk Dec 13, 2023
323d2fb
style: Make main hero responsive
geoffreyvanwyk Dec 13, 2023
954b71a
style: Disable dark mode
geoffreyvanwyk Dec 13, 2023
f1962b7
chore: Remove dark mode from Tailwind
geoffreyvanwyk Dec 13, 2023
4a374b2
chore: Autoformat navigation layout
geoffreyvanwyk Dec 13, 2023
b3ba610
style: Make dark style default in navbar
geoffreyvanwyk Dec 13, 2023
3ffa649
style: Make dark style default for nav links
geoffreyvanwyk Dec 13, 2023
0772dc1
style: Add logo to navigation brand
geoffreyvanwyk Dec 13, 2023
41ad440
style: Make dark style default for footer
geoffreyvanwyk Dec 14, 2023
e3ab31e
feat: Add copyright notice to footer
geoffreyvanwyk Dec 14, 2023
0e4f9cb
chore: Add Digital Ocean affiliate link to footer
geoffreyvanwyk Dec 14, 2023
8afa115
feat: Add information to secondary hero
geoffreyvanwyk Dec 14, 2023
16deac7
feat: Add link to GitHub repo to navbar
geoffreyvanwyk Dec 14, 2023
fdda8f4
chore: Move website into Ansible files directory
geoffreyvanwyk Dec 14, 2023
a85c52f
style: Make cards in secondary hero same height
geoffreyvanwyk Dec 14, 2023
319b48c
chore: Remove _site from version control
geoffreyvanwyk Dec 14, 2023
e09e247
fix: Media files copied wrong way around
geoffreyvanwyk Dec 14, 2023
d6c74ba
chore: Install Line Awesome via NPM
geoffreyvanwyk Dec 14, 2023
07648d7
feat: Change deployment of website
geoffreyvanwyk Dec 14, 2023
b80215b
style: Increase vertical padding on primary hero
geoffreyvanwyk Dec 14, 2023
772cd5e
fix: Other versions dropdown obscured by secondary hero
geoffreyvanwyk Dec 14, 2023
3d8e1d1
refactor: Extract secondary hero into component
geoffreyvanwyk Dec 14, 2023
1d2fed2
fix: Line-awesome icon in navigation brand not loaded
geoffreyvanwyk Dec 14, 2023
3208c42
feat: Add credentials to secondary hero
geoffreyvanwyk Dec 14, 2023
44777a9
fix: Icons not loading
geoffreyvanwyk Dec 14, 2023
e79e62f
chore(dev): Run `php hyde serve` as part of `npm run watch`
geoffreyvanwyk Dec 14, 2023
f2c1274
style: Fix layout and issues with dark mode
geoffreyvanwyk Dec 15, 2023
e325601
chore(dev): Do not run Hyde server with `npm run dev`
geoffreyvanwyk Dec 15, 2023
032ff33
style: Only two columns of information cards on medium screens
geoffreyvanwyk Dec 15, 2023
8d06acc
style: Colorize information cards
geoffreyvanwyk Dec 15, 2023
62e565c
style: Flex wrap credentials
geoffreyvanwyk Dec 15, 2023
7716051
feat: Add link to Moodle project
geoffreyvanwyk Dec 15, 2023
fd952d5
chore(style): Compiled CSS for previous changes
geoffreyvanwyk Dec 15, 2023
e749fc7
chore(style): Build styles for production
geoffreyvanwyk Dec 15, 2023
917603d
chore(ci): Add build job for website
geoffreyvanwyk Dec 16, 2023
6c05fce
chore(ci): Wrong working dir for building templates
geoffreyvanwyk Dec 16, 2023
cede8b2
chore(ci): Debug action run failure
geoffreyvanwyk Dec 16, 2023
a6c9e8d
chore(ci): Fix website artifact download path
geoffreyvanwyk Dec 16, 2023
ffeb921
chore(cd): Build website before deployment
geoffreyvanwyk Dec 16, 2023
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
46 changes: 45 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,59 @@ jobs:
- name: Lint code.
run: ansible-lint .

website:
name: Build website
needs: ansible-lint
defaults:
run:
working-directory: ./files/website
runs-on: ubuntu-latest

steps:
- name: Checkout the codebase.
uses: actions/checkout@v2

- name: Install Composer dependencies.
uses: php-actions/composer@v6
with:
working_dir: ./files/website

- name: Build the templates.
run: php hyde build

- name: Install Node.js.
uses: actions/setup-node@v4
with:
node-version: 20.0.0

- name: Install NPM dependencies.
run: npm install

- name: Build assets.
run: npm run prod

- name: Upload website artifact.
uses: actions/upload-artifact@v4
with:
name: website
path: files/website/_site
retention-days: 1

molecule:
name: Molecule
needs: ansible-lint
needs: website
runs-on: ubuntu-22.04

steps:
- name: Check out the codebase.
uses: actions/checkout@v2

- name: Download website artifact.
uses: actions/download-artifact@v4
with:
name: website
path: files/website/_site

- name: Set up Python 3.
uses: actions/setup-python@v2
with:
Expand Down
58 changes: 51 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,76 @@ name: Deploy
- master

jobs:
ansible-playbook:
name: Run playbook
website:
name: Build website
defaults:
run:
working-directory: ./files/website
runs-on: ubuntu-22.04

steps:
- name: Check out the codebase.
- name: Checkout the codebase
uses: actions/checkout@v2

- name: Set up Python 3.
- name: Install Composer dependencies
uses: php-actions/composer@v6
with:
working_dir: ./files/website

- name: Build the templates
run: php hyde build

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20.0.0

- name: Install NPM dependencies
run: npm install

- name: Build assets
run: npm run prod

- name: Upload website artifact
uses: actions/upload-artifact@v4
with:
name: website_to_deploy
path: files/website/_site
retention-days: 1

ansible:
name: Run Ansible playbook
needs: website
runs-on: ubuntu-22.04

steps:
- name: Check out the codebase
uses: actions/checkout@v2

- name: Download website artifact.
uses: actions/download-artifact@v4
with:
name: website_to_deploy
path: files/website/_site

- name: Set up Python 3
uses: actions/setup-python@v2
with:
python-version: "3.x"

- name: Install Ansible.
- name: Install Ansible
run: pip3 install ansible

- name: Install playbooks dependencies
run: ansible-galaxy role install --role-file requirements.yml

- name: Install SSH key.
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}

- name: Run plays.
- name: Run plays
run: >
ansible-playbook main.playbook.yml
--inventory ${{ secrets.ANSIBLE_INVENTORY }},
Expand Down
8 changes: 8 additions & 0 deletions files/website/.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
13 changes: 13 additions & 0 deletions files/website/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
* text eol=lf

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

.github/ export-ignore
tests/ export-ignore
CHANGELOG.md export-ignore
LICENSE.md export-ignore
SECURITY.md export-ignore
12 changes: 12 additions & 0 deletions files/website/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/vendor
/node_modules
/builds
/.idea
/.vscode
/.vagrant
/.cache
.phpunit.result.cache

.env

/_site
106 changes: 106 additions & 0 deletions files/website/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# 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 screen-readers 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 included 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 the pre-configured Laravel Mix package.

### Customization

- You don't need to configure anything as Hyde is shipped with sensible defaults.
- You can, however, customize nearly everything. Here are just a few out of many 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/1.x/installation) and [Getting Started](https://hydephp.com/docs/1.x/getting-started) 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 the `hyde:make` commands 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
```


## 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 [email protected] 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.
Empty file added files/website/_docs/.gitkeep
Empty file.
2 changes: 2 additions & 0 deletions files/website/_media/app.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions files/website/_media/app.js

Large diffs are not rendered by default.

Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Loading