Skip to content

Commit

Permalink
feat: first version
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Oct 26, 2024
0 parents commit 22b007a
Show file tree
Hide file tree
Showing 27 changed files with 5,645 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
github: razonyang
custom:
- https://paypal.me/razonyang
- https://afdian.com/a/razonyang
15 changes: 15 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: lint

on:
push:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
- run: npm ci
- run: npm run lint
18 changes: 18 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

name: release-please

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
with:
command: manifest
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
public/
resources/
.hugo_build.lock
node_modules/
14 changes: 14 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
pull_request_rules:
- name: Automatic merge for Renovate pull requests
conditions:
- author=renovate[bot]
actions:
merge:
method: rebase

- name: Automatic merge on approval
conditions:
- "#approved-reviews-by>=1"
actions:
merge:
method: rebase
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.0.1"
}
1 change: 1 addition & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/*.tmpl.scss
9 changes: 9 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "stylelint-config-standard-scss",
"rules": {
"at-rule-no-unknown": null,
"color-function-notation": null,
"scss/at-rule-no-unknown": true,
"scss/at-extend-no-missing-placeholder": null
}
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 HB Framework Authors

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.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# HB Search Theme

[![Used By](https://flat.badgen.net/github/dependents-repo/hbstack/theme-search?icon=hugo&label=used+by&color=green)](https://github.com/hbstack/theme-search/network/dependents)
![Hugo Requirements](https://img.shields.io/badge/dynamic/json?color=important&label=requirements&query=requirements&logo=hugo&style=flat-square&url=https://api.razonyang.com/v1/hugo/modules/github.com/hbstack/theme-search)
[![License](https://flat.badgen.net/github/license/hbstack/theme-search)](https://github.com/hbstack/theme-search/blob/main/LICENSE)
[![Version](https://flat.badgen.net/github/tag/hbstack/theme-search)](https://github.com/hbstack/theme-search/tags)
45 changes: 45 additions & 0 deletions assets/hb/modules/theme-search/scss/_search.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
.search-container {
padding: 0 !important;
}

.hb-header {
margin-bottom: 0 !important;
}

.search-header,
.search-footer {
background: var(--#{$prefix}body-bg);
position: sticky !important;
}

.search-header {
top: 0;
padding-top: .5rem;
}

.search-body {
max-height: unset !important;
}

.search-footer {
bottom: 0;
padding-bottom: .5rem;
}

// .search-result-title {
// color: var(--#{$prefix}primary);
// }

// .search-result {
// --search-result-bg: var(--#{$prefix}body-bg);
// --search-result-bg-active: var(--#{$prefix}body-bg);
// --search-result-color-active: var(--#{$prefix}body-color);
// --search-result-color-secondary-active: var(--#{$prefix}body-color-secondary);

// &[aria-selected=true] {
// .search-result-title {
// text-decoration: underline;
// color: var(--#{$prefix}primary);
// }
// }
// }
3 changes: 3 additions & 0 deletions assets/hb/modules/theme-search/scss/_sidebar.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.hb-search-sidebar {
top: .5rem;
}
2 changes: 2 additions & 0 deletions assets/hb/modules/theme-search/scss/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@import 'search';
@import 'sidebar';
Empty file.
25 changes: 25 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module github.com/hbstack/theme-search

go 1.22

require (
github.com/gohugoio/hugo-mod-bootstrap-scss/v5 v5.20300.20200 // indirect
github.com/gohugoio/hugo-mod-jslibs-dist/popperjs/v2 v2.21100.20000 // indirect
github.com/hbstack/base v0.6.2 // indirect
github.com/hbstack/footer v0.4.1 // indirect
github.com/hbstack/hb v0.15.3 // indirect
github.com/hbstack/header v0.16.3 // indirect
github.com/hbstack/search v0.2.2 // indirect
github.com/hugomods/base v0.7.2 // indirect
github.com/hugomods/fuse-js v0.1.0 // indirect
github.com/hugomods/hugopress v0.5.0 // indirect
github.com/hugomods/i18n-js v0.2.1 // indirect
github.com/hugomods/icons v0.6.5 // indirect
github.com/hugomods/icons/vendors/bootstrap v0.5.8 // indirect
github.com/hugomods/search v0.18.1 // indirect
github.com/hugomods/search-index v0.1.0 // indirect
github.com/hugomods/seo/modules/base v0.1.3 // indirect
github.com/krisk/Fuse v7.0.0+incompatible // indirect
github.com/twbs/bootstrap v5.3.3+incompatible // indirect
github.com/twbs/icons v1.11.3 // indirect
)
38 changes: 38 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
github.com/gohugoio/hugo-mod-bootstrap-scss/v5 v5.20300.20200 h1:SmpwwN3DNzJWbV+IT8gaFu07ENUFpCvKou5BHYUKuVs=
github.com/gohugoio/hugo-mod-bootstrap-scss/v5 v5.20300.20200/go.mod h1:kx8MBj9T7SFR8ZClWvKZPmmUxBaltkoXvnWlZZcSnYA=
github.com/gohugoio/hugo-mod-jslibs-dist/popperjs/v2 v2.21100.20000 h1:GZxx4Hc+yb0/t3/rau1j8XlAxLE4CyXns2fqQbyqWfs=
github.com/gohugoio/hugo-mod-jslibs-dist/popperjs/v2 v2.21100.20000/go.mod h1:mFberT6ZtcchrsDtfvJM7aAH2bDKLdOnruUHl0hlapI=
github.com/hbstack/base v0.6.2 h1:ihsxMroTujvjVnKZwueujELNXGo9gsCQdrBrJ32zkuU=
github.com/hbstack/base v0.6.2/go.mod h1:eO3xP3CJ2Dwc38+FjVqZuzmvT8dYF2D2Dw4Sx4pi9Ng=
github.com/hbstack/footer v0.4.1 h1:dGEIcqCM6K/s9bygnFQlPcVMJn+BblAjaESied8H7ug=
github.com/hbstack/footer v0.4.1/go.mod h1:EvignAN0ShrWDbPAlf9+lrRfJSha9G4wYPDUed4wPzg=
github.com/hbstack/hb v0.15.3 h1:Q7XKGYLJobkRYKiMd4tLmmBQDaIBX7n3f8QlwAohKvA=
github.com/hbstack/hb v0.15.3/go.mod h1:FJilVCHtkVpfXZT+Ii2OFCVeu9wQh/YGgRMuPKX5ycA=
github.com/hbstack/header v0.16.3 h1:WId/dVFwR0QRab1/qLJagE0PA+yW9lkq+icsMTUmZ/8=
github.com/hbstack/header v0.16.3/go.mod h1:4f3Nhslt+UQ1Fo82HuspQO7jLJ/UrZ8GgDKImiZx5FA=
github.com/hbstack/search v0.2.2 h1:OcGCw2cVzZlB48wogNatcbaHk2BB7Boc/ESt9txI4Gw=
github.com/hbstack/search v0.2.2/go.mod h1:sVNCCvokrCfydqCNF/q7kcAd+U73a7Y/0P+v8vJaC0I=
github.com/hugomods/base v0.7.2 h1:SShNl7koN79CEUdGQ65Knbf/c2k+bE+El5ManYWd8Cg=
github.com/hugomods/base v0.7.2/go.mod h1:hnWCPbVxuhXBwdFax3mmbMlWKmIo/7OP36MCLOyHtT4=
github.com/hugomods/fuse-js v0.1.0 h1:CmWHBZANvjOP44RDNQNLntqlLf9GLqeM29jekxTNcPE=
github.com/hugomods/fuse-js v0.1.0/go.mod h1:srCqvtBQR02HS/abTraDU4oINv1D3PljNPdexdoHhpo=
github.com/hugomods/hugopress v0.5.0 h1:eQHg1aKnc5StGFnV5H0BORhE0UmHYpaWHnX9QNseHrw=
github.com/hugomods/hugopress v0.5.0/go.mod h1:CRYvr60xOkZOf4Atkuj+uEj2EH5pjJ39Ws3aJAkoMkA=
github.com/hugomods/i18n-js v0.2.1 h1:uIUl4LiYdwo8IK08oq7OmluYLedL21Wc9Rig1taDTSI=
github.com/hugomods/i18n-js v0.2.1/go.mod h1:eJfxjgI2CQsNA1/ReIVvr5127DftUKcbHd2A2SQmDvU=
github.com/hugomods/icons v0.6.5 h1:vuaBlVO/MTsQNir4JWvPazjmtMMWG55Lif6VHCmd7KI=
github.com/hugomods/icons v0.6.5/go.mod h1:cIkSvK6W0q6N4U6n9KGz+QfRWQXAW0INd+1P31gPNGg=
github.com/hugomods/icons/vendors/bootstrap v0.5.8 h1:6M+G4F58pt3GkiGFeCDjKonExVV8PbBAVhDS8YQT7oY=
github.com/hugomods/icons/vendors/bootstrap v0.5.8/go.mod h1:jla3IbQAByyz45AikUAw/c7h0wUMUn5Z2j4gh+zVDj4=
github.com/hugomods/search v0.18.1 h1:NZEQa1FCHrLPBunuuv854KCTfHTw38hPGwVxvWqneDg=
github.com/hugomods/search v0.18.1/go.mod h1:xPnDGjP/HCdEWJrJBwwdI2mEtdxFxp+wHBwSl/r2m00=
github.com/hugomods/search-index v0.1.0 h1:JmCeggTFjbztJnSfum4PZ/USlmHP2rIkAWOwSpj11dA=
github.com/hugomods/search-index v0.1.0/go.mod h1:2owtATJ1XxWAvK/trnNoUC1EoBimAtRYVa7F+JO/s9c=
github.com/hugomods/seo/modules/base v0.1.3 h1:1RYumYqpmNTamOnoVjhu1u5S8dxx71awYcJaiIuJw60=
github.com/hugomods/seo/modules/base v0.1.3/go.mod h1:kKuDlSh6uMjNAfe4j1RFQze4HwTHVKWuLIRsMwENqxs=
github.com/krisk/Fuse v7.0.0+incompatible h1:jVyg6No+Joc51Rn97QQYJZIpCxzd4ywACn/4+FKWjvo=
github.com/krisk/Fuse v7.0.0+incompatible/go.mod h1:3moWv8rDjwoKic9nwiPLgZjldkbdTAbtzJHCu/Vsj4A=
github.com/twbs/bootstrap v5.3.3+incompatible h1:goFoqinzdHfkeegpFP7pvhbd0g+A3O2hbU3XCjuNrEQ=
github.com/twbs/bootstrap v5.3.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
github.com/twbs/icons v1.11.3 h1:XhvrQ1XDom9ggBbQx3wQCFGEr8qAQwQP/dAcw8OXMtA=
github.com/twbs/icons v1.11.3/go.mod h1:GnRlymgVWp5iVJCMa0Me5b6tFyGpVc2bSxPMRGIJmyA=
23 changes: 23 additions & 0 deletions hugo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# [module.hugoVersion]
# min = "0.111.3"

[[module.imports]]
path = "github.com/hbstack/base"

[[module.imports]]
path = "github.com/hbstack/search"

[params.hb]
full_width = true

[params.hb.header]
sticky = false

[params.search]
modal_container = ''
expand_results_meta = true

# [params.hb.theme-search]

# [params.hugopress.modules.hb-theme-search.hooks.body-end]
# cacheable = true
Binary file added images/screenshot.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 images/tn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions layouts/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{ define "main" }}
{{ partial "hb/modules/theme-search/index" . }}
{{ end }}
8 changes: 8 additions & 0 deletions layouts/partials/hb/modules/theme-search/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div class="hb-search row">
<div class="hb-search-container col-12 col-md-8 col-lg-9">
<div class="search-container"></div>
</div>
<div class="hb-search-sidebar col-12 col-md-4 col-lg-3 mt-2 position-sticky h-100">
{{ partial "hugopress/functions/render-hooks" (dict "Name" "hb-search-sidebar" "Page" .) }}
</div>
</div>
Loading

0 comments on commit 22b007a

Please sign in to comment.