Rework blog
This commit is contained in:
parent
bdf95f35ed
commit
643f9de5c8
4 changed files with 9 additions and 41 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
|||
tailwindcss
|
||||
.hugo_build.lock
|
||||
resources/
|
||||
public/
|
||||
|
|
0
content/posts/.gitkeep
Normal file
0
content/posts/.gitkeep
Normal file
|
@ -1,14 +0,0 @@
|
|||
[
|
||||
{
|
||||
"title": "Hello World",
|
||||
"release": "2023-05-24",
|
||||
"author": "LinuxSquare",
|
||||
"content": "## Meow World"
|
||||
},
|
||||
{
|
||||
"title": "Bye World",
|
||||
"release": "2023-05-26",
|
||||
"author": "LinuxSquare",
|
||||
"content": ""
|
||||
}
|
||||
]
|
|
@ -1,34 +1,15 @@
|
|||
<!-- Get Data maybe from strapi -->
|
||||
<div class="flex flex-col">
|
||||
{{ range .Site.Data.news }}
|
||||
{{ range last 4 (site.GetPage "posts").Pages.ByDate }}
|
||||
<div class="flex-auto">
|
||||
<h3 class="mb-0">{{.title}}</h3>
|
||||
<small>{{.release}}</small>
|
||||
<h3 class="mb-0">{{ .Title }}</h3>
|
||||
<small>{{ .Date | time.Format ":date_long" }}</small>
|
||||
</div>
|
||||
<p></p>
|
||||
<button
|
||||
type="button"
|
||||
<p>{{ .Summary }}</p>
|
||||
<a
|
||||
class="text-white bg-blue-700 hover:bg-blue-800 focus:outline-none focus:ring-4 focus:ring-blue-300 font-medium rounded-full text-sm px-5 py-2.5 text-center me-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 max-w-2xs"
|
||||
onclick="openNewsPage('{{.title}}', '{{.release}}', '{{.author}}', '{{.content}}')">Read more</button>
|
||||
|
||||
href="{{ .RelPermalink }}">
|
||||
Read more
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
<div id="newsbox" class="invisible">
|
||||
<div class="color-background"></div>
|
||||
<div class="content">
|
||||
<div class="inner">
|
||||
<div class="close-btn" onclick="closeNewsPage()"></div>
|
||||
<h3 id="title-h3" class="title"></h3>
|
||||
<div class="flex flex-row lead">
|
||||
<span id="post-date" class="flex-auto"></span>
|
||||
<span id="authorname" class="flex-auto"></span>
|
||||
</div>
|
||||
<div class="content">
|
||||
<div id="content-box">
|
||||
{{ "## Meow" | markdownify }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue