Giter Club home page Giter Club logo

hugo-theme-techdoc's People

Contributors

antoniovazquezblanco avatar cengique avatar coliff avatar deining avatar michaeltlombardi avatar moul avatar thingsym avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hugo-theme-techdoc's Issues

`hugo --minify --enableGitInfo` throws Error building site when rendering of 404.

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  > 


Page navigation does not work as intended when no page weights are used

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:

  • The Home page has a link to the next page but not a link to the previous page. [expected]
  • All intermediate pages have a link to the previous page and a link to the next page. [expected]
  • The last page has a link to the previous page and a link to a next page (that is the same as the previous page). [not expected]

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>&nbsp;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.

use relURL instead of absURL

Hello, I worked with your theme with a site using subfolders. With these, the render was broken because the css couldn't be retrieved. After some tests and research (see here), I found you just need to change absURL to relURL in your template (for example here,here or here)

favicon

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

links for menu target localhost

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

how to limit page width?

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.

Appends "s" to Menu

Hi Team

Please excuse if I'm doing something wrong, however ...

$ hugo new "TEST/test.md"
Menu gets an "s" appended so TEST becomes TESTs

image

Deprecation warnings

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 }}

algolia search

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

Hidden Menu Items Return 404

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.

[RFE] lunr or other search engine support

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)

search feature

Would it be possible to add a search box?

While unable to code it myself, i could assist with testing.

Thanks!

Can't use link inside panel

Hi,
I was trying to use a link (<> and syntax) within a panel, but the first doesn't get rendered and the second just shows the raw text instead of the clickable link.

Thanks

-buildDrafts option -> "range can't iterate over presets"

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.

Expanded by default with slide-menu

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.

Hugo Error Function "Union" not defined while trying to publish as subdomain branch on netlify

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

Sorting

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.

https://raw.githubusercontent.com/thingsym/hugo-theme-techdoc/master/exampleSite/content/chapter2/2.md

Originally posted by @thingsym in #13 (comment)

table of contents for one of the pages in contents

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!

Panel Shortcode: Markdown isn't processed

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:

Screen Shot 2020-03-24 at 2 01 59 PM

It appears that no markdown is processed.

github pages throwing error while rendering the search shortcode

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.

"Last updated on " doesn't work properly

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 {{ $.Lastmod.Format ( $.Site.Params.lastUpdate | default "2 Jan 2006") }}
From this, I get "Last updated on 1 Jan 0001 " on all pages.

Algolia search

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)

Links in notice alerts barely readable

Links inside notice alerts (especially hovers) are barely readable with the default CSS being used.

{{< panel status="notice" title="Example Link in Alert" icon="fas fa-exclamation-triangle" >}}This is an example <a href="https://www.example.com">Link</a> inside a notice alert.{{< /panel >}}

image

image

Wrong image path inside the cover image?

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!

UniqueID throwing a warning when building

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.