Skip to content

Commit

Permalink
updating the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
thorstenkramm committed Mar 3, 2024
1 parent 6b18c59 commit 7616588
Show file tree
Hide file tree
Showing 13 changed files with 258 additions and 4 deletions.
Binary file added docs/assets/images/robot.webp
Binary file not shown.
Binary file modified docs/content/docs/actions/render-buttons/buttons1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/content/docs/actions/render-buttons/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
weight: 006
weight: 306
title: "Render Buttons"
description: ""
icon: "article"
Expand Down
Binary file modified docs/content/docs/get-started/buttons-date.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/content/docs/get-started/buttons-date.webp
Binary file not shown.
5 changes: 3 additions & 2 deletions docs/content/docs/get-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ tar xzf $DOWNLOAD
./httpe -r example.rules.unix.yaml
```

## Execute the examples

On a second terminal, execute a request like this

```shell
Expand Down Expand Up @@ -101,8 +103,7 @@ how HTTPE has executed a script and send back the output.

{{< figure
src="buttons-date.png"
caption="A button created from the rules."
width="50%"
caption="A button created from the rules."
>}}
## Understand the rules
Expand Down
3 changes: 2 additions & 1 deletion docs/data/landing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ hero:
image:
path: "images" # path to image under configured assets directory. default 'images'
filename: "httpe_screenshot.png" # filename of your hero image (including file extension)
filename: "robot.webp" # filename of your hero image (including file extension)
#filename: "httpe_screenshot.png" # filename of your hero image (including file extension)
alt: "HTTPE Screenshot" # Optional but recommended
boxShadow: true # default 'false' (excludes .svg images)
rounded: true # round the image corners? default 'false' (excludes .svg images)
Expand Down
1 change: 1 addition & 0 deletions docs/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title = 'HTTP Everything'
[params]
[params.docs]
sidebarIcons = true
prism = false

[params.social]
github = "http-everyting/httpe"
Expand Down
125 changes: 125 additions & 0 deletions docs/layouts/partials/docs/head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<head>
<meta charset="utf-8" />
<title>
{{- $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }}
{{- if eq $url "/" }}
{{- .Site.Title }}
{{- else }}
{{- if .Params.heading }}
{{ .Params.heading }}
{{ else }}
{{- if eq .Title .Site.Title }}
{{- .Title }}
{{- else }}
{{- .Title }} | {{ .Site.Params.docs.Title | default (.Site.Title) }}
{{- end }}
{{- end }}
{{- end -}}
</title>
{{- if not hugo.IsProduction }}
<meta name="robots" content="noindex">
{{- end }}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{{- with .Description | default ($.Param "description") }}
<meta name="description" content="{{ . }}">
{{- end }}
<!-- favicon -->
{{ block "favicon" . }}{{ partialCached (printf "%s/%s" ($.Scratch.Get "pathName") "head/favicon.html") . }}{{ end }}
{{- partial (printf "%s/%s" ($.Scratch.Get "pathName") "head/opengraph") . }}
{{- partial (printf "%s/%s" ($.Scratch.Get "pathName") "head/twitter_cards") . }}
<!-- Dark Mode -->
{{ if eq .Site.Params.docs.darkMode true -}}
{{ $darkModeInit := resources.Get (printf "/%s/%s" ($.Scratch.Get "pathName") "js/darkmode-init.js") | js.Build | minify -}}
<script>{{ $darkModeInit.Content | safeJS }}</script>
{{ end -}}
<!-- FlexSearch -->
{{ if or (not (isset .Site.Params.flexsearch "enabled")) (eq .Site.Params.flexsearch.enabled true) -}}
{{ if and (.Site.Params.docsearch.appID) (.Site.Params.docsearch.apiKey) -}}
{{ else }}
{{ $flexSearch := resources.Get (printf "/%s/%s" ($.Scratch.Get "pathName") "js/flexsearch.bundle.js") }}
{{- if not .Site.IsServer }}
{{ $flexSearch := $flexSearch | minify | fingerprint "sha384" }}
<script type="text/javascript" src="{{ $flexSearch.Permalink }}" integrity="{{ $flexSearch.Data.Integrity }}" crossorigin="anonymous"></script>
{{ else }}
<script type="text/javascript" src="{{ $flexSearch.Permalink }}"></script>
{{ end }}
{{ end }}
{{ end }}
<!-- Google Fonts -->
{{- partialCached "google-fonts" . }}
<!-- Custom CSS -->
{{- $options := dict "enableSourceMap" true }}
{{- if hugo.IsProduction}}
{{- $options := dict "enableSourceMap" false "outputStyle" "compressed" }}
{{- end }}
{{- $style := resources.Get (printf "/%s/%s" ($.Scratch.Get "pathName") "scss/style.scss") }}
{{- $style = $style | resources.ExecuteAsTemplate (printf "/%s/%s" ($.Scratch.Get "pathName") "scss/style.scss") . | resources.ToCSS $options }}
{{- if hugo.IsProduction }}
{{- $style = $style | minify | fingerprint "sha384" }}
{{- end -}}
<link rel="stylesheet" href="{{ $style.RelPermalink }}" {{ if hugo.IsProduction }}integrity="{{ $style.Data.Integrity }}"{{ end -}} crossorigin="anonymous">
<!-- Katex CSS -->
{{- if .Params.katex -}}
{{- $options := dict "enableSourceMap" true }}
{{- if hugo.IsProduction}}
{{- $options := dict "enableSourceMap" false "outputStyle" "compressed" }}
{{- end -}}
{{- $katexCSS := resources.Get (printf "/%s/%s" ($.Scratch.Get "pathName") "scss/katex.scss") }}
{{- $katexCSS = $katexCSS | resources.ExecuteAsTemplate (printf "/%s/%s" ($.Scratch.Get "pathName") "scss/katex.scss") . | resources.ToCSS $options }}
{{- if hugo.IsProduction }}
{{- $katexCSS = $katexCSS | minify | fingerprint "sha384" }}
{{- end -}}
<link rel="stylesheet" href="{{ $katexCSS.RelPermalink }}" {{ if hugo.IsProduction }}integrity="{{ $katexCSS.Data.Integrity }}"{{ end -}} crossorigin="anonymous">
{{- end -}}
<!-- Katex JS -->
{{- if .Params.katex -}}
{{ $katex := resources.Get (printf "/%s/%s" ($.Scratch.Get "pathName") "js/katex.js") }}
{{ $katexAutoRender := resources.Get (printf "/%s/%s" ($.Scratch.Get "pathName") "js/auto-render.js") }}
{{ if hugo.IsProduction }}
{{ $katex = $katex | minify | fingerprint "sha384" }}
{{ $katexAutoRender = $katexAutoRender | minify | fingerprint "sha384" }}
{{- end -}}
<script src="{{ $katex.RelPermalink }}" {{ if hugo.IsProduction }}integrity="{{ $katex.Data.Integrity }}"{{ end -}} defer></script>
<script src="{{ $katexAutoRender.RelPermalink }}" {{ if hugo.IsProduction }}integrity="{{ $katexAutoRender.Data.Integrity }}"{{ end -}} defer></script>
{{ end -}}

<!-- Katex Config -->
{{ if .Params.katex }}
{{- partialCached (printf "%s/%s" ($.Scratch.Get "pathName") "footer/katex.html") . -}}
{{ end }}
<!-- Plausible Analytics Config -->
{{- if not .Site.IsServer }}
{{ if and (.Site.Params.plausible.scriptURL | default "https://plausible.io") (.Site.Params.plausible.dataDomain) -}}
{{- partialCached (printf "%s/%s" ($.Scratch.Get "pathName") "head/plausible") . }}
{{- end -}}
{{- end -}}
<!-- Google Analytics v4 Config -->
{{- if not .Site.IsServer }}
{{- if .Site.GoogleAnalytics }}
{{- template "_internal/google_analytics.html" . -}}
{{- end -}}
{{- end -}}
<style>
.docs-content .main-content code {
font-size: 0.8em;
}
.docs-content .main-content figure {
border: 1px solid #cccccc; /* Thin gray border */
display: inline-block; /* Ensures content flows around the figure */
margin: 0 auto; /* Centers the figure horizontally */
overflow: hidden; /* Hides any overflowing image content */
width: fit-content;
}
.docs-content .main-content figure figcaption p {
background: #3c4858;
color: white;
text-align: center;
margin: 0;
padding: 0.3em;
}
.docs-content .main-content figure img {
margin: 0;
height: 100%;
}
</style>
</head>
22 changes: 22 additions & 0 deletions docs/layouts/partials/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!-- Footer Start -->
<footer class="footer footer-light footer-bar">
<div class="footer-py-30">
<div class="container text-center">
<div class="row align-items-center">
<div class="col-sm-6">
<div class="text-sm-start">
<p class="mb-0">
{{ $yearToken := (cond (isset .Site.Params (lower "copyrightYearToken")) $.Site.Params.copyrightYearToken ":YEAR:") }}
{{ replace $.Site.Params.footer.copyright $yearToken (string (now.Format "2006")) | markdownify }}
</p>
</div>
</div>

<div class="col-sm-6 mt-4 mt-sm-0 pt-2 pt-sm-0">
<!-- <p>Privacy</p> -->
</div><!--end col-->
</div><!--end row-->
</div><!--end container-->
</div>
</footer><!--end footer-->
<!-- Footer End -->
65 changes: 65 additions & 0 deletions docs/layouts/partials/head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<head>
<meta charset="utf-8"/>
<title>{{- .Site.Title }}</title>
{{- if not hugo.IsProduction }}
<meta name="robots" content="noindex">
{{- end }}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description"
content="HTTPE is a web application server that maps URLs to actions. Create UIs with no code to trigger actions with a browser - desktop or mobile."/>
<meta name="keywords" content="http application server, low code"/>
<meta name="author" content="Thorsten Kramm"/>
<meta name="email" content="info@httpe.io"/>
<meta name="website" content="https://httpe.io"/>
<!-- favicon -->
{{ block "head/favicon" . }}{{ partialCached "head/favicon.html" . }}{{ end }}
<!-- Google Fonts -->
{{- partial "google-fonts" . }}
<!-- Custom CSS -->
{{- $options := dict "enableSourceMap" true }}
{{- if hugo.IsProduction}}
{{- $options := dict "enableSourceMap" false "outputStyle" "compressed" }}
{{- end }}
{{- $style := resources.Get "/scss/style.scss" }}
{{- $style = $style | resources.ExecuteAsTemplate "/scss/style.scss" . | resources.ToCSS $options }}
{{- if hugo.IsProduction }}
{{- $style = $style | minify | fingerprint "sha384" }}
{{- end -}}
<link rel="stylesheet" href="{{ $style.RelPermalink }}" {{ if hugo.IsProduction
}}integrity="{{ $style.Data.Integrity }}" {{ end -}}/>
<!-- Bootstrap JS -->
{{ $js := resources.Get "js/bootstrap.js" }}
{{ $params := dict }}
{{ $sourceMap := cond hugo.IsProduction "" "inline" }}
{{ $opts := dict "sourceMap" $sourceMap "minify" hugo.IsProduction "target" "es2018" "params" $params }}
{{ $js = $js | js.Build $opts }}
{{ if hugo.IsProduction }}
{{ $js = $js | fingerprint "sha384" }}
{{ end }}
<script src="{{ $js.RelPermalink }}" {{ if hugo.IsProduction }}integrity="{{ $js.Data.Integrity }}" {{ end -}}
defer></script>
<!-- Image Compare Viewer -->
{{ if .Site.Data.landing.image_compare.enable }}
{{ $imagecompare := resources.Get "js/image-compare-viewer.min.js" }}
{{- if not .Site.IsServer }}
{{- $js := (slice $imagecompare) | resources.Concat "/js/image-compare.js" | minify | fingerprint "sha384" }}
<script type="text/javascript" src="{{ $js.Permalink }}" integrity="{{ $js.Data.Integrity }}"></script>
{{- else }}
{{- $js := (slice $imagecompare) | resources.Concat "/js/image-compare.js" }}
<script type="text/javascript" src="{{ $js.Permalink }}" {{ if hugo.IsProduction
}}integrity="{{ $js.Data.Integrity }}" {{ end }}></script>
{{- end }}
{{- end }}
<!-- Plausible Analytics Config -->
{{- if not .Site.IsServer }}
{{ if and (.Site.Params.plausible.scriptURL) (.Site.Params.plausible.dataDomain) -}}
{{- partialCached "head/plausible" . }}
{{- end -}}
{{- end -}}
<!-- Google Analytics v4 Config -->
{{- if not .Site.IsServer }}
{{- if .Site.GoogleAnalytics }}
{{- template "_internal/google_analytics.html" . -}}
{{- end -}}
{{- end -}}
</head>
31 changes: 31 additions & 0 deletions docs/layouts/shortcodes/figure.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<div style="margin: 0; text-align: center; vertical-align: center">
<figure{{ with .Get "class" }} class="{{ . }}"{{ end }}>
{{- if .Get "link" -}}
<a href="{{ .Get "link" }}"{{ with .Get "target" }} target="{{ . }}"{{ end }}{{ with .Get "rel" }} rel="{{ . }}"{{ end }}>
{{- end -}}
<img src="{{ .Get "src" }}"
{{- if or (.Get "alt") (.Get "caption") }}
alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}"
{{- end -}}
{{- with .Get "width" }} width="{{ . }}"{{ end -}}
{{- with .Get "height" }} height="{{ . }}"{{ end -}}
{{- with .Get "loading" }} loading="{{ . }}"{{ end -}}
/><!-- Closing img tag -->
{{- if .Get "link" }}</a>{{ end -}}
{{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
<figcaption>
{{ with (.Get "title") -}}
<h4>{{ . }}</h4>
{{- end -}}
{{- if or (.Get "caption") (.Get "attr") -}}<p>
{{- .Get "caption" | markdownify -}}
{{- with .Get "attrlink" }}
<a href="{{ . }}">
{{- end -}}
{{- .Get "attr" | markdownify -}}
{{- if .Get "attrlink" }}</a>{{ end }}</p>
{{- end }}
</figcaption>
{{- end }}
</figure>
</div>
8 changes: 8 additions & 0 deletions example.rules.unix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,11 @@ rules:
path: /hosts
do:
answer.file: /etc/hosts

- name: A button
on:
path: /button
do:
render.buttons:
- url: /date
name: Date

0 comments on commit 7616588

Please sign in to comment.