openhab / website

This repository contains the final artifacts from which the project website is served.
https://www.openhab.org/
20 stars 47 forks source link

[Download Page] Can we get system based anchors? #78

Open Confectrician opened 6 years ago

Confectrician commented 6 years ago

Hi,

Is it possible to add anchors and hashed urls that open the downlad page with a specific tab?

Something like https://www.openhab.org/download/#linux or https://www.openhab.org/download/#windows_snapshot or https://www.openhab.org/download/#windows_stable.

Which could be set on the corresponding buttons of the download page.

We could then replace links on the docs installation pages with simple and easy maintanable direct links.

Wdyt?

ghys commented 6 years ago

Yep, good idea! Just needs a few lines of code in the component and access this.$route.hash.

Confectrician commented 6 years ago

If you point me to the right direction for the start i would love to start contributing here too. 🙂

ghys commented 6 years ago

Sure!

First try to run the site on your local machine by following the (very succint) instructions in https://github.com/openhab/website/blob/master/CONTRIBUTING.md#running-in-development-mode:

  1. Install NodeJS and Ruby
  2. Install the dependencies with npm install
  3. Install VuePress globally with npm install -g vuepress
  4. Run ruby prepare-docs.rb in the website's folder
  5. Run vuepress dev and wait a minute or two to get the development server listening in port 8080.

Then you can try making changes. actually for this one you can use as an example:

https://github.com/openhab/website/blob/1e0e3830213150a44905f25837a75aa7b9bd78a7/.vuepress/components/HomePage.vue#L201-L203

but you'll want to add a mounted () method in https://github.com/openhab/website/blob/master/.vuepress/components/InstallInstructions.vue instead, and not change window.location but set properties set in data () with what you find in this.$route.hash - something like:

mounted () {
  if (this.$route.hash) {
    if (this.$route.hash.system) {
      this.currentSystem = this.$route.hash.system
    }
    if (this.$route.hash.distro) {
      this.currentDistro = this.$route.hash.distro
    }
    if (this.$route.hash.version) {
      this.currentVersion = this.$route.hash.version
    }
  }
},

(this is completely untested, just a general idea! 😉 ) Then you can try navigating to /download/#distro=rpm&version=unstable, /download/#system=raspberry-pi and so on. If it works do the pull request so we can get a preview deploy!

Good luck ;)

Confectrician commented 6 years ago

Thanks for the overview. Perfect issue for digging into this. :)

I will update you are as if anything isn't working.

Confectrician commented 6 years ago

https://stackoverflow.com/questions/50774321/vuepress-unexpected-token

Same problem here. (I cant even run vuepress -v. Also throws this error.) Any ideas?

Edit: Forget this, seems that i had a really old node js version installed^^

ghys commented 6 years ago

Hmm, no clue, but I'm still on 0.10.0. Check your node version (mine is 8.9.4) and also try node_modules/.bin/vuepress dev to use the local binary (which will normally be 0.10.0), or downgrade to 0.10.0.

Confectrician commented 6 years ago

See edit. 😄 i was on 5.X.X

But have another error now:

 WAIT  Extracting site metadata...
Error: Cannot find module './addons-actions.js'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (D:\openHAB\openhab-website\.vuepress\config.js:1:85)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)

This seems related to openhab docs?! ruby script has run already.

ghys commented 6 years ago

If the file doesn't exist, the script hasn't run properly :) Relaunch it and check the output (or paste it here!).

Confectrician commented 6 years ago
>D:\openHAB\openhab-website>ruby prepare-docs.rb
>>> Deleting .vuepress/openhab-docs if existing...
>>> Cloning openhab-docs
Cloning into '.vuepress/openhab-docs'...
remote: Counting objects: 4662, done.
remote: Compressing objects: 100% (1888/1888), done.
remote: Total 4662 (delta 1671), reused 4133 (delta 1619), pack-reused 0
Receiving objects: 100% (4662/4662), 26.04 MiB | 3.54 MiB/s, done.
Resolving deltas: 100% (1671/1671), done.
Checking out files: 100% (5779/5779), done.
>>> Download ESH addons feature file
C:/Ruby22/lib/ruby/2.2.0/net/http.rb:923:in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)
        from C:/Ruby22/lib/ruby/2.2.0/net/http.rb:923:in `block in connect'
        from C:/Ruby22/lib/ruby/2.2.0/timeout.rb:74:in `timeout'
        from C:/Ruby22/lib/ruby/2.2.0/net/http.rb:923:in `connect'
        from C:/Ruby22/lib/ruby/2.2.0/net/http.rb:863:in `do_start'
        from C:/Ruby22/lib/ruby/2.2.0/net/http.rb:852:in `start'
        from C:/Ruby22/lib/ruby/2.2.0/net/http.rb:583:in `start'
        from C:/Ruby22/lib/ruby/2.2.0/net/http.rb:478:in `get_response'
        from C:/Ruby22/lib/ruby/2.2.0/net/http.rb:455:in `get'
        from prepare-docs.rb:36:in `<main>'

maybe i should check my ruby version too. (Is windows a problem maybe?)

ghys commented 6 years ago

Yeah I had this one too - use 2.5.0 or later!

On Tue, Jun 19, 2018 at 11:02 PM, Jerome L. notifications@github.com wrote:

D:\openHAB\openhab-website>ruby prepare-docs.rb

Deleting .vuepress/openhab-docs if existing... Cloning openhab-docs Cloning into '.vuepress/openhab-docs'... remote: Counting objects: 4662, done. remote: Compressing objects: 100% (1888/1888), done. remote: Total 4662 (delta 1671), reused 4133 (delta 1619), pack-reused 0 Receiving objects: 100% (4662/4662), 26.04 MiB | 3.54 MiB/s, done. Resolving deltas: 100% (1671/1671), done. Checking out files: 100% (5779/5779), done. Download ESH addons feature file C:/Ruby22/lib/ruby/2.2.0/net/http.rb:923:in connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError) from C:/Ruby22/lib/ruby/2.2.0/net/http.rb:923:inblock in connect' from C:/Ruby22/lib/ruby/2.2.0/timeout.rb:74:in timeout' from C:/Ruby22/lib/ruby/2.2.0/net/http.rb:923:inconnect' from C:/Ruby22/lib/ruby/2.2.0/net/http.rb:863:in do_start' from C:/Ruby22/lib/ruby/2.2.0/net/http.rb:852:instart' from C:/Ruby22/lib/ruby/2.2.0/net/http.rb:583:in start' from C:/Ruby22/lib/ruby/2.2.0/net/http.rb:478:inget_response' from C:/Ruby22/lib/ruby/2.2.0/net/http.rb:455:in get' from prepare-docs.rb:36:in

'

maybe i should check my ruby version too.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/openhab/website/issues/78#issuecomment-398544724, or mute the thread https://github.com/notifications/unsubscribe-auth/AB6Us3D3ufX1C4nghkobqqvIvzVs7NQ5ks5t-WbqgaJpZM4Uq9-Q .

-- Yannick Schaus mailto:yannick@schaus.net

Confectrician commented 6 years ago

Still some warnings and errors in the output but basically there was a build and i can view it on localhost. Thanks for the fast help.

Updated tools, can save lots of time...