Browse Source

Fix links and settings for deploying to gh-pages

Rename root document file so it goes to index.html
master
Zak Patterson 5 years ago
parent
commit
489bb26504
  1. 8
      .travis.yml
  2. 8
      README.md
  3. 33
      build.sbt
  4. 6
      docs/index.md

8
.travis.yml

@ -14,12 +14,11 @@ jobs:
- stage: verify
script:
- sbt ++$TRAVIS_SCALA_VERSION todomvc/fullOptJS::webpack
- sbt ++$TRAVIS_SCALA_VERSION router/fullOptJS::webpack
- sbt docs/mdoc
- sbt docs/makeMicrosite
- mkdir -p router-docs/site/todomvc
- mkdir -p router-docs/site
- cp -R router-docs/target/site/* ./router-docs/site/
- cp ./router-docs/site/Readme.html ./router-docs/site/index.html
deploy:
provider: pages
@ -29,5 +28,4 @@ deploy:
local-dir: router-docs/site
target-branch: gh-pages
on:
branch: master
branch: master

8
README.md

@ -5,7 +5,13 @@ Easy routing for [outwatch](https://outwatch.github.io) on scala.js
Most of this code is adapted from [http4s](http4s.org)'s route parsing and path pattern matching.
See [documentation](https://clovellytech.github.io/outwatch-router/index.html)
See [documentation][doc-root]
Todo:
* Add history api
* Add state to update from `window.location`
[travis-img]:https://travis-ci.com/clovellytech/outwatch-router.svg?branch=master
[travis-link]:https://travis-ci.com/clovellytech/outwatch-router
[doc-root]:https://clovellytech.github.io/outwatch-router

33
build.sbt

@ -15,15 +15,36 @@ val commonSettings = Seq(
val withTests : String = "compile->compile;test->test"
val testOnly : String = "test->test"
lazy val docs = (project in file("./router-docs"))
.settings(name := "outwatch-router-docs")
.enablePlugins(MdocPlugin)
lazy val docs = project
.in(file("./router-docs"))
.settings(commonSettings)
.enablePlugins(MdocPlugin)
.enablePlugins(MicrositesPlugin)
.settings(
name := "outwatch-router-docs",
description := "A router for outwatch",
organizationName := "com.clovellytech",
organizationHomepage := Some(url("https://github.com/clovellytech")),
homepage := Some(url("https://clovellytech.github.io/outwatch-router")),
micrositeUrl := "https://clovellytech.github.io/outwatch-router",
micrositeBaseUrl := "/outwatch-router",
micrositeName := "Outwatch Router",
micrositeCompilingDocsTool := WithMdoc,
micrositeGithubOwner := "clovellytech",
micrositeGithubRepo := "outwatch-router",
scalacOptions := options.scalacConsole
)
.settings(
mdocVariables := Map(
"VERSION" -> version.value
)
)
.dependsOn(router)
lazy val copyFastOptJS = TaskKey[Unit]("copyFastOptJS", "Copy javascript files to target directory")
lazy val router = (project in file("./outwatch-router"))
lazy val router = project
.in(file("./outwatch-router"))
.settings(name := "outwatch-router")
.enablePlugins(ScalaJSPlugin)
.enablePlugins(ScalaJSBundlerPlugin)
@ -33,7 +54,6 @@ lazy val router = (project in file("./outwatch-router"))
scalacOptions += "-P:scalajs:sjsDefinedByDefault",
useYarn := true, // makes scalajs-bundler use yarn instead of npm
jsEnv in Test := new org.scalajs.jsenv.jsdomnodejs.JSDOMNodeJSEnv,
scalaJSUseMainModuleInitializer := true,
scalaJSModuleKind := ModuleKind.CommonJSModule, // configure Scala.js to emit a JavaScript module instead of a top-level script
version in webpack := "4.16.1",
version in startWebpackDevServer := "3.1.4",
@ -63,7 +83,8 @@ lazy val exampleApp = (project in file("router-example"))
.settings(commonSettings)
.dependsOn(router)
lazy val root = (project in file("."))
lazy val root = project
.in(file("."))
.settings(name := "outwatch-router-root")
.settings(commonSettings)
.settings(

6
docs/Intro.md → docs/index.md

@ -1,3 +1,9 @@
---
layout: home
title: "Outwatch Router"
section: "home"
---
Outwatch Router
===
Loading…
Cancel
Save