Convert docdock theme from submodule to native files and fix Hugo compatibility

This commit is contained in:
2025-10-07 22:04:56 +02:00
parent 4dde383587
commit 288932b4af
354 changed files with 41378 additions and 4 deletions

View File

@@ -0,0 +1,66 @@
+++
title = "Customize website look and feel"
Weight=3
+++
You can change the style and behavior of the theme without touching it.
* inject your own html, css or js into the page
* overide existing css or js with your own files
{{%notice note %}}
No needs to copy the entire theme to customize some parts
Bellow are solutions to avoid copying the entire theme into your own codebase.
{{%/notice%}}
## Add custom CSS and JS or HTML into the \<head\> part of each page :
Create a custom header partial `layouts/partials/custom-head.html`
> * content/
> * layouts/
> * partials/
> * custom-head.html
write your own content like (an example from @nzbart):
```html
<link rel="stylesheet" href="/css/custom.css">
<script src="/js/custom.js"></script>
```
Then overrode the style your want to change in `static/css/custom.css` (in this case, to avoid altering the casing of titles):
```css
h2 {
text-transform: none;
}
```
And executed some additional JavaScript from `static/js/custom.js` (note that jQuery is already loaded by the theme):
```javascript
function tweakPage() {
// make some changes here
}
$(tweakPage)
```
now feel free to add the JS, CSS, HTML code you want :)
## Add custom HTML at the end of the body part of each page :
Create a `custom-footer.html` into a `layouts/partials` folder next to the content folder
> * content/
> * layouts/
> * partials/
> * custom-footer.html
now feel free to add the JS, CSS, HTML code you want :)
## Overide existing CSS or JS
Create the matching file in your static folder, hugo will use yours instead of the theme's one.
Example :
create a theme.css and place it into `static/css/` to fully overide docdock's theme.css

View File

@@ -0,0 +1,24 @@
+++
title = "Disable features"
+++
You can disable feature in docdock by changing some params in `config.toml`
## hide Next / Prev Chevrons
```
[params]
disableNavChevron = true
```
## hide Search box in side menu
```
[params]
disableSearch = true
```
## hide the {{%icon fa-home%}} icon in side bar
```
[params]
disableHomeIcon = true
```

View File

@@ -0,0 +1,35 @@
+++
title = "Theme variants"
description = "change theme style/colors"
+++
In site configuration file, you can set a variant name of this theme to load a specific css, with different color specifications.
add a param `themeVariant = "VARIANT_NAME"` in the `[params]` part of config.toml file.
{{%info%}}Available variants change only colors at this moment{{%/info%}}
## Variant "gray"
```
[params]
themeVariant = "gray"
```
![green docdock](/variant-gray.png)
## Variant "gold"
```
[params]
themeVariant = "gold"
```
![gold docdock](/variant-gold.png)
## Variant "green"
```
[params]
themeVariant = "green"`
```
![green docdock](/variant-green.png)

View File

@@ -0,0 +1,25 @@
+++
title = "Theme styles"
description = "change theme style"
+++
In site configuration file, you can set a subtheme name of this theme to load a specific css.
add a param `themeStyle = "STYLE_NAME"` in the `[params]` part of config.toml file.
## Style "original"
```
[params]
themeStyle = "original"
```
![green docdock](/variant-gray.png)
## Style "flex" (work in progress)
```
[params]
themeStyle = "flex"
```
![flex](/style-flex.png)