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

alexanderdavide
12.01.2022 eac53f66f73ced5c1320fc0862102ae88c925007
refactor: extract and unify wrapper to baseof
8 files modified
56 ■■■■■ changed files
assets/scss/partials/components/_post.scss 8 ●●●●● patch | view | raw | blame | history
assets/scss/partials/components/_sidebar.scss 8 ●●●●● patch | view | raw | blame | history
assets/scss/partials/components/_wrapper.scss 16 ●●●●● patch | view | raw | blame | history
layouts/_default/baseof.html 4 ●●●● patch | view | raw | blame | history
layouts/_default/single.html 2 ●●●●● patch | view | raw | blame | history
layouts/index.html 9 ●●●● patch | view | raw | blame | history
layouts/partials/sidebar.html 2 ●●●●● patch | view | raw | blame | history
layouts/portfolio/list.html 7 ●●●● patch | view | raw | blame | history
assets/scss/partials/components/_post.scss
@@ -2,14 +2,6 @@
  background-color: $accent;
  margin: 30px;
  &-wrapper {
    width: 100%;
    @include desktop_and_print {
      width: $content-width;
    }
  }
  &__more {
    font-size: 1.4rem;
  }
assets/scss/partials/components/_sidebar.scss
@@ -19,14 +19,6 @@
    width: calc(var(--sidebar-width) - 20%);
  }
  &-wrapper {
    width: 100%;
    @include desktop_and_print {
      width: $sidebar-width;
    }
  }
  &__content {
    @include desktop_and_print {
      display: flex;
assets/scss/partials/components/_wrapper.scss
@@ -5,4 +5,20 @@
  @include desktop {
    flex-direction: row;
  }
  &__main {
    width: 100%;
    @include desktop_and_print {
      width: $content-width;
    }
  }
  &__sidebar {
    width: 100%;
    @include desktop_and_print {
      width: $sidebar-width;
    }
  }
}
layouts/_default/baseof.html
@@ -9,8 +9,12 @@
  <body class="body">
    <header class="header">{{ partial "navbar.html" . }}</header>
    <div class="wrapper">
      <aside class="wrapper__sidebar">
      {{- partial "sidebar.html" . -}}
      </aside>
      <main class="wrapper__main">
      {{- block "main" . }}{{- end }}
      </main>
    </div>
    {{- partial "footer.html" (dict "context" . "footerClassModifier" "base") -}}
layouts/_default/single.html
@@ -1,5 +1,4 @@
{{ define "main" }}
  <div class="post-wrapper">
    <div
      class="post {{ with .Site.Params.doNotLoadAnimations }}
        .
@@ -107,6 +106,5 @@
      {{ end }}
    </div>
  </div>
{{ end }}
layouts/index.html
@@ -1,5 +1,4 @@
{{ define "main" }}
  <main class="post-wrapper">
    <div
      class="post {{ with .Site.Params.doNotLoadAnimations }}
        .
@@ -52,12 +51,7 @@
        {{ if .Params.thumbnail }}
          <div class="post__thumbnail-wrapper">
            <a href="{{ .RelPermalink }}">
              <img
                class="post__thumbnail"
                src="{{ .Params.thumbnail | relURL }}"
                alt="Thumbnail image"
                loading="lazy"
              />
            <img class="post__thumbnail" src="{{ .Params.thumbnail | relURL }}" alt="Thumbnail image" loading="lazy" />
            </a>
          </div>
@@ -115,6 +109,5 @@
    <div class="pagination">
      {{ template "partials/pagination.html" . }}
    </div>
  </main>
{{ end }}
layouts/partials/sidebar.html
@@ -1,4 +1,3 @@
<aside class="sidebar-wrapper">
  <div
    class="sidebar{{ with .Site.Params.doNotLoadAnimations }}
      .
@@ -29,4 +28,3 @@
    </div>
    {{- partial "footer.html" (dict "context" . "footerClassModifier" "sidebar") -}}
  </div>
</aside>
layouts/portfolio/list.html
@@ -1,5 +1,4 @@
{{ define "main" }}
  <div class="post-wrapper">
    {{ range $index, $elemen:= .Site.Data.portfolio.portfolioitems }}
      <div
        class="post {{ with .Site.Params.doNotLoadAnimations }}
@@ -73,9 +72,7 @@
              <p>{{ .description | markdownify }}</p>
              {{ if .link }}
                <div class="portfolio__button-wrapper">
                  <a class="portfolio__button" href="{{ .link | safeURL }}" target="_blank" rel="noopener"
                    >Visit Site</a
                  >
                <a class="portfolio__button" href="{{ .link | safeURL }}" target="_blank" rel="noopener">Visit Site</a>
                </div>
              {{ end }}
@@ -92,6 +89,6 @@
      </div>
    {{ end }}
  </div>
{{ end }}