thingsym / hugo-theme-techdoc Goto Github PK
View Code? Open in Web Editor NEWThe Techdoc is a Hugo Theme for technical documentation.
Home Page: https://themes.gohugo.io/hugo-theme-techdoc/
License: MIT License
The Techdoc is a Hugo Theme for technical documentation.
Home Page: https://themes.gohugo.io/hugo-theme-techdoc/
License: MIT License
such as # ## ### in the sidebar to show the logical structure of the manuscript.
hugo --minify --enableGitInfo
throws Error building site when rendering of 404.
Did any one try that ?
w1593950 ☸️ ~/k/i/ > hugo --minify --enableGitInfo
Total in 67 ms
Error: Error building site: render of "404" failed: execute of template failed: template: 404.html:22:4: executing "404.html" at <partial "sidebar.html" .>: error calling partial: execute of template failed: template: partials/sidebar.html:5:4: executing "partials/sidebar.html" at <partial "menu/slide-menu.html" .>: error calling partial: "/Users/w1593950/docs/themes/hugo-theme-techdoc/layouts/partials/menu/slide-menu.html:10:17": execute of template failed: template: partials/menu/slide-menu.html:10:17: executing "partials/menu/slide-menu.html" at <.Site.Home.Sections.ByWeight>: error calling Sections: runtime error: invalid memory address or nil pointer dereference
w1593950 ☸️ ~/k/i/is >
How to set a customized theme color?
Message: /usr/local/bin/rst2html.py rendering databases/database.rst: fork/exec /usr/local/bin/rst2html.py: no such file or directory
Looks like I have to start from scratch now ;(
Hi, I'm using version 0.9.7
of your theme and I'm not setting any weights in the pages I'm creating since I want to order them alphabetically. To do this I set the ordersectionsby = "title"
in the [params]
section of my config.toml
.
With this configuration I've noticed the following behaviour:
Furthermore, the sidebar has the pages sorted alphabetically by their title however the navigation links themselves are still sorted by weight (which means they are "randomly" sorted in my case as I'm not assigning weights to the pages).
I've managed to fix this second issue by applying the following diff, however I'm not familiar with the inner workings of Hugo enough to understand how I can fix the first issue mentioned (this is my first time using Hugo).
diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html
index 104ea8a..c81daf6 100644
--- a/layouts/partials/pagination.html
+++ b/layouts/partials/pagination.html
@@ -1,6 +1,6 @@
{{- $currentNode := . -}}
<nav class="pagination">
-{{- template "pagination" dict "menu" .Site.Home "currentnode" $currentNode "menu_exclusion" .Site.Params.menu_exclusion -}}
+{{- template "pagination" dict "menu" .Site.Home "currentnode" $currentNode "menu_exclusion" .Site.Params.menu_exclusion "ordersectionsby" .Site.Params.ordersectionsby -}}
{{- with ($.Scratch.Get "prevPage") -}}
<a class="nav nav-prev" href="{{ .Permalink }}" title="{{ .Title }}"><i class="fas fa-arrow-left" aria-hidden="true"></i> Prev - {{ .Title }}</a>
{{ end -}}
@@ -12,6 +12,7 @@
{{- define "pagination" -}}
{{- $currentNode := .currentnode -}}
{{- $menu_exclusion := .menu_exclusion -}}
+{{- $order_sections_by := .ordersectionsby -}}
{{- if hasPrefix $currentNode.Permalink .menu.Permalink -}}
{{- $currentNode.Scratch.Set "NextPageOK" "OK" -}}
@@ -38,7 +39,13 @@
{{- $currentNode.Scratch.Set "pages" (.menu.Pages | union .menu.Sections) -}}
{{- end -}}
{{- $pages := ($currentNode.Scratch.Get "pages") -}}
-{{- range $pages.ByWeight -}}
- {{- template "pagination" dict "menu" . "currentnode" $currentNode "menu_exclusion" $menu_exclusion -}}
+{{- if eq $order_sections_by "title" -}}
+ {{- range $pages.ByTitle -}}
+ {{- template "pagination" dict "menu" . "currentnode" $currentNode "menu_exclusion" $menu_exclusion "ordersectionsby" $order_sections_by -}}
+ {{- end -}}
+{{- else -}}
+ {{- range $pages.ByWeight -}}
+ {{- template "pagination" dict "menu" . "currentnode" $currentNode "menu_exclusion" $menu_exclusion "ordersectionsby" $order_sections_by -}}
+ {{- end -}}
{{- end -}}
{{- end -}}
P.S: I haven't created a PR for this diff since I'm not familiar with how Hugo works. This was just what I inferred from looking at some files and thus might not be the best way to tackle this problem.
As a site author, I want to be able to install and update techdoc as a Hugo module for ease of use.
Where do I place my favicon.ico?
I placed it in static/img/favicon.ico and static/imgages/favicon.ico, it doesn't use it.
I can't find it in the code as well (I'm not a html coder, so I might be wrong)
Thanks in advance
Hello, thanks for the good work!
I"m preparing a website here https://ibarraespinosa.github.io/cursovein/ and my menu is targeting local host. Could you guide me to find my mistake?
baseURL = "https://ibarraespinosa.github.io/cursovein"
publishDir = "docs"
languageCode = "pt-br"
DefaultContentLanguage = "pt"
title = "Curso de VEIN"
theme = "hugo-theme-techdoc"
hasCJKLanguage = true
metaDataFormat = "yaml"
pygmentsCodeFences = true
pygmentsUseClasses = true
defaultContentLanguage = "pt"
defaultContentLanguageInSubdir= false
enableMissingTranslationPlaceholders = false
[Params]
# Souce Code repository section
description = "Curso VEIN"
github_repository = "https://github.com/atmoschem/vein"
version = "0.8.7"
# Documentation repository section
# documentation repository (set edit link to documentation repository)
github_doc_repository = "https://atmoschem.github.io/vein/"
# Analytic section
google_analytics_id = "" # Your Google Analytics tracking id
tag_manager_container_id = "" # Your Google Tag Manager container id
google_site_verification = "" # Your Google Site Verification for Search Console
# Open Graph and Twitter Cards settings section
title = "Hugo Techdoc Theme"
images = ["og-image.png"]
# See https://gohugo.io/templates/internal/#open-graph
# See https://gohugo.io/templates/internal/#twitter-cards
# Theme settings section
# Theme color
custom_font_color = ""
custom_background_color = ""
# Documentation Menu section
# Menu style settings
menu_style = "slide-menu" # "open-menu" or "slide-menu"
# Date format
dateformat = "" # default "2 Jan 2006"
# See the format reference https://gohugo.io/functions/format/#hugo-date-and-time-templating-reference
# path name excluded from documentation menu
menu_exclusion = [
"archives",
"archive",
"blog",
"entry",
"post",
"posts"
]
# Global menu section
[[menu.main]]
name = "Home"
url = "/"
weight = 1
[[menu.main]]
name = "Twitter"
url = "https://twitter.com/SergioIbarraEs1"
weight = 2
[markup]
[markup.tableOfContents]
startLevel = 2
endLevel = 4
ordered = false
I really like the theme, and I am using it to document a software project
https://berndpfrommer.github.io/tagslam_web/
One question: Is there a way to limit the width of the page? The formatting looks a bit weird at times when the page is viewed on a wide screen (1920x1200). In particular the size of embedded videos then is really large, and I wasn't able to control their size. It would look neater if both videos and text were e.g. at most 800px wide.
I get following deprecation warnings, With "grep" i found that all mentioned are in themes directory, the only theme installed is "hugo-theme-techdoc":
WARN 2020/01/07 00:24:53 Page.Hugo is deprecated and will be removed in a future release. Use the global hugo function. \
WARN 2020/01/07 00:24:53 Page.URL is deprecated and will be removed in a future release. Use .Permalink or .RelPermalink. If what you want is the front matter URL value, use .Params.url
WARN 2020/01/07 00:24:53 .File.Path on zero object. Wrap it in if or with: {{ with .File }}{{ .Path }}{{ end }} \
WARN 2020/01/07 00:24:53 Page.UniqueID is deprecated and will be removed in a future release. Use .File.UniqueID \
WARN 2020/01/07 00:24:53 .File.UniqueID on zero object. Wrap it in if or with: {{ with .File }}{{ .UniqueID }}{{ end }}
Hi
May I ask you to explain how to add data to algolia index?
I have setup all steps and cans saw my data. May be run something additional need?
Thanks
Regards,
Vitaliy
FYI, I am unable to access your demo site: https://themes.gohugo.io/theme/hugo-theme-techdoc/
First, thank for your theme. I am trying it on my website (https://www.vle-project.org).
To reduce the size of the left menu, it is possible to only open menu and hierarchized sub-menu for the active page ?
I have a site with two directories in the content directory:
| content
--| schemas
-- | page1.md
--| subschemas
-- | subpage.md
In my config I have:
menu_exclusion = [
"subschemas"]
This is because I do not want subschemas appearing in the menu (the content is 200+ pages) - but there are links from pages on the schemas pages to subschemas. When I hide them using the above the exclusions the links all return 404's.
Is there anyway to hide an item from a menu but still be able to reference it by URL?
Sorry I'm new to Hugo - I've looked around I can't find anything obvious, from what I read this behaviour is down to how the theme has been implemented.
I'd like to have my sidebar display without 'Home', as the menu bar includes this persistent link already. Is it possible to exclude 'Home' from the sidebar?
It would be great to include lunr or other search engine (out of the generated .json index) to avoid requiring integration with external sites.
Other themes like PaperMod allows to integrate the search directly (and of course, working on static sites)
Would it be possible to add a search box?
While unable to code it myself, i could assist with testing.
Thanks!
I was looking for a configuration option which disables this rotation feature. Someone, please help.
How is the order of the side menu determined?
hugo version 0.71 (also .70)
theme version: .90
When I add option -buildDrafts I get an error ending "range can't iterate over presets". If I go back to version .40, the error goes away.
Here's the entire commandline error:
Error: Error building site: failed to render pages: render of "page" failed: exe
cute of template failed: template: _default/single.html:4:4: executing "_default
/single.html" at <partial "head.html" .>: error calling partial: execute of temp
late failed: template: _internal/schema.html:22:82: executing "_internal/schema.
html" at <.Params.tags>: range can't iterate over presets
I'm still just learning Hugo, so my site isn't very big, nor interesting.
Is it possible to have a section expanded by default when using the slide-menu? Perhaps having a parameter in the YAML for an _index.md file indicating this subfolder should be expanded. Thanks.
Not sure the cause, but any help would be appreciated. When trying to publish a hugo site as a subdomain on netlify, the branch fails with the following error:
7:07:46 PM: Executing user command: hugo
7:07:46 PM: Started building sites ...
7:07:46 PM: ERROR: 2019/01/24 00:07:46 template.go:477: template: theme/partials/menu.html:30: function "union" not defined
7:07:46 PM: ERROR: 2019/01/24 00:07:46 template.go:477: template: theme/partials/pagination.html:38: function "union" not defined
7:07:46 PM: ERROR: 2019/01/24 00:07:46 general.go:212: Error while rendering homepage: template: /opt/build/repo/themes/hugo-theme-techdoc/layouts/_default/baseof.html:2:20: executing "/opt/build/repo/themes/hugo-theme-techdoc/layouts/_default/baseof.html" at <.Page.Language>: can't evaluate field Page in type *hugolib.Node
Hello,
I created this web site: flobeyer.de
On my smartphone the menu bar is on the bottom of the page. I wonder what I have to do that the menu is on top of the page?
Best regards
Florian
In the issue below order or sorting is discussed, I would also like to order alphabetically.
Is there a possibility to sort on Title?
https://gohugo.io/templates/lists/#by-title
Hi, @jcrubino.
The order of the side menu is determined by the weight
of Front Matter.
Lower weight gets higher precedence. So menu with lower weight will come first.
https://gohugo.io/content-management/front-matter/
The sample of Front Matter with weight is as below.
Originally posted by @thingsym in #13 (comment)
The techdoc theme is GREAT, Thank You for creating it.
One of the things I'd like to support in my pages is a table of contents for the material in the page.
Is there a simple way to integrate this with the out of the box version of techdoc, or does supporting this mean that I need to create some new _index.html / _index.md files, a new partial or something like that?
Thanks!
Is there a way to get markdown processed for the inline portion of the panel shortcode?
For example, when I include a simple link:
{{< panel status="notice" title="My Title" >}}
[I'm an inline-style link with title](https://www.google.com "Google's Homepage")
{{< /panel >}}
The link is not rendered:
It appears that no markdown is processed.
Is it possible to add unlimited levels?
Thanks.
Run hugo
Start building sites …
hugo v0.120.4-f11bca5fec2ebb3a02727fb2a5cfb08da96fd9df+extended linux/amd64 BuildDate=2023-11-08T11:18:07Z VendorInfo=gohugoio
Total in 143 ms
Error: error building site: "/home/runner/work/portfolio/portfolio/content/sample/search-shortcode.md:13:1": failed to render shortcode "search": failed to process shortcode: "/home/runner/work/portfolio/portfolio/themes/hugo-theme-techdoc/layouts/shortcodes/search.html:3:4": execute of template failed: template: shortcodes/search.html:3:4: executing "shortcodes/search.html" at <partial "search.html" .>: error calling partial: execute of template failed: html/template:partials/search.html: ends in a non-text context: {stateJSRegexp delimNone urlPartNone jsCtxRegexp attrNone elementScript }
Error: Process completed with exit code 1.
The "Last updated on" date is not working in the footer of the web pages.
The file last-updated.html from layouts/partials/ is:
Last updated on {{
From this, I get "Last updated on 1 Jan 0001 " on all pages.
For me it produces a incomplete json in technote/public/algolia.json:
[{"objectID":"f1229466f5a80e7cccdac452442f4756"},"objectID":"8c5128a009a51f04d0a8cf9aa96a1183"},{"objectID":"a9fee9dbb4fee679405e2bf8a6408cd9"}]
Which results in an incomplete index at Algolia:
{
"objectID": "ffe689385f2400c55dc72d63cbb5f62c"
}
According to the solution mentioned in issue 22 it should look like:
[
{
"content": "First 1000 words here...",
"date": "2019-12-28 00:00:00",
"href": "https://yourdomain.com/2019/12/28/lengthy-blog-post",
"objectID": "163846258b8839cf2591a6b88c522d84_0",
"order": 0,
"tags": ["conferences"],
"title": "A lengthy blog post"
}
]
Could you please explain how to implement this, or point me in the direct of my mistake?
Quote issue 22:
I have found solution. Need load json file to algolia manually (more info you can find there https://www.bennet.org/blog/site-search-jamstack-hugo-algolia/ )
Originally posted by @vglu in #22 (comment)
The "home page" example content seems to have a "home image" reference inside the front-matter, but the image is not found inside the folder files nor is it appearing while testing it.
How should it work?
Thanks for the great effort!
Building sites … WARN 2019/11/30 07:36:32 .File.UniqueID on zero object. Wrap it in if or with: {{ with .File }}{{ .UniqueID }}{{ end }}
Pretty sure it's in the menu where "file" is probably CurrentNode
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.