Afegida paginació i configuarció del tema.
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: "{{ replace .Name "-" " " | title }}"
|
title: "{{ replace .Name "-" " " | title }}"
|
||||||
date: {{ .Date }}
|
|
||||||
draft: true
|
draft: true
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
7
archetypes/post.md
Normal file
7
archetypes/post.md
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
title: "{{ replace .Name "-" " " | title }}"
|
||||||
|
author: ""
|
||||||
|
date: {{ .Date }}
|
||||||
|
type: post
|
||||||
|
draft: true
|
||||||
|
---
|
||||||
@@ -8,6 +8,7 @@ params:
|
|||||||
themeColor: green # ["orange", "blue", "red", "green", "pink"]
|
themeColor: green # ["orange", "blue", "red", "green", "pink"]
|
||||||
fullWidthTheme: false
|
fullWidthTheme: false
|
||||||
centerTheme: true
|
centerTheme: true
|
||||||
|
postTypeName: post
|
||||||
logo:
|
logo:
|
||||||
logoText: L'Ajuntament
|
logoText: L'Ajuntament
|
||||||
|
|
||||||
|
|||||||
@@ -9,12 +9,16 @@ Això és l'Ajuntament oficial a l'ombra! Ben aviat serem a tot el poble, i als
|
|||||||
## Un subtítol
|
## Un subtítol
|
||||||
Sabem fer moltes coses! Per exemple: _Text torçat_ Uau! Com mola!
|
Sabem fer moltes coses! Per exemple: _Text torçat_ Uau! Com mola!
|
||||||
|
|
||||||

|
{{< figure
|
||||||
|
src="/img/el_marc_i_el_nil.gif"
|
||||||
|
position="center" alt="El Marc i el Nil!"
|
||||||
|
style="border-radius: 8px;"
|
||||||
|
caption="Aquests som nosaltres"
|
||||||
|
captionStyle="border-radius: 8px;" >}}
|
||||||
|
|
||||||
# Som uns hackers
|
# Som uns hackers
|
||||||
Una miqueta de codi
|
|
||||||
```python
|
{{< code language="python" title="Una mica de codi" >}}
|
||||||
import random
|
import random
|
||||||
import time
|
import time
|
||||||
|
|
||||||
@@ -26,7 +30,7 @@ def un_membre():
|
|||||||
print(f"El jefe de l'Ajuntament és...")
|
print(f"El jefe de l'Ajuntament és...")
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
print(un_membre())
|
print(un_membre())
|
||||||
```
|
{{< /code >}}
|
||||||
|
|
||||||
# Un nou punt
|
# Un nou punt
|
||||||
Això s'ha afegit automàticament!
|
Això s'ha afegit automàticament!
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
title: "00 - Conceptes bàsics"
|
title: "00 - Conceptes bàsics"
|
||||||
author: "Marc Sastre Rienitz"
|
author: "Marc Sastre Rienitz"
|
||||||
date: 2021-10-27T21:56:35+02:00
|
date: 2021-10-27T21:56:35+02:00
|
||||||
|
type: post
|
||||||
---
|
---
|
||||||
|
|
||||||
# Què és un programa?
|
# Què és un programa?
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
title: "01 - Conceptes bàsics II"
|
title: "01 - Conceptes bàsics II"
|
||||||
author: "Marc Sastre Rienitz"
|
author: "Marc Sastre Rienitz"
|
||||||
date: 2021-10-29T19:05:57+02:00
|
date: 2021-10-29T19:05:57+02:00
|
||||||
|
type: post
|
||||||
draft: true
|
draft: true
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
57
layouts/_default/single.html
Normal file
57
layouts/_default/single.html
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
{{ define "main" }}
|
||||||
|
<div class="post">
|
||||||
|
<h1 class="post-title">
|
||||||
|
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
|
||||||
|
<div class="post-meta">
|
||||||
|
{{ if .Params.Date }}
|
||||||
|
<span class="post-date">
|
||||||
|
{{ .Date.Format "2006-01-02" }} {{ if $.Site.Params.showLastUpdated }}[{{or $.Site.Params.updatedDatePrefix "Updated"}}: {{ .Lastmod.Format "2006-01-02" }}]{{ end }}
|
||||||
|
</span>
|
||||||
|
{{ end }}
|
||||||
|
{{ with .Params.Author }}
|
||||||
|
<span class="post-author">:: {{ . }}</span>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{ if .Params.tags }}
|
||||||
|
<span class="post-tags">
|
||||||
|
{{ range .Params.tags }}
|
||||||
|
#<a href="{{ (urlize (printf "tags/%s/" .)) | absLangURL }}">{{ . }}</a>
|
||||||
|
{{ end }}
|
||||||
|
</span>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if .Params.Cover }}
|
||||||
|
<img src="{{ .Params.Cover | absURL }}" class="post-cover" alt="{{ .Title | plainify | default " " }}" />
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if .Params.Toc }}
|
||||||
|
<div class="table-of-contents">
|
||||||
|
<h2>
|
||||||
|
{{ if .Params.TocTitle }}
|
||||||
|
{{ .Params.TocTitle }}
|
||||||
|
{{ else if $.Site.Params.TocTitle }}
|
||||||
|
{{ $.Site.Params.TocTitle }}
|
||||||
|
{{ else }}
|
||||||
|
Table of Contents
|
||||||
|
{{ end }}
|
||||||
|
</h2>
|
||||||
|
{{ .TableOfContents }}
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
<div class="post-content">
|
||||||
|
{{- with .Content -}}
|
||||||
|
<div>
|
||||||
|
{{ . | replaceRE "(<h[1-9] id=\"([^\"]+)\".+)(</h[1-9]+>)" `${1}<a href="#${2}" class="hanchor" ariaLabel="Anchor">⌗</a> ${3}` | safeHTML }}
|
||||||
|
</div>
|
||||||
|
{{- end -}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{ if eq .Type $.Site.Params.postTypeName }}
|
||||||
|
{{ partial "posts_pagination.html" . }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ partial "comments.html" . }}
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
26
layouts/partials/posts_pagination.html
Normal file
26
layouts/partials/posts_pagination.html
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{{ if or .NextInSection .PrevInSection }}
|
||||||
|
<div class="pagination">
|
||||||
|
<div class="pagination__title">
|
||||||
|
<span class="pagination__title-h">{{ $.Site.Params.ReadOtherPosts }}</span>
|
||||||
|
<hr />
|
||||||
|
</div>
|
||||||
|
<div class="pagination__buttons">
|
||||||
|
{{ if .PrevInSection }}
|
||||||
|
<span class="button previous">
|
||||||
|
<a href="{{ .PrevInSection.Permalink }}">
|
||||||
|
<span class="button__icon">←</span>
|
||||||
|
<span class="button__text">{{ .PrevInSection.Title }}</span>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
{{ end }}
|
||||||
|
{{ if .NextInSection }}
|
||||||
|
<span class="button next">
|
||||||
|
<a href="{{ .NextInSection.Permalink }}">
|
||||||
|
<span class="button__text">{{ .NextInSection.Title }}</span>
|
||||||
|
<span class="button__icon">→</span>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
Reference in New Issue
Block a user