Skip to content

Commit

Permalink
Updated design by Dmitry Skirta
Browse files Browse the repository at this point in the history
  • Loading branch information
tabuna committed Dec 19, 2021
1 parent be2e6c5 commit 1be748c
Show file tree
Hide file tree
Showing 319 changed files with 29,342 additions and 57,041 deletions.
13 changes: 7 additions & 6 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"plugins": [
["prismjs", {
"languages": ["javascript", "php"]
}]
]
}
"plugins": [
["prismjs", {
"languages": ["javascript", "css", "markup", "php", "ini", "yaml", "bash", "sql"],
"css": false
}]
]
}
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2

[docker-compose.yml]
indent_size = 4
52 changes: 52 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=

BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DRIVER=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

MEMCACHED_HOST=127.0.0.1

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* text=auto
*.css linguist-vendored
*.scss linguist-vendored
*.js linguist-vendored
CHANGELOG.md export-ignore
20 changes: 16 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,32 @@ jobs:
- name: Setup PHP 🔧
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: mbstring
php-version: 8.0
extensions: mbstring, xml
coverage: none
tools: composer:v2

- name: Install and Build 🔧
env:
APP_NAME: Orchid
APP_ENV: production
APP_KEY: base64:8Jv9H6OMWkWui9VzMwjSiLPfMqRnZGN0PNVUmMc5Dyc=
APP_DEBUG: false
APP_URL: https://orchid.software
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: |
php artisan export
php artisan make:sitemap
- name: Generate
run: |
composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
npm install --force
npm install
npm run production
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BRANCH: gh-pages
FOLDER: build_production
FOLDER: storage/app/public
24 changes: 15 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
/build_local/
/build_staging/
/build_production/
/build_staging/
/node_modules/
/vendor/
.DS_Store
./cache/
.idea
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.env.backup
.phpunit.result.cache
docker-compose.override.yml
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
/.idea
/.vscode
21 changes: 0 additions & 21 deletions LICENSE.txt

This file was deleted.

56 changes: 56 additions & 0 deletions app/Console/Commands/GenerateSiteMap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use Illuminate\Support\Str;
use Carbon\Carbon;
use Spatie\Sitemap\Sitemap;
use Spatie\Sitemap\Tags\Url;

class GenerateSiteMap extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'make:sitemap';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Create and generate sitemaps';

/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
$disk = config('export.disk');
$files = \Storage::disk($disk)->allFiles();

$sitemap = Sitemap::create();

collect($files)->filter(function (string $file) {
return Str::of($file)->endsWith('.html');
})->map(function (string $file) {
return (string) Str::of($file)->remove('index.html');
})->map(function ($path) {
return Url::create($path)
->setLastModificationDate(Carbon::yesterday())
->setChangeFrequency(Url::CHANGE_FREQUENCY_DAILY);
})->each(function (Url $url) use ($sitemap) {
$sitemap->add($url);
});


$sitemap->writeToDisk($disk, 'sitemap.xml');

return 0;
}
}
32 changes: 32 additions & 0 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
// $schedule->command('inspire')->hourly();
}

/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__ . '/Commands');

require base_path('routes/console.php');
}
}
86 changes: 86 additions & 0 deletions app/Docs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?php

namespace App;

use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\URL;
use Illuminate\Support\Str;
use Symfony\Component\Yaml\Yaml;

class Docs
{
/**
* @var string
*/
protected $locale;

/**
* @var string
*/
protected $path;

/**
* @param string $locale
* @param string $path
*/
public function __construct(string $locale, string $path)
{
app()->setLocale($locale);

$this->locale = $locale;
$this->path = "/$locale/$path.md";
}

/**
* @param string $view
*
* @return \Illuminate\Contracts\View\View
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
*/
public function view(string $view)
{
$page = Storage::disk('docs')->get($this->path);

$variables = Str::of($page)->after('---')->before('---');

$variables = Yaml::parse($variables);

$all = collect()->merge($variables)->merge([
'content' => Str::of($page)->after('---')->after('---')->markdown(),
'edit' => $this->editLinkGitHub(),
]);

return view($view, $all);
}

/**
* @return string
*/
protected function editLinkGitHub()
{
return "https://github.com/orchidsoftware/orchid.software/edit/master/source$this->path";
}

/**
* @param string $locale
*
* @return string
*/
public static function ahref(string $locale)
{
$pattern = "/$locale/";

$url = str_ireplace([
config('app.url') . '/ru',
config('app.url') . '/en',
], $pattern, URL::current());

if (!Str::contains($url, $pattern)) {
$url .= $pattern;
}

$url = config('app.url') . str_replace('//', '/', parse_url($url, PHP_URL_PATH));

return Str::finish($url, '/');
}
}
41 changes: 41 additions & 0 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

namespace App\Exceptions;

use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable;

class Handler extends ExceptionHandler
{
/**
* A list of the exception types that are not reported.
*
* @var array<int, class-string<Throwable>>
*/
protected $dontReport = [
//
];

/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array<int, string>
*/
protected $dontFlash = [
'current_password',
'password',
'password_confirmation',
];

/**
* Register the exception handling callbacks for the application.
*
* @return void
*/
public function register()
{
$this->reportable(function (Throwable $e) {
//
});
}
}
Loading

0 comments on commit 1be748c

Please sign in to comment.