Giter VIP home page Giter VIP logo

hugo-theme-relearn's People

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

hugo-theme-relearn's Issues

theme: tweak changelog

Dates in changelog are ill formatted.
Link changelog in README.
Describe release process in separate file

Insert Plotly graphs

Hello,

I would like to insert plots from Plotly, I have been trying the solutions listed here:
https://mertbakir.gitlab.io/hugo/plotly-with-hugo/

and following the example from here:
https://github.com/kc-tal/hugo-plotly-example

But it doesn't work with the Relearn theme, after adding to the HEAD section in layouts/partials/header.html:

{{ if .Params.plotly }}
    <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
{{ end }}

and adding layouts/shortcodes/load-plotly.html:

{{ if not ($.Page.Scratch.Get "plotlyloaded") }}
  {{ $.Page.Scratch.Set "plotlyloaded" 1 }}
  <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
{{ end }}

and layout/shortcodes/plotly:

{{ $json := .Get "json" }}
{{ $height := .Get "height" | default "200px" }}
<div id="{{$json}}" class="plotly" style="height:{{$height}}"></div>
<script>
Plotly.d3.json({{$json}}, function(err, fig) {
    Plotly.plot('{{$json}}', fig.data, fig.layout, {responsive: true});
});
</script>

and setting plotly: true in the front matter and using in the markdown:

{{% load-plotly /%}} {{% plotly json="example.json" height="450px" /%}}

I get this error:

Rebuild failed:

"/Users/emortiz/software/GitHub/package/docs/content/basics/parallelization.md:22:18": failed to extract shortcode: shortcode "%}}" has no .Inner, yet a closing tag was provided

20 ___
21 see:
22 {{% load-plotly /%}} {{% plotly json="example.json" height="450px" /%}}

hugo v0.85.0+extended darwin/amd64 BuildDate=unknown

I am using hugo 0.85 in macOS Catalina

Thanks!

Edgardo

BaseURL minor issue and ../credits/ path resolving

I have this theme on a test site at http://example.com/hugo , yet I found in the config.toml if I had as the baseURL = http://example.com/hugo , a lot of the links had ..hugo/hugo in them, so I just have the baseURL as http://example.com

It all works fine except for the 'credits', it should be resolving to http://example.com/hugo/credits , yet it is resolving to http://example.com/credits and of course nothing is displayed. The "credits" link works fine locally, as do all links.

I notice the /credits/ path resolves correctly at https://relearn.netlify.app/credits/

This is no big deal, as I'm slowly replacing a lot of the content with the blog content for the site.

(In all cases, example.com is replaced with the real domain name)

theme: adjust print styles

A short checklist of things that are sub par with current printing. Some stuff may be browser related, I am on Windows using FF and Chrome (and sometimes IE11 if I'm in a good mood)

  • text to big, go with DIN saying 11 to 12 pt
  • adjust color for notice boxes
  • adjust color for codeblocks
  • adjust color for table headers
  • sidebar removal (FF)
  • next / prev removal
  • remove runtime styles to have determinstic print output
  • unsticky header

Reference: matcornic/hugo-theme-learn#413

mermaid: update to 8.10.2

Sadly, there are issues with mermaid 8.8.0 and versions prior.

  • Since version 8.2.0, click events and HTML inside of mermaid graphs are only working if securityLevel="loose" is set during mermaid.initialize. See here.

    Since mermaid 8.7.0 there is a securityLevel="antiscript" that seems to be a good fit for a default configuration in our theme.

  • Since mermaid 8.7.0, mermaid.initialize does not carry over its initialized values to a rendered graph. If securityLevel="loose" ist set during our initialization code in footer.html this will not be applied during rendering.

    The official mermaid docs may suffer form the same issue. The <span> tag is renderd as text.

  • The mermaid 8.2.x branch suffers from incorrect padding for some nodes.

I tested mermaid 8.6.4 and all the above issues are not observable there. So that's my current favorite until further issues.

In the mean time, there may be mermaid versions newer than 8.8.0 been released that dont't have the mentioned issues. So let's find a working version...

This is referenced of matcornic/hugo-theme-learn#443.

theme: adjust copy-to-clipboard

Copy to clipboard has a lot of smaller issues:

  • contrast for inline code is bad in notice boxes
  • bordering the icon does not work well with bordering of inline code
  • hover color on inline code icon is blurred
  • hover color on block code is statically set to link color of standard theme

And related to that:

  • tooltip misses outline border, especially when displayed over dark background (like block code)
  • inline code font size is sized by factor of parent font size, which is a hassle if you want to replicate the size for other elements

children: add parameter for container style

Children shortcode can override the style of the used HTML elements to encapsulate each child. In case user decides for a non-list element like div or h2 the resulting HTML is still encapsulated in ul tags. That doesn't make sense semantically.

Solution: add extra parameter to also override the style of the container.

mermaid: only highlight text in HTML elements

Mermaid uses different techniques to generate text in graphs:

in a native svg element
in a svg foreignObject element that embedds html

Highlightning fails for the first case. This patch avoids highlighting text in those elements.
Highlightning for the second case is preserved with this patch.

For users this may be a bit suprising to sometimes see highlighted text in mermaid graphs and sometimes not.

This is a copy of matcornic/hugo-theme-learn#235.

theme: provide compatiblity settings

  • add settings to preserve old features to achieve best compatibility to learn-theme.
  • document new settings
  • document learn-theme compatiblity settings

theme: normalize front matter to TOML format

Having a mix of TOML and YAML in front matter makes copy&pasting setting from one page to another a burden.
Also copying from and to the documenation requires additional care to not make examples invalid.

Because tooling for TOML seem superior (at least in VSCode), lets switch all documentation and front matter settings in the example page to TOML.

Additionally we can get rid of some unnecessary fields like date.

notice: make restyling of notice boxes more robust

If a user wants to change colors of the notice box labels in his own theme, this is currently hard to achieve in a future proof way.

This is because color is given to the border-top. Therefore if the theme changes the layout of the boxes and uses a different technique to color the notice labels, the users site will be broken.

theme: add partial templates for pre/post menu entries

Adding partial templates menu-pre.html and menu-post.html allows easier customisation of the menu look & feel.

A possible use-case is to add a badge to each menu entry based on a property in that page front matter.

That's already possible with the pre field but that leads to too much duplication as I'd have to write the full HTML for the badge in every page.

mermaid: support pan & zoom for graphs

Mermaid generates a width=100% for certain diagram types - e.g the gantt diagram. On a narrow website this may cause a busy graph to be hard to read.

The mermaid docs expose this behaviour, too, as seen here.

Also related to this issue: If mermaid does not generate a width=100% the diagramm may overflow out of view if the browser window is too narrow - without generating scroll bars. This is clearly an issue of our CSS and also affects print output.

Nevertheless I don't have an idea how to fix this in a satisfying way for all users.

This is a copy of matcornic/hugo-theme-learn#257

mermaid: expose options in config.toml

Mermaid configuration can be difficult for some users because of some options that are meant to be secure and therefore are only settable during mermaid.initialize.

By exposing the whole mermaid config object to our config.toml our users would have all the freedom they may require.

This is a copy of matcornic/hugo-theme-learn#453.

docs: rework README.md

a lot of information is duplicated in the README.md and the exampleSite.

Add more links to the exampleSite documentation and streamline it to other themes README.

Remove release information (to wiki?)

theme: make content a template

Making content a template would be useful for people who want to do some automatic processing across the whole site. An example of that can be to enable people to add support for wiki-style links (as described here: matcornic/hugo-theme-learn#469) on their own, even if Hugo or the theme don't support it natively.

Another use case would be to create a common footer on each content page as described in matcornic/hugo-theme-learn#514

theme: make chapter archetype more readable

Because content in chapters is currently centered - which looks bad with more than a couple of words - we'll change this to a justifyied display. This still distinguishes the style from a normal page but with improved readabilty in case of longer text.

Was fixed with #54, but here for reference and changelog generation.

notice: align box colors to common standards

The color of the info notice box is currently green and the note box is blue.

This contradicts international standards where the i symbol (for info) is usually associated with a blue color.

So: Switch colors.

menu: control menu expansion with alwaysopen parameter

It may be desireable to control the rules for expanding sub-menu items in the menu.

E.g. the exampleSite works as a reference guide while also providing tests for available features. This results in poor documentation eg. the examples of the children shortcode messes up the menu structure.

Reference: matcornic/hugo-theme-learn#511
Reference: matcornic/hugo-theme-learn#439
Reference: matcornic/hugo-theme-learn#437
Reference: matcornic/hugo-theme-learn#414
Reference: matcornic/hugo-theme-learn#325
Reference: matcornic/hugo-theme-learn#155
Reference: matcornic/hugo-theme-learn#88

code highlighter: switch to standard hugo highlighter

Since a while, Hugo has its own mechanism for code highlightning.

We will remove the old highlightning code provided by the client-side javascript library highlight.js and all its related files.

This also solves issues introduced by Hugos own highlightning because in our theme we are currently highlighting the code twice leading to unpredictiable results.

This will also fix an issue were light code highlightning themes weren't displayed correctly because our styles are overwriting color information, see matcornic/hugo-theme-learn#187

Another advantage is the huge list of supported languages which by far exceeds our current list.

On the downside, this is a breaking change because our current color theme isn't supported by Hugo.

Reference: matcornic/hugo-theme-learn#371

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.