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

Add routeUrlWith for Gitlab-friendly deployments #48

Closed
srid opened this issue Jun 19, 2021 · 0 comments · Fixed by #49
Closed

Add routeUrlWith for Gitlab-friendly deployments #48

srid opened this issue Jun 19, 2021 · 0 comments · Fixed by #49
Labels
enhancement New feature or request good first issue Good for newcomers zurihack

Comments

@srid
Copy link
Owner

srid commented Jun 19, 2021

We already have routeUrl that produces "pretty" URLs (ie, without .html suffix),

ema/src/Ema/Route.hs

Lines 20 to 23 in e745650

-- TODO: Allow a way to configure disabling stripping of .html, since not all
-- static site hosts support pretty URLs.
routeUrl :: forall r model. Ema model r => model -> r -> Text
routeUrl model =

Some places like Gitlab do not support these kinds of URLs. Therefore, add a routeUrlWith that takes an extra argument telling it to whether to "prettify" the URL or not.

And then define a type like this,

data UrlStrategy
  = UrlPretty
  | UrlDirect

Ema users can then use either routeUrl or routeUrlWith UrlDirect to define their URL linking behaviour.

@srid srid added enhancement New feature or request good first issue Good for newcomers labels Jun 19, 2021
@srid srid added the zurihack label Jun 19, 2021
@srid srid pinned this issue Jun 19, 2021
@srid srid mentioned this issue Jun 27, 2021
@srid srid closed this as completed in #49 Jun 27, 2021
@srid srid unpinned this issue Aug 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers zurihack
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant