restructuring; setting up basic webserver and templating
This commit is contained in:
14
templates/article.html
Normal file
14
templates/article.html
Normal file
@@ -0,0 +1,14 @@
|
||||
{{ define "content" }}
|
||||
|
||||
{{ range . }}
|
||||
<div class="card" style="">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">{{ .Title }}</h5>
|
||||
<h6 class="card-subtitle mb-2 text-body-secondary">{{ .Author }}</h6>
|
||||
<p class="card-text">{{ .Content }}</p>
|
||||
<a href="{{ .SourceUrl }}" class="card-link">Link</a>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
13
templates/layout.html
Normal file
13
templates/layout.html
Normal file
@@ -0,0 +1,13 @@
|
||||
{{ define "base" }}
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
||||
<body>
|
||||
|
||||
{{ template "content" . }}
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
|
||||
</body>
|
||||
</html>
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user