mirror of https://github.com/lxndrblz/anatole.git

Alexander Bilz
11.44.2022 5a52f7f8f7cb130041e049ce9740eeb42df4b34d
refactor: archive

2 files modified
87 ■■■■■ changed files
assets/scss/partials/components/_archive.scss 65 ●●●●● patch | view | raw | blame | history
layouts/_default/list.html 22 ●●●● patch | view | raw | blame | history
assets/scss/partials/components/_archive.scss
@@ -1,40 +1,33 @@
.archive {
    width: 100%;
    &__list {
        font-size: 1.4rem;
        margin: 30px;
        padding: 0;
        &-item{
            padding-bottom: 5px;
            list-style-type: none;
            .post-time {
                float: right;
                display: inline-block;
                max-width: 10%;
                text-align: right;
                color: $primary-light;
            }
            a {
                color: $primary;
                width: 90%;
                display: inline-block;
              }
              a:hover {
                color: $info;
              }
        }
        &-title{
            font-size: 2.4rem;
            color: $primary;
            font-weight: 600;
            line-height: 2.2em;
        }
  &__list {
    font-size: 1.4rem;
    margin: 30px;
    padding: 0;
    &-item {
      padding-bottom: 5px;
      list-style-type: none;
    }
    &-date {
      float: right;
      max-width: 10%;
      text-align: right;
      color: $primary-light;
    }
    &-title {
      color: $primary;
      width: 90%;
      display: inline-block;
      &:hover {
        color: $info;
      }
    }
    &-heading {
      font-size: 2.4rem;
      color: $primary;
      font-weight: 600;
      line-height: 2.2em;
    }
  }
}
layouts/_default/list.html
@@ -1,6 +1,6 @@
{{ define "main" }}
  <div
    class="archive {{ with .Site.Params.doNotLoadAnimations }}
    class="post post-wrapper archive {{ with .Site.Params.doNotLoadAnimations }}
      .
    {{ else }}
@@ -10,24 +10,22 @@
  >
    <ul class="archive__list">
      {{ range .Data.Pages.GroupByDate "2006" }}
        <div class="archive__list-title">{{ .Key }}</div>
        <div class="archive__list-heading">{{ .Key }}</div>
        {{ range .Pages }}
          <ul>
            <li class="archive__list-item">
                <a href="{{ .RelPermalink }}" title="{{ .Title }}">{{ .Title }}</a>
                <div class="post-time">
                  <span class="date"
                    >{{ if isset .Site.Params "listdateformat" }}
                      {{ .Date.Format .Site.Params.listDateFormat }}
              <a class="archive__list-title" href="{{ .RelPermalink }}" title="{{ .Title }}">{{ .Title }}</a>
              <div class="archive__list-date">
                {{ if isset .Site.Params "listdateformat" }}
                  {{ .Date.Format .Site.Params.listDateFormat }}
                    {{ else }}
                      {{ .Date.Format "Jan 2" }}
                {{ else }}
                  {{ .Date.Format "Jan 2" }}
                    {{ end }}</span
                  >
                </div>
                {{ end }}
              </div>
            </li>
          </ul>