Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Netlify Support #208

Closed
Nosferican opened this issue Sep 4, 2019 · 7 comments
Closed

Netlify Support #208

Nosferican opened this issue Sep 4, 2019 · 7 comments

Comments

@Nosferican
Copy link

Nosferican commented Sep 4, 2019

Thanks for putting up this project! I am taking a look at it and contemplating migrating from Hugo to JuDoc since my needs aren't too crazy. I was wondering if it was possible or work towards having JuDoc Netlify compatible. My current personal website is here. I would like to keep the domain name the same as I already got my business cards printed with it 😜.

List of SSG supported by Netlify.

Netlify Discourse post.

@tlienart
Copy link
Owner

tlienart commented Sep 5, 2019

Hello @Nosferican, great! (and thanks for asking on their forum, I'll be glad to see the answer)

With respect to Netlify, I'm not familiar with it so I had a look at this tutorial and it seems that there's no specific step needed (but I may be wrong) given that it directly connects into the github repo that contains your site (?)

So it seems like you would just have to:

  1. authorize Netlify to connect to your repo (as per tutorial)
  2. that's it

JuDoc produces a static website that is displayable by Github directly so I would think that when Netlify connects to the repo it just hosts it as GitHub would (but with your url).

Could you give it a shot and let me know if you encounter snags? I'll be glad to update the docs to reflect any issues :-)

PS: I see that you're using the Academic theme from Hugo; I've not yet ported that theme to JuDocTemplates (https://tlienart.github.io/JuDocTemplates.jl/) but you could still use it if you're willing to tweak things a bit (see this part of the docs) ; I'll be happy to give you a hand if that's what you'd like to try and once we're happy with the result we can add the theme to the list :-) more generally if you need help getting started, I'll be happy to lend a hand.

Cheers

@Nosferican
Copy link
Author

Answer to the post. It should just require adding Julia to the build image (and testing).

@tlienart
Copy link
Owner

tlienart commented Sep 5, 2019

Hmm but there's something I don't get here: why would they need to run anything? basically everything is run on your computer with JuDoc. Once the HTML etc is generated, the only thing they (or any other host) has to do is to serve the stuff. So they definitely do not need Julia?

I mean for my site for instance, GitHub certainly doesn't run any julia code in order to serve it 🙂 ; am I missing something?

I feel you should literally just need to point Netlify to a repo (possibly private) that contains the output of JuDoc.

@Nosferican
Copy link
Author

For example, when hosting documentation through Documenter, the code is run through the continuous integration (same as the code coverage). For example,

# For learning how to customize the CI check out
# Continous Integration:
# https://docs.travis-ci.com/user/languages/julia
# https://github.com/marketplace/travis-ci
# Code Coverage:
# https://github.com/JuliaCI/Coverage.jl
# Documentation:
# https://github.com/JuliaDocs/Documenter.jl

language: julia
os:
  - linux
  - osx
  - windows
julia:
  - 1.0
  - 1.2
  - nightly
codecov: true
notifications:
  email: false
jobs:
  allow_failures:
    - julia: nightly
  fast_finish: true
  include:
    - os: windows
      arch: x86
      julia: 1.0
    - os: windows
      arch: x86
      julia: 1.2
    - os: windows
      arch: x86
      julia: nightly
    - stage: "Documentation"
      os: linux
      julia: 1.2
      script:
        - julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd()));
                                               Pkg.instantiate()'
        - julia --project=docs/ docs/make.jl
      after_success: skip

which then the build directory is pushed to the gh-pages branch.
Netlify does the same thing. An alternative would be to run it locally and manually push the site to a branch which Netlify then reads without having to do a build stage.

@tlienart
Copy link
Owner

tlienart commented Sep 5, 2019

Yes, definitely the latter.

I think the case for Documenter is different in that the HTML is generated remotely through a Julia process and everything is done automatically (pushing to gh-pages etc).

In theory, JuDoc could do the same thing but at the moment the philosophy is that you generate everything locally so that the site can be optimized to death (including pre-rendering HTML to avoid having javascript dependencies etc) and everything is in the repo on the master branch; then GitHub (or Netlify or anything else) just have to serve the content.

See for instance the repo for my website which you can see is 99.5% HTML (all generated locally) along with the markdown that was used to generate it; everything on the master branch; and I just use GitHub to serve the content.

I hope that makes sense 🙂 but so the good news is that you should definitely be able to use both JuDoc and Netlify as far as I understand

@Nosferican
Copy link
Author

The manual deployment option should work. I will try it out for my next update cycle.

@tlienart
Copy link
Owner

tlienart commented Sep 6, 2019

Ok great, I'll close this here but will be glad to hear from you whether it's gone smoothly or not 🙂

@tlienart tlienart closed this as completed Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants