Giter VIP home page Giter VIP logo

hugo-theme-docdock's Introduction

Hugo docDock Theme

This repository contains a theme for Hugo, based on

Visit the theme documentation to see what is going on. It is actually built with this theme.

Main features

  • Search
  • Unlimited menu levels
  • RevealJS presentation from markdown (embededed or fullscreen page)
  • Attachments files
  • List child pages
  • Include segment of content from one page in another (Excerpt)
  • Automatic next/prev buttons to navigate through menu entries
  • Mermaid diagram
  • Icons, Buttons, Alerts, Panels, Tip/Note/Info/Warning boxes
  • Image resizing, shadow...
  • Customizable look and feel

Overview

Installation

Check that your Hugo version is minimum 0.30 with hugo version. We assume that all changes to Hugo content and customizations are going to be tracked by git (GitHub, Bitbucket etc.). Develop locally, build on remote system.

To start real work:

  1. Initialize Hugo
  2. Install DocDock theme
  3. Configure DocDock and Hugo

Prepare empty Hugo site

Create empty directory, which will be root of your Hugo project. Navigate there and let Hugo to create minimal required directory structure:

$ hugo new site .

AFTER that, initialize this as git directory where to track further changes

$ git init

Next, there are at least three ways to install DocDock (first recommended):

  1. As git submodule
  2. As git clone
  3. As direct copy (from ZIP)

Navigate to your themes folder in your Hugo site and use perform one of following scenarios.

1. Install DocDock as git submodule

DocDock will be added like a dependency repo to original project. When using CI tools like Netlify, Jenkins etc., submodule method is required, or you will get theme not found issues. Same applies when building site on remote server trough SSH.

If submodule is no-go, use 3rd option.

On your root of Hugo execute:

$ git submodule add https://github.com/vjeantet/hugo-theme-docdock.git themes/docdock

Next initialize submodule for parent git repo:

$ git submodule init
$ git submodule update

Now you are ready to add content and customize looks. Do not change any file inside theme directory.

If you want to freeze changes to DocDock theme itself and use still submodules, fork private copy of DocDock and use that as submodule. When you are ready to update theme, just pull changes from origin to your private fork.

2. Install DocDock simply as git clone

This method results that files are checked out locally, but won't be visible from parent git repo. Probably you will build site locally with hugo command and use result from public/ on your own.

$ git clone https://github.com/vjeantet/hugo-theme-docdock.git themes/docdock

3. Install DocDock from ZIP

All files from theme will be tracked inside parent repo, to update it, have to override files in theme. Download following zip and extract inside themes/.

https://github.com/vjeantet/hugo-theme-docdock/archive/master.zip

Name of theme in next step will be hugo-theme-docdock-master, can rename as you wish.

Configure

Import sample config from sample site to Hugo root.

$ cp themes/docdock/exampleSite/config.toml .

Change following config.toml line as needed, depending on method above:

theme = "<hugo-theme-docdock-dir-name>"

Comment out following line, so default themes/ will be used:

# themesdir = "../.."

(Bonus)

Create empty file .gitkeep inside public/ and add following to .gitignore. This way it will keep repo smaller and won't bring build result files and errors to remote checkout places:

/public/*
!/public/.gitkeep

Preview site

$ hugo server

to browse site on http://localhost:1313

Usage

hugo-theme-docdock's People

Contributors

aral avatar enigmacurry avatar eyoder avatar fmuro avatar gwleclerc avatar ivan-danilov avatar joepvd avatar johnblood avatar jose-oc avatar kamilchm avatar karlmacklin avatar lgfischer avatar lierdakil avatar marthym avatar matcornic avatar petzi53 avatar pilskalns avatar rabadiw avatar ripienaar avatar rsanderscybraics avatar shazic avatar siamkreative avatar tonivj5 avatar uweschaefer avatar viertaxa avatar vjeantet avatar w-floyd avatar wshayes avatar xipas avatar yoann-m 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hugo-theme-docdock's Issues

Where to translate the shortcode warning?

I created a warning in my website by using this:

{{% notice warning %}} something something{{% /notice %}}
In the compiled website beside the ! there is written Warning but as the target audience is german I wanted to change this to Warnung. I was grepping through the theme and copying the css and scss files to ./static and tried to get the string translated but to no avail.

So please tell me which file I need to copy to ./static and edit to get this string changed as I am clueless right now.

Is it possible to start with the menu unfolded?

When opening the site, the submenu items are hidden under their parents and unfold when clicking on the parent page.

Is it possible to configure teh site so that all sub-entries of the menu are unfolded at start (and therefore the structure of the site is immediately visible)?

Menu on mobile devices

Hello,
Sorry if this is a basic question. I'm using your theme and I am having some issue with displaying the menu on mobile devices. If I open your page,

http://docdock.netlify.com/

The menu button appears on the top left on the screen. On my site, on the other hand, the menu button does not appears.

http://novasarc.hafogvatn.is//

How do you enable the menu on mobile devices?

Many thanks,

Julian

baseURL in subdirectory causes 404 on clippy.svg

My site is configured with a baseURL in /docs/.

Whenever a code snippet is used, the CSS tries to fetch /images/clippy.svg. This causes a 404 because the actual URL is /docs/images/clippy.svg

Bug to generate tags link

In this link of code, the links of tags are generated for each page according to BaseURL. However, if the BaseURL is ending with a / trailing slash, the link become two slash plus tags (e.g. "//tag1").

It will be better to check the trailing slash or remove slash before tags.

<a class="label label-default" href="{{$.Site.BaseURL}}/tags/{{ $tag | urlize }}">{{ $tag }}</a>

Left menu is broken since PR #67

If you go to https://docdock.netlify.com/, you can see that Left menu is broken du to modifications on partial menu.html

<li data-nav-id="{{.URL}}" class="dd-item
    {{- if .IsAncestor $currentNode}}parent{{end}}
    {{- if eq .UniqueID $currentNode.UniqueID}}active{{end}}
    {{- if .Params.alwaysopen}}parent{{end -}}
">

This code has to consequence to render parent and active li elements as

<li data-nav-id="/getting-start/" class="dd-itemparentactive visited">

instead of

<li data-nav-id="/getting-start/" class="dd-item parent active visited">

I think that - in {{}} should not be used in class attribute of html elements.

Make ordersectionsby = "title" case insensitive

The current implementation is case sensitive resulting in incorrectly ordered pages when there are titles with upper and lower case first letters.

Request: Make the ordersectionsby = "title" case insensitive.

Switch from horsey.js to jquery.autocomplete.js?

Since we are using jQuery, should we use jQuery-Autocomplete instead of horsey.js?

We should probably list the pros/cons. Here are some pros of using jQuery-Autocomplete:

  1. More lightweight as it uses jQuery: 32 KB vs 175 KB.
  2. Seems more maintained (more contributors or recent updates)

This is a question / suggestion. I will play a bit with jQuery-Autocomplete to see if it's worth switching.

Issue with relative paths

screen shot 2017-09-11 at 9 19 11 am

Does anyone else have trouble getting the example site to work with relative paths? (See attached).

I have the same problem on my main deployed site.

Add a index page for tags

In my website, I have setup tags for each page (using R package blogdown). All tag links work fine, except a missing index pages of all tags. It will be really useful to add an index file for tags.

Setting the themeVariant in config.toml does not have any effect

Hi,

for me setting the themeVariant in the config.toml does not have any effect. Im always seeing the blue default theme.

My config.toml:

DefaultContentLanguage = "en"
theme = "docdock"
themeVariant = "gray"

im running hugo 0.24.1
Hugo Static Site Generator v0.24.1 darwin/amd64 BuildDate: 2017-06-26T09:33:45+02:00

Any suggestions on what I'm doing wrong are highly appreciated.

About the search engine

The documentation states:

ABOUT THE SEARCH ENGINE

Nothing to do on your side. :-)

Docdock theme uses the last improvement available in hugo version 20+ to generate a json index file ready to be consumed by lunr.js javascript search engine.

Where is this JSON file located? I'm not seeing it in my installation, and the search engine doesn't seem to be working at the moment.

All fonts changed to italic

Hi! Great theme!

I'm running into a situation with my fonts and I was hoping that I could ask you what I hope is a fairly straight forward question that should take you 2 secs. I'm in the process of doing some customization and have successfully modified some aspects of the color palette. My challenge now is that all the fonts are italic and I am not able to find the css script that is assigning the italic fonts. I've checked the themes css (thoroughly) but no luck identifying where the appropriate change needs to be made. Could you please advise me on this issue?

Refactor main stylesheet

I am already customizing the theme by using a custom theme variant. While customizing the theme using theme variant, I realized that the CSS could be improved.

Here are the things I have noticed about the stylesheet theme.css

  • Way too many !important rules (64 times). Here is an example. This is mainly due to how the stylesheet is organized / structured.
  • Inconsistent indentation / formatting, making it hard to read.
  • No CSS variables in main stylesheet. If the variables were defined in the main stylesheet, then the theme variants would be way easier to created...

If you want I can try to create a PR

multi language

what needs to be changed in the theme to make it multi language ?

edit everything look to work nice except the _index.md & _header.md

Failed to build

I got some error and blank homepage when I started up my site via hugo server

ERROR 2017/08/09 12:56:08 Error while rendering "page": template: theme/_default/single.html:1:3: executing "theme/_default/single.html" at <partial "header.html...>: error calling partial: template: theme/partials/header.html:36:7: executing "theme/partials/header.html" at <partial "menu.html" ...>: error calling partial: template: theme/partials/menu.html:68:13: executing "section-tree-nav" at <.IsAncestor>: can't evaluate field IsAncestor in type *hugolib.Page
ERROR 2017/08/09 12:56:08 Error while rendering "section": template: theme/_default/list.html:1:3: executing "theme/_default/list.html" at <partial "header.html...>: error calling partial: template: theme/partials/header.html:36:7: executing "theme/partials/header.html" at <partial "menu.html" ...>: error calling partial: template: theme/partials/menu.html:68:13: executing "section-tree-nav" at <.IsAncestor>: can't evaluate field IsAncestor in type *hugolib.Page
ERROR 2017/08/09 12:56:08 Error while rendering "home": template: theme/index.html:1:3: executing "theme/index.html" at <partial "header.html...>: error calling partial: template: theme/partials/header.html:36:7: executing "theme/partials/header.html" at <partial "menu.html" ...>: error calling partial: template: theme/partials/menu.html:68:13: executing "section-tree-nav" at <.IsAncestor>: can't evaluate field IsAncestor in type *hugolib.Page
ERROR 2017/08/09 12:56:08 Error while rendering "taxonomy": template: theme/_default/list.html:1:3: executing "theme/_default/list.html" at <partial "header.html...>: error calling partial: template: theme/partials/header.html:36:7: executing "theme/partials/header.html" at <partial "menu.html" ...>: error calling partial: template: theme/partials/menu.html:68:13: executing "section-tree-nav" at <.IsAncestor>: can't evaluate field IsAncestor in type *hugolib.Page

Feature request: Add sidebar resize capability

Pages with long names are cut off when displayed in the nav sidebar.

The default theme sets the nav sidebar to a fixed width of 300px and the body is set to fixed size via margin-left=300px.

Request: Add a horizontal resize feature to the nav sidebar and dynamically resize the body margin-left size based on the size of the nav sidebar.

[Question] [Performance] Concatenate and minify JavaScript dependencies?

Hi there,

Should all dependencies be concatenated?

  • \hugo-theme-docdock\static\js\clipboard.min.js
  • \hugo-theme-docdock\static\js\featherlight.min.js
  • \hugo-theme-docdock\static\js\highlight.pack.js
  • \hugo-theme-docdock\static\js\horsey.js
  • \hugo-theme-docdock\static\js\html5shiv-printshiv.min.js
  • \hugo-theme-docdock\static\js\hugo-learn.js
  • \hugo-theme-docdock\static\js\jquery-2.x.min.js
  • \hugo-theme-docdock\static\js\learn.js
  • \hugo-theme-docdock\static\js\list.txt
  • \hugo-theme-docdock\static\js\lunr.min.js
  • \hugo-theme-docdock\static\js\modernizr.custom.71422.js
  • \hugo-theme-docdock\static\js\search.js

If all of those dependencies are required for the theme to function, I would suggest to concenate and minify those using gulp / grunt or npm directly.

I would only exclude jQuery from being included in the bundle as some users would like to serve it from Google CDN. It could be very handy to have a setting to override where is jQuery loaded from.

Cheers

Bug/Feature: Tags list do not list section pages and tags not listable

Tags do not list section pages (_index.md), what you call the homepage, when the corresponding tags are applied to them.

For instance, the Create Page in the example section has Tag1 as a tag, but if you click for Tag1 it won't show the "Create Page" as a corresponding page.

Also the theme does not directly support listing available tags (or other taxonomies), but this is pretty easily fixed via terms.html.

I addressed these issues in this commit in my fork if you want to take a look at it.

Thanks,
Pete

(and thanks for your theme!)

Borders and Shadows not displayed for images

Hi,

I just replaced Hugo Theme Learn with the theme DocDock on my website https://invincible.site

It is working great but I would like to report a minor issue related to images.

In order to display shadows and borders for my images, I used the following markdown:

![ImageTitle][page link]  

[page link]: /images/Image01.JPG?classes=border,shadow

This is similar to what is described on your documentation under Shortcodes > image menu and it worked fine with the previous theme (Hugo theme Learn) as well.

However, with DocDock, the borders and shadows are not displayed.

I had tested this with the following browsers and none of them are showing the desired results:
Safari,
Firefox 53.0.3,
Google Chrome 58.0.3029.110,
Microsoft Edge 40.15063.0.0,
IE 11 and
Maxathon 4.4.8.1000.

An additional issue with IE and Maxathon web browsers is that theme variants (green and gold) are not reflected, even if they are selected through the config.toml (should I open a separate issue for this?).

Note
Here is a disclaimer about the changes to your CSS that I did. I do not believe that my changes should have an effect on the issues that I reported, but I am stating them for transparency:

  1. I used the template from your gold theme variant to create a theme that reflected the color theme of my website. The only things that I changed were the color values in the CSS variables.
  2. I changed the border-top of the footline to "none", so that it is not displayed on the pages.

top level pages without children have open/collapse icon

As you can see on the homepage of docdock theme, top level pages that have no children still show an open/collapse arrow icon.

docdockbug

Edit: By the way I create a top level page as a folder with _index.md file. Any .md under the 'content/' doesn't show up in the sidebar.

Open external links in new window

I'd like some guidance on how to get docdock to open links to external web sites in a new window, while retaining the way that internal links stay in the same window.

Feature request: Add theme setting for default sorting of menu entries

Hi @vjeantet

With the recent content organization, my navigation entries don't seem to be sorted alphabetically like it used to be. I do no specify the weight attribute.

I am using Hugo version 0.25 and your theme at commit 5869299. My entries used to be sorted alphabetically but now it looks like it's sorted by date.

If no weights are provided (or if weights are the same), date will be used to sort
https://gohugo.io/content/ordering/

Cheers

"Page 1 on 3" should actually be "Page 1 of 3"

The text "Page 1 on 3" should read "Page 1 of 3".

You may want to change the [pagination-on] section in i18/en.toml.

I did not sent a PR because I'm not sure if you would prefer to change only other = "on" or if you would prefer to also change [pagination-on] so that it is consistent with the English text.

Content structure can conflict with taxonomies

I create this folder structure:

config.toml
content
   \- tools
        |- _index.md   (title = "Tools")
        |- main-tool.md
        |- api-management
        |       |- _index.md   (title = "API Management")
        |       \- tool1.md
        \- user-management
                |- _index.md   (title = "User Management")
                \- tool2.md

When running Hugo (0.24.1) locally with the Dockdock theme, I get this console output:

$ hugo
Started building sites ...
Built site for language en:
0 draft content
0 future content
0 expired content
9 regular pages created
7 other pages created
0 non-page files copied
1 paginator pages created
0 tools created
total in 16 ms

The rendered site contains the "Tools" section with all my links are directly listed under it. No subsections "API Management" and "User Management". The generated URLs are correct though:

  • /tools/main-tool/index.html
  • /tools/api-management/tool1/index.html
  • /tools/user-management/tool2/index.html

The breadcrumbs at the top of each page list Wiki > Tools > <name of tool here>, also not the subsection.

Eventually I found out that I have an overlap between my content organisation and a configured taxonomy. Here was my taxonomy section from config.toml:

[taxonomies]
tool = "tools"

After disabling this, the site rendered correctly again. Would it be possible to generate an error, or render a big warning when such an overlap exists?

indexing

I can add bleve as a search engine if you want.

Problems with visibility of .Rmd files after header

I tried to publish a post as .Rmd file with a YAML front matter. Everything works fine until a header appears (e.g. ## My Title). Header and all the text thereafter appears with an extreme light gray, so that one even almost can't read the text.

But there is no problem with the exact same file using .Rmarkdown file ending instead of a.Rmd ending. .Rmarkdown is rendered by Blackfriday whereas .Rmd is rendered by Pandoc. There are slight differences, but there shouldn't be any different with standard Markdown. I tested .Rmd- files with other Hugo themes and had no problems.

I tried it also with a fresh installation out of the box so that I could prevent an issue of some changes I already had made to the template. What could be the problem?

shortcode {{% notice %}} renders solid title bar above every <p> element

Hey - first thanks for sharing such an awesome hugo theme!

When working with {{% notice %}}, it seems multiple paragraphs are rendered with a solid title bar above every paragraph.

Example code demonstrating this attached (except with a .md.txt extension to work around github supported file types)

Pull request incoming to fix theme.css div.notice elements for multi-paragraph support. Tried to follow existing css pattern but welcome any feedback.

Thanks,
Erik

notice_test.md.txt

show page toc at top of the page

Like in media wiki I want to show the toc of the current page at the top of that page.

I tried a lto of stuff, but the toc os always empty! For testing reasons I put

{{ .TableOfContents }}

into the default layouts, but that doesn't work... (the toc is emtpy)

Reverse alpha sort

I'm trying to sort out how to sort entries, so that the most recent documents end up at the top.

The hardest way to do this is with the 'weight=' parameter, though I could do it by computing a weight for the first entry at some large number and then count backwards.

By default the sort order is a-z, my documents naturally want to sort z-a, I don't see an easy way to do that in a directive.

Search problems

Hi !

I don't understand why my search bar just highlights some words. I installed lunr et i tried a lot of solution but nothing help me !

maybe my index is wrong but lunr do it automaticaly

Can you help me please ? (forgive my english, i learn ;) )

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.