Skip to content

Commit

Permalink
Shortcode: Github star
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmeggle committed Apr 26, 2024
1 parent 047a43c commit 148d70b
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 5 deletions.
9 changes: 6 additions & 3 deletions content/blog/getting-started/index.de.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
draft: false
title: Robotmk v2 Schnellstart
lead: Step by Step den ersten RobotFramework-Test mit Robotmk in Checkmk integrieren.
lead: Step by Step den ersten RobotFramework-Test mit Robotmk v2 in Checkmk integrieren.
commentid: rmkv2-quickstart
menutitle: Getting Started
date: 2024-04-17T21:37:42+02:00
Expand All @@ -19,8 +19,7 @@ slug: robotmk-v2-schnellstart
---


Mit dieser Schritt-für-Schritt-Anleitung gelingt Dir der Einstieg in Synthetic Monitoring mit Robotmk.

Mit dieser Schritt-für-Schritt-Anleitung gelingt Dir der Einstieg in Synthetic Monitoring mit der neuen, in Checkmk 2.3 enthaltenen Version von Robotmk.

<!--more-->

Expand Down Expand Up @@ -190,6 +189,10 @@ Diese Checkliste fasst noch einmal alle Schritte in Kürze zusammen:
- ✓ Backen / Deployen / Installieren des Agenten
- ✓ Discovery

(Wenn alles geklappt hat, wäre das doch ein toller Zeitpunkt, das Projekt auf Github mit einem Stern :star: zu versehen, oder? :smile: )
{{< github_button button="star" user="elabit" repo="robotmk" count="true" large="true" dark="false" >}}


---

## Zusammenfassung
Expand Down
7 changes: 5 additions & 2 deletions content/blog/getting-started/index.en.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
draft: false
title: Robotmk v2 quick start
lead: Integrate the first RobotFramework test with Robotmk in Checkmk step by step.
lead: Integrate the first RobotFramework test with Robotmk v2 in Checkmk step by step.
commentid: rmkv2-quickstart
menutitle: Getting started
date: 2024-04-17T21:37:42+02:00
Expand All @@ -19,7 +19,7 @@ slug: robotmk-v2-quickstart
---


This step-by-step guide will help you get started with Synthetic Monitoring with Robotmk.
This step-by-step guide will help you get started with synthetic monitoring with the new version of Robotmk, which is integrated in Checkmk 2.3.

<!--more-->

Expand Down Expand Up @@ -188,6 +188,9 @@ This checklist summarises all the steps in a nutshell:
- ✓ Baking / Deploying / Installing the agent
- ✓ Discovery

(If everything worked out, this would be a great time to star :star: the project on Github, right? :smile: )
{{< github_button button="star" user="elabit" repo="robotmk" count="true" large="true" dark="false" >}}

---

## Summary
Expand Down
1 change: 1 addition & 0 deletions hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ baseURL: https://blog.robotmk.org/
languageCode: en-us
title: Robotmk | Blog
theme: mainroad
enableEmoji: true

menu:
main:
Expand Down
6 changes: 6 additions & 0 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<header class="header sticky-top">
{{/* https://github.com/statropy/github-button-hugo-shortcode */}}
{{ if .HasShortcode "github_button" }}
<script async defer src="https://buttons.github.io/buttons.js"></script>
{{end}}
{{/* https://github.com/statropy/github-button-hugo-shortcode */}}

<div class="container header__container">
{{ partial "logo.html" . }}
{{ partial "menu.html" . }}
Expand Down
77 changes: 77 additions & 0 deletions layouts/shortcodes/github_button.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{{/* https://github.com/statropy/github-button-hugo-shortcode */}}
{{ $button := .Get "button"}}
{{ $data_icon := "mark-github" }}
{{ $aria_label := "" }}
{{ $button_text := "" }}
{{ $href := "" }}

{{if eq $button "follow"}}
{{ $href = printf "%s" (.Get "user")}}
{{ $aria_label = printf "Follow @%s on GitHub" (.Get "user") }}
{{ $button_text = printf "Follow @%s" (.Get "user") }}
{{else if eq $button "sponsor"}}
{{ $href = printf "sponsors/%s" (.Get "user")}}
{{ $data_icon = "heart" }}
{{ $aria_label = printf "Sponsor @%s on GitHub" (.Get "user") }}
{{ $button_text = "Sponsor" }}
{{else if eq $button "watch"}}
{{ $href = printf "%s/%s/subscription" (.Get "user") (.Get "repo")}}
{{ $data_icon = "eye" }}
{{ $aria_label = printf "Watch %s/%s on GitHub" (.Get "user") (.Get "repo")}}
{{ $button_text = "Watch" }}
{{else if eq $button "star"}}
{{ $href = printf "%s/%s/" (.Get "user") (.Get "repo")}}
{{ $data_icon = "star" }}
{{ $aria_label = printf "Star %s/%s on GitHub" (.Get "user") (.Get "repo")}}
{{ $button_text = "Star" }}
{{else if eq $button "fork"}}
{{ $href = printf "%s/%s/fork" (.Get "user") (.Get "repo")}}
{{ $data_icon = "repo-forked" }}
{{ $aria_label = printf "Fork %s/%s on GitHub" (.Get "user") (.Get "repo")}}
{{ $button_text = "Fork" }}
{{else if eq $button "template"}}
{{ $href = printf "%s/%s/generate" (.Get "user") (.Get "repo")}}
{{ $data_icon = "repo-template" }}
{{ $aria_label = printf "Use this template %s/%s on GitHub" (.Get "user") (.Get "repo")}}
{{ $button_text = "Use this template" }}
{{else if eq $button "issue"}}
{{ $href = printf "%s/%s/issues" (.Get "user") (.Get "repo")}}
{{ $data_icon = "issue-opened" }}
{{ $aria_label = printf "Issue %s/%s on GitHub" (.Get "user") (.Get "repo")}}
{{ $button_text = "Issue" }}
{{else if eq $button "download"}}
{{ $branch := default "master" (.Get "branch")}}
{{ $href = printf "%s/%s/archive/%s.zip" (.Get "user") (.Get "repo") $branch}}
{{ $data_icon = "download" }}
{{ $aria_label = printf "Download %s/%s on GitHub" (.Get "user") (.Get "repo")}}
{{ $button_text = "Download" }}
{{else if eq $button "view"}}
{{ $href = printf "%s/%s" (.Get "user") (.Get "repo")}}
{{ $data_icon = "mark-github" }}
{{ $aria_label = printf "View %s/%s on GitHub" (.Get "user") (.Get "repo")}}
{{ $button_text = .Get "repo" }}
{{end}}

{{ with .Get "text" }}
{{ $button_text = . }}
{{ end }}

{{ with .Get "icon" }}
{{ $data_icon = . }}
{{ end }}

{{ with .Get "aria_label" }}
{{ $aria_label = . }}
{{ end }}

<a
class="github-button"
href="https://github.com/{{$href}}"
data-icon="octicon-{{$data_icon}}"
aria-label="{{$aria_label}}"
{{ with .Get "count"}} data-show-count="{{.}}"{{ end }}
{{if eq "true" (.Get "dark")}}data-color-scheme="dark"{{ end }}
{{if eq "true" (.Get "large")}}data-size="large"{{ end }}
>
{{$button_text}}
</a>

0 comments on commit 148d70b

Please sign in to comment.