tlienart / Franklin.jl

(yet another) static site generator. Simple, customisable, fast, maths with KaTeX, code evaluation, optional pre-rendering, in Julia.
https://franklinjl.org
MIT License
944 stars 113 forks source link

Nutshell + Franklin Rough Edges #971

Open mcognetta opened 1 year ago

mcognetta commented 1 year ago

Carried over from Slack:

I've been playing with Nutshell after learning about it today: https://ncase.me/nutshell/ it works pretty well with Franklin, but there are a few rough edges that I've noticed. I'll start a thread with an MWE. If someone else could try these out that would be great!

At the bottom is an MWE that shows the few rough edges that I have encountered already. Namely:

So the only problem that really remains is embedding other pages from the same Franklin site. Embedding sections of other pages works as expected, but embedding the full page fails. Here is an example of what it looks like:

nutshell_franklin_relative_pages


MWE

@def title = "Nutshell + Franklin.jl"

# Nutshell + Franklin.jl

Add the following to your head.html file:

```html
  <script src="https://cdn.jsdelivr.net/gh/ncase/nutshell@1.0.1/nutshell.min.js"></script>

Relative Links

It does not seem to like embedding a full post from a relative link.

[:INSERT ANOTHER POST'S RELATIVE LINK HERE]()

However, embedding a section from another page seems to work fine.

[:RELATIVE LINK PLUS SECTION](#SECTION)

It looks like the problem is with Franklin's headers, as this works: :Nutshell Demo

mcognetta commented 1 year ago

Opened https://github.com/ncase/nutshell/issues/13 to address the other issues.

tlienart commented 1 year ago

I had a quick look today

index.md :

~~~
<script src="https://cdn.jsdelivr.net/gh/ncase/nutshell@1.0.1/nutshell.min.js"></script>
~~~

Attempt at nutshell

[:nutshell to foo](/foo/)

foo.md

# Foo

This is a post on another page

## Bar

Etc $1+1=2$.

Observed result

Screenshot 2022-08-25 at 10 31 52

So I think things work fine; just the relative link needs to be fully specified (/foo/ as opposed to foo).

Observe that the math doesn't work (even if you force hasmath=true on the parent page; I suspect this is to do with how nutshell handles the content; it means that it would not be compatible with maths or likely also highlighted code.