Skip to content

Commit

Permalink
Merge pull request #20 from murdercode/new-asset
Browse files Browse the repository at this point in the history
New asset format
  • Loading branch information
murdercode authored Feb 13, 2023
2 parents 1b25563 + 575548f commit e854e03
Show file tree
Hide file tree
Showing 9 changed files with 84 additions and 53 deletions.
30 changes: 20 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,26 @@ All notable changes to `laravel-shortcode-plus` will be documented in this file.

### What's Changed

- fix component render method by @DispatchCode in https://github.com/murdercode/laravel-shortcode-plus/pull/15
- fix component render method by @DispatchCode
in https://github.com/murdercode/laravel-shortcode-plus/pull/15

**Full Changelog**: https://github.com/murdercode/laravel-shortcode-plus/compare/v1.2.4...v1.2.5

## v1.2.4 - 2022-12-01

### What's Changed

- fix title using addslashes by @DispatchCode in https://github.com/murdercode/laravel-shortcode-plus/pull/14
- fix title using addslashes by @DispatchCode
in https://github.com/murdercode/laravel-shortcode-plus/pull/14

**Full Changelog**: https://github.com/murdercode/laravel-shortcode-plus/compare/v1.2.3...v1.2.4

## v1.2.3 - 2022-12-01

### What's Changed

- Feature/livewire modal images by @DispatchCode in https://github.com/murdercode/laravel-shortcode-plus/pull/13
- Feature/livewire modal images by @DispatchCode
in https://github.com/murdercode/laravel-shortcode-plus/pull/13

**Full Changelog**: https://github.com/murdercode/laravel-shortcode-plus/compare/v1.2.2...v1.2.3

Expand All @@ -34,33 +37,40 @@ All notable changes to `laravel-shortcode-plus` will be documented in this file.

### What's Changed

- bugfix gallery tag on readme by @DispatchCode in https://github.com/murdercode/laravel-shortcode-plus/pull/4
- Loading all migrations from the migrations folder by @DispatchCode in https://github.com/murdercode/laravel-shortcode-plus/pull/5
- Bump dependabot/fetch-metadata from 1.3.4 to 1.3.5 by @dependabot in https://github.com/murdercode/laravel-shortcode-plus/pull/6
- bugfix gallery tag on readme by @DispatchCode
in https://github.com/murdercode/laravel-shortcode-plus/pull/4
- Loading all migrations from the migrations folder by @DispatchCode
in https://github.com/murdercode/laravel-shortcode-plus/pull/5
- Bump dependabot/fetch-metadata from 1.3.4 to 1.3.5 by @dependabot
in https://github.com/murdercode/laravel-shortcode-plus/pull/6

### New Contributors

- @dependabot made their first contribution in https://github.com/murdercode/laravel-shortcode-plus/pull/6
- @dependabot made their first contribution
in https://github.com/murdercode/laravel-shortcode-plus/pull/6

**Full Changelog**: https://github.com/murdercode/laravel-shortcode-plus/compare/v1.2.0...v1.2.1

## v1.2.0 - 2022-11-05

### What's Changed

- Feature/gallery parser by @DispatchCode in https://github.com/murdercode/laravel-shortcode-plus/pull/3
- Feature/gallery parser by @DispatchCode
in https://github.com/murdercode/laravel-shortcode-plus/pull/3

**Full Changelog**: https://github.com/murdercode/laravel-shortcode-plus/compare/v1.1.0...v1.2.0

## v1.1.0 - 2022-11-04

### What's Changed

- Feature/image parser by @DispatchCode in https://github.com/murdercode/laravel-shortcode-plus/pull/2
- Feature/image parser by @DispatchCode
in https://github.com/murdercode/laravel-shortcode-plus/pull/2

### New Contributors

- @DispatchCode made their first contribution in https://github.com/murdercode/laravel-shortcode-plus/pull/2
- @DispatchCode made their first contribution
in https://github.com/murdercode/laravel-shortcode-plus/pull/2

**Full Changelog**: https://github.com/murdercode/laravel-shortcode-plus/compare/v1.0.0...v1.1.0

Expand Down
42 changes: 28 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<p align="center"><img src="https://github.com/murdercode/laravel-shortcode-plus/raw/HEAD/art/laravel-shortcode-logo.svg" width="50%" alt="Logo Laravel Shortcode Plus"></p>

[![Latest Version on Packagist](https://img.shields.io/packagist/v/murdercode/laravel-shortcode-plus.svg?style=flat-square)](https://packagist.org/packages/murdercode/laravel-shortcode-plus)
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/murdercode/laravel-shortcode-plus/run-tests?label=tests)](https://github.com/murdercode/laravel-shortcode-plus/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/murdercode/laravel-shortcode-plus/Fix%20PHP%20code%20style%20issues?label=code%20style)](https://github.com/murdercode/laravel-shortcode-plus/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/murdercode/laravel-shortcode-plus/run-tests.yml?branch=main)](https://github.com/murdercode/laravel-shortcode-plus/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/murdercode/laravel-shortcode-plus/fix-php-code-style-issues.yml?branch=main)](https://github.com/murdercode/laravel-shortcode-plus/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/murdercode/laravel-shortcode-plus.svg?style=flat-square)](https://packagist.org/packages/murdercode/laravel-shortcode-plus)
![License Mit](https://img.shields.io/github/license/murdercode/laravel-shortcode-plus)


---

## Why Shortcode+?
Expand Down Expand Up @@ -44,12 +45,24 @@ the best SEO practices around.

## Installation

First, you need Laravel Livewire:

```bash
composer require livewire/livewire
```

You can install the package via composer:

```bash
composer require murdercode/laravel-shortcode-plus
```

You can use shortcodes CSS publishing the assets:

```bash
php artisan vendor:publish --tag="laravel-shortcode-plus-assets"
```

You can publish and run the migrations with:

```bash
Expand All @@ -71,6 +84,7 @@ return [
];
```
-->

Optionally, you can publish the views using

```bash
Expand All @@ -83,10 +97,10 @@ Laravel Shortcode Plus is shipped with a default CSS for a better user experienc
following line before your `</head>`:

```php
{!! LaravelShortcodePlus::css() !!}
<link href="{{asset('vendor/shortcode-plus/css/shortcodes.css')}}" rel="stylesheet">
```

Now you can parse your source as follow:
Now you can parse your source as follows:

```php
use Murdercode\ShortcodePlus\Facades\ShortcodePlus;
Expand All @@ -106,16 +120,16 @@ $twitterOembed = LaravelShortcodePlus::source($html)->parseTwitterTag();

Here is the list of the available parsers:

| Parser | Description | Parameters | Example |
| --- |--------------------------|----------------|---------------------------------------------------------------------------|
| `parseTwitterTag()` | Parse a `[twitter]` tag. | `url` | `[twitter url="https://twitter.com/elonmusk/status/1585841080431321088"]` |
| `parseYoutubeTag()` | Parse a `[youtube]` tag. | `url` | `[youtube url="https://www.youtube.com/watch?v=9bZkp7q19f0"]` |
| `parseSpotifyTag()` | Parse a `[spotify]` tag. | `url` or `uri` | `[spotify url="https://open.spotify.com/track/2TpxZ7JUBn3uw46aR7qd6V"]` |
| `parseFaqTag()` | Parse a `[faq]` tag. | `title` | `[faq title="What is the answer to the ultimate question?"]42[/faq]` |
| `parseSpoilerTag()` | Parse a `[spoiler]` tag. | `title` | `[spoiler title="Spoiler"]This is hidden content[/spoiler]` |
| `parseFacebookTag()` | Parse a `[facebook]` tag. | `url` | `[facebook url="https://www.facebook.com/elonmusk/posts/10157744420210129"]` |
| `parseImageTag()` | Parse an `[image]` tag. | `id`, `caption` (optional) | `[image id="123"]` |
| `parseGalleryTag()` | Parse a `[gallery]` tag. | `title`, `images` | Single or multiple images: `[gallery title="Gallery title here" images="1"]` or `[gallery title="Gallery title here" images="1,2,3"]` |
| Parser | Description | Parameters | Example |
|----------------------|---------------------------|----------------------------|---------------------------------------------------------------------------------------------------------------------------------------|
| `parseTwitterTag()` | Parse a `[twitter]` tag. | `url` | `[twitter url="https://twitter.com/elonmusk/status/1585841080431321088"]` |
| `parseYoutubeTag()` | Parse a `[youtube]` tag. | `url` | `[youtube url="https://www.youtube.com/watch?v=9bZkp7q19f0"]` |
| `parseSpotifyTag()` | Parse a `[spotify]` tag. | `url` or `uri` | `[spotify url="https://open.spotify.com/track/2TpxZ7JUBn3uw46aR7qd6V"]` |
| `parseFaqTag()` | Parse a `[faq]` tag. | `title` | `[faq title="What is the answer to the ultimate question?"]42[/faq]` |
| `parseSpoilerTag()` | Parse a `[spoiler]` tag. | `title` | `[spoiler title="Spoiler"]This is hidden content[/spoiler]` |
| `parseFacebookTag()` | Parse a `[facebook]` tag. | `url` | `[facebook url="https://www.facebook.com/elonmusk/posts/10157744420210129"]` |
| `parseImageTag()` | Parse an `[image]` tag. | `id`, `caption` (optional) | `[image id="123"]` |
| `parseGalleryTag()` | Parse a `[gallery]` tag. | `title`, `images` | Single or multiple images: `[gallery title="Gallery title here" images="1"]` or `[gallery title="Gallery title here" images="1,2,3"]` |

### Note for Facebook

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"laravel-shortcodes"
],
"scripts": {
"dev": "npx tailwindcss -i ./resources/src/css/shortcodes.css -o ./resources/views/css/shortcodes.css --watch",
"build": "npx tailwindcss -i ./resources/src/css/shortcodes.css -o ./resources/views/css/shortcodes.css --minify"
"dev": "npx tailwindcss -i ./resources/src/css/shortcodes.css -o resources/dist/css/shortcodes.css --watch",
"build": "npx tailwindcss -i ./resources/src/css/shortcodes.css -o resources/dist/css/shortcodes.css --minify"
},
"devDependencies": {
"@tailwindcss/typography": "^0.5.8",
Expand Down
1 change: 1 addition & 0 deletions resources/dist/css/shortcodes.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e854e03

Please sign in to comment.