Skip to content

Commit

Permalink
Merge branch 'release-0.9.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
thingsym committed Oct 8, 2020
2 parents 2207378 + 6a1c930 commit 31ee73a
Show file tree
Hide file tree
Showing 25 changed files with 9,916 additions and 10,522 deletions.
10 changes: 1 addition & 9 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,8 @@ trim_trailing_whitespace = true
indent_style = tab
indent_size = 2

[{*.html,*.js}]
[*.{html,js,json,yml,xml,toml}]
indent_style = space

[{package.json,*.yml}]
indent_style = space
indent_size = 2

[{composer.json,*.toml}]
indent_style = space
indent_size = 4

[*.md]
trim_trailing_whitespace = false
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ The Techdoc is a Hugo Theme for technical documentation.
* Edit link to documentation repository
* Header link to HTML headings
* Custom Shortcodes
* Code highlight with clipboard
* Alert panel
* Button
* Search Shortcode powered by [Algolia](https://www.algolia.com/)
* Open Graph
* Analytics with Google Analytics, Google Tag Manager
Expand Down Expand Up @@ -70,7 +73,7 @@ For an example of `config.toml`, [config.toml](https://github.com/thingsym/hugo-
### Directory layout

```
tree .
tree . -I node_modules
.
├── archetypes
Expand Down Expand Up @@ -125,6 +128,7 @@ tree .
│   │   └── single.html
│   └── shortcodes
│   ├── button.html
│   ├── code.html
│   ├── panel.html
│   └── search.html
├── LICENSE.md
Expand All @@ -134,6 +138,7 @@ tree .
├── resources
├── src
│   ├── js
│   │   ├── code.js
│   │   ├── headerlink.js
│   │   ├── jquery.backtothetop
│   │   │   ├── jquery.backtothetop.js
Expand Down Expand Up @@ -221,21 +226,28 @@ Small patches and bug reports can be submitted a issue tracker in Github. Forkin

## Changelog

* Version 0.9.4 - 2020.10.08
* improve scss for custom shortcodes using css custom properties
* change stack to css custom properties
* fix scss
* fix button shortcode, adding notice color
* add Code highlight with clipboard custom shortcode
* fix webpack.config.js
* fix npm scripts
* update package.json
* adjust no sidebar layout
* Version 0.9.3 - 2020.08.02
* remove jQuery dependency with keydown nav
* add header link

* Version 0.9.2 - 2020.06.14
* add note and sample to document
* fix tableOfContents endLevel
* add chapter 'unlimited levels' to document
* add menu indentation up to 5 levels

* Version 0.9.1 - 2020.05.24
* fix config.toml
* fix url in rss meta link
* remove line break in algolia.json

* Version 0.9.0 - 2020.04.01
* fix lint config
* update Sample Document
Expand Down Expand Up @@ -306,6 +318,12 @@ Techdoc bundles the following third-party resources:
* CSS reset by [normalize.css](https://necolas.github.io/normalize.css/), [MIT](https://opensource.org/licenses/MIT)
* jQuery Plugin [Back to the Top](https://github.com/thingsym/jquery.backtothetop), [MIT](https://opensource.org/licenses/MIT)
* Sass Mixin [Flexbox Grid Mixins](https://thingsym.github.io/flexbox-grid-mixins/), [MIT](https://opensource.org/licenses/MIT)
* [jQuery](https://jquery.com/)
* [jQuery Easing](https://github.com/gdsmith/jquery.easing)
* [Font Awesome](https://fontawesome.com/)
* [clipboard.js](https://clipboardjs.com/)
* [algoliasearch](https://github.com/algolia/algoliasearch-client-javascript)
* [Day.js](https://github.com/iamkun/dayjs)

## Author

Expand Down
4 changes: 2 additions & 2 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ enableMissingTranslationPlaceholders = false
# Source Code repository section
description = "put your description"
github_repository = "https://github.com/thingsym/hugo-theme-techdoc"
version = "0.9.3"
version = "0.9.4"

# Documentation repository section
# documentation repository (set edit link to documentation repository)
Expand All @@ -43,7 +43,7 @@ enableMissingTranslationPlaceholders = false

# Documentation Menu section
# Menu style settings
menu_style = "open-menu" # "open-menu" or "slide-menu"
menu_style = "open-menu" # "open-menu" or "slide-menu" or "" blank is as no sidebar

# Date format
dateformat = "" # default "2 Jan 2006"
Expand Down
3 changes: 3 additions & 0 deletions exampleSite/content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ images:
* [Theme color](getting-started/screenshot/#theme-color)
* [Edit link](getting-started/screenshot/#edit-link) to documentation repository
* [Custom Shortcodes](sample/custom-shortcodes/)
* Code highlight with clipboard
* Alert panel
* Button
* [Search Shortcode](sample/search-shortcode/) powered by [Algolia](https://www.algolia.com/)
* Open Graph
* Analytics with Google Analytics, Google Tag Manager
6 changes: 3 additions & 3 deletions exampleSite/content/getting-started/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ For an example of `config.toml`, see [config.toml](https://github.com/thingsym/h
# Source Code repository section
description = "put your description"
github_repository = "https://github.com/thingsym/hugo-theme-techdoc"
version = "0.9.3"
version = "0.9.4"

# Documentation repository section
# documentation repository (set edit link to documentation repository)
Expand All @@ -41,7 +41,7 @@ For an example of `config.toml`, see [config.toml](https://github.com/thingsym/h

# Documentation Menu section
# Menu style settings
menu_style = "open-menu" # "open-menu" or "slide-menu"
menu_style = "open-menu" # "open-menu" or "slide-menu" or "" blank is as no sidebar

# Date format
dateformat = "" # default "2 Jan 2006"
Expand Down Expand Up @@ -80,7 +80,7 @@ default: `https://github.com/thingsym/hugo-theme-techdoc`

The version of souce code

default: `0.9.3`
default: `0.9.4`

#### `github_doc_repository`

Expand Down
1 change: 1 addition & 0 deletions exampleSite/content/sample/build-in-shortcodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ date: 2017-10-17T15:26:15Z
draft: false
weight: 10
description: "calling built-in Shortcodes into your content files."
TableOfContents: true
---

See https://gohugo.io/content-management/shortcodes/#use-hugos-built-in-shortcodes
Expand Down
19 changes: 18 additions & 1 deletion exampleSite/content/sample/custom-shortcodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,23 @@ date: 2017-10-17T15:26:15Z
draft: false
weight: 10
description: "calling custom Shortcodes into your content files."
TableOfContents: true
---

## Code highlight with clipboard

{{< code file="sample/custom-shortcodes.html" >}}{{</* highlight html */>}}
<section id="main">
<div>
<h1 id="title">{{ .Title }}</h1>
{{ range .Pages }}
{{ .Render "summary"}}
{{ end }}
</div>
</section>
{{</* /highlight */>}}
{{< /code >}}

## Alert panel

{{< panel >}}Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.{{< /panel >}}
Expand Down Expand Up @@ -44,12 +59,14 @@ description: "calling custom Shortcodes into your content files."

### Alert panel with Font Awesome

{{< panel status="danger" title="danger" icon="fas fa-download" >}}Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.{{< /panel >}}
{{< panel status="danger" title="danger" icon="fas fa-exclamation-triangle" >}}Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.{{< /panel >}}

## Button

{{< button url="#" >}}primary{{< /button >}}

{{< button status="notice" url="#" >}}notice{{< /button >}}

{{< button status="success" url="#" >}}success{{< /button >}}

{{< button status="caution" url="#" >}}caution{{< /button >}}
Expand Down
3 changes: 2 additions & 1 deletion layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
{{ partial "meta/chroma.html" . -}}
<script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery.easing@1.4.1/jquery.easing.min.js"></script>
<script src="{{"js/bundle.js" | absURL}}"></script>
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.6/dist/clipboard.min.js"></script>
<script src="{{ "js/bundle.js" | absURL }}"></script>
{{- partial "meta/google-analytics-async.html" . -}}
{{- partial "meta/tag-manager.html" . -}}
{{- partial "meta/google-site-verification.html" . -}}
Expand Down
2 changes: 2 additions & 0 deletions layouts/partials/sidebar.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ if ne .Site.Params.menu_style "" }}
<div class="sidebar">
{{ if eq .Site.Params.menu_style "open-menu" }}
{{- partial "menu/open-menu.html" . -}}
Expand All @@ -8,3 +9,4 @@
{{- partial "sidebar-footer.html" . -}}
</div>
</div>
{{ end }}
4 changes: 2 additions & 2 deletions layouts/partials/site-header.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<header>
<h1>{{ .Site.Title }}</h1>
{{ with .Site.Params.version }}
{{- with .Site.Params.version -}}
<span class="version">Version {{ . }}</span>
{{end}}
{{- end -}}
{{- with .Site.Params.github_repository -}}
<a href="{{ . }}" class="github"><i class="fab fa-github"></i></a>
{{- end -}}
Expand Down
18 changes: 18 additions & 0 deletions layouts/shortcodes/code.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- $file := .Get "file" -}}
{{- $codeLang := "" -}}
{{- $suffix := findRE "(\\.[^.]+)$" $file 1 -}}
{{- with $suffix -}}
{{- $codeLang = (index . 0 | strings.TrimPrefix ".") -}}
{{- end -}}
{{- with .Get "codeLang" -}}{{- $codeLang = . -}}{{- end -}}
<div class="code" id="{{ $file | urlize}}">
{{- with $file -}}
<div class="filename">{{.}}</div>
{{- end -}}
{{- if ne (.Get "copy") "false" -}}
<button class="copy-btn copy" title="Copy this code to your clipboard." data-clipboard-action="copy" aria-label="Copy this code."><i class="fas fa-clipboard"></i> Copy</button>
{{- end -}}
<div class="code-content" {{ with .Get "download" }}id="{{ . }}"{{ end }}>
{{ if .Get "nocode" }}{{ $.Inner }}{{ else }}{{ with $codeLang }}{{- highlight $.Inner . "" | -}}{{ else }}<pre><code>{{- .Inner | string -}}</code></pre>{{ end }}{{ end }}
</div>
</div>
Loading

0 comments on commit 31ee73a

Please sign in to comment.