HTMLを綺麗に
This commit is contained in:
@@ -42,7 +42,7 @@ class Template {
|
||||
*/
|
||||
public function addCss(string $name): void {
|
||||
$this->custCss[] =
|
||||
'<link rel="stylesheet" type="text/css" href="/static/style-'.$name.'.css" />';
|
||||
"<link rel=\"stylesheet\" type=\"text/css\" href=\"/static/style-{$name}.css\" />\n";
|
||||
$this->assign('custCss', $this->custCss);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
{@ include(common/header) @}
|
||||
{@ include(common/search) @}
|
||||
|
||||
<div class="news-article">
|
||||
{@ if (isset($meta->thumbnail) && $meta->thumbnail != '') @}
|
||||
<div class="thumbnail{{ isset($meta->thumborient) && $meta->thumborient != 'center' ? ' '.$meta->thumborient : '' }}">
|
||||
@@ -8,9 +10,18 @@
|
||||
<div class="meta">
|
||||
<div class="meta-date">{{ $meta->date }}</div>
|
||||
<div class="meta-author">{{ $meta->author }}</div>
|
||||
{@ if (isset($meta->category) && !empty($meta->category) && $meta->category[0] !== '') @}
|
||||
{@ foreach ($meta->category as $cat) @}
|
||||
<div class="meta-category">
|
||||
{{ $cat }}
|
||||
|
||||
</div>
|
||||
{@ endforeach @}
|
||||
{@ endif @}
|
||||
</div>
|
||||
|
||||
<h1 class="title">{{{ $meta->title }}}</h1>
|
||||
{{{ $article }}}
|
||||
|
||||
</div>
|
||||
{@ include(common/footer) @}
|
||||
|
||||
@@ -9,11 +9,9 @@
|
||||
<div class="news-content">
|
||||
<div class="news-meta">
|
||||
<span class="news-date">{{ $post['date'] }}</span>
|
||||
{# {@ if (isset($post['category']) && is_array($post['category'])) @} #}
|
||||
{@ foreach ($post['category'] as $cat) @}
|
||||
<span class="news-category">{{ $cat }}</span>
|
||||
{@ endforeach @}
|
||||
{# {@ endif @} #}
|
||||
</div>
|
||||
<h2 class="news-title">
|
||||
<a href="/{{ $section }}/{{ $post['slug'] }}{{{ isset($_GET['q']) ? '?q='.urlencode($_GET['q']) : '' }}}">{{{ $post['title'] }}}</a>
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
{@ include(common/header) @}
|
||||
{@ include(common/search) @}
|
||||
|
||||
<div class="news-grid">
|
||||
{@ foreach ($posts as $post) @}
|
||||
{@ include(common/newscard) @}
|
||||
{@ endforeach @}
|
||||
</div>
|
||||
|
||||
{@ include(common/pagination) @}
|
||||
{@ include(common/footer) @}
|
||||
|
||||
Reference in New Issue
Block a user