Skip to content

Commit

Permalink
Merge pull request #72 from grml/zeha/tips
Browse files Browse the repository at this point in the history
tips: use tips data from github.com/grml/grml-tips
  • Loading branch information
zeha authored Dec 20, 2024
2 parents 5248a7c + ec7b3d9 commit c099a9d
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 4,079 deletions.
28 changes: 28 additions & 0 deletions content/tips/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
+++
title = 'Tips'
layout = 'tips'
+++
{{< tips.inline >}}

{{ $url := "https://raw.githubusercontent.com/grml/grml-tips/refs/heads/master/grml_tips" }}
{{ $s := slice }}
{{ $number := 0 }}
{{ with resources.GetRemote $url }}
{{ with .Err }}
{{ errorf "%s" . }}
{{ else }}
{{- range (split (strings.TrimSuffix "-- \n" .Content) "\n-- \n") -}}
<a name="{{ $number }}"></a>
Grml Tip Number {{ $number }}<br>
{{ $tip := . -}}
<pre>{{ htmlEscape $tip -}}</pre>
<hr>
{{ $number = add $number 1 }}

{{- end -}}
{{ end -}}
{{ else }}
{{ errorf "Unable to fetch %q" $url }}
{{ end -}}

{{< /tips.inline >}}
20 changes: 20 additions & 0 deletions layouts/_default/tips.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!doctype html>
<html>
<head>
<title>grml.org - grml Tips</title>
<meta name="Title" content="grml.org - grml Tips" />
<meta name="Author" content="the grml team [www.grml.org/team/]" />
<meta name="Keywords" content="grml.org, grml" />
<meta name="Description" content="grml Tips" />
<meta name="Abstract" content="Grml, a Live Linux distribution" />
<meta name="Robots" content="index,follow" />
<meta name="Language" content="english" />
<meta name="identifier-url" content="https://grml.org/" />
<link rel="home" href="/" title="grml.org" />
</head>
<body>

{{ .Content }}

</body>
</html>
Loading

0 comments on commit c099a9d

Please sign in to comment.