Skip to content

Commit

Permalink
Updated cli commands, added seo-friendly tags, default cover image
Browse files Browse the repository at this point in the history
  • Loading branch information
erikaheidi committed May 12, 2021
1 parent 5611393 commit 703599c
Show file tree
Hide file tree
Showing 15 changed files with 3,854 additions and 330 deletions.
14 changes: 0 additions & 14 deletions app/Command/Create/DefaultController.php

This file was deleted.

26 changes: 15 additions & 11 deletions app/Command/Help/DefaultController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Command\Help;

use League\CommonMark\Block\Element\Paragraph;
use Minicli\App;
use Minicli\Command\CommandController;
use Minicli\Command\CommandRegistry;
Expand All @@ -19,25 +20,28 @@ public function boot(App $app)

public function handle()
{
$this->getPrinter()->info('Available Commands');
$this->getPrinter()->info($this->app->getSignature());

foreach ($this->command_map as $command => $sub) {

$this->getPrinter()->newline();
$this->getPrinter()->out($command, 'info_alt');
$print_table[] = [ 'Namespace', 'Command' ];

foreach ($this->command_map as $command => $sub) {
if ($command == 'web') {
continue;
}
$print_table[] = [ $command, ''];
if (is_array($sub)) {
foreach ($sub as $subcommand) {
if ($subcommand !== 'default') {
$this->getPrinter()->newline();
$this->getPrinter()->out(sprintf('%s%s','└──', $subcommand));
if ($subcommand == 'default') {
$row = "./librarian $command\n";
} else {
$row = "./librarian $command $subcommand\n";
}

$print_table[] = [ '', $row ];
}
}
$this->getPrinter()->newline();
}

$this->getPrinter()->newline();
$this->getPrinter()->newline();
$this->getPrinter()->printTable($print_table);
}
}
154 changes: 110 additions & 44 deletions app/Resources/css/prism.css
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
/* PrismJS 1.20.0
https://prismjs.com/download.html#themes=prism-tomorrow&languages=markup+clike+bash+markdown+markup-templating+php+php-extras+sql+twig+yaml&plugins=line-numbers */
/* PrismJS 1.23.0
https://prismjs.com/download.html#themes=prism-okaidia&languages=markup+css+clike+javascript+apacheconf+arduino+bash+c+cpp+docker+git+go+graphql+javadoclike+json+markdown+markup-templating+nginx+php+phpdoc+php-extras+puppet+python+regex+rest+ruby+sql+twig+uri&plugins=line-numbers+toolbar+copy-to-clipboard */
/**
* prism.js tomorrow night eighties for JavaScript, CoffeeScript, CSS and HTML
* Based on https://github.com/chriskempson/tomorrow-theme
* @author Rose Pritchard
* okaidia theme for JavaScript, CSS and HTML
* Loosely based on Monokai textmate theme by http://www.monokai.nl/
* @author ocodia
*/

code[class*="language-"],
pre[class*="language-"] {
color: #ccc;
color: #f8f8f2;
background: none;
text-shadow: 0 1px rgba(0, 0, 0, 0.3);
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
font-size: 1em;
text-align: left;
Expand All @@ -27,19 +28,19 @@ pre[class*="language-"] {
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;

}

/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
border-radius: 0.3em;
}

:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background: #2d2d2d;
background: #272822;
}

/* Inline code */
Expand All @@ -50,61 +51,65 @@ pre[class*="language-"] {
}

.token.comment,
.token.block-comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: #999;
color: #8292a2;
}

.token.punctuation {
color: #ccc;
color: #f8f8f2;
}

.token.namespace {
opacity: .7;
}

.token.property,
.token.tag,
.token.attr-name,
.token.namespace,
.token.constant,
.token.symbol,
.token.deleted {
color: #e2777a;
color: #f92672;
}

.token.function-name {
color: #6196cc;
.token.boolean,
.token.number {
color: #ae81ff;
}

.token.boolean,
.token.number,
.token.function {
color: #f08d49;
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #a6e22e;
}

.token.property,
.token.class-name,
.token.constant,
.token.symbol {
color: #f8c555;
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string,
.token.variable {
color: #f8f8f2;
}

.token.selector,
.token.important,
.token.atrule,
.token.keyword,
.token.builtin {
color: #cc99cd;
.token.attr-value,
.token.function,
.token.class-name {
color: #e6db74;
}

.token.string,
.token.char,
.token.attr-value,
.token.regex,
.token.variable {
color: #7ec699;
.token.keyword {
color: #66d9ef;
}

.token.operator,
.token.entity,
.token.url {
color: #67cdcc;
.token.regex,
.token.important {
color: #fd971f;
}

.token.important,
Expand All @@ -119,10 +124,6 @@ pre[class*="language-"] {
cursor: help;
}

.token.inserted {
color: green;
}

pre[class*="language-"].line-numbers {
position: relative;
padding-left: 3.8em;
Expand Down Expand Up @@ -164,3 +165,68 @@ pre[class*="language-"].line-numbers > code {
text-align: right;
}

div.code-toolbar {
position: relative;
}

div.code-toolbar > .toolbar {
position: absolute;
top: .3em;
right: .2em;
transition: opacity 0.3s ease-in-out;
opacity: 0;
}

div.code-toolbar:hover > .toolbar {
opacity: 1;
}

/* Separate line b/c rules are thrown out if selector is invalid.
IE11 and old Edge versions don't support :focus-within. */
div.code-toolbar:focus-within > .toolbar {
opacity: 1;
}

div.code-toolbar > .toolbar .toolbar-item {
display: inline-block;
}

div.code-toolbar > .toolbar a {
cursor: pointer;
}

div.code-toolbar > .toolbar button {
background: none;
border: 0;
color: inherit;
font: inherit;
line-height: normal;
overflow: visible;
padding: 0;
-webkit-user-select: none; /* for button */
-moz-user-select: none;
-ms-user-select: none;
}

div.code-toolbar > .toolbar a,
div.code-toolbar > .toolbar button,
div.code-toolbar > .toolbar span {
color: #bbb;
font-size: .8em;
padding: 0 .5em;
background: #f5f2f0;
background: rgba(224, 224, 224, 0.2);
box-shadow: 0 2px 0 0 rgba(0,0,0,0.2);
border-radius: .5em;
}

div.code-toolbar > .toolbar a:hover,
div.code-toolbar > .toolbar a:focus,
div.code-toolbar > .toolbar button:hover,
div.code-toolbar > .toolbar button:focus,
div.code-toolbar > .toolbar span:hover,
div.code-toolbar > .toolbar span:focus {
color: inherit;
text-decoration: none;
}

2 changes: 2 additions & 0 deletions app/Resources/data/_to/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
4 changes: 2 additions & 2 deletions app/Resources/themes/default/_partials/post.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
{% endif %}

<h1 class="text-3xl lg:text-3xl my-4 text-gray-600 hover:text-blue-800">
<a href="{{ site_root() }}{{ content.getLink() }}" title="Read the full article: {{ content.frontMatterGet('title') }}">{{ content.frontMatterGet('title') ?? content.title }}</a>
<a href="{{ site_url() }}/{{ content.getLink() }}" title="Read the full article: {{ content.frontMatterGet('title') }}">{{ content.frontMatterGet('title') ?? content.title }}</a>
</h1>
<p class="text-md text-gray-500 mb-4">{{ content.getDate() }}</p>
<article class="prose xl:prose-xl max-w-none mb-6">
{% if full %}
{{ content.body_html|raw }}
{% else %}
{{ content.frontMatterGet('description') ?? 'No description provided.' }}
<p class="mt-6"><a href="{{ site_root() }}{{ content.getLink() }}">Read More...</a></p>
<p class="mt-6"><a href="{{ site_url() }}/{{ content.getLink() }}">Read More...</a></p>
{% endif %}
</article>

Expand Down
21 changes: 20 additions & 1 deletion app/Resources/themes/default/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,26 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="{% block description %} {{ site_description() }} {% endblock %}">
<meta name="author" content="Librarian">
{% block meta %}
<meta name="author" content="{{ config('site_author') }}">
<meta property="og:title" content="{{ site_title() }}">
<meta property="og:description" content="{{ site_description() }}">
<meta property="og:site_name" content="{{ site_title() }}">
<meta property="og:type" content="article">
<meta property="og:image" content="{{ site_url() }}/img/default_cover_image.png">
<meta property="og:image:url" content="{{ site_url() }}/img/default_cover_image.png">
<meta property="og:image:alt" content="{{ site_title() }}">
<meta property="og:url" content="{{ site_url() }}">

<meta name="twitter:site" content="{{ site_url() }}">
<meta name="twitter:title" content="{{ site_title() }}">
<meta name="twitter:description" content="{{ site_description() }}">
<meta name="twitter:creator" content="{{ config('site_author') }}">
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:url" content="{{ site_url() }}"/>
<meta name="twitter:image" content="{{ site_url() }}/img/default_cover_image.png">
<meta name="twitter:image:alt" content="{{ site_title() }}">
{% endblock %}

<link href="{{ site_root() }}css/app.css" rel="stylesheet">

Expand Down
19 changes: 18 additions & 1 deletion app/Resources/themes/default/content/single.html.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
{% extends 'base.html.twig' %}

{% block featured_content %}
{% block meta %}
<meta name="author" content="{{ content.frontMatterGet('author') ?? config('site_author') }}">
<meta property="og:title" content="{{ content.frontMatterGet('title') }}">
<meta property="og:description" content="{{ content.frontMatterGet('description') }}">
<meta property="og:site_name" content="{{ site_title() }}">
<meta property="og:type" content="article">
<meta property="og:image" content="{% if content.frontMatterGet('cover_image') %}{{ content.frontMatterGet('cover_image') }}{% else %}{{ site_url() }}/img/default_cover_image.png'{% endif %}">
<meta property="og:image:url" content="{% if content.frontMatterGet('cover_image') %}{{ content.frontMatterGet('cover_image') }}{% else %}{{ site_url() }}/img/default_cover_image.png'{% endif %}">
<meta property="og:image:alt" content="{{ content.frontMatterGet('title') }} - {{ site_title() }}">
<meta property="og:url" content="{{ site_url() }}/{{ content.getLink() }}">

<meta name="twitter:site" content="{{ site_url() }}">
<meta name="twitter:title" content="{{ content.frontMatterGet('title') }}">
<meta name="twitter:description" content="{{ content.frontMatterGet('description') }}">
<meta name="twitter:creator" content="{{ content.frontMatterGet('author') ?? config('site_author') }}">
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:url" content="{{ site_url() }}/{{ content.getLink() }}"/>
<meta name="twitter:image" content="{% if content.frontMatterGet('cover_image') %}{{ content.frontMatterGet('cover_image') }}{% else %}{{ site_url() }}/img/default_cover_image.png'{% endif %}">
<meta name="twitter:image:alt" content="{{ content.frontMatterGet('title') }} - {{ site_title() }}">
{% endblock %}

{% block content %}
Expand Down
Loading

0 comments on commit 703599c

Please sign in to comment.