summaryrefslogtreecommitdiffstats
path: root/themes/rusticus/layouts
diff options
context:
space:
mode:
authorRomeo Disca <romeo.disca@gmail.com>2019-04-26 17:35:31 +0200
committerRomeo Disca <romeo.disca@gmail.com>2019-04-26 17:35:31 +0200
commit56b90d3deae11bdda58c15505c5c0a0662caa3ea (patch)
treec5d9d1d318a996cdc55ce8bbaf2729961ca2b5f8 /themes/rusticus/layouts
parent358a2e2b54b5933716c0bc88c8730696d1a6d81b (diff)
generalize front-page-summary
Diffstat (limited to 'themes/rusticus/layouts')
-rw-r--r--themes/rusticus/layouts/partials/home/front-page-summary.html18
-rw-r--r--themes/rusticus/layouts/partials/home/tax-news.html13
-rw-r--r--themes/rusticus/layouts/partials/main.html6
3 files changed, 20 insertions, 17 deletions
diff --git a/themes/rusticus/layouts/partials/home/front-page-summary.html b/themes/rusticus/layouts/partials/home/front-page-summary.html
new file mode 100644
index 0000000..773503e
--- /dev/null
+++ b/themes/rusticus/layouts/partials/home/front-page-summary.html
@@ -0,0 +1,18 @@
+
+
+<ul class="front-page-summary">
+ {{ $page := .context.Site.GetPage "section" .section }}
+ {{ $pages := $page.Pages.ByExpiryDate }}
+ {{ if eq .section "blog" }}
+ {{ $pages = $page.Pages.ByDate.Reverse }}
+ {{ end }}
+ {{ range first 3 $pages }}
+ <li hugo-nav="{{ .RelPermalink}}">
+ <a href="{{ .Permalink}}">
+ <h3>{{ .LinkTitle }}</h3>
+ <p>{{ .Summary }}</p>
+ </a>
+ </li>
+ {{ end }}
+</ul>
+
diff --git a/themes/rusticus/layouts/partials/home/tax-news.html b/themes/rusticus/layouts/partials/home/tax-news.html
deleted file mode 100644
index c6de685..0000000
--- a/themes/rusticus/layouts/partials/home/tax-news.html
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-<ul class="front-page-summary">
- {{ range first 3 (.Site.GetPage "section" "news").Pages.ByExpiryDate }}
- <li hugo-nav="{{ .RelPermalink}}">
- <a href="{{ .Permalink}}">
- <h3>{{ .LinkTitle }}</h3>
- <p>{{ .Summary }}</p>
- </a>
- </li>
- {{ end }}
-</ul>
-
diff --git a/themes/rusticus/layouts/partials/main.html b/themes/rusticus/layouts/partials/main.html
index dab3663..b3d7e65 100644
--- a/themes/rusticus/layouts/partials/main.html
+++ b/themes/rusticus/layouts/partials/main.html
@@ -8,13 +8,11 @@
<section class="news">
<h1>news</h1>
- {{ partial "home/tax-news.html" . }}
+ {{ partial "home/front-page-summary.html" (dict "context" . "section" "news") }}
</section>
<section class="blog">
<h1>blog</h1>
- <div class="thumbnail">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Corrupti veniam possimus nemo repellat, ex neque et nesciunt vero labore id quam quas repellendus odio error reiciendis officiis? Dolore, deserunt temporibus.</div>
- <div class="thumbnail">Lorem ipsum dolor sit amet consectetur adipisicing elit. Cum esse aliquam magnam inventore maiores quasi dolore perspiciatis et, laudantium sint labore nostrum quod dolorem blanditiis fugit at amet! Commodi, fuga!</div>
- <div class="thumbnail">Lorem, ipsum dolor sit amet consectetur adipisicing elit. Nobis quo explicabo repellendus voluptatibus quidem excepturi odio eum quod ullam atque tenetur velit a cumque in aspernatur corporis, aperiam quibusdam architecto.</div>
+ {{ partial "home/front-page-summary.html" (dict "context" . "section" "blog") }}
</section>
<section class="knowledge-base">
<h1>knowledge base</h1>
al.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
name: PHP Tests
on:
  pull_request

jobs:
  php:
    runs-on: ubuntu-latest
    continue-on-error: ${{ matrix.experimental }}
    name: "PHP: Nextcloud ${{ matrix.nextcloud }} - PHP ${{ matrix.php-versions }} - DB ${{ matrix.database }}"
    strategy:
      matrix:
        php-versions: ['7.4']
        nextcloud: ['stable21']
        database: ['sqlite']
        experimental: [false]
    steps:
      - name: Checkout
        uses: actions/checkout@v2.3.4

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php-versions }}
          extensions: pdo_sqlite,pdo_mysql,pdo_pgsql,gd,zip
          coverage: pcov

      ### Back to normal setup
      - name: Set up server non MySQL
        uses: SMillerDev/nextcloud-actions/setup-nextcloud@main
        with:
          cron: true
          version: ${{ matrix.nextcloud }}
          database-type: ${{ matrix.database }}

      - name: Prime app build
        run: make

      - name: Configure server with app
        uses: SMillerDev/nextcloud-actions/setup-nextcloud-app@main
        with:
          app: 'news'
          check-code: true

      - name: Setup problem matchers for PHPUnit
        run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

      - name: Prep PHP tests
        working-directory: ../server/apps/news
        run: make php-test-dependencies
      - name: Unittests
        working-directory: ../server/apps/news
        run: make unit-test
      - name: Upload codecoverage
        working-directory: ../server/apps/news
        run: bash <(curl -s https://codecov.io/bash) -f build/php-unit.clover -N ${{ github.sha }}