diff options
| author | la-ninpre <leobrekalini@gmail.com> | 2020-12-09 12:39:31 +0300 |
|---|---|---|
| committer | la-ninpre <leobrekalini@gmail.com> | 2020-12-09 12:42:53 +0300 |
| commit | 2d91f98aae123493bf3739f874cf42a73dbb643b (patch) | |
| tree | b64fecdbae63850c8b7728f042b74307305f6174 | |
| parent | 94aa9aef93789893416dcbc21851a16915e852b0 (diff) | |
| download | aaoth.xyz-2d91f98aae123493bf3739f874cf42a73dbb643b.tar.gz aaoth.xyz-2d91f98aae123493bf3739f874cf42a73dbb643b.zip | |
move duplicated code to include file
because it was the same in tagsort and other pages.
| -rw-r--r-- | _includes/post-preview.html | 10 | ||||
| -rw-r--r-- | _layouts/tagsort.html | 11 | ||||
| -rw-r--r-- | _sass/main.scss | 6 | ||||
| -rw-r--r-- | other.md | 11 |
4 files changed, 17 insertions, 21 deletions
diff --git a/_includes/post-preview.html b/_includes/post-preview.html new file mode 100644 index 0000000..d86c92c --- /dev/null +++ b/_includes/post-preview.html @@ -0,0 +1,10 @@ +<div class="post"> + <h2 id="{{ post.title | slugify }}"> + <a href="{{ post.url }}">{{ post.title }}</a> + </h2> + {{ post.excerpt }} + <p> + <a href="{{ post.url }}">read more...</a> + </p> + <small><p>{{ post.date | date_to_string }}</p></small> +</div> diff --git a/_layouts/tagsort.html b/_layouts/tagsort.html index 4265df2..359484a 100644 --- a/_layouts/tagsort.html +++ b/_layouts/tagsort.html @@ -6,15 +6,6 @@ layout: default <div class="posts"> {% for post in site.tags[page.tag] %} - <div class="post"> - <h2 id="{{ post.title | slugify }}"> - <a href="{{ post.url }}">{{ post.title }}</a> - </h2> - {{ post.excerpt }} - <p> - <a href="{{ post.url }}">read more...</a> - </p> - <small><p>{{ post.date | date_to_string }}</p></small> - </div> + {% include post-preview.html %} {% endfor %} </div> diff --git a/_sass/main.scss b/_sass/main.scss index 4c9beb4..af609ae 100644 --- a/_sass/main.scss +++ b/_sass/main.scss @@ -181,6 +181,9 @@ footer { body p { padding-top: 1em; } + footer p { + padding: 0; + } nav { margin-bottom: 5vh; ul { @@ -212,11 +215,12 @@ footer { padding-top: 0; } ul { + padding-top: 1em; display: flex; flex-wrap: wrap; - justify-content: flex-start; li { margin: auto; + padding: 0 0.5em; } } } @@ -12,15 +12,6 @@ filter by tag: {% for tag in site.tags %}[{{ tag[0] }}](/tags/{{ tag[0] }}) <div class="posts"> {% for post in site.posts %} - <div class="post"> - <h2 id="{{ post.title | slugify }}"> - <a href="{{ post.url }}">{{ post.title }}</a> - </h2> - {{ post.excerpt }} - <p> - <a href="{{ post.url }}">read more...</a> - </p> - <small><p>{{ post.date | date_to_string }}</p></small> - </div> + {% include post-preview.html %} {% endfor %} </div> |
