Skip to content

Commit

Permalink
Add font-face for Consolas font and style blockquote.
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Dec 13, 2023
1 parent 9abc20d commit 1d6a3cd
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 10 deletions.
23 changes: 18 additions & 5 deletions src/Framework/resource/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@
scroll-behavior:smooth
}
}
@font-face {
font-family:consolas;
font-style:normal;
src:url('https://fonts.cdnfonts.com/css/consola-mono') format('woff2');
}
body {
margin:0;
font-family:var(--bs-body-font-family);
Expand Down Expand Up @@ -590,12 +595,20 @@ a:hover,a:focus {
.text-justify {
text-align:justify !important
}
body.page blockquote {
border-left: 5px solid #F1592A;
background: white;
}
blockquote {
padding: 10px 20px;
margin: 0 0 20px;
font-size: 17.5px;
border-left: 5px solid #F1592A;
}
pre {
display: block;
padding: 9.5px;
margin: 0 0 10px;
font-size: 13px;
line-height: 1.42857143;
padding: 10px !important;
font-family: consolas !important;
font-size: 18px !important;
color:var(--bs-white);
word-break: break-all;
word-wrap: break-word;
Expand Down
5 changes: 5 additions & 0 deletions src/Service/ApiService.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ public function getImageCardX(string $slug): string
: '/image/cardx.png';
}

public function getPosts(): array
{
return $this->finderRepository->find($this->post)->orderBy(['id' => SORT_DESC])->all();
}

public function getPostBySlug(string $slug): array|null|ActiveRecordInterface
{
return $this->finderRepository->findByOneCondition($this->post, ['slug' => $slug]);
Expand Down
2 changes: 1 addition & 1 deletion src/UseCase/Blog/view/post/_post.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
->content(
Div::widget()->class('entry-content')->content($post->content),
Div::widget()
->class('post-tags mb-5')
->class('post-tags mt-5 mb-5')
->content(
implode(
' ',
Expand Down
7 changes: 4 additions & 3 deletions src/UseCase/Post/Update/UpdateAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,16 @@ public function run(string $slug = null): string|Response
return $this->controller->redirect(['post/index']);
}

$imageFile = file_exists(Yii::getAlias('@uploads') . '/' . $post->image_file)
? '/uploads' . '/' . $post->image_file : '';

return $this->controller->render(
'_form',
[
'blogModule' => $this->blogModule,
'buttonTitle' => Yii::t('yii.blog', 'Update'),
'formModel' => $postForm,
'imageFile' => $post->image_file !== ''
? '/uploads' . '/' . $post->image_file
: '',
'imageFile' => $imageFile,
'nodeTree' => $this->categoryService->buildNodeTreeWithDepth(),
'seoForm' => $seoForm,
'title' => Yii::t('yii.blog', 'Update posts'),
Expand Down
2 changes: 1 addition & 1 deletion src/UseCase/Post/view/_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
['fontname', ['fontname']],
['color', ['color']],
['para', ['ul', 'ol', 'paragraph']],
['lineHeights', ['0.5', '1']],
['height', ['height']],
['table', ['table']],
['insert', ['link', 'picture', 'video']],
['view', ['fullscreen', 'codeview', 'help']],
Expand Down

0 comments on commit 1d6a3cd

Please sign in to comment.