diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml new file mode 100644 index 0000000..fc06a70 --- /dev/null +++ b/.github/workflows/website.yml @@ -0,0 +1,31 @@ +name: Build website + +on: + push: + branches: + - master + - website + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + + - name: Setup Hugo + uses: peaceiris/actions-hugo@v2 + with: + hugo-version: 'latest' + extended: true + + - name: Build + run: 'cd website && hugo --minify' + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./website/public diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c621d1..e856546 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,16 @@ # 🎀 Changelog ## Unreleased -**NOTE:** Hilbish now uses [Task] insead of Make for builds. -Windows support is also now at a lower tier; The only thing guaranteed is -Hilbish *compiling* on Windows. +**NOTES FOR USERS/PACKAGERS UPDATING:** +- Hilbish now uses [Task] insead of Make for builds. +- The doc format has been changed from plain text to markdown. +**YOU MUST reinstall Hilbish to remove the duplicate, old docs.** +- Hilbish will by default install to **`/usr/local`** instead of just `/usr/` +when building via Task. This is mainly to avoid conflict of distro packages +and local installs, and is the correct place when building from git either way. +To keep Hilbish in `/usr`, you must have `PREFIX="/usr/"` when running `task build` or `task install` +- Windows is no longer supported. It will build and run, but **will** have problems. +If you want to help fix the situation, start a discussion or open an issue and contribute. [Task]: https://taskfile.dev/#/ @@ -103,6 +110,7 @@ of a dot. (ie. `job.stop()` -> `job:stop()`) - All `fs` module functions which take paths now implicitly expand ~ to home. - **Breaking Change:** `hilbish.greeting` has been moved to an opt (`hilbish.opts.greeting`) and is always printed by default. To disable it, set the opt to false. +- **Breaking Change:** `command.no-perm` hook has been replaced with `command.not-executable` - History is now fetched from Lua, which means users can override `hilbish.history` methods to make it act how they want. - `guide` has been removed. See the [website](https://rosettea.github.io/Hilbish/) @@ -161,6 +169,8 @@ will result in the files being completed. - Cut off item names in grid menu if its longer than cell width - Fix completion search menu disappearing - Completion paths having duplicated characters if it's escaped +- Get custom completion command properly to call from Lua +- Put proper command on the line when using up and down arrow keys to go through command history ## [2.0.0-rc1] - 2022-09-14 This is a pre-release version of Hilbish for testing. To see the changelog, diff --git a/README.md b/README.md index 5ca8232..b4f85f7 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ If you're new to nix you should probably read up on how to do that [here](https: ## Manual Build ### Prerequisites - [Go 1.17+](https://go.dev) -- [Task](https://taskfile.dev/#/) +- [Task](https://taskfile.dev/installation/) (**Go on the hyperlink here to see Task's install method for your OS.**) ### Build First, clone Hilbish. The recursive is required, as some Lua libraries diff --git a/Taskfile.yaml b/Taskfile.yaml index 54b5ea0..603633f 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -3,19 +3,19 @@ version: '3' vars: - PREFIX: '{{default "/usr" .PREFIX}}' + PREFIX: '{{default "/usr/local" .PREFIX}}' bindir__: '{{.PREFIX}}/bin' BINDIR: '{{default .bindir__ .BINDIR}}' libdir__: '{{.PREFIX}}/share/hilbish' LIBDIR: '{{default .libdir__ .LIBDIR}}' - GOFLAGS: '-ldflags "-s -w"' + GOFLAGS: '-ldflags "-s -w -X main.dataDir={{.LIBDIR}}"' tasks: default: cmds: - CGO_ENABLED=0 go build {{.GOFLAGS}} vars: - GOFLAGS: '-ldflags "-s -w -X main.gitCommit=$(git rev-parse --short HEAD) -X main.gitBranch=$(git rev-parse --abbrev-ref HEAD)"' + GOFLAGS: '-ldflags "-s -w -X main.dataDir={{.LIBDIR}} -X main.gitCommit=$(git rev-parse --short HEAD) -X main.gitBranch=$(git rev-parse --abbrev-ref HEAD)"' build: cmds: diff --git a/exec.go b/exec.go index caf7d1b..d668192 100644 --- a/exec.go +++ b/exec.go @@ -141,9 +141,9 @@ func runInput(input string, priv bool) { if err != nil { if exErr, ok := isExecError(err); ok { hooks.Emit("command." + exErr.typ, exErr.cmd) - err = exErr.sprint() + } else { + fmt.Fprintln(os.Stderr, err) } - fmt.Fprintln(os.Stderr, err) } cmdFinish(exitCode, input, priv) } diff --git a/go.mod b/go.mod index 825dae0..52b274a 100644 --- a/go.mod +++ b/go.mod @@ -29,4 +29,4 @@ replace github.com/maxlandon/readline => ./readline replace layeh.com/gopher-luar => github.com/layeh/gopher-luar v1.0.10 -replace github.com/arnodel/golua => github.com/Rosettea/golua v0.0.0-20220518005949-116371948fe3 +replace github.com/arnodel/golua => github.com/Rosettea/golua v0.0.0-20221213193027-cbf6d4e4d345 diff --git a/go.sum b/go.sum index c313c19..74a351b 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,10 @@ github.com/Rosettea/golua v0.0.0-20220419183026-6d22d6fec5ac h1:dtXrgjch8PQyf7C9 github.com/Rosettea/golua v0.0.0-20220419183026-6d22d6fec5ac/go.mod h1:9jzpYPiU2is0HVGCiuIOBSXdergHUW44IEjmuN1UrIE= github.com/Rosettea/golua v0.0.0-20220518005949-116371948fe3 h1:I/wWr40FFLFF9pbT3wLb1FAEZhKb/hUWE+nJ5uHBK2g= github.com/Rosettea/golua v0.0.0-20220518005949-116371948fe3/go.mod h1:9jzpYPiU2is0HVGCiuIOBSXdergHUW44IEjmuN1UrIE= +github.com/Rosettea/golua v0.0.0-20220621002945-b05143999437 h1:6lWu4YVLeKuZ8jR9xwHONhkHBsrIbw5dpfG1gtOVw0A= +github.com/Rosettea/golua v0.0.0-20220621002945-b05143999437/go.mod h1:9jzpYPiU2is0HVGCiuIOBSXdergHUW44IEjmuN1UrIE= +github.com/Rosettea/golua v0.0.0-20221213193027-cbf6d4e4d345 h1:QNYjYDogUSiNUkffbhFSrSCtpZhofeiVYGFN2FI4wSs= +github.com/Rosettea/golua v0.0.0-20221213193027-cbf6d4e4d345/go.mod h1:9jzpYPiU2is0HVGCiuIOBSXdergHUW44IEjmuN1UrIE= github.com/Rosettea/sh/v3 v3.4.0-0.dev.0.20220306140409-795a84b00b4e h1:P2XupP8SaylWaudD1DqbWtZ3mIa8OsE9635LmR+Q+lg= github.com/Rosettea/sh/v3 v3.4.0-0.dev.0.20220306140409-795a84b00b4e/go.mod h1:R09vh/04ILvP2Gj8/Z9Jd0Dh0ZIvaucowMEs6abQpWs= github.com/Rosettea/sh/v3 v3.4.0-0.dev.0.20220524215627-dfd9a4fa219b h1:s5eDMhBk6H1BgipgLub/gv9qeyBaTuiHM0k3h2/9TSE= diff --git a/nature/completions.lua b/nature/completions.lua index d20cc59..f8127a1 100644 --- a/nature/completions.lua +++ b/nature/completions.lua @@ -24,7 +24,7 @@ function hilbish.completion.handler(line, pos) return {compGroup}, pfx else local ok, compGroups, pfx = pcall(hilbish.completion.call, - 'command.' .. #fields[1], query, ctx, fields) + 'command.' .. fields[1], query, ctx, fields) if ok then return compGroups, pfx end diff --git a/nature/init.lua b/nature/init.lua index aa85a2e..ecd1054 100644 --- a/nature/init.lua +++ b/nature/init.lua @@ -69,3 +69,11 @@ end bait.catch('error', function(event, handler, err) bait.release(event, handler) end) + +bait.catch('command.not-found', function(cmd) + print(string.format('hilbish: %s not found', cmd)) +end) + +bait.catch('command.not-executable', function(cmd) + print(string.format('hilbish: %s: not executable', cmd)) +end) diff --git a/readline/history.go b/readline/history.go index 41200c6..f772813 100644 --- a/readline/history.go +++ b/readline/history.go @@ -123,23 +123,20 @@ func (rl *Instance) walkHistory(i int) { // When we are exiting the current line buffer to move around // the history, we make buffer the current line - if rl.histPos == 0 && (rl.histPos+i) == 1 { + if rl.histOffset == 0 && rl.histOffset + i == 1 { rl.lineBuf = string(rl.line) } - switch rl.histPos + i { - case 0, history.Len() + 1: - rl.histPos = 0 + rl.histOffset += i + if rl.histOffset == 0 { rl.line = []rune(rl.lineBuf) rl.pos = len(rl.lineBuf) - return - case -1: - rl.histPos = 0 - rl.lineBuf = string(rl.line) - default: + } else if rl.histOffset <= -1 { + rl.histOffset = 0 + } else { dedup = true old = string(rl.line) - new, err = history.GetLine(history.Len() - rl.histPos - 1) + new, err = history.GetLine(history.Len() - rl.histOffset) if err != nil { rl.resetHelpers() print("\r\n" + err.Error() + "\r\n") @@ -148,7 +145,6 @@ func (rl *Instance) walkHistory(i int) { } rl.clearLine() - rl.histPos += i rl.line = []rune(new) rl.pos = len(rl.line) if rl.pos > 0 { diff --git a/readline/instance.go b/readline/instance.go index fcd8379..039f040 100644 --- a/readline/instance.go +++ b/readline/instance.go @@ -134,6 +134,7 @@ type Instance struct { // history operating params lineBuf string histPos int + histOffset int histNavIdx int // Used for quick history navigation. // diff --git a/readline/readline.go b/readline/readline.go index 7397faf..f1d6c96 100644 --- a/readline/readline.go +++ b/readline/readline.go @@ -49,7 +49,7 @@ func (rl *Instance) Readline() (string, error) { // History Init // We need this set to the last command, so that we can access it quickly - rl.histPos = 0 + rl.histOffset = 0 rl.viUndoHistory = []undoItem{{line: "", pos: 0}} // Multisplit @@ -546,6 +546,10 @@ func (rl *Instance) Readline() (string, error) { // entry readline is currently configured for and then update the line entries // accordingly. func (rl *Instance) editorInput(r []rune) { + if len(r) == 0 { + return + } + switch rl.modeViMode { case VimKeys: rl.vi(r[0]) diff --git a/vars_linux.go b/vars_linux.go index 815ba6a..e1160ba 100644 --- a/vars_linux.go +++ b/vars_linux.go @@ -14,7 +14,7 @@ var ( .. hilbish.userDir.config .. '/hilbish/?/init.lua;' .. hilbish.userDir.config .. '/hilbish/?/?.lua;' .. hilbish.userDir.config .. '/hilbish/?.lua'` - dataDir = "/usr/share/hilbish" + dataDir = "/usr/local/share/hilbish" preloadPath = dataDir + "/nature/init.lua" sampleConfPath = dataDir + "/.hilbishrc.lua" // Path to default/sample config defaultConfDir = "" diff --git a/website/.hugo_build.lock b/website/.hugo_build.lock new file mode 100644 index 0000000..e69de29 diff --git a/website/archetypes/default.md b/website/archetypes/default.md new file mode 100644 index 0000000..00e77bd --- /dev/null +++ b/website/archetypes/default.md @@ -0,0 +1,6 @@ +--- +title: "{{ replace .Name "-" " " | title }}" +date: {{ .Date }} +draft: true +--- + diff --git a/website/config.toml b/website/config.toml new file mode 100644 index 0000000..ff6b801 --- /dev/null +++ b/website/config.toml @@ -0,0 +1,25 @@ +baseURL = 'https://rosettea.github.io/Hilbish/' +languageCode = 'en-us' +title = 'Hilbish' +theme = 'hsh' +enableGitInfo = true + +[menu] +[[menu.nav]] + identifier = 'home' + name = 'Home' + pageref = '/' + weight = 1 +[[menu.nav]] + identifier = 'install' + name = 'Install' + pageref = '/install' + weight = 2 +[[menu.nav]] + identifier = 'docs' + name = 'Docs' + pageref = '/docs' + weight = 3 + +[markup.goldmark.renderer] +unsafe = true diff --git a/website/content/_index.md b/website/content/_index.md new file mode 100644 index 0000000..2b1087b --- /dev/null +++ b/website/content/_index.md @@ -0,0 +1,134 @@ +--- +description: 'Something Unique. Hilbish is the new interactive shell for Lua fans. Extensible, scriptable, configurable: All in Lua.' +--- + +[//]: <> + + +
+

Something Unique.

+

+ Hilbish is the new interactive shell for Lua fans.
+ Extensible, scriptable, configurable: All in Lua. +

+ Install + Github +
+ +
+ +
+
+
+
+
+ + + +
+
+
Simple and Easy Scripting
+
+

+ Hilbish is configured and scripted in the Lua programming language. + This removes all the old, ugly things about Shell script and introduces + everything good about Lua, including other languages (Moonscript & Fennel). +

+
+
+
+
+
+
+
+
+
+ + + +
+
+
History and Completion Menus
+
+

+ Hilbish provides the user with proper menus for completions, + history searching. Want to see your previous commands? Hit Ctrl-R. +

+
+
+
+
+
+
+
+
+
+ + + +
+
+
Tons of Features, and More to Come
+
+

+ Hilbish offers a bunch of features to make your interactive + shell experience rich. Things like syntax highlighting and hinting + available via the Lua API. +

+

* Command hints shown in photo are not default.

+
+
+
+
+
+ + +
+ +
+ +

Why not just Lua?

+

+ Hilbish is your interactive shell as well as a just a Lua interpreter + and enhanced REPL.
+

+ + +
+ +

Try It Today!

+

+ Hilbish is known to run on the 3 major platforms (Windows, MacOS, Linux) + but likely builds on other Unixes! +
+ Windows doesn't work as well as it should, so if you're a Windows user, + say something! +

+

diff --git a/website/content/docs/_index.md b/website/content/docs/_index.md new file mode 100644 index 0000000..4f30ab3 --- /dev/null +++ b/website/content/docs/_index.md @@ -0,0 +1,19 @@ +--- +title: Introduction +layout: doc +weight: -1 +menu: docs +--- + +Here lies the documentation for Hilbish, the hyper extensible Lua shell. +Hilbish provides you with a few quality of life features and useful +functions to ensure you can make the shell fully yours. + +These features include: +- Completion and history search menus +- Hinting and syntax highlighting (scripted by user) + +# Installation +Steps on installing Hilbish will be at the Install page in the navigation bar +at the top. This also included getting development builds from the GitHub +repository. diff --git a/website/content/docs/faq.md b/website/content/docs/faq.md new file mode 100644 index 0000000..d5cd1a2 --- /dev/null +++ b/website/content/docs/faq.md @@ -0,0 +1,25 @@ +--- +title: Frequently Asked Questions +layout: doc +weight: -20 +menu: docs +--- + +# Is Hilbish POSIX compliant? +No, it is not. POSIX compliance is a non-goal. Perhaps in the future, +someone would be able to write a native plugin to support shell scripting +(which would be against it's main goal, but ....) + +# Windows Support? +It compiles for Windows (CI ensures it does), but otherwise it is not +directly supported. If you'd like to improve this situation, +checkout [the discussion](https://github.com/Rosettea/Hilbish/discussions/165). + +# Where is the API documentation? +The builtin `doc` command supplies all documentation of Hilbish provided +APIs. This will be on the website in the near future. + +# Why? +Hilbish emerged from the desire of a Lua configured shell. +It was the initial reason that it was created, but now it's more: +to be hyper extensible, simpler and more user friendly. diff --git a/website/content/docs/features/_index.md b/website/content/docs/features/_index.md new file mode 100644 index 0000000..0e14346 --- /dev/null +++ b/website/content/docs/features/_index.md @@ -0,0 +1,11 @@ +--- +title: Features +layout: doc +weight: -40 +menu: docs +--- + +Hilbish has a wide range of features to enhance the user's experience and +is always adding new ones. If there is something missing here or something +you would like to see, please [start a discussion](https://github.com/Rosettea/Hilbish/discussions) +or comment on any existing ones which match your request. diff --git a/website/content/docs/features/runner-mode.md b/website/content/docs/features/runner-mode.md new file mode 100644 index 0000000..87ecc8b --- /dev/null +++ b/website/content/docs/features/runner-mode.md @@ -0,0 +1,17 @@ +--- +title: Runner Mode +description: Customize the interactive script/command runner. +layout: doc +menu: + docs: + parent: "Features" +--- + +Hilbish allows you to change how interactive text can be interpreted. +This is mainly due to the fact that the default method Hilbish uses +is that it runs Lua first and then falls back to shell script. + +In some cases, someone might want to switch to just shell script to avoid +it while interactive but still have a Lua config, or go full Lua to use +Hilbish as a REPL. This also allows users to add alternative languages, +instead of either like Fennel. diff --git a/website/content/docs/getting-started.md b/website/content/docs/getting-started.md new file mode 100644 index 0000000..f0fe56d --- /dev/null +++ b/website/content/docs/getting-started.md @@ -0,0 +1,59 @@ +--- +title: Getting Started +layout: doc +weight: -10 +menu: docs +--- + +To start Hilbish, open a terminal. If Hilbish has been installed and is not the +default shell, you can simply run `hilbish` to start it. This will launch +a normal interactive session. +To exit, you can either run the `exit` command or hit Ctrl+D. + +# Setting as Default +## Login shell +There are a few ways to make Hilbish your default shell. A simple way is +to make it your user/login shell. + +{{< warning `It is not recommended to set Hilbish as your login shell. That is expected to be a +POSIX compliant shell, which Hilbish is not. At most, there will just be a +few variables missing in your environment` >}} + +To do that, simply run `chsh -s /usr/bin/hilbish`. +Some distros (namely Fedora) might have `lchsh` instead, which is used like `lchsh `. +When prompted, you can put the path for Hilbish. + +## Default with terminal +The simpler way is to set the default shell for your terminal. The way of +doing this depends on how your terminal settings are configured. + +## Run after login shell +Some shells (like zsh) have an rc file, like `.zlogin`, which is ran when the shell session +is a login shell. In that file, you can run Hilbish. Example: + +``` +exec hilbish -S -l +``` + +This will replace the shell with Hilbish, set $SHELL to Hilbish and launch it as a login shell. + +# Configuration +Once installation and setup has been done, you can then configure Hilbish. +It is configured and scripted via Lua, so the config file is a Lua file. +You can use any pure Lua library to do whatever you want. + +Hilbish's sample configuration is usually located in `hilbish.dataDir .. '/.hilbishrc.lua'`. +You can print that path via Lua to see what it is: `print(hilbish.dataDir .. '/.hilbishrc.lua')`. +As an example, it will usually will result in `/usr/share/hilbish/.hilbishrc.lua` on Linux. + +To edit your user configuration, you can copy that file to `hilbish.userDir.config .. '/hilbish/init.lua'`, +which follows XDG on Linux and MacOS, and is located in %APPDATA% on Windows. + +As the directory is usually `~/.config` on Linux, you can run this command to copy it: +`cp /usr/share/hilbish/.hilbishrc.lua ~/.config/hilbish/init.lua` + +Now you can get to editing it. Since it's just a Lua file, having basic +knowledge of Lua would help. All of Lua's standard libraries and functions +from Lua 5.4 are available. Hilbish has some custom and modules that are +available. To see them, you can run the `doc` command. This also works as +general documentation for other things. diff --git a/website/content/install.md b/website/content/install.md new file mode 100644 index 0000000..731b8c0 --- /dev/null +++ b/website/content/install.md @@ -0,0 +1,38 @@ +--- +title: Install +description: Steps on how to install Hilbish on all the OSes and distros supported. +layout: page +--- + +## Official Binaries +The best way to get Hilbish is to get a build directly from GitHub. +At any time, there are 2 versions of Hilbish recommended for download: +the latest stable release, and development builds from the master branch. + +You can download both at any time, but note that the development builds may +have breaking changes. + +For the latest **stable release**, check here: https://github.com/Rosettea/Hilbish/releases/latest +For a **development build**: https://nightly.link/Rosettea/Hilbish/workflows/build/master + +## Package Repositories +### Arch Linux (AUR) +Hilbish is on the AUR. Setup an AUR helper, and install. +Example with yay: + +``` +yay -S hilbish +``` + +Or, from master branch: +``` +yay -S hilbish-git +``` + +### Alpine Linux +Hilbish is currentlty in the testing/edge repository for Alpine. +Follow the steps [here](https://wiki.alpinelinux.org/wiki/Enable_Community_Repository) +(Using testing repositories) and install: +``` +apk add hilbish +``` diff --git a/website/static/hilbish-flower.png b/website/static/hilbish-flower.png new file mode 100644 index 0000000..b4fb0f7 Binary files /dev/null and b/website/static/hilbish-flower.png differ diff --git a/website/themes/hsh/LICENSE b/website/themes/hsh/LICENSE new file mode 100644 index 0000000..da3c8c1 --- /dev/null +++ b/website/themes/hsh/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Rosettea + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/website/themes/hsh/archetypes/default.md b/website/themes/hsh/archetypes/default.md new file mode 100644 index 0000000..ac36e06 --- /dev/null +++ b/website/themes/hsh/archetypes/default.md @@ -0,0 +1,2 @@ ++++ ++++ diff --git a/website/themes/hsh/layouts/404.html b/website/themes/hsh/layouts/404.html new file mode 100644 index 0000000..06b3561 --- /dev/null +++ b/website/themes/hsh/layouts/404.html @@ -0,0 +1,7 @@ +{{ define "main"}} +
+
+

Go Home

+
+
+{{ end }} diff --git a/website/themes/hsh/layouts/_default/_markup/render-heading.html b/website/themes/hsh/layouts/_default/_markup/render-heading.html new file mode 100644 index 0000000..6ea5346 --- /dev/null +++ b/website/themes/hsh/layouts/_default/_markup/render-heading.html @@ -0,0 +1,6 @@ + + {{ .Text | safeHTML }} + +{{ if eq .Text ""}} +
+{{ end }} diff --git a/website/themes/hsh/layouts/_default/_markup/render-link.html b/website/themes/hsh/layouts/_default/_markup/render-link.html new file mode 100644 index 0000000..9c2a95e --- /dev/null +++ b/website/themes/hsh/layouts/_default/_markup/render-link.html @@ -0,0 +1,4 @@ + + {{ .Text | safeHTML }} + + diff --git a/website/themes/hsh/layouts/_default/baseof.html b/website/themes/hsh/layouts/_default/baseof.html new file mode 100644 index 0000000..dad9ef8 --- /dev/null +++ b/website/themes/hsh/layouts/_default/baseof.html @@ -0,0 +1,21 @@ + + + {{- partial "head.html" . -}} + + + + + + + + + + + + + + {{- partial "header.html" . -}} + {{- block "main" . }}{{- end }} + {{- partial "footer.html" . -}} + + diff --git a/website/themes/hsh/layouts/_default/doc.html b/website/themes/hsh/layouts/_default/doc.html new file mode 100644 index 0000000..bebbf5e --- /dev/null +++ b/website/themes/hsh/layouts/_default/doc.html @@ -0,0 +1,53 @@ +{{ define "main" }} +
+
+
+ +
+
+
+
+

{{ .Title }}

+

+ {{ $date := .Date.UTC.Format "Jan 2, 2006" }} + {{ $lastmod := .Lastmod.UTC.Format "Jan 2, 2006" }} + {{ if and (ne $lastmod $date) (gt .Lastmod .Date) }} + Last updated {{ $lastmod }}
+ {{ end }} + + {{ if .Description }} + {{ .Description }}
+ {{ end}} +

+ {{.Content}} +
+ + +
+
+{{ end }} + diff --git a/website/themes/hsh/layouts/_default/list.html b/website/themes/hsh/layouts/_default/list.html new file mode 100644 index 0000000..e69de29 diff --git a/website/themes/hsh/layouts/_default/page.html b/website/themes/hsh/layouts/_default/page.html new file mode 100644 index 0000000..69aaf99 --- /dev/null +++ b/website/themes/hsh/layouts/_default/page.html @@ -0,0 +1,7 @@ +{{ define "main" }} +
+
+ {{.Content}} +
+
+{{ end }} diff --git a/website/themes/hsh/layouts/_default/single.html b/website/themes/hsh/layouts/_default/single.html new file mode 100644 index 0000000..0ac0e37 --- /dev/null +++ b/website/themes/hsh/layouts/_default/single.html @@ -0,0 +1,8 @@ +{{ define "main" }} +
+
+

{{ .Title }}

+ {{.Content}} +
+
+{{ end }} diff --git a/website/themes/hsh/layouts/index.html b/website/themes/hsh/layouts/index.html new file mode 100644 index 0000000..a9f64d2 --- /dev/null +++ b/website/themes/hsh/layouts/index.html @@ -0,0 +1,6 @@ +{{ define "main" }} +
+ {{.Content}} +
+{{ end }} + diff --git a/website/themes/hsh/layouts/partials/footer.html b/website/themes/hsh/layouts/partials/footer.html new file mode 100644 index 0000000..15aa193 --- /dev/null +++ b/website/themes/hsh/layouts/partials/footer.html @@ -0,0 +1,32 @@ + diff --git a/website/themes/hsh/layouts/partials/head.html b/website/themes/hsh/layouts/partials/head.html new file mode 100644 index 0000000..3556074 --- /dev/null +++ b/website/themes/hsh/layouts/partials/head.html @@ -0,0 +1,26 @@ + + {{ $title := print .Title " — " .Site.Title }} + {{ if .IsHome }}{{ $title = .Site.Title }}{{ end }} + {{ $title }} + + + + + + + + + + + + + + + + + + + + + + diff --git a/website/themes/hsh/layouts/partials/header.html b/website/themes/hsh/layouts/partials/header.html new file mode 100644 index 0000000..281b602 --- /dev/null +++ b/website/themes/hsh/layouts/partials/header.html @@ -0,0 +1,25 @@ +
+ +
diff --git a/website/themes/hsh/layouts/shortcodes/warning.html b/website/themes/hsh/layouts/shortcodes/warning.html new file mode 100644 index 0000000..b217b57 --- /dev/null +++ b/website/themes/hsh/layouts/shortcodes/warning.html @@ -0,0 +1,6 @@ + diff --git a/website/themes/hsh/theme.toml b/website/themes/hsh/theme.toml new file mode 100644 index 0000000..a567739 --- /dev/null +++ b/website/themes/hsh/theme.toml @@ -0,0 +1,21 @@ +# theme.toml template for a Hugo theme +# See https://github.com/gohugoio/hugoThemes#themetoml for an example + +name = "Hsh" +license = "MIT" +licenselink = "https://github.com/yourname/yourtheme/blob/master/LICENSE" +description = "" +homepage = "http://example.com/" +tags = [] +features = [] +min_version = "0.41.0" + +[author] + name = "" + homepage = "" + +# If porting an existing theme +[original] + name = "" + homepage = "" + repo = ""