diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-06-22 19:30:56 +0200 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-06-22 19:30:56 +0200 |
| commit | 5269ad50ddb0b641aa96dac7c8f49b156646d4c4 (patch) | |
| tree | 281934bf6cbece774b18d1fbda4d8fe764c93ae2 | |
| parent | 4dccae11c13ccefbafb4e58bcbaf4166900d6e94 (diff) | |
| download | mitjafelicijan.com-5269ad50ddb0b641aa96dac7c8f49b156646d4c4.tar.gz | |
Better filtering
| -rw-r--r-- | .github/workflows/deploy.yaml | 2 | ||||
| -rw-r--r-- | templates/note.html | 4 | ||||
| -rw-r--r-- | templates/post.html | 11 |
3 files changed, 12 insertions, 5 deletions
diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 6f31879..0058ab0 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml | |||
| @@ -27,7 +27,7 @@ jobs: | |||
| 27 | uses: actions/configure-pages@v3 | 27 | uses: actions/configure-pages@v3 |
| 28 | - name: Run a multi-line script | 28 | - name: Run a multi-line script |
| 29 | run: | | 29 | run: | |
| 30 | wget https://github.com/mitjafelicijan/jbmafp/releases/download/v0.2/jbmafp.zip | 30 | wget https://github.com/mitjafelicijan/jbmafp/releases/download/v0.3/jbmafp.zip |
| 31 | unzip jbmafp.zip | 31 | unzip jbmafp.zip |
| 32 | chmod +x jbmafp | 32 | chmod +x jbmafp |
| 33 | ./jbmafp -b | 33 | ./jbmafp -b |
diff --git a/templates/note.html b/templates/note.html index 5f3f928..c543773 100644 --- a/templates/note.html +++ b/templates/note.html | |||
| @@ -17,8 +17,8 @@ | |||
| 17 | <p><big><strong>Other notes</strong></big></p> | 17 | <p><big><strong>Other notes</strong></big></p> |
| 18 | <ul itemscope itemtype="https://schema.org/SiteNavigationElement" role="list" aria-label="Other notes"> | 18 | <ul itemscope itemtype="https://schema.org/SiteNavigationElement" role="list" aria-label="Other notes"> |
| 19 | <meta itemprop="name" content="Other notes"> | 19 | <meta itemprop="name" content="Other notes"> |
| 20 | {{ range random 20 .Pages }} | 20 | {{ range .Pages | filterbytype "note" | random 15 }} |
| 21 | {{ if and (eq .Type "note") (not .Draft) }} | 21 | {{ if not .Draft }} |
| 22 | <li> | 22 | <li> |
| 23 | {{ range .Meta.tags }} | 23 | {{ range .Meta.tags }} |
| 24 | <mark>{{ . }}</mark> | 24 | <mark>{{ . }}</mark> |
diff --git a/templates/post.html b/templates/post.html index c8925fa..1fbdd04 100644 --- a/templates/post.html +++ b/templates/post.html | |||
| @@ -4,6 +4,13 @@ | |||
| 4 | {{ define "description" }}{{ .Page.Summary }}{{ end }} | 4 | {{ define "description" }}{{ .Page.Summary }}{{ end }} |
| 5 | 5 | ||
| 6 | {{ define "content" }} | 6 | {{ define "content" }} |
| 7 | |||
| 8 | <ul> | ||
| 9 | {{ range .Pages | filterbytype "post" | random 10 }} | ||
| 10 | <li><a href="{{ .RelPermalink }}">{{ .Type }} - {{ .Title }}</a></li> | ||
| 11 | {{ end }} | ||
| 12 | </ul> | ||
| 13 | |||
| 7 | <section> | 14 | <section> |
| 8 | <h1>{{ .Page.Title }}</h1> | 15 | <h1>{{ .Page.Title }}</h1> |
| 9 | <p><cap>{{ .Page.Type }}</cap>, {{ .Page.Created.Format "Jan 2, 2006" }}, on <a href="{{ .Config.BaseURL }}">{{ .Config.Title }}'s blog</a></p> | 16 | <p><cap>{{ .Page.Type }}</cap>, {{ .Page.Created.Format "Jan 2, 2006" }}, on <a href="{{ .Config.BaseURL }}">{{ .Config.Title }}'s blog</a></p> |
| @@ -17,8 +24,8 @@ | |||
| 17 | <p><big><strong>Other posts</strong></big></p> | 24 | <p><big><strong>Other posts</strong></big></p> |
| 18 | <ul itemscope itemtype="https://schema.org/SiteNavigationElement" role="list" aria-label="Other posts"> | 25 | <ul itemscope itemtype="https://schema.org/SiteNavigationElement" role="list" aria-label="Other posts"> |
| 19 | <meta itemprop="name" content="Other post"> | 26 | <meta itemprop="name" content="Other post"> |
| 20 | {{ range random 20 .Pages }} | 27 | {{ range .Pages | filterbytype "post" | random 15 }} |
| 21 | {{ if and (eq .Type "post") (not .Draft) }} | 28 | {{ if not .Draft }} |
| 22 | <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li> | 29 | <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li> |
| 23 | {{ end }} | 30 | {{ end }} |
| 24 | {{ end }} | 31 | {{ end }} |
